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 Member Functions | Private Attributes
sistrip::FEDStatusRegister Class Reference

#include <SiStripFEDBufferComponents.h>

Public Member Functions

bool feDataMissingFlag (const uint8_t internalFEUnitNum) const
 
 FEDStatusRegister (const uint16_t fedStatusRegister)
 
 FEDStatusRegister (const FEDBufferState qdrMemoryBufferState=BUFFER_STATE_UNSET, const FEDBufferState l1aBxFIFOBufferState=BUFFER_STATE_UNSET, const bool trackerHeaderMonitorDataReadyFlagSet=false, const bool slinkFullFlagSet=false)
 
bool l1aBxFIFOEmptyFlag () const
 
bool l1aBxFIFOFullFlag () const
 
bool l1aBxFIFOPartialFullFlag () const
 
FEDBufferState l1aBxFIFOState () const
 
 operator uint16_t () const
 
void print (std::ostream &os) const
 
void printFlags (std::ostream &os) const
 
bool qdrMemoryEmptyFlag () const
 
bool qdrMemoryFullFlag () const
 
bool qdrMemoryPartialFullFlag () const
 
FEDBufferState qdrMemoryState () const
 
FEDStatusRegistersetL1ABXFIFOBufferState (const FEDBufferState state)
 
FEDStatusRegistersetQDRMemoryBufferState (const FEDBufferState state)
 
FEDStatusRegistersetSLinkFullFlag (const bool bitSet)
 
FEDStatusRegistersetTrackerHeaderMonitorDataReadyFlag (const bool bitSet)
 
bool slinkFullFlag () const
 
bool trackerHeaderMonitorDataReadyFlag () const
 

Private Member Functions

bool getBit (const uint8_t num) const
 
void setBit (const uint8_t num, const bool bitSet)
 
void setL1ABXFIFOEmptyFlag (const bool bitSet)
 
void setL1ABXFIFOFullFlag (const bool bitSet)
 
void setL1ABXFIFOPartialFullFlag (const bool bitSet)
 
void setQDRMemoryEmptyFlag (const bool bitSet)
 
void setQDRMemoryFullFlag (const bool bitSet)
 
void setQDRMemoryPartialFullFlag (const bool bitSet)
 

Private Attributes

uint16_t data_
 

Detailed Description

Definition at line 245 of file SiStripFEDBufferComponents.h.

Constructor & Destructor Documentation

sistrip::FEDStatusRegister::FEDStatusRegister ( const uint16_t  fedStatusRegister)
inline

Definition at line 810 of file SiStripFEDBufferComponents.h.

811  : data_(fedStatusRegister) { }
sistrip::FEDStatusRegister::FEDStatusRegister ( const FEDBufferState  qdrMemoryBufferState = BUFFER_STATE_UNSET,
const FEDBufferState  l1aBxFIFOBufferState = BUFFER_STATE_UNSET,
const bool  trackerHeaderMonitorDataReadyFlagSet = false,
const bool  slinkFullFlagSet = false 
)
inline

Definition at line 875 of file SiStripFEDBufferComponents.h.

References setL1ABXFIFOBufferState(), setQDRMemoryBufferState(), setSLinkFullFlag(), and setTrackerHeaderMonitorDataReadyFlag().

877  : data_(0x0000)
878  {
879  setSLinkFullFlag(slinkFullFlagSet);
880  setTrackerHeaderMonitorDataReadyFlag(trackerHeaderMonitorDataReadyFlagSet);
881  setQDRMemoryBufferState(qdrMemoryBufferState);
882  setL1ABXFIFOBufferState(l1aBxFIFOBufferState);
883  }
FEDStatusRegister & setTrackerHeaderMonitorDataReadyFlag(const bool bitSet)
FEDStatusRegister & setSLinkFullFlag(const bool bitSet)
FEDStatusRegister & setL1ABXFIFOBufferState(const FEDBufferState state)
FEDStatusRegister & setQDRMemoryBufferState(const FEDBufferState state)

Member Function Documentation

bool sistrip::FEDStatusRegister::feDataMissingFlag ( const uint8_t  internalFEUnitNum) const
inline

Definition at line 843 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by sistrip::FEDBuffer::FEDBuffer(), and printFlags().

844  {
845  return getBit(8+internalFEUnitNum);
846  }
bool getBit(const uint8_t num) const
bool sistrip::FEDStatusRegister::getBit ( const uint8_t  num) const
inlineprivate
bool sistrip::FEDStatusRegister::l1aBxFIFOEmptyFlag ( ) const
inline

Definition at line 840 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by l1aBxFIFOState(), and printFlags().

841  { return getBit(7); }
bool getBit(const uint8_t num) const
bool sistrip::FEDStatusRegister::l1aBxFIFOFullFlag ( ) const
inline

Definition at line 834 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by l1aBxFIFOState(), and printFlags().

835  { return getBit(5); }
bool getBit(const uint8_t num) const
bool sistrip::FEDStatusRegister::l1aBxFIFOPartialFullFlag ( ) const
inline

Definition at line 837 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by l1aBxFIFOState(), and printFlags().

838  { return getBit(6); }
bool getBit(const uint8_t num) const
FEDBufferState sistrip::FEDStatusRegister::l1aBxFIFOState ( ) const
sistrip::FEDStatusRegister::operator uint16_t ( ) const
inline

Definition at line 813 of file SiStripFEDBufferComponents.h.

814  { return data_; }
void sistrip::FEDStatusRegister::print ( std::ostream &  os) const
inline

Definition at line 848 of file SiStripFEDBufferComponents.h.

References data_, and sistrip::printHex().

Referenced by sistrip::operator<<().

849  { printHex(&data_,2,os); }
void printHex(const void *pointer, const size_t length, std::ostream &os)
void sistrip::FEDStatusRegister::printFlags ( std::ostream &  os) const

Definition at line 478 of file SiStripFEDBufferComponents.cc.

References feDataMissingFlag(), sistrip::FEUNITS_PER_FED, l1aBxFIFOEmptyFlag(), l1aBxFIFOFullFlag(), l1aBxFIFOPartialFullFlag(), qdrMemoryEmptyFlag(), qdrMemoryFullFlag(), qdrMemoryPartialFullFlag(), slinkFullFlag(), and trackerHeaderMonitorDataReadyFlag().

Referenced by sistrip::FEDBufferBase::print().

479  {
480  if (slinkFullFlag()) os << "SLINK_FULL ";
481  if (trackerHeaderMonitorDataReadyFlag()) os << "HEADER_MONITOR_READY ";
482  if (qdrMemoryFullFlag()) os << "QDR_FULL ";
483  if (qdrMemoryPartialFullFlag()) os << "QDR_PARTIAL_FULL ";
484  if (qdrMemoryEmptyFlag()) os << "QDR_EMPTY ";
485  if (l1aBxFIFOFullFlag()) os << "L1A_FULL ";
486  if (l1aBxFIFOPartialFullFlag()) os << "L1A_PARTIAL_FULL ";
487  if (l1aBxFIFOEmptyFlag()) os << "L1A_EMPTY ";
488  for (uint8_t iFE = 0; iFE < FEUNITS_PER_FED; iFE++) {
489  if (feDataMissingFlag(iFE)) os << "FEUNIT" << uint16_t(iFE) << "MISSING ";
490  }
491  }
bool feDataMissingFlag(const uint8_t internalFEUnitNum) const
static const uint16_t FEUNITS_PER_FED
bool sistrip::FEDStatusRegister::qdrMemoryEmptyFlag ( ) const
inline

Definition at line 831 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags(), and qdrMemoryState().

832  { return getBit(4); }
bool getBit(const uint8_t num) const
bool sistrip::FEDStatusRegister::qdrMemoryFullFlag ( ) const
inline

Definition at line 825 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags(), and qdrMemoryState().

826  { return getBit(2); }
bool getBit(const uint8_t num) const
bool sistrip::FEDStatusRegister::qdrMemoryPartialFullFlag ( ) const
inline

Definition at line 828 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags(), and qdrMemoryState().

829  { return getBit(3); }
bool getBit(const uint8_t num) const
FEDBufferState sistrip::FEDStatusRegister::qdrMemoryState ( ) const
void sistrip::FEDStatusRegister::setBit ( const uint8_t  num,
const bool  bitSet 
)
private
FEDStatusRegister & sistrip::FEDStatusRegister::setL1ABXFIFOBufferState ( const FEDBufferState  state)

Definition at line 538 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(), setL1ABXFIFOEmptyFlag(), setL1ABXFIFOFullFlag(), setL1ABXFIFOPartialFullFlag(), and contentValuesCheck::ss.

Referenced by FEDStatusRegister().

539  {
540  switch (state) {
541  case BUFFER_STATE_FULL:
543  case BUFFER_STATE_EMPTY:
544  case BUFFER_STATE_UNSET:
545  break;
546  default:
547  std::ostringstream ss;
548  ss << "Invalid buffer state: ";
549  printHex(&state,1,ss);
550  throw cms::Exception("FEDBuffer") << ss.str();
551  }
555  return *this;
556  }
void setL1ABXFIFOFullFlag(const bool bitSet)
void setL1ABXFIFOPartialFullFlag(const bool bitSet)
void printHex(const void *pointer, const size_t length, std::ostream &os)
void setL1ABXFIFOEmptyFlag(const bool bitSet)
void sistrip::FEDStatusRegister::setL1ABXFIFOEmptyFlag ( const bool  bitSet)
inlineprivate

Definition at line 872 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by setL1ABXFIFOBufferState().

873  { setBit(7,bitSet); }
void setBit(const uint8_t num, const bool bitSet)
void sistrip::FEDStatusRegister::setL1ABXFIFOFullFlag ( const bool  bitSet)
inlineprivate

Definition at line 866 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by setL1ABXFIFOBufferState().

867  { setBit(5,bitSet); }
void setBit(const uint8_t num, const bool bitSet)
void sistrip::FEDStatusRegister::setL1ABXFIFOPartialFullFlag ( const bool  bitSet)
inlineprivate

Definition at line 869 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by setL1ABXFIFOBufferState().

870  { setBit(6,bitSet); }
void setBit(const uint8_t num, const bool bitSet)
FEDStatusRegister & sistrip::FEDStatusRegister::setQDRMemoryBufferState ( const FEDBufferState  state)

Definition at line 518 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(), setQDRMemoryEmptyFlag(), setQDRMemoryFullFlag(), setQDRMemoryPartialFullFlag(), and contentValuesCheck::ss.

Referenced by FEDStatusRegister().

519  {
520  switch (state) {
521  case BUFFER_STATE_FULL:
523  case BUFFER_STATE_EMPTY:
524  case BUFFER_STATE_UNSET:
525  break;
526  default:
527  std::ostringstream ss;
528  ss << "Invalid buffer state: ";
529  printHex(&state,1,ss);
530  throw cms::Exception("FEDBuffer") << ss.str();
531  }
535  return *this;
536  }
void setQDRMemoryEmptyFlag(const bool bitSet)
void setQDRMemoryFullFlag(const bool bitSet)
void printHex(const void *pointer, const size_t length, std::ostream &os)
void setQDRMemoryPartialFullFlag(const bool bitSet)
void sistrip::FEDStatusRegister::setQDRMemoryEmptyFlag ( const bool  bitSet)
inlineprivate

Definition at line 863 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by setQDRMemoryBufferState().

864  { setBit(4,bitSet); }
void setBit(const uint8_t num, const bool bitSet)
void sistrip::FEDStatusRegister::setQDRMemoryFullFlag ( const bool  bitSet)
inlineprivate

Definition at line 857 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by setQDRMemoryBufferState().

858  { setBit(2,bitSet); }
void setBit(const uint8_t num, const bool bitSet)
void sistrip::FEDStatusRegister::setQDRMemoryPartialFullFlag ( const bool  bitSet)
inlineprivate

Definition at line 860 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by setQDRMemoryBufferState().

861  { setBit(3,bitSet); }
void setBit(const uint8_t num, const bool bitSet)
FEDStatusRegister & sistrip::FEDStatusRegister::setSLinkFullFlag ( const bool  bitSet)
inline

Definition at line 851 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by FEDStatusRegister().

852  { setBit(0,bitSet); return *this; }
void setBit(const uint8_t num, const bool bitSet)
FEDStatusRegister & sistrip::FEDStatusRegister::setTrackerHeaderMonitorDataReadyFlag ( const bool  bitSet)
inline

Definition at line 854 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by FEDStatusRegister().

855  { setBit(1,bitSet); return *this; }
void setBit(const uint8_t num, const bool bitSet)
bool sistrip::FEDStatusRegister::slinkFullFlag ( ) const
inline

Definition at line 819 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags().

820  { return getBit(0); }
bool getBit(const uint8_t num) const
bool sistrip::FEDStatusRegister::trackerHeaderMonitorDataReadyFlag ( ) const
inline

Definition at line 822 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags().

823  { return getBit(1); }
bool getBit(const uint8_t num) const

Member Data Documentation

uint16_t sistrip::FEDStatusRegister::data_
private

Definition at line 281 of file SiStripFEDBufferComponents.h.

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