CMS 3D CMS Logo

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 276 of file SiStripFEDBufferComponents.h.

Constructor & Destructor Documentation

◆ FEDStatusRegister() [1/2]

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

Definition at line 957 of file SiStripFEDBufferComponents.h.

957 : data_(fedStatusRegister) {}

◆ FEDStatusRegister() [2/2]

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 1007 of file SiStripFEDBufferComponents.h.

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

1011  : data_(0x0000) {
1012  setSLinkFullFlag(slinkFullFlagSet);
1013  setTrackerHeaderMonitorDataReadyFlag(trackerHeaderMonitorDataReadyFlagSet);
1014  setQDRMemoryBufferState(qdrMemoryBufferState);
1015  setL1ABXFIFOBufferState(l1aBxFIFOBufferState);
1016  }
FEDStatusRegister & setTrackerHeaderMonitorDataReadyFlag(const bool bitSet)
FEDStatusRegister & setSLinkFullFlag(const bool bitSet)
FEDStatusRegister & setL1ABXFIFOBufferState(const FEDBufferState state)
FEDStatusRegister & setQDRMemoryBufferState(const FEDBufferState state)

Member Function Documentation

◆ feDataMissingFlag()

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

Definition at line 979 of file SiStripFEDBufferComponents.h.

References getBit().

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

979  {
980  return getBit(8 + internalFEUnitNum);
981  }
bool getBit(const uint8_t num) const

◆ getBit()

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

◆ l1aBxFIFOEmptyFlag()

bool sistrip::FEDStatusRegister::l1aBxFIFOEmptyFlag ( ) const
inline

Definition at line 977 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by l1aBxFIFOState(), and printFlags().

977 { return getBit(7); }
bool getBit(const uint8_t num) const

◆ l1aBxFIFOFullFlag()

bool sistrip::FEDStatusRegister::l1aBxFIFOFullFlag ( ) const
inline

Definition at line 973 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by l1aBxFIFOState(), and printFlags().

973 { return getBit(5); }
bool getBit(const uint8_t num) const

◆ l1aBxFIFOPartialFullFlag()

bool sistrip::FEDStatusRegister::l1aBxFIFOPartialFullFlag ( ) const
inline

Definition at line 975 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by l1aBxFIFOState(), and printFlags().

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

◆ l1aBxFIFOState()

FEDBufferState sistrip::FEDStatusRegister::l1aBxFIFOState ( ) const

◆ operator uint16_t()

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

Definition at line 959 of file SiStripFEDBufferComponents.h.

◆ print()

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

Definition at line 983 of file SiStripFEDBufferComponents.h.

References data_, l1tGTMenu_BTagSeeds_cff::os, and sistrip::printHex().

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

◆ printFlags()

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

Definition at line 554 of file SiStripFEDBufferComponents.cc.

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

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

554  {
555  if (slinkFullFlag())
556  os << "SLINK_FULL ";
558  os << "HEADER_MONITOR_READY ";
559  if (qdrMemoryFullFlag())
560  os << "QDR_FULL ";
562  os << "QDR_PARTIAL_FULL ";
563  if (qdrMemoryEmptyFlag())
564  os << "QDR_EMPTY ";
565  if (l1aBxFIFOFullFlag())
566  os << "L1A_FULL ";
568  os << "L1A_PARTIAL_FULL ";
569  if (l1aBxFIFOEmptyFlag())
570  os << "L1A_EMPTY ";
571  for (uint8_t iFE = 0; iFE < FEUNITS_PER_FED; iFE++) {
572  if (feDataMissingFlag(iFE))
573  os << "FEUNIT" << uint16_t(iFE) << "MISSING ";
574  }
575  }
bool feDataMissingFlag(const uint8_t internalFEUnitNum) const
static const uint16_t FEUNITS_PER_FED

◆ qdrMemoryEmptyFlag()

bool sistrip::FEDStatusRegister::qdrMemoryEmptyFlag ( ) const
inline

Definition at line 971 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags(), and qdrMemoryState().

971 { return getBit(4); }
bool getBit(const uint8_t num) const

◆ qdrMemoryFullFlag()

bool sistrip::FEDStatusRegister::qdrMemoryFullFlag ( ) const
inline

Definition at line 967 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags(), and qdrMemoryState().

967 { return getBit(2); }
bool getBit(const uint8_t num) const

◆ qdrMemoryPartialFullFlag()

bool sistrip::FEDStatusRegister::qdrMemoryPartialFullFlag ( ) const
inline

Definition at line 969 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags(), and qdrMemoryState().

969 { return getBit(3); }
bool getBit(const uint8_t num) const

◆ qdrMemoryState()

FEDBufferState sistrip::FEDStatusRegister::qdrMemoryState ( ) const

◆ setBit()

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

◆ setL1ABXFIFOBufferState()

FEDStatusRegister & sistrip::FEDStatusRegister::setL1ABXFIFOBufferState ( const FEDBufferState  state)

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

626  {
627  switch (state) {
628  case BUFFER_STATE_FULL:
630  case BUFFER_STATE_EMPTY:
631  case BUFFER_STATE_UNSET:
632  break;
633  default:
634  std::ostringstream ss;
635  ss << "Invalid buffer state: ";
636  printHex(&state, 1, ss);
637  throw cms::Exception("FEDBuffer") << ss.str();
638  }
642  return *this;
643  }
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)

◆ setL1ABXFIFOEmptyFlag()

void sistrip::FEDStatusRegister::setL1ABXFIFOEmptyFlag ( const bool  bitSet)
inlineprivate

Definition at line 1005 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by setL1ABXFIFOBufferState().

1005 { setBit(7, bitSet); }
void setBit(const uint8_t num, const bool bitSet)

◆ setL1ABXFIFOFullFlag()

void sistrip::FEDStatusRegister::setL1ABXFIFOFullFlag ( const bool  bitSet)
inlineprivate

Definition at line 1001 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by setL1ABXFIFOBufferState().

1001 { setBit(5, bitSet); }
void setBit(const uint8_t num, const bool bitSet)

◆ setL1ABXFIFOPartialFullFlag()

void sistrip::FEDStatusRegister::setL1ABXFIFOPartialFullFlag ( const bool  bitSet)
inlineprivate

Definition at line 1003 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by setL1ABXFIFOBufferState().

1003 { setBit(6, bitSet); }
void setBit(const uint8_t num, const bool bitSet)

◆ setQDRMemoryBufferState()

FEDStatusRegister & sistrip::FEDStatusRegister::setQDRMemoryBufferState ( const FEDBufferState  state)

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

607  {
608  switch (state) {
609  case BUFFER_STATE_FULL:
611  case BUFFER_STATE_EMPTY:
612  case BUFFER_STATE_UNSET:
613  break;
614  default:
615  std::ostringstream ss;
616  ss << "Invalid buffer state: ";
617  printHex(&state, 1, ss);
618  throw cms::Exception("FEDBuffer") << ss.str();
619  }
623  return *this;
624  }
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)

◆ setQDRMemoryEmptyFlag()

void sistrip::FEDStatusRegister::setQDRMemoryEmptyFlag ( const bool  bitSet)
inlineprivate

Definition at line 999 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by setQDRMemoryBufferState().

999 { setBit(4, bitSet); }
void setBit(const uint8_t num, const bool bitSet)

◆ setQDRMemoryFullFlag()

void sistrip::FEDStatusRegister::setQDRMemoryFullFlag ( const bool  bitSet)
inlineprivate

Definition at line 995 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by setQDRMemoryBufferState().

995 { setBit(2, bitSet); }
void setBit(const uint8_t num, const bool bitSet)

◆ setQDRMemoryPartialFullFlag()

void sistrip::FEDStatusRegister::setQDRMemoryPartialFullFlag ( const bool  bitSet)
inlineprivate

Definition at line 997 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by setQDRMemoryBufferState().

997 { setBit(3, bitSet); }
void setBit(const uint8_t num, const bool bitSet)

◆ setSLinkFullFlag()

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

Definition at line 985 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by FEDStatusRegister().

985  {
986  setBit(0, bitSet);
987  return *this;
988  }
void setBit(const uint8_t num, const bool bitSet)

◆ setTrackerHeaderMonitorDataReadyFlag()

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

Definition at line 990 of file SiStripFEDBufferComponents.h.

References setBit().

Referenced by FEDStatusRegister().

990  {
991  setBit(1, bitSet);
992  return *this;
993  }
void setBit(const uint8_t num, const bool bitSet)

◆ slinkFullFlag()

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

Definition at line 963 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags().

963 { return getBit(0); }
bool getBit(const uint8_t num) const

◆ trackerHeaderMonitorDataReadyFlag()

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

Definition at line 965 of file SiStripFEDBufferComponents.h.

References getBit().

Referenced by printFlags().

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

Member Data Documentation

◆ data_

uint16_t sistrip::FEDStatusRegister::data_
private

Definition at line 312 of file SiStripFEDBufferComponents.h.

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