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 FEDBufferState qdrMemoryBufferState=BUFFER_STATE_UNSET, const FEDBufferState l1aBxFIFOBufferState=BUFFER_STATE_UNSET, const bool trackerHeaderMonitorDataReadyFlagSet=false, const bool slinkFullFlagSet=false)
 
 FEDStatusRegister (const uint16_t fedStatusRegister)
 
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.

1011  : data_(0x0000) {
1012  setSLinkFullFlag(slinkFullFlagSet);
1013  setTrackerHeaderMonitorDataReadyFlag(trackerHeaderMonitorDataReadyFlagSet);
1014  setQDRMemoryBufferState(qdrMemoryBufferState);
1015  setL1ABXFIFOBufferState(l1aBxFIFOBufferState);
1016  }

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

Member Function Documentation

◆ feDataMissingFlag()

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

Definition at line 979 of file SiStripFEDBufferComponents.h.

979  {
980  return getBit(8 + internalFEUnitNum);
981  }

References getBit().

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

◆ 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.

977 { return getBit(7); }

References getBit().

Referenced by l1aBxFIFOState(), and printFlags().

◆ l1aBxFIFOFullFlag()

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

Definition at line 973 of file SiStripFEDBufferComponents.h.

973 { return getBit(5); }

References getBit().

Referenced by l1aBxFIFOState(), and printFlags().

◆ l1aBxFIFOPartialFullFlag()

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

Definition at line 975 of file SiStripFEDBufferComponents.h.

975 { return getBit(6); }

References getBit().

Referenced by l1aBxFIFOState(), and printFlags().

◆ l1aBxFIFOState()

FEDBufferState sistrip::FEDStatusRegister::l1aBxFIFOState ( ) const

◆ operator uint16_t()

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

Definition at line 959 of file SiStripFEDBufferComponents.h.

959 { return data_; }

◆ print()

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

Definition at line 983 of file SiStripFEDBufferComponents.h.

983 { printHex(&data_, 2, os); }

References data_, and sistrip::printHex().

◆ printFlags()

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

Definition at line 554 of file SiStripFEDBufferComponents.cc.

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  }

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

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

◆ qdrMemoryEmptyFlag()

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

Definition at line 971 of file SiStripFEDBufferComponents.h.

971 { return getBit(4); }

References getBit().

Referenced by printFlags(), and qdrMemoryState().

◆ qdrMemoryFullFlag()

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

Definition at line 967 of file SiStripFEDBufferComponents.h.

967 { return getBit(2); }

References getBit().

Referenced by printFlags(), and qdrMemoryState().

◆ qdrMemoryPartialFullFlag()

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

Definition at line 969 of file SiStripFEDBufferComponents.h.

969 { return getBit(3); }

References getBit().

Referenced by printFlags(), and qdrMemoryState().

◆ qdrMemoryState()

FEDBufferState sistrip::FEDStatusRegister::qdrMemoryState ( ) const

◆ setBit()

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

Definition at line 599 of file SiStripFEDBufferComponents.cc.

599  {
600  const uint16_t mask = (0x0001 << num);
601  if (bitSet)
602  data_ |= mask;
603  else
604  data_ &= (~mask);
605  }

References data_, and EgammaValidation_cff::num.

Referenced by setL1ABXFIFOEmptyFlag(), setL1ABXFIFOFullFlag(), setL1ABXFIFOPartialFullFlag(), setQDRMemoryEmptyFlag(), setQDRMemoryFullFlag(), setQDRMemoryPartialFullFlag(), setSLinkFullFlag(), and setTrackerHeaderMonitorDataReadyFlag().

◆ setL1ABXFIFOBufferState()

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

Definition at line 626 of file SiStripFEDBufferComponents.cc.

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  }

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().

◆ setL1ABXFIFOEmptyFlag()

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

Definition at line 1005 of file SiStripFEDBufferComponents.h.

1005 { setBit(7, bitSet); }

References setBit().

Referenced by setL1ABXFIFOBufferState().

◆ setL1ABXFIFOFullFlag()

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

Definition at line 1001 of file SiStripFEDBufferComponents.h.

1001 { setBit(5, bitSet); }

References setBit().

Referenced by setL1ABXFIFOBufferState().

◆ setL1ABXFIFOPartialFullFlag()

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

Definition at line 1003 of file SiStripFEDBufferComponents.h.

1003 { setBit(6, bitSet); }

References setBit().

Referenced by setL1ABXFIFOBufferState().

◆ setQDRMemoryBufferState()

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

Definition at line 607 of file SiStripFEDBufferComponents.cc.

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  }

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().

◆ setQDRMemoryEmptyFlag()

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

Definition at line 999 of file SiStripFEDBufferComponents.h.

999 { setBit(4, bitSet); }

References setBit().

Referenced by setQDRMemoryBufferState().

◆ setQDRMemoryFullFlag()

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

Definition at line 995 of file SiStripFEDBufferComponents.h.

995 { setBit(2, bitSet); }

References setBit().

Referenced by setQDRMemoryBufferState().

◆ setQDRMemoryPartialFullFlag()

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

Definition at line 997 of file SiStripFEDBufferComponents.h.

997 { setBit(3, bitSet); }

References setBit().

Referenced by setQDRMemoryBufferState().

◆ setSLinkFullFlag()

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

Definition at line 985 of file SiStripFEDBufferComponents.h.

985  {
986  setBit(0, bitSet);
987  return *this;
988  }

References setBit().

Referenced by FEDStatusRegister().

◆ setTrackerHeaderMonitorDataReadyFlag()

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

Definition at line 990 of file SiStripFEDBufferComponents.h.

990  {
991  setBit(1, bitSet);
992  return *this;
993  }

References setBit().

Referenced by FEDStatusRegister().

◆ slinkFullFlag()

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

Definition at line 963 of file SiStripFEDBufferComponents.h.

963 { return getBit(0); }

References getBit().

Referenced by printFlags().

◆ trackerHeaderMonitorDataReadyFlag()

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

Definition at line 965 of file SiStripFEDBufferComponents.h.

965 { return getBit(1); }

References getBit().

Referenced by printFlags().

Member Data Documentation

◆ data_

uint16_t sistrip::FEDStatusRegister::data_
private

Definition at line 312 of file SiStripFEDBufferComponents.h.

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

sistrip::FEDStatusRegister::setBit
void setBit(const uint8_t num, const bool bitSet)
Definition: SiStripFEDBufferComponents.cc:599
sistrip::FEDStatusRegister::l1aBxFIFOPartialFullFlag
bool l1aBxFIFOPartialFullFlag() const
Definition: SiStripFEDBufferComponents.h:975
sistrip::FEDStatusRegister::qdrMemoryPartialFullFlag
bool qdrMemoryPartialFullFlag() const
Definition: SiStripFEDBufferComponents.h:969
sistrip::FEDStatusRegister::feDataMissingFlag
bool feDataMissingFlag(const uint8_t internalFEUnitNum) const
Definition: SiStripFEDBufferComponents.h:979
sistrip::FEDStatusRegister::setQDRMemoryEmptyFlag
void setQDRMemoryEmptyFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:999
sistrip::FEDStatusRegister::slinkFullFlag
bool slinkFullFlag() const
Definition: SiStripFEDBufferComponents.h:963
sistrip::FEDStatusRegister::setSLinkFullFlag
FEDStatusRegister & setSLinkFullFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:985
sistrip::FEDStatusRegister::setL1ABXFIFOBufferState
FEDStatusRegister & setL1ABXFIFOBufferState(const FEDBufferState state)
Definition: SiStripFEDBufferComponents.cc:626
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
sistrip::BUFFER_STATE_EMPTY
Definition: SiStripFEDBufferComponents.h:122
sistrip::FEDStatusRegister::setQDRMemoryFullFlag
void setQDRMemoryFullFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:995
sistrip::FEDStatusRegister::data_
uint16_t data_
Definition: SiStripFEDBufferComponents.h:312
sistrip::BUFFER_STATE_FULL
Definition: SiStripFEDBufferComponents.h:124
sistrip::FEUNITS_PER_FED
static const uint16_t FEUNITS_PER_FED
Definition: ConstantsForHardwareSystems.h:29
sistrip::BUFFER_STATE_PARTIAL_FULL
Definition: SiStripFEDBufferComponents.h:123
sistrip::FEDStatusRegister::setL1ABXFIFOPartialFullFlag
void setL1ABXFIFOPartialFullFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:1003
sistrip::BUFFER_STATE_UNSET
Definition: SiStripFEDBufferComponents.h:121
sistrip::FEDStatusRegister::qdrMemoryFullFlag
bool qdrMemoryFullFlag() const
Definition: SiStripFEDBufferComponents.h:967
sistrip::FEDStatusRegister::getBit
bool getBit(const uint8_t num) const
Definition: SiStripFEDBufferComponents.h:961
sistrip::printHex
void printHex(const void *pointer, const size_t length, std::ostream &os)
Definition: SiStripFEDBufferComponents.cc:26
sistrip::FEDStatusRegister::setQDRMemoryBufferState
FEDStatusRegister & setQDRMemoryBufferState(const FEDBufferState state)
Definition: SiStripFEDBufferComponents.cc:607
sistrip::FEDStatusRegister::qdrMemoryEmptyFlag
bool qdrMemoryEmptyFlag() const
Definition: SiStripFEDBufferComponents.h:971
sistrip::FEDStatusRegister::setL1ABXFIFOFullFlag
void setL1ABXFIFOFullFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:1001
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
RunInfoPI::state
state
Definition: RunInfoPayloadInspectoHelper.h:16
Exception
Definition: hltDiff.cc:245
mps_fire.result
result
Definition: mps_fire.py:311
sistrip::FEDStatusRegister::setL1ABXFIFOEmptyFlag
void setL1ABXFIFOEmptyFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:1005
sistrip::FEDStatusRegister::l1aBxFIFOFullFlag
bool l1aBxFIFOFullFlag() const
Definition: SiStripFEDBufferComponents.h:973
sistrip::FEDBufferState
FEDBufferState
Definition: SiStripFEDBufferComponents.h:120
sistrip::FEDStatusRegister::l1aBxFIFOEmptyFlag
bool l1aBxFIFOEmptyFlag() const
Definition: SiStripFEDBufferComponents.h:977
sistrip::FEDStatusRegister::setQDRMemoryPartialFullFlag
void setQDRMemoryPartialFullFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:997
sistrip::FEDStatusRegister::setTrackerHeaderMonitorDataReadyFlag
FEDStatusRegister & setTrackerHeaderMonitorDataReadyFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:990
sistrip::FEDStatusRegister::trackerHeaderMonitorDataReadyFlag
bool trackerHeaderMonitorDataReadyFlag() const
Definition: SiStripFEDBufferComponents.h:965