NSCL DDAS  12.1-001
Support for XIA DDAS at FRIB
Classes | Enumerations | Functions
DAQ::DDAS::HardwareRegistry Namespace Reference

The HardwareRegistry namespace is where information about all known DDAS modules are stored. More...

Classes

struct  HardwareSpecification
 Generic hardware specs for hardware types. More...
 

Enumerations

enum  HardwareType {
  RevB_100MHz_12Bit =1 , RevC_100MHz_12Bit =2 , RevD_100MHz_12Bit =3 , RevF_100MHz_14Bit =4 ,
  RevF_100MHz_16Bit =5 , RevF_250MHz_12Bit =6 , RevF_250MHz_14Bit =7 , RevF_250MHz_16Bit =8 ,
  RevF_500MHz_12Bit =9 , RevF_500MHz_14Bit =10 , RevF_500MHz_16Bit =11 , Unknown =0
}
 The HardwareType enum. More...
 

Functions

void configureHardwareType (int type, const HardwareSpecification &spec)
 
HardwareSpecificationgetSpecification (int type)
 Retrieve a reference to the current hdwr specification for a hardware type. More...
 
void resetToDefaults ()
 
int computeHardwareType (int hdwrVersion, int adcFreq, int adcRes)
 Compute the hardware type from input specifications. More...
 
int createHardwareType (int hdwrVersion, int adcFreq, int adcRes, double clockCalibration)
 Create an enumerated hardware type from input specifications. More...
 

Detailed Description

The HardwareRegistry namespace is where information about all known DDAS modules are stored.

The information that the user can access in this namespace's functions is not specific to a module but rather to a hardware type. If the user wants to know basic information about the ADC resolution or frequency, this namespace will scratch that itch. However, if the user is looking for information about the serial number, this is not the place for that. In fact, there currently is no place for that.

The HardwareRegistry is fairly simple. It is just a map of HardwareRegistry::HardwareSpecifications that are keyed by HardwareRegistry::HardwareType enumerations. The HardwareRegistry provides a default state that provides the normal specifications for each hardware type in use at the NSCL. If for some crazy reason, something changes, the user can change the specifications associated with each device type.

There is also a function to determine the hardware type enumeration value given the hardware revision, ACD frequency, and ADC resolution called HardwareRegistry::computeHardwareType(). The reverse operation is called HardwareRegistry::getSpecification(HardwareType type). Together these two functions are probably the most useful tools.

Enumeration Type Documentation

◆ HardwareType

The HardwareType enum.

The HardwareType enumeration provides an identifier for each type of hardware that might be found in the system. The user can determine which hardware type they are dealing with by calling the Pixie16ReadModuleInfo() methods to access the ADC sampling frequency, the ADC resolution, and the hardware revision. Together with those three pieces of information, it is possible to determine the appropriate HardwareType.

Todo:
(ASC 3/13/24): Create a method that can query a module and compute the HardwareType.
Enumerator
RevB_100MHz_12Bit 
RevC_100MHz_12Bit 
RevD_100MHz_12Bit 
RevF_100MHz_14Bit 
RevF_100MHz_16Bit 
RevF_250MHz_12Bit 
RevF_250MHz_14Bit 
RevF_250MHz_16Bit 
RevF_500MHz_12Bit 
RevF_500MHz_14Bit 
RevF_500MHz_16Bit 
Unknown 

Function Documentation

◆ computeHardwareType()

int DAQ::DDAS::HardwareRegistry::computeHardwareType ( int  hdwrVersion,
int  adcFreq,
int  adcRes 
)

Compute the hardware type from input specifications.

Parameters
hdwrVersionHardware revision.
adcFreqADC sampling frequency.
adcResADC bit resolution (e.g. 12, 14, etc.).
Returns
An enumerated hardware type.

◆ configureHardwareType()

void DAQ::DDAS::HardwareRegistry::configureHardwareType ( int  type,
const HardwareSpecification spec 
)

◆ createHardwareType()

int DAQ::DDAS::HardwareRegistry::createHardwareType ( int  hdwrVersion,
int  adcFreq,
int  adcRes,
double  clockCalibration 
)

Create an enumerated hardware type from input specifications.

Parameters
hdwrVersionHardware revision.
adcFreqADC sampling frequency.
adcResADC bit resolution (e.g. 12, 14, etc.).
clockCalibrationFPGA clock calibration in ns/clock tick.
Returns
An enumerated hardware type.

◆ getSpecification()

DAQ::DDAS::HardwareRegistry::HardwareSpecification & DAQ::DDAS::HardwareRegistry::getSpecification ( int  type)

Retrieve a reference to the current hdwr specification for a hardware type.

Parameters
typeThe enumerated hardware type.
Exceptions
std::runtime_errorIf no specification exists for the hardware type provided.
Returns
Reference to a hardware specificiation.

◆ resetToDefaults()

void DAQ::DDAS::HardwareRegistry::resetToDefaults ( )