CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 314 of file SiStripFEDBufferComponents.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 861 of file SiStripFEDBufferComponents.h.

862  : data_(backendStatusRegister) { }
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 589 of file SiStripFEDBufferComponents.cc.

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

599  : data_(0)
600  {
601  setInternalFreezeFlag(internalFreeze);
602  setSLinkDownFlag(slinkDown);
603  setSLinkFullFlag(slinkFull);
604  setBackpressureFlag(backpressure);
605  setTTCReadyFlag(ttcReady);
606  setTrackerHeaderMonitorDataReadyFlag(trackerHeaderMonitorDataReady);
607  setQDRMemoryState(qdrMemoryBufferState);
608  setFrameAddressFIFOState(frameAddressFIFOBufferState);
609  setTotalLengthFIFOState(totalLengthFIFOBufferState);
610  setTrackerHeaderFIFOState(trackerHeaderFIFOBufferState);
611  setL1ABXFIFOState(l1aBxFIFOBufferState);
612  setFEEventLengthFIFOState(feEventLengthFIFOBufferState);
614  }
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

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

Definition at line 882 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags().

883  { return getBit(4); }
bool getBit(const uint8_t num) const
FEDBufferState sistrip::FEDBackendStatusRegister::feEventLengthFIFOState ( ) const
inline
FEDBufferState sistrip::FEDBackendStatusRegister::feFPGABufferState ( ) const
inline
FEDBufferState sistrip::FEDBackendStatusRegister::frameAddressFIFOState ( ) const
inline
bool sistrip::FEDBackendStatusRegister::getBit ( const uint8_t  num) const
inlineprivate
FEDBufferState sistrip::FEDBackendStatusRegister::getBufferState ( const uint8_t  bufferPosition) const
private

Definition at line 554 of file SiStripFEDBufferComponents.cc.

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

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

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

Definition at line 873 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags().

874  { return getBit(1); }
bool getBit(const uint8_t num) const
FEDBufferState sistrip::FEDBackendStatusRegister::l1aBxFIFOState ( ) const
inline
sistrip::FEDBackendStatusRegister::operator uint32_t ( ) const
inline

Definition at line 864 of file SiStripFEDBufferComponents.h.

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

Definition at line 867 of file SiStripFEDBufferComponents.h.

References data_, and sistrip::printHex().

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

Definition at line 529 of file SiStripFEDBufferComponents.cc.

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

530  {
531  if (internalFreezeFlag()) os << "INTERNAL_FREEZE ";
532  if (slinkDownFlag()) os << "SLINK_DOWN ";
533  if (slinkFullFlag()) os << "SLINK_FULL ";
534  if (backpressureFlag()) os << "BACKPRESSURE ";
535  if (ttcReadyFlag()) os << "TTC_READY ";
536  if (trackerHeaderMonitorDataReadyFlag()) os << "HEADER_MONITOR_READY ";
538  printFlagsForBuffer(frameAddressFIFOState(),"FRAME_ADDRESS",os);
539  printFlagsForBuffer(totalLengthFIFOState(),"TOTAL_LENGTH",os);
540  printFlagsForBuffer(trackerHeaderFIFOState(),"TRACKER_HEADER",os);
541  printFlagsForBuffer(l1aBxFIFOState(),"L1ABX",os);
544  }
void printFlagsForBuffer(const FEDBufferState bufferState, const std::string name, std::ostream &os) const
void sistrip::FEDBackendStatusRegister::printFlagsForBuffer ( const FEDBufferState  bufferState,
const std::string  name,
std::ostream &  os 
) const
private

Definition at line 546 of file SiStripFEDBufferComponents.cc.

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

Referenced by printFlags().

547  {
548  if (bufferState&BUFFER_STATE_EMPTY) os << name << "_EMPTY ";
549  if (bufferState&BUFFER_STATE_PARTIAL_FULL) os << name << "_PARTIAL_FULL ";
550  if (bufferState&BUFFER_STATE_FULL) os << name << "_FULL ";
551  if (bufferState == BUFFER_STATE_UNSET) os << name << "_UNSET ";
552  }
FEDBufferState sistrip::FEDBackendStatusRegister::qdrMemoryState ( ) const
inline
FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setBackpressureFlag ( const bool  bitSet)
inline

Definition at line 900 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by FEDBackendStatusRegister().

901  { setBit(4,bitSet); return *this; }
void setBit(const uint8_t num, const bool bitSet)
void sistrip::FEDBackendStatusRegister::setBit ( const uint8_t  num,
const bool  bitSet 
)
private

Definition at line 582 of file SiStripFEDBufferComponents.cc.

References data_, and pileupDistInMC::num.

Referenced by setBackpressureFlag(), setBufferSate(), setInternalFreezeFlag(), setSLinkDownFlag(), setSLinkFullFlag(), setTrackerHeaderMonitorDataReadyFlag(), and setTTCReadyFlag().

583  {
584  const uint32_t mask = (0x00000001 << num);
585  if (bitSet) data_ |= mask;
586  else data_ &= (~mask);
587  }
void sistrip::FEDBackendStatusRegister::setBufferSate ( const uint8_t  bufferPosition,
const FEDBufferState  state 
)
private

Definition at line 563 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().

564  {
565  switch (state) {
566  case BUFFER_STATE_FULL:
568  case BUFFER_STATE_EMPTY:
569  case BUFFER_STATE_UNSET:
570  break;
571  default:
572  std::ostringstream ss;
573  ss << "Invalid buffer state: ";
574  printHex(&state,1,ss);
575  throw cms::Exception("FEDBuffer") << ss.str();
576  }
577  setBit(bufferPosition+STATE_OFFSET_EMPTY, state&BUFFER_STATE_EMPTY);
579  setBit(bufferPosition+STATE_OFFSET_FULL, state&BUFFER_STATE_FULL);
580  }
void setBit(const uint8_t num, const bool bitSet)
void printHex(const void *pointer, const size_t length, std::ostream &os)
FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setFEEventLengthFIFOState ( const FEDBufferState  state)
inline
FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setFEFPGABufferState ( const FEDBufferState  state)
inline

Definition at line 980 of file SiStripFEDBufferComponents.h.

References BUFFER_POSITION_FE_FPGA_BUFFER, and setBufferSate().

Referenced by FEDBackendStatusRegister().

981  {
983  return *this;
984  }
void setBufferSate(const uint8_t bufferPosition, const FEDBufferState state)
FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setFrameAddressFIFOState ( const FEDBufferState  state)
inline
FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setInternalFreezeFlag ( const bool  bitSet)
inline

Definition at line 891 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by FEDBackendStatusRegister().

892  { setBit(1,bitSet); return *this; }
void setBit(const uint8_t num, const bool bitSet)
FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setL1ABXFIFOState ( const FEDBufferState  state)
inline

Definition at line 968 of file SiStripFEDBufferComponents.h.

References BUFFER_POSITION_L1ABX_FIFO, and setBufferSate().

Referenced by FEDBackendStatusRegister().

969  {
971  return *this;
972  }
void setBufferSate(const uint8_t bufferPosition, const FEDBufferState state)
FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setQDRMemoryState ( const FEDBufferState  state)
inline

Definition at line 944 of file SiStripFEDBufferComponents.h.

References BUFFER_POSITION_QDR_MEMORY, and setBufferSate().

Referenced by FEDBackendStatusRegister().

945  {
947  return *this;
948  }
void setBufferSate(const uint8_t bufferPosition, const FEDBufferState state)
FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setSLinkDownFlag ( const bool  bitSet)
inline

Definition at line 894 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by FEDBackendStatusRegister().

895  { setBit(2,bitSet); return *this; }
void setBit(const uint8_t num, const bool bitSet)
FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setSLinkFullFlag ( const bool  bitSet)
inline

Definition at line 897 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by FEDBackendStatusRegister().

898  { setBit(3,bitSet); return *this; }
void setBit(const uint8_t num, const bool bitSet)
FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setTotalLengthFIFOState ( const FEDBufferState  state)
inline
FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setTrackerHeaderFIFOState ( const FEDBufferState  state)
inline
FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setTrackerHeaderMonitorDataReadyFlag ( const bool  bitSet)
inline

Definition at line 906 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by FEDBackendStatusRegister().

907  { setBit(7,bitSet); return *this; }
void setBit(const uint8_t num, const bool bitSet)
FEDBackendStatusRegister & sistrip::FEDBackendStatusRegister::setTTCReadyFlag ( const bool  bitSet)
inline

Definition at line 903 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by FEDBackendStatusRegister().

904  { setBit(6,bitSet); return *this; }
void setBit(const uint8_t num, const bool bitSet)
bool sistrip::FEDBackendStatusRegister::slinkDownFlag ( ) const
inline

Definition at line 876 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags().

877  { return getBit(2); }
bool getBit(const uint8_t num) const
bool sistrip::FEDBackendStatusRegister::slinkFullFlag ( ) const
inline

Definition at line 879 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags().

880  { return getBit(3); }
bool getBit(const uint8_t num) const
FEDBufferState sistrip::FEDBackendStatusRegister::totalLengthFIFOState ( ) const
inline
FEDBufferState sistrip::FEDBackendStatusRegister::trackerHeaderFIFOState ( ) const
inline
bool sistrip::FEDBackendStatusRegister::trackerHeaderMonitorDataReadyFlag ( ) const
inline

Definition at line 888 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags().

889  { return getBit(7); }
bool getBit(const uint8_t num) const
bool sistrip::FEDBackendStatusRegister::ttcReadyFlag ( ) const
inline

Definition at line 885 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags().

886  { return getBit(6); }
bool getBit(const uint8_t num) const

Member Data Documentation

uint32_t sistrip::FEDBackendStatusRegister::data_
private

Definition at line 380 of file SiStripFEDBufferComponents.h.

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