CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
sistrip::FEDBackendStatusRegister Class Reference

#include <SiStripFEDBufferComponents.h>

Public Member Functions

bool backpressureFlag () const
 
 FEDBackendStatusRegister (const uint32_t backendStatusRegister)
 
 FEDBackendStatusRegister (const FEDBufferState qdrMemoryBufferState=BUFFER_STATE_UNSET, const FEDBufferState frameAddressFIFOBufferState=BUFFER_STATE_UNSET, const FEDBufferState totalLengthFIFOBufferState=BUFFER_STATE_UNSET, const FEDBufferState trackerHeaderFIFOBufferState=BUFFER_STATE_UNSET, const FEDBufferState l1aBxFIFOBufferState=BUFFER_STATE_UNSET, const FEDBufferState feEventLengthFIFOBufferState=BUFFER_STATE_UNSET, const FEDBufferState feFPGABufferState=BUFFER_STATE_UNSET, const bool backpressure=false, const bool slinkFull=false, const bool slinkDown=false, const bool internalFreeze=false, const bool trackerHeaderMonitorDataReady=false, const bool ttcReady=true)
 
FEDBufferState feEventLengthFIFOState () const
 
FEDBufferState feFPGABufferState () const
 
FEDBufferState frameAddressFIFOState () const
 
bool internalFreezeFlag () const
 
FEDBufferState l1aBxFIFOState () const
 
 operator uint32_t () const
 
void print (std::ostream &os) const
 
void printFlags (std::ostream &os) const
 
FEDBufferState qdrMemoryState () const
 
FEDBackendStatusRegistersetBackpressureFlag (const bool bitSet)
 
FEDBackendStatusRegistersetFEEventLengthFIFOState (const FEDBufferState state)
 
FEDBackendStatusRegistersetFEFPGABufferState (const FEDBufferState state)
 
FEDBackendStatusRegistersetFrameAddressFIFOState (const FEDBufferState state)
 
FEDBackendStatusRegistersetInternalFreezeFlag (const bool bitSet)
 
FEDBackendStatusRegistersetL1ABXFIFOState (const FEDBufferState state)
 
FEDBackendStatusRegistersetQDRMemoryState (const FEDBufferState state)
 
FEDBackendStatusRegistersetSLinkDownFlag (const bool bitSet)
 
FEDBackendStatusRegistersetSLinkFullFlag (const bool bitSet)
 
FEDBackendStatusRegistersetTotalLengthFIFOState (const FEDBufferState state)
 
FEDBackendStatusRegistersetTrackerHeaderFIFOState (const FEDBufferState state)
 
FEDBackendStatusRegistersetTrackerHeaderMonitorDataReadyFlag (const bool bitSet)
 
FEDBackendStatusRegistersetTTCReadyFlag (const bool bitSet)
 
bool slinkDownFlag () const
 
bool slinkFullFlag () const
 
FEDBufferState totalLengthFIFOState () const
 
FEDBufferState trackerHeaderFIFOState () const
 
bool trackerHeaderMonitorDataReadyFlag () const
 
bool ttcReadyFlag () const
 

Private Types

enum  bufferPositions {
  BUFFER_POSITION_QDR_MEMORY = 0, BUFFER_POSITION_FRAME_ADDRESS_FIFO = 1, BUFFER_POSITION_TOTAL_LENGTH_FIFO = 2, BUFFER_POSITION_TRACKER_HEADER_FIFO = 3,
  BUFFER_POSITION_L1ABX_FIFO = 4, BUFFER_POSITION_FE_EVENT_LENGTH_FIFO = 5, BUFFER_POSITION_FE_FPGA_BUFFER = 6
}
 
enum  stateOffsets { STATE_OFFSET_FULL = 8, STATE_OFFSET_PARTIAL_FULL = 16, STATE_OFFSET_EMPTY = 24 }
 

Private Member Functions

bool getBit (const uint8_t num) const
 
FEDBufferState getBufferState (const uint8_t bufferPosition) const
 
void printFlagsForBuffer (const FEDBufferState bufferState, const std::string name, std::ostream &os) const
 
void setBit (const uint8_t num, const bool bitSet)
 
void setBufferSate (const uint8_t bufferPosition, const FEDBufferState state)
 

Private Attributes

uint32_t data_
 

Detailed Description

Definition at line 394 of file SiStripFEDBufferComponents.h.

Member Enumeration Documentation

◆ bufferPositions

◆ stateOffsets

Constructor & Destructor Documentation

◆ FEDBackendStatusRegister() [1/2]

sistrip::FEDBackendStatusRegister::FEDBackendStatusRegister ( const uint32_t  backendStatusRegister)
inline

Definition at line 1020 of file SiStripFEDBufferComponents.h.

1021  : data_(backendStatusRegister) {}

◆ FEDBackendStatusRegister() [2/2]

sistrip::FEDBackendStatusRegister::FEDBackendStatusRegister ( const FEDBufferState  qdrMemoryBufferState = BUFFER_STATE_UNSET,
const FEDBufferState  frameAddressFIFOBufferState = BUFFER_STATE_UNSET,
const FEDBufferState  totalLengthFIFOBufferState = BUFFER_STATE_UNSET,
const FEDBufferState  trackerHeaderFIFOBufferState = BUFFER_STATE_UNSET,
const FEDBufferState  l1aBxFIFOBufferState = BUFFER_STATE_UNSET,
const FEDBufferState  feEventLengthFIFOBufferState = BUFFER_STATE_UNSET,
const FEDBufferState  feFPGABufferState = BUFFER_STATE_UNSET,
const bool  backpressure = false,
const bool  slinkFull = false,
const bool  slinkDown = false,
const bool  internalFreeze = false,
const bool  trackerHeaderMonitorDataReady = false,
const bool  ttcReady = true 
)

Definition at line 717 of file SiStripFEDBufferComponents.cc.

References feFPGABufferState(), setBackpressureFlag(), setFEEventLengthFIFOState(), setFEFPGABufferState(), setFrameAddressFIFOState(), setInternalFreezeFlag(), setL1ABXFIFOState(), setQDRMemoryState(), setSLinkDownFlag(), setSLinkFullFlag(), setTotalLengthFIFOState(), setTrackerHeaderFIFOState(), setTrackerHeaderMonitorDataReadyFlag(), and setTTCReadyFlag().

730  : data_(0) {
731  setInternalFreezeFlag(internalFreeze);
732  setSLinkDownFlag(slinkDown);
733  setSLinkFullFlag(slinkFull);
734  setBackpressureFlag(backpressure);
735  setTTCReadyFlag(ttcReady);
736  setTrackerHeaderMonitorDataReadyFlag(trackerHeaderMonitorDataReady);
737  setQDRMemoryState(qdrMemoryBufferState);
738  setFrameAddressFIFOState(frameAddressFIFOBufferState);
739  setTotalLengthFIFOState(totalLengthFIFOBufferState);
740  setTrackerHeaderFIFOState(trackerHeaderFIFOBufferState);
741  setL1ABXFIFOState(l1aBxFIFOBufferState);
742  setFEEventLengthFIFOState(feEventLengthFIFOBufferState);
744  }
FEDBackendStatusRegister & setFEFPGABufferState(const FEDBufferState state)
FEDBackendStatusRegister & setQDRMemoryState(const FEDBufferState state)
FEDBackendStatusRegister & setL1ABXFIFOState(const FEDBufferState state)
FEDBackendStatusRegister & setFrameAddressFIFOState(const FEDBufferState state)
FEDBackendStatusRegister & setTrackerHeaderFIFOState(const FEDBufferState state)
FEDBackendStatusRegister & setTotalLengthFIFOState(const FEDBufferState state)
FEDBackendStatusRegister & setTTCReadyFlag(const bool bitSet)
FEDBackendStatusRegister & setTrackerHeaderMonitorDataReadyFlag(const bool bitSet)
FEDBackendStatusRegister & setSLinkFullFlag(const bool bitSet)
FEDBackendStatusRegister & setFEEventLengthFIFOState(const FEDBufferState state)
FEDBackendStatusRegister & setInternalFreezeFlag(const bool bitSet)
FEDBackendStatusRegister & setBackpressureFlag(const bool bitSet)
FEDBackendStatusRegister & setSLinkDownFlag(const bool bitSet)

Member Function Documentation

◆ backpressureFlag()

bool sistrip::FEDBackendStatusRegister::backpressureFlag ( ) const
inline

Definition at line 1035 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags().

1035 { return getBit(4); }

◆ feEventLengthFIFOState()

FEDBufferState sistrip::FEDBackendStatusRegister::feEventLengthFIFOState ( ) const
inline

◆ feFPGABufferState()

FEDBufferState sistrip::FEDBackendStatusRegister::feFPGABufferState ( ) const
inline

◆ frameAddressFIFOState()

FEDBufferState sistrip::FEDBackendStatusRegister::frameAddressFIFOState ( ) const
inline

◆ getBit()

bool sistrip::FEDBackendStatusRegister::getBit ( const uint8_t  num) const
inlineprivate

◆ getBufferState()

FEDBufferState sistrip::FEDBackendStatusRegister::getBufferState ( const uint8_t  bufferPosition) const
private

Definition at line 680 of file SiStripFEDBufferComponents.cc.

References sistrip::BUFFER_STATE_EMPTY, sistrip::BUFFER_STATE_FULL, sistrip::BUFFER_STATE_PARTIAL_FULL, getBit(), mps_fire::result, STATE_OFFSET_EMPTY, STATE_OFFSET_FULL, and STATE_OFFSET_PARTIAL_FULL.

Referenced by feEventLengthFIFOState(), feFPGABufferState(), frameAddressFIFOState(), l1aBxFIFOState(), qdrMemoryState(), totalLengthFIFOState(), and trackerHeaderFIFOState().

◆ internalFreezeFlag()

bool sistrip::FEDBackendStatusRegister::internalFreezeFlag ( ) const
inline

Definition at line 1029 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags().

1029 { return getBit(1); }

◆ l1aBxFIFOState()

FEDBufferState sistrip::FEDBackendStatusRegister::l1aBxFIFOState ( ) const
inline

◆ operator uint32_t()

sistrip::FEDBackendStatusRegister::operator uint32_t ( ) const
inline

Definition at line 1023 of file SiStripFEDBufferComponents.h.

◆ print()

void sistrip::FEDBackendStatusRegister::print ( std::ostream &  os) const
inline

Definition at line 1025 of file SiStripFEDBufferComponents.h.

References data_, and sistrip::printHex().

1025 { printHex(&data_, 4, os); }
void printHex(const void *pointer, const size_t length, std::ostream &os)

◆ printFlags()

void sistrip::FEDBackendStatusRegister::printFlags ( std::ostream &  os) const

Definition at line 645 of file SiStripFEDBufferComponents.cc.

References backpressureFlag(), feEventLengthFIFOState(), feFPGABufferState(), frameAddressFIFOState(), internalFreezeFlag(), l1aBxFIFOState(), printFlagsForBuffer(), qdrMemoryState(), slinkDownFlag(), slinkFullFlag(), totalLengthFIFOState(), trackerHeaderFIFOState(), trackerHeaderMonitorDataReadyFlag(), and ttcReadyFlag().

645  {
646  if (internalFreezeFlag())
647  os << "INTERNAL_FREEZE ";
648  if (slinkDownFlag())
649  os << "SLINK_DOWN ";
650  if (slinkFullFlag())
651  os << "SLINK_FULL ";
652  if (backpressureFlag())
653  os << "BACKPRESSURE ";
654  if (ttcReadyFlag())
655  os << "TTC_READY ";
657  os << "HEADER_MONITOR_READY ";
658  printFlagsForBuffer(qdrMemoryState(), "QDR", os);
659  printFlagsForBuffer(frameAddressFIFOState(), "FRAME_ADDRESS", os);
660  printFlagsForBuffer(totalLengthFIFOState(), "TOTAL_LENGTH", os);
661  printFlagsForBuffer(trackerHeaderFIFOState(), "TRACKER_HEADER", os);
662  printFlagsForBuffer(l1aBxFIFOState(), "L1ABX", os);
663  printFlagsForBuffer(feEventLengthFIFOState(), "FE_LENGTH", os);
665  }
void printFlagsForBuffer(const FEDBufferState bufferState, const std::string name, std::ostream &os) const

◆ printFlagsForBuffer()

void sistrip::FEDBackendStatusRegister::printFlagsForBuffer ( const FEDBufferState  bufferState,
const std::string  name,
std::ostream &  os 
) const
private

Definition at line 667 of file SiStripFEDBufferComponents.cc.

References sistrip::BUFFER_STATE_EMPTY, sistrip::BUFFER_STATE_FULL, sistrip::BUFFER_STATE_PARTIAL_FULL, sistrip::BUFFER_STATE_UNSET, and Skims_PA_cff::name.

Referenced by printFlags().

669  {
670  if (bufferState & BUFFER_STATE_EMPTY)
671  os << name << "_EMPTY ";
672  if (bufferState & BUFFER_STATE_PARTIAL_FULL)
673  os << name << "_PARTIAL_FULL ";
674  if (bufferState & BUFFER_STATE_FULL)
675  os << name << "_FULL ";
676  if (bufferState == BUFFER_STATE_UNSET)
677  os << name << "_UNSET ";
678  }

◆ qdrMemoryState()

FEDBufferState sistrip::FEDBackendStatusRegister::qdrMemoryState ( ) const
inline

◆ setBackpressureFlag()

FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setBackpressureFlag ( const bool  bitSet)
inline

Definition at line 1056 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by FEDBackendStatusRegister().

1056  {
1057  setBit(4, bitSet);
1058  return *this;
1059  }
void setBit(const uint8_t num, const bool bitSet)

◆ setBit()

void sistrip::FEDBackendStatusRegister::setBit ( const uint8_t  num,
const bool  bitSet 
)
private

◆ setBufferSate()

void sistrip::FEDBackendStatusRegister::setBufferSate ( const uint8_t  bufferPosition,
const FEDBufferState  state 
)
private

Definition at line 691 of file SiStripFEDBufferComponents.cc.

References sistrip::BUFFER_STATE_EMPTY, sistrip::BUFFER_STATE_FULL, sistrip::BUFFER_STATE_PARTIAL_FULL, sistrip::BUFFER_STATE_UNSET, Exception, sistrip::printHex(), setBit(), contentValuesCheck::ss, STATE_OFFSET_EMPTY, STATE_OFFSET_FULL, and STATE_OFFSET_PARTIAL_FULL.

Referenced by setFEEventLengthFIFOState(), setFEFPGABufferState(), setFrameAddressFIFOState(), setL1ABXFIFOState(), setQDRMemoryState(), setTotalLengthFIFOState(), and setTrackerHeaderFIFOState().

691  {
692  switch (state) {
693  case BUFFER_STATE_FULL:
695  case BUFFER_STATE_EMPTY:
696  case BUFFER_STATE_UNSET:
697  break;
698  default:
699  std::ostringstream ss;
700  ss << "Invalid buffer state: ";
701  printHex(&state, 1, ss);
702  throw cms::Exception("FEDBuffer") << ss.str();
703  }
704  setBit(bufferPosition + STATE_OFFSET_EMPTY, state & BUFFER_STATE_EMPTY);
706  setBit(bufferPosition + STATE_OFFSET_FULL, state & BUFFER_STATE_FULL);
707  }
void setBit(const uint8_t num, const bool bitSet)
void printHex(const void *pointer, const size_t length, std::ostream &os)

◆ setFEEventLengthFIFOState()

FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setFEEventLengthFIFOState ( const FEDBufferState  state)
inline

◆ setFEFPGABufferState()

FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setFEFPGABufferState ( const FEDBufferState  state)
inline

◆ setFrameAddressFIFOState()

FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setFrameAddressFIFOState ( const FEDBufferState  state)
inline

◆ setInternalFreezeFlag()

FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setInternalFreezeFlag ( const bool  bitSet)
inline

Definition at line 1041 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by FEDBackendStatusRegister().

1041  {
1042  setBit(1, bitSet);
1043  return *this;
1044  }
void setBit(const uint8_t num, const bool bitSet)

◆ setL1ABXFIFOState()

FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setL1ABXFIFOState ( const FEDBufferState  state)
inline

◆ setQDRMemoryState()

FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setQDRMemoryState ( const FEDBufferState  state)
inline

◆ setSLinkDownFlag()

FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setSLinkDownFlag ( const bool  bitSet)
inline

Definition at line 1046 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by FEDBackendStatusRegister().

1046  {
1047  setBit(2, bitSet);
1048  return *this;
1049  }
void setBit(const uint8_t num, const bool bitSet)

◆ setSLinkFullFlag()

FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setSLinkFullFlag ( const bool  bitSet)
inline

Definition at line 1051 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by FEDBackendStatusRegister().

1051  {
1052  setBit(3, bitSet);
1053  return *this;
1054  }
void setBit(const uint8_t num, const bool bitSet)

◆ setTotalLengthFIFOState()

FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setTotalLengthFIFOState ( const FEDBufferState  state)
inline

◆ setTrackerHeaderFIFOState()

FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setTrackerHeaderFIFOState ( const FEDBufferState  state)
inline

◆ setTrackerHeaderMonitorDataReadyFlag()

FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setTrackerHeaderMonitorDataReadyFlag ( const bool  bitSet)
inline

Definition at line 1066 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by FEDBackendStatusRegister().

1066  {
1067  setBit(7, bitSet);
1068  return *this;
1069  }
void setBit(const uint8_t num, const bool bitSet)

◆ setTTCReadyFlag()

FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setTTCReadyFlag ( const bool  bitSet)
inline

Definition at line 1061 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by FEDBackendStatusRegister().

1061  {
1062  setBit(6, bitSet);
1063  return *this;
1064  }
void setBit(const uint8_t num, const bool bitSet)

◆ slinkDownFlag()

bool sistrip::FEDBackendStatusRegister::slinkDownFlag ( ) const
inline

Definition at line 1031 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags().

1031 { return getBit(2); }

◆ slinkFullFlag()

bool sistrip::FEDBackendStatusRegister::slinkFullFlag ( ) const
inline

Definition at line 1033 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags().

1033 { return getBit(3); }

◆ totalLengthFIFOState()

FEDBufferState sistrip::FEDBackendStatusRegister::totalLengthFIFOState ( ) const
inline

◆ trackerHeaderFIFOState()

FEDBufferState sistrip::FEDBackendStatusRegister::trackerHeaderFIFOState ( ) const
inline

◆ trackerHeaderMonitorDataReadyFlag()

bool sistrip::FEDBackendStatusRegister::trackerHeaderMonitorDataReadyFlag ( ) const
inline

Definition at line 1039 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags().

1039 { return getBit(7); }

◆ ttcReadyFlag()

bool sistrip::FEDBackendStatusRegister::ttcReadyFlag ( ) const
inline

Definition at line 1037 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags().

1037 { return getBit(6); }

Member Data Documentation

◆ data_

uint32_t sistrip::FEDBackendStatusRegister::data_
private

Definition at line 463 of file SiStripFEDBufferComponents.h.

Referenced by getBit(), print(), and setBit().