#include <pit_driver_opticalLink.h>
Public Member Functions | |
pit_driver_opticalLink (unsigned int p_linkNumber, pit_driver_optinBoard *p_parentOptinBoard) | |
Default constructor. | |
~pit_driver_opticalLink () | |
Destructor. | |
pit_driver_foChannel & | getFoChannel (unsigned int channelNum) |
Getter of the child pit_driver_foChannel objects. | |
unsigned int | getLinkNumber () const |
Getter of the pit_driver_opticalLink::linkNumber data member. | |
unsigned int | getBoardNumber () const |
Getter of the number of the OPTIN board where the link channel serviced by this object is located. | |
UInt28 | getBoardBaseAdress () const |
Gets the PIT memory base address of the OPTIN board that this link belongs to. | |
bool | isMotherBoardPlugged () |
Function to determine if the OPTIN board that this link belongs to is plugegd on the BRAIN board or not. | |
char | getSide () const |
Getter of the pit_driver_opticalLink::side data member. | |
unsigned int | getSector () const |
Getter of the pit_driver_opticalLink::sector data member. | |
unsigned int | getHalfStave () const |
Getter of the pit_driver_opticalLink::half_stave data member. | |
bool | isInnerLayer () const |
Function to determin if this link is receiving data from a Half Stave in the inner layer of the SPD (or in the outer one). | |
int | refresh () |
Refreshes all hardware related data members, DIM services and calls the corresponding refresh method of all children objects. | |
void | refreshCoordinates () |
Method to refresh the link coordinates. | |
void | setConfiguration () |
Method to refresh the link configuration. | |
bool | refreshLinkRequired () |
Retrieves from the configuration handler if the FastOR data of the link serviced by this object are required in the active PIT configuration. | |
bool | isLinkRequired () |
Getter of the pit_driver_opticalLink::linkRequired data member. | |
UInt32 | refreshLinkSetting () |
Reads the link setting1 register and updates the related DIM Services. | |
UInt32 | readLinkSetting () throw (exception) |
Read the link setting1 register. | |
int | writeLinkSetting (UInt32 p_linkSetting) throw (exception) |
Write the link setting1 register. | |
UInt32 | readLinkSetting2 () throw (exception) |
Read the link setting2 register. | |
int | writeLinkSetting2 (UInt32 p_linkSetting) throw (exception) |
Write the link setting2 register. | |
UInt32 | refreshLinkStatus () |
Reads the link setting1 register and updates the related DIM Services. | |
UInt32 | readLinkStatus () throw (exception) |
Read the link status register. | |
unsigned int | getFoMask () |
Getter of the pit_driver_opticalLink::foMask data member. | |
int | getUdfFoPattern () |
Getter of the pit_driver_opticalLink::udfFoPattern data member. | |
bool | readLinkLocked () throw (exception) |
Reads the link status register to determine if the link is correctly locked to the data stream coming from the MCM. | |
int | readLinkPhase () throw (exception) |
Reads the link status register to extract the phase of the data stream from the MCM with respect to the general PIT timer. | |
int | readLinkDelay () throw (exception) |
Reads the link setting1 register to read the value of the delay (BC clock units) applied to the FastOR stream of this link. | |
int | writeLinkDelay (int p_linkDelay) throw (exception) |
Writes to the link setting1 register the delay to apply to the FastOR stream of this link. | |
int | readFoMask () throw (exception) |
Reads the link setting1 register to read the value of the FastOR mask field controlling the masking of the ten FastOR channels of this link. | |
int | writeFoMask (unsigned int p_foMask) throw (exception) |
Writes the FastOR mask field of the link setting1 register controlling the masking of the ten FastOR channels of this link. | |
int | writeFoMask (std::string p_foMask) throw (exception) |
Writes the FastOR mask field of the link setting1 register controlling the masking of the ten FastOR channels of this link. | |
int | readUdfFoPattern () throw (exception) |
Reads the link setting1 register to read the value of the User Defined FastOR field controlling the setting of the internal generator of FastOR pulses of this link. | |
int | writeUdfFoPattern (int p_udfFoPattern) throw (exception) |
Writes the User Defined FastOR field of the link setting1 register controlling the internal generator of FastOR pulses of this link. | |
int | writeEnUdFastors (bool enable) |
Writes the bit enabling or disabling the internal generator of FastOR pulses of this link. | |
bool | readEnUdFastors () |
Reads the value of the bit enabling or disabling the internal generator of FastOR pulses of this link. | |
unsigned int | readSelfMaskingEnable () throw (exception) |
Reads the value of the Self Masking Enable field of the link setting2 register controlling the activation of the automatic masking of long FastOR pulses for this link. | |
unsigned int | writeSelfMaskingEnable (unsigned int p_selfMaskingEnable) throw (exception) |
Writes the value of the Self Masking Enable field of the link setting2 register controlling the activation of the automatic masking of long FastOR pulses for this link. | |
int | readTimeStamp (int p_timeStampNumber) throw (exception) |
Reads the value of the link timestamp registers. | |
int | readErrorCounter () throw (exception) |
Reads the value of the link Error Counter register. | |
bool | getCountersAutoEnable () throw (exception) |
Reads the value of the bit enabling the automatic start and stop of FastOR counters. | |
void | setCountersAutoEnable (bool autoCountersEnableFlag) throw (exception) |
Writes the bit enabling the automatic start and stop of FastOR counters. | |
void | startCounters () throw (exception) |
Command to START (reset) all ten FastOR counters of this link. | |
void | stopCounters () throw (exception) |
Command to STOP (strobe) all ten FastOR counters of this link. | |
Static Public Attributes | |
static const unsigned int | ALL_SELFMASKING_OFF = 0x000 |
A useful bit mask to ease the resetting of the ten bits of the Self Masking Enable field. | |
static const unsigned int | ALL_SELFMASKING_ON = 0x3FF |
A useful bit mask to ease the setting of the ten bits of the Self Masking Enable field. | |
Private Types | |
enum | LinkConstants { OFFSET_LINK_SETTING = 0x21, OFFSET_LINK_SETTING2 = 0x09, OFFSET_LINK_STATUS = 0x15, OFFSET_LINK_TIMESTAMP = 0x2D, OFFSET_LINK_ERROR_COUNTER = 0x54, BIT_OFFSET_LINK_DELAY = 28, BIT_NUMBER_LINK_DELAY = 4 } |
Private Member Functions | |
void | decodeLinkSetting (UInt32 linkSetting) |
Decodes the bits of the link setting register and updates the corresponding data members. | |
void | decodeLinkStatus (UInt32 linkStatus) |
Decodes the bits of the link status register and updates the corresponding data members. | |
void | refreshStatusServices () |
Refreshes the DIM services connected to the link status data members. | |
Private Attributes | |
unsigned int | linkNumber |
Numeric identifier of the link channel associated to this object. | |
pit_driver_optinBoard * | parentOptinBoard |
Parent pit_driver_optinBoard object, servicing theOPTIN board that the link channel represented by this object belongs to. | |
char | side |
Physical side of the SPD ('A' or 'C') where the Half Stave serviced by this object is located. | |
unsigned int | sector |
Number of the SPD sector [0;9] where the Half Stave serviced by this object is located. | |
unsigned int | half_stave |
Number of the SPD Half Stave [0;5] (in the specific half sector) serviced by this object. | |
pit_driver_foChannel * | foChannel [NUMBER_FO_CHANNELS] |
Instances of 10 child pit_driver_foChannel objects. | |
pit_comm * | commFEE |
Instance of pit_comm object providing the low level functions to communicate with the electronics. | |
log4cpp::Category * | logDriverOpticalLink |
Pointer to the logger object. | |
int | linkRequired |
Data member storing if the FastOR data of this optical link are required in the present PIT configuration. | |
DimService * | serviceLinkRequired |
DIM Services publishing if the FastOR data of this optical link are required (pit_driver_opticalLink::linkRequired data member). | |
int | linkError |
Data member storing if the G-Link stream of this optical link is not correctly received. | |
DimService * | serviceLinkError |
DIM Services publishing the pit_driver_opticalLink::linkRequired data member. | |
int | linkLocked |
Data member storing if the G-Link stream of the MCM connected to this link is correctly decoded. | |
DimService * | serviceLinkLocked |
DIM Services publishing the pit_driver_opticalLink::linkLocked data member. | |
int | linkPhase |
Phase of communication incoming from MCM (units: 25 ns clock periods; range: 0,3; -1 error). | |
int | linkDelay |
Delay added to the FastOR data stream incoming from MCM (number of 25 ns BC clock cycles). | |
unsigned int | foMask |
Data member storing the FastOR mask (10 bits) of the chips processed by the link corresponding to this. | |
unsigned int | udfFoPattern |
Data member storing the User Defined FastOR register (10 bits) of the link corresponding to this. | |
bool | udfEnable |
Status of the User Defined FastOR functionality enable bit. | |
bool | autoCountersEnable |
Status of the bit enabling the automatic start and stop of the link counters. | |
unsigned int | selfMaskingEnable |
Status of the 10 bits enabling the FastOR long pulses self-masking functionality. | |
Static Private Attributes | |
static const unsigned int | FOMASK_OFFSET = 0 |
Bit offset of the FastOR mask bits. | |
static const unsigned int | FOMASK_BITLENGTH = 10 |
Bit length of the FastOR mask. | |
static const unsigned int | ALL_CHIP_MASKED = 0x000003FF |
static const unsigned int | UDF_FO_PATTERN_OFFSET = 10 |
Bit offset of the UDF FO Pattern. | |
static const unsigned int | UDF_FO_PATTERN_BITLENGTH = 10 |
Bit length of the UDF FO Pattern. | |
static const unsigned int | ALL_CHIP_NOT_FORCED = 0x0000000 |
static const unsigned int | UDF_FO_ENABLE_OFFSET = 20 |
Bit offset of the UDF FO enable bit. | |
static const unsigned int | UDF_FO_ENABLE_BITLENGTH = 1 |
Bit length of the UDF FO enable bit. | |
static const unsigned int | AUTOCOUNTERS_OFFSET = 24 |
Bit offset of the auto_counters enable bit. | |
static const unsigned int | AUTOCOUNTERS_BITLENGTH = 1 |
Bit offset of the auto_counters enable bit. | |
static const unsigned int | SELFMASKING_OFFSET = 22 |
Bit offset of the self_masking_enable bits. | |
static const unsigned int | SELFMASKING_BITLENGTH = 10 |
Bit length of the UDF FO Pattern. |
This class provides the methods to access the functionalities related to the individual input channels (links) of the OPTIN boards, each one receiving and processing the G-Link stream from one SPD MCM (Half Stave). Most of core FastOR pre-processing functionalities are controlled by the functions of this class. Twelve identical link modules are implemented in each OPTIN FPGA, each one servicing one Half Stave. Twelve pit_driver_opticalLink are instantiated in the parent object of class pit_driver_optinBoard.
Definition at line 32 of file pit_driver_opticalLink.h.
enum pit_driver_opticalLink::LinkConstants [private] |
OFFSET_LINK_SETTING | |
OFFSET_LINK_SETTING2 | |
OFFSET_LINK_STATUS | |
OFFSET_LINK_TIMESTAMP | |
OFFSET_LINK_ERROR_COUNTER | |
BIT_OFFSET_LINK_DELAY | |
BIT_NUMBER_LINK_DELAY |
Definition at line 166 of file pit_driver_opticalLink.h.
pit_driver_opticalLink::pit_driver_opticalLink | ( | unsigned int | p_linkNumber, | |
pit_driver_optinBoard * | p_parentOptinBoard | |||
) |
Default constructor.
p_linkNumber | Number of the link channel represented by this object used to initialize the pit_driver_opticalLink::linkNumber data member | |
p_parentOptinBoard | Pointer to the parent pit_driver_optinBoard object to initialize the pit_driver_opticalLink::parentOptinBoard data member |
Definition at line 20 of file pit_driver_opticalLink.cpp.
References ALL_CHIP_MASKED, ALL_CHIP_NOT_FORCED, ALL_SELFMASKING_OFF, commFEE, foChannel, foMask, pit_comm::getInstance(), half_stave, pit_driver_optinBoard::IsBoardPlugged(), linkError, linkLocked, linkNumber, linkRequired, logDriverOpticalLink, NUMBER_FO_CHANNELS, parentOptinBoard, refreshCoordinates(), refreshLinkStatus(), sector, selfMaskingEnable, serviceLinkError, serviceLinkLocked, serviceLinkRequired, setConfiguration(), side, and udfFoPattern.
pit_driver_opticalLink::~pit_driver_opticalLink | ( | ) |
Destructor.
Definition at line 104 of file pit_driver_opticalLink.cpp.
References foChannel, NUMBER_FO_CHANNELS, serviceLinkError, serviceLinkLocked, and serviceLinkRequired.
void pit_driver_opticalLink::decodeLinkSetting | ( | UInt32 | linkSetting | ) | [private] |
Decodes the bits of the link setting register and updates the corresponding data members.
Definition at line 225 of file pit_driver_opticalLink.cpp.
References ALL_CHIP_MASKED, AUTOCOUNTERS_BITLENGTH, AUTOCOUNTERS_OFFSET, autoCountersEnable, BIT_NUMBER_LINK_DELAY, BIT_OFFSET_LINK_DELAY, extractFromUInt32(), foMask, FOMASK_BITLENGTH, FOMASK_OFFSET, linkDelay, linkRequired, logDriverOpticalLink, UDF_FO_ENABLE_BITLENGTH, UDF_FO_ENABLE_OFFSET, UDF_FO_PATTERN_BITLENGTH, UDF_FO_PATTERN_OFFSET, udfEnable, and udfFoPattern.
Referenced by refreshLinkSetting(), setCountersAutoEnable(), writeEnUdFastors(), and writeLinkSetting().
void pit_driver_opticalLink::decodeLinkStatus | ( | UInt32 | linkStatus | ) | [private] |
Decodes the bits of the link status register and updates the corresponding data members.
Definition at line 276 of file pit_driver_opticalLink.cpp.
References extractFromUInt32(), linkLocked, and linkPhase.
Referenced by refreshLinkStatus().
void pit_driver_opticalLink::refreshStatusServices | ( | ) | [private] |
Refreshes the DIM services connected to the link status data members.
Definition at line 291 of file pit_driver_opticalLink.cpp.
References serviceLinkLocked.
Referenced by refresh(), and refreshLinkStatus().
pit_driver_foChannel & pit_driver_opticalLink::getFoChannel | ( | unsigned int | channelNum | ) |
Getter of the child pit_driver_foChannel objects.
Definition at line 124 of file pit_driver_opticalLink.cpp.
References foChannel, getBoardNumber(), linkNumber, logDriverOpticalLink, and NUMBER_FO_CHANNELS.
Referenced by pit_driver::findNoisyChips(), pit_driver::getFoChannelFromStream(), and pit_driver::refreshLinkCountersService().
unsigned int pit_driver_opticalLink::getLinkNumber | ( | ) | const [inline] |
Getter of the pit_driver_opticalLink::linkNumber data member.
Definition at line 196 of file pit_driver_opticalLink.h.
References linkNumber.
Referenced by pit_driver_foChannel::getLinkNumber(), and pit_driver_foChannel::readCounter().
unsigned int pit_driver_opticalLink::getBoardNumber | ( | ) | const |
Getter of the number of the OPTIN board where the link channel serviced by this object is located.
Definition at line 537 of file pit_driver_opticalLink.cpp.
References pit_driver_optinBoard::getBoardNumber(), and parentOptinBoard.
Referenced by pit_driver_foChannel::getBoardNumber(), and getFoChannel().
UInt28 pit_driver_opticalLink::getBoardBaseAdress | ( | ) | const |
Gets the PIT memory base address of the OPTIN board that this link belongs to.
Definition at line 538 of file pit_driver_opticalLink.cpp.
References pit_driver_optinBoard::getBaseAddress(), and parentOptinBoard.
Referenced by pit_driver_foChannel::readCounter().
bool pit_driver_opticalLink::isMotherBoardPlugged | ( | ) |
Function to determine if the OPTIN board that this link belongs to is plugegd on the BRAIN board or not.
Definition at line 582 of file pit_driver_opticalLink.cpp.
References pit_driver_optinBoard::IsBoardPlugged(), and parentOptinBoard.
Referenced by pit_driver::dumpLinkMaskToFile(), pit_driver::refreshLinkCountersService(), pit_driver::startFoCounters(), and pit_driver::stopFoCounters().
char pit_driver_opticalLink::getSide | ( | ) | const [inline] |
Getter of the pit_driver_opticalLink::side data member.
Definition at line 212 of file pit_driver_opticalLink.h.
References side.
Referenced by pit_driver_foChannel::getSide(), pit_driver::readLinkPhases(), pit_driver::readLinkTimeStamps(), setConfiguration(), pit_driver::updateLinkDbVersion(), and writeFoMask().
unsigned int pit_driver_opticalLink::getSector | ( | ) | const [inline] |
Getter of the pit_driver_opticalLink::sector data member.
Definition at line 217 of file pit_driver_opticalLink.h.
References sector.
Referenced by pit_driver_foChannel::getSector(), pit_driver::readLinkPhases(), pit_driver::readLinkTimeStamps(), and pit_driver::updateLinkDbVersion().
unsigned int pit_driver_opticalLink::getHalfStave | ( | ) | const [inline] |
Getter of the pit_driver_opticalLink::half_stave data member.
Definition at line 222 of file pit_driver_opticalLink.h.
References half_stave.
Referenced by pit_driver_foChannel::getHalfStave(), pit_driver::readLinkPhases(), pit_driver::readLinkTimeStamps(), setConfiguration(), pit_driver::updateLinkDbVersion(), and writeFoMask().
bool pit_driver_opticalLink::isInnerLayer | ( | ) | const |
Function to determin if this link is receiving data from a Half Stave in the inner layer of the SPD (or in the outer one).
Definition at line 527 of file pit_driver_opticalLink.cpp.
References half_stave.
int pit_driver_opticalLink::refresh | ( | ) |
Refreshes all hardware related data members, DIM services and calls the corresponding refresh method of all children objects.
Definition at line 137 of file pit_driver_opticalLink.cpp.
References refreshLinkSetting(), refreshLinkStatus(), and refreshStatusServices().
Referenced by pit_driver::reloadLinkConfiguration().
void pit_driver_opticalLink::refreshCoordinates | ( | ) |
Method to refresh the link coordinates.
Queries the configuration handler to get the /a Sector, Side and Half Stave coordinates corresponding to this link
Definition at line 148 of file pit_driver_opticalLink.cpp.
References pit_driver_optinBoard::getBoardNumber(), half_stave, linkNumber, parentOptinBoard, sector, and side.
Referenced by pit_driver_opticalLink().
void pit_driver_opticalLink::setConfiguration | ( | ) |
Method to refresh the link configuration.
queries the configuration for corresponding sector side half stave
Definition at line 160 of file pit_driver_opticalLink.cpp.
References pit_driver_optinBoard::getBoardNumber(), getHalfStave(), getSide(), pit_driver_optinBoard::IsBoardPlugged(), linkDelay, linkNumber, logDriverOpticalLink, parentOptinBoard, writeFoMask(), and writeLinkDelay().
Referenced by pit_driver_opticalLink(), and pit_driver::reloadLinkConfiguration().
bool pit_driver_opticalLink::refreshLinkRequired | ( | ) |
Retrieves from the configuration handler if the FastOR data of the link serviced by this object are required in the active PIT configuration.
This method does not access hardware. It queries the configuration handler object to determine if the FastOR data of the link serviced by this object are required in the active PIT configuration. It sets data member pit_driver_opticalLink::linkRequired and refreshes the associated DIM service.
Definition at line 208 of file pit_driver_opticalLink.cpp.
References ALL_CHIP_MASKED, getFoMask(), linkRequired, and serviceLinkRequired.
bool pit_driver_opticalLink::isLinkRequired | ( | ) | [inline] |
Getter of the pit_driver_opticalLink::linkRequired data member.
Definition at line 250 of file pit_driver_opticalLink.h.
References linkRequired.
Referenced by pit_driver::findNoisyChips().
UInt32 pit_driver_opticalLink::refreshLinkSetting | ( | ) |
Reads the link setting1 register and updates the related DIM Services.
Definition at line 326 of file pit_driver_opticalLink.cpp.
References decodeLinkSetting(), and readLinkSetting().
Referenced by getCountersAutoEnable(), readEnUdFastors(), readFoMask(), readLinkDelay(), readUdfFoPattern(), and refresh().
UInt32 pit_driver_opticalLink::readLinkSetting | ( | ) | throw (exception) |
Read the link setting1 register.
This method access hardware (if possible) to read the setting1 register It sets accordingly data members: linkDelay, foMask, udfFoPattern, selfMaskingEnable on communication success; all set to 0s on communication failure (as unknown). It can be used by the other public member functions to perform the hardware access to read the link setting register
std::exception | In case communication to hardware fails |
Definition at line 312 of file pit_driver_opticalLink.cpp.
References commFEE, pit_driver_optinBoard::getBaseAddress(), linkNumber, OFFSET_LINK_SETTING, parentOptinBoard, and pit_comm::PITReadWord().
Referenced by refreshLinkSetting(), setCountersAutoEnable(), writeEnUdFastors(), writeFoMask(), writeLinkDelay(), and writeUdfFoPattern().
int pit_driver_opticalLink::writeLinkSetting | ( | UInt32 | p_linkSetting | ) | throw (exception) |
Write the link setting1 register.
This method access hardware (if possible) to write the setting1 register It sets accordingly data members: linkDelay, foMask, udfFoPattern, selfMaskingEnable on communication success; all set to 0s on communication failure (as unknown).
std::exception | In case communication to hardware fails |
Definition at line 246 of file pit_driver_opticalLink.cpp.
References commFEE, decodeLinkSetting(), pit_driver_optinBoard::getBaseAddress(), linkNumber, OFFSET_LINK_SETTING, parentOptinBoard, and pit_comm::PITWriteWord().
Referenced by setCountersAutoEnable(), writeEnUdFastors(), writeFoMask(), writeLinkDelay(), and writeUdfFoPattern().
UInt32 pit_driver_opticalLink::readLinkSetting2 | ( | ) | throw (exception) |
Read the link setting2 register.
This method access hardware (if possible) to read the setting2 register
std::exception | In case communication to hardware fails |
Definition at line 334 of file pit_driver_opticalLink.cpp.
References commFEE, pit_driver_optinBoard::getBaseAddress(), linkNumber, OFFSET_LINK_SETTING2, parentOptinBoard, and pit_comm::PITReadWord().
Referenced by readSelfMaskingEnable(), and writeSelfMaskingEnable().
int pit_driver_opticalLink::writeLinkSetting2 | ( | UInt32 | p_linkSetting | ) | throw (exception) |
Write the link setting2 register.
This method access hardware (if possible) to write the setting2 register
std::exception | In case communication to hardware fails |
Definition at line 346 of file pit_driver_opticalLink.cpp.
References commFEE, pit_driver_optinBoard::getBaseAddress(), linkNumber, OFFSET_LINK_SETTING2, parentOptinBoard, and pit_comm::PITWriteWord().
Referenced by writeSelfMaskingEnable().
UInt32 pit_driver_opticalLink::refreshLinkStatus | ( | void | ) |
Reads the link setting1 register and updates the related DIM Services.
Definition at line 301 of file pit_driver_opticalLink.cpp.
References decodeLinkStatus(), readLinkStatus(), and refreshStatusServices().
Referenced by pit_driver::executeCommand(), pit_driver_foChannel::isRateValid(), pit_driver_opticalLink(), readLinkLocked(), readLinkPhase(), refresh(), and pit_driver::refreshLinkStatus().
UInt32 pit_driver_opticalLink::readLinkStatus | ( | ) | throw (exception) |
Read the link status register.
This method reads the status register from the hardware. On communication success it sets accordingly data members pit_driver_opticalLink::linkError and pit_driver_opticalLink::linkLocked and refreshes the DIM service associated with them.
std::exception | In case communication to hardware fails |
Definition at line 267 of file pit_driver_opticalLink.cpp.
References commFEE, pit_driver_optinBoard::getBaseAddress(), linkNumber, OFFSET_LINK_STATUS, parentOptinBoard, and pit_comm::PITReadWord().
Referenced by pit_driver_foChannel::isRateValid(), and refreshLinkStatus().
unsigned int pit_driver_opticalLink::getFoMask | ( | ) | [inline] |
Getter of the pit_driver_opticalLink::foMask data member.
Definition at line 310 of file pit_driver_opticalLink.h.
References foMask.
Referenced by pit_driver_foChannel::isMasked(), refreshLinkRequired(), and pit_driver_foChannel::setMask().
int pit_driver_opticalLink::getUdfFoPattern | ( | ) | [inline] |
Getter of the pit_driver_opticalLink::udfFoPattern data member.
Definition at line 315 of file pit_driver_opticalLink.h.
References udfFoPattern.
Referenced by pit_driver_foChannel::forceHigh(), and pit_driver_foChannel::isForced().
bool pit_driver_opticalLink::readLinkLocked | ( | ) | throw (exception) |
Reads the link status register to determine if the link is correctly locked to the data stream coming from the MCM.
This method access hardware (if possible) to determine if this link is in locked state. On communication success it sets accordingly the pit_driver_opticalLink::linkLocked data member and refreshes the associated DIM service.
std::exception | In case of failure of the communication to the hardware |
Definition at line 357 of file pit_driver_opticalLink.cpp.
References linkLocked, and refreshLinkStatus().
Referenced by pit_driver::findNoisyChips(), pit_driver::readLinkPhases(), and pit_driver::readLinkTimeStamps().
int pit_driver_opticalLink::readLinkPhase | ( | ) | throw (exception) |
Reads the link status register to extract the phase of the data stream from the MCM with respect to the general PIT timer.
This method access hardware (if possible) to determine the phase of the data from this link On communication success it sets accordingly the pit_driver_opticalLink::linkPhase data member and refreshes the associated DIM service.
std::exception | In case of failure of the communication to the hardware |
Definition at line 366 of file pit_driver_opticalLink.cpp.
References linkPhase, and refreshLinkStatus().
Referenced by pit_driver::executeCommand(), and pit_driver::readLinkPhases().
int pit_driver_opticalLink::readLinkDelay | ( | ) | throw (exception) |
Reads the link setting1 register to read the value of the delay (BC clock units) applied to the FastOR stream of this link.
This method access hardware (if possible) to read the value of the delay field of the setting1 register, controlling the FastOR delay line for this link
std::exception | In case of failure of the communication to the hardware |
Definition at line 494 of file pit_driver_opticalLink.cpp.
References linkDelay, and refreshLinkSetting().
Referenced by pit_driver::applyLinkDelaysFromVector(), pit_driver::executeCommand(), and pit_driver::updateLinkDbVersion().
int pit_driver_opticalLink::writeLinkDelay | ( | int | p_linkDelay | ) | throw (exception) |
Writes to the link setting1 register the delay to apply to the FastOR stream of this link.
This method access the hardware (if possible) to set the value of the delay field of the setting1 register, controlling the FastOR delay line for this link.
p_linkDelay | New value of the delay [0;7] |
std::exception | In case of failure of the communication to the hardware |
Definition at line 482 of file pit_driver_opticalLink.cpp.
References BIT_NUMBER_LINK_DELAY, BIT_OFFSET_LINK_DELAY, insertIntoUInt32(), logDriverOpticalLink, readLinkSetting(), and writeLinkSetting().
Referenced by pit_driver::applyLinkDelaysFromVector(), pit_driver::executeCommand(), and setConfiguration().
int pit_driver_opticalLink::readFoMask | ( | ) | throw (exception) |
Reads the link setting1 register to read the value of the FastOR mask field controlling the masking of the ten FastOR channels of this link.
This method access the hardware to read the value of the chip FastOR mask field controlling the masking of the ten FastOR channels of this link. On communication success it sets accordingly the pit_driver_opticalLink::foMask data member.
std::exception | In case of failure of the communication to the hardware |
Definition at line 373 of file pit_driver_opticalLink.cpp.
References foMask, and refreshLinkSetting().
Referenced by pit_driver::dumpLinkMaskToFile(), pit_driver::executeCommand(), and pit_driver::updateLinkDbVersion().
int pit_driver_opticalLink::writeFoMask | ( | unsigned int | p_foMask | ) | throw (exception) |
Writes the FastOR mask field of the link setting1 register controlling the masking of the ten FastOR channels of this link.
This method access the hardware to set the value of the chip FastOR mask field, controlling the masking of the ten FastOR channels of this link.
p_foMask | Value to write to the FastOR mask field, 10 less significant bits corresponding to ten chips |
std::exception | In case of failure of the communication to the hardware |
Definition at line 397 of file pit_driver_opticalLink.cpp.
References ALL_CHIP_MASKED, getHalfStave(), getSide(), insertIntoUInt32(), linkRequired, logDriverOpticalLink, readLinkSetting(), serviceLinkRequired, and writeLinkSetting().
Referenced by pit_driver::executeCommand(), setConfiguration(), pit_driver_foChannel::setMask(), and writeFoMask().
int pit_driver_opticalLink::writeFoMask | ( | std::string | p_foMask | ) | throw (exception) |
Writes the FastOR mask field of the link setting1 register controlling the masking of the ten FastOR channels of this link.
This method access the hardware to set the value of the chip FastOR mask field, controlling the masking of the ten FastOR channels of this link.
p_foMask | A string of ten bit literals '0' and '1' that is translated into the ten bit mask. Leftmost literal is for chip number 0 |
std::exception | In case of failure of the communication to the hardware |
Definition at line 426 of file pit_driver_opticalLink.cpp.
References foChannel, FOMASK_BITLENGTH, insertIntoUInt32(), NUMBER_FO_CHANNELS, and writeFoMask().
int pit_driver_opticalLink::readUdfFoPattern | ( | ) | throw (exception) |
Reads the link setting1 register to read the value of the User Defined FastOR field controlling the setting of the internal generator of FastOR pulses of this link.
This method access the hardware to read the value of the User Defined FastOR field controlling the setting of the internal generator of FastOR pulses of this link. On communication success, it sets accordingly the pit_driver_opticalLink::udfFoPattern data member.
std::exception | In case of failure of the communication to the hardware |
Definition at line 387 of file pit_driver_opticalLink.cpp.
References refreshLinkSetting(), and udfFoPattern.
int pit_driver_opticalLink::writeUdfFoPattern | ( | int | p_udfFoPattern | ) | throw (exception) |
Writes the User Defined FastOR field of the link setting1 register controlling the internal generator of FastOR pulses of this link.
This method access the hardware to set the value of the User Defined FastOR field controlling the setting of the internal generator of FastOR pulses of this link.
p_udfFoPattern | Value to write to the FastOR mask field, 10 less significant bits corresponding to ten chips |
std::exception | In case of failure of the communication to the hardware |
Definition at line 461 of file pit_driver_opticalLink.cpp.
References insertIntoUInt32(), readLinkSetting(), UDF_FO_PATTERN_BITLENGTH, UDF_FO_PATTERN_OFFSET, and writeLinkSetting().
Referenced by pit_driver_foChannel::forceHigh(), and pit_driver::pitFastOrTransmissionTest().
int pit_driver_opticalLink::writeEnUdFastors | ( | bool | enable | ) |
Writes the bit enabling or disabling the internal generator of FastOR pulses of this link.
enable | New value of the bit enabling or disabling the nternal generator of FastOR pulses |
Definition at line 540 of file pit_driver_opticalLink.cpp.
References decodeLinkSetting(), insertIntoUInt32(), readLinkSetting(), UDF_FO_ENABLE_BITLENGTH, UDF_FO_ENABLE_OFFSET, and writeLinkSetting().
Referenced by pit_driver::executeCommand(), and pit_driver::pitFastOrTransmissionTest().
bool pit_driver_opticalLink::readEnUdFastors | ( | ) |
Reads the value of the bit enabling or disabling the internal generator of FastOR pulses of this link.
Definition at line 549 of file pit_driver_opticalLink.cpp.
References refreshLinkSetting(), and udfEnable.
Referenced by pit_driver::executeCommand().
unsigned int pit_driver_opticalLink::readSelfMaskingEnable | ( | ) | throw (exception) |
Reads the value of the Self Masking Enable field of the link setting2 register controlling the activation of the automatic masking of long FastOR pulses for this link.
This method access the hardware to read the value of the Self Masking Enable field of the link setting2 register, controlling the activation of the automatic masking of long FastOR pulses for this link.
std::exception | In case of failure of the communication to the hardware |
Definition at line 379 of file pit_driver_opticalLink.cpp.
References extractFromUInt32(), readLinkSetting2(), SELFMASKING_OFFSET, and selfMaskingEnable.
Referenced by pit_driver::executeCommand().
unsigned int pit_driver_opticalLink::writeSelfMaskingEnable | ( | unsigned int | p_selfMaskingEnable | ) | throw (exception) |
Writes the value of the Self Masking Enable field of the link setting2 register controlling the activation of the automatic masking of long FastOR pulses for this link.
This method access the hardware to set the Self Masking Enable field of the link setting2 register, controlling the activation of the automatic masking of long FastOR pulses for this link.
p_selfMaskingEnable | New value of the Self Masking Enable field of the link setting2 register |
std::exception | In case of failure of the communication to the hardware |
Definition at line 470 of file pit_driver_opticalLink.cpp.
References ALL_SELFMASKING_ON, insertIntoUInt32(), readLinkSetting2(), SELFMASKING_BITLENGTH, SELFMASKING_OFFSET, and writeLinkSetting2().
Referenced by pit_driver::executeCommand().
int pit_driver_opticalLink::readTimeStamp | ( | int | p_timeStampNumber | ) | throw (exception) |
Reads the value of the link timestamp registers.
This method reads one of the three timestamp registers associated to this link. It corresponds to a dedicated DIM Command
p_timeStampNumber | Index selecting the timestamp register [0,2] |
std::exception | in case communication to hardware fails |
Definition at line 501 of file pit_driver_opticalLink.cpp.
References commFEE, pit_driver_optinBoard::getBaseAddress(), linkNumber, OFFSET_LINK_TIMESTAMP, parentOptinBoard, and pit_comm::PITReadWord().
Referenced by pit_driver::executeCommand(), and pit_driver::readLinkTimeStamps().
int pit_driver_opticalLink::readErrorCounter | ( | ) | throw (exception) |
Reads the value of the link Error Counter register.
This method reads the Error Counter register counting the loss of communication events of this link
std::exception | in case communication to hardware fails |
Definition at line 518 of file pit_driver_opticalLink.cpp.
References commFEE, pit_driver_optinBoard::getBaseAddress(), linkNumber, OFFSET_LINK_ERROR_COUNTER, parentOptinBoard, and pit_comm::PITReadWord().
Referenced by pit_driver::executeCommand().
bool pit_driver_opticalLink::getCountersAutoEnable | ( | ) | throw (exception) |
Reads the value of the bit enabling the automatic start and stop of FastOR counters.
This method access hardware (if possible) to read the bit enabling the automatic start and stop of the counters of this link. It corresponds to a dedicated DIMCommand.
std::exception | In case communication to hardware fails |
Definition at line 566 of file pit_driver_opticalLink.cpp.
References autoCountersEnable, and refreshLinkSetting().
Referenced by pit_driver::executeCommand().
void pit_driver_opticalLink::setCountersAutoEnable | ( | bool | autoCountersEnableFlag | ) | throw (exception) |
Writes the bit enabling the automatic start and stop of FastOR counters.
This method access hardware (if possible) to write the bit enabling the automatic start and stop of the counters of this link. It corresponds to a dedicated DIMCommand.
autoCountersEnableFlag | New setting |
std::exception | In case communication to hardware fails |
Definition at line 573 of file pit_driver_opticalLink.cpp.
References AUTOCOUNTERS_OFFSET, decodeLinkSetting(), insertIntoUInt32(), readLinkSetting(), and writeLinkSetting().
Referenced by pit_driver::executeCommand().
void pit_driver_opticalLink::startCounters | ( | ) | throw (exception) |
Command to START (reset) all ten FastOR counters of this link.
This method access hardware (if possible) to issue the command to START (RESET) the 10 FastOR counters of this link. It corresponds to a dedicated DIMCommand.
std::exception | In case communication to hardware fails |
Definition at line 556 of file pit_driver_opticalLink.cpp.
References pit_driver_optinBoard::COUNTERS_START_LINK00, linkNumber, parentOptinBoard, and pit_driver_optinBoard::writeOptinCommand().
Referenced by pit_driver::executeCommand(), and pit_driver::startFoCounters().
void pit_driver_opticalLink::stopCounters | ( | ) | throw (exception) |
Command to STOP (strobe) all ten FastOR counters of this link.
This method access hardware (if possible) to issue the command to STOP (strobe) the 10 FastOR counters of this link. It corresponds to a dedicated DIMCommand.
std::exception | In case communication to hardware fails |
Definition at line 561 of file pit_driver_opticalLink.cpp.
References pit_driver_optinBoard::COUNTERS_STOP_LINK00, linkNumber, parentOptinBoard, and pit_driver_optinBoard::writeOptinCommand().
Referenced by pit_driver::executeCommand(), and pit_driver::stopFoCounters().
unsigned int pit_driver_opticalLink::linkNumber [private] |
Numeric identifier of the link channel associated to this object.
The twelve links on each OPTIN board are numbered from 0 to 11. This data member is the number identifying the one represented by this object
Definition at line 39 of file pit_driver_opticalLink.h.
Referenced by getFoChannel(), getLinkNumber(), pit_driver_opticalLink(), readErrorCounter(), readLinkSetting(), readLinkSetting2(), readLinkStatus(), readTimeStamp(), refreshCoordinates(), setConfiguration(), startCounters(), stopCounters(), writeLinkSetting(), and writeLinkSetting2().
Parent pit_driver_optinBoard object, servicing theOPTIN board that the link channel represented by this object belongs to.
Tweleve link modules are implemented on each OPTIN board. Correspondingly each pit_driver_opticalLink object is a child of one pit_driver_optinBoard object. This data member is the pointer to the parent pit_driver_optinBoard object servicing the OPTIN board that this link belongs to. This is used to access the hadware access functionalities provided by the parent object.
Definition at line 46 of file pit_driver_opticalLink.h.
Referenced by getBoardBaseAdress(), getBoardNumber(), isMotherBoardPlugged(), pit_driver_opticalLink(), readErrorCounter(), readLinkSetting(), readLinkSetting2(), readLinkStatus(), readTimeStamp(), refreshCoordinates(), setConfiguration(), startCounters(), stopCounters(), writeLinkSetting(), and writeLinkSetting2().
char pit_driver_opticalLink::side [private] |
Physical side of the SPD ('A' or 'C') where the Half Stave serviced by this object is located.
Definition at line 49 of file pit_driver_opticalLink.h.
Referenced by getSide(), pit_driver_opticalLink(), and refreshCoordinates().
unsigned int pit_driver_opticalLink::sector [private] |
Number of the SPD sector [0;9] where the Half Stave serviced by this object is located.
Definition at line 52 of file pit_driver_opticalLink.h.
Referenced by getSector(), pit_driver_opticalLink(), and refreshCoordinates().
unsigned int pit_driver_opticalLink::half_stave [private] |
Number of the SPD Half Stave [0;5] (in the specific half sector) serviced by this object.
Definition at line 55 of file pit_driver_opticalLink.h.
Referenced by getHalfStave(), isInnerLayer(), pit_driver_opticalLink(), and refreshCoordinates().
pit_driver_foChannel* pit_driver_opticalLink::foChannel[NUMBER_FO_CHANNELS] [private] |
Instances of 10 child pit_driver_foChannel objects.
The pointers of this array access to 10 pit_driver_foChannel objects representing the FastOR channels processed by the link serviced by this pit_driver_opticalLink object. Each Half Stave contains ten chips (FastOR channels in the PIT) and correspondingly each pit_driver_opticalLink object servicing that Half Stave has ten pit_driver_foChannel child objects corresponding to the ten chips on the Half Stave
Definition at line 63 of file pit_driver_opticalLink.h.
Referenced by getFoChannel(), pit_driver_opticalLink(), writeFoMask(), and ~pit_driver_opticalLink().
pit_comm* pit_driver_opticalLink::commFEE [private] |
Instance of pit_comm object providing the low level functions to communicate with the electronics.
This object provides the interface to communicate to the electronics using the dedicated DDL link.
Definition at line 68 of file pit_driver_opticalLink.h.
Referenced by pit_driver_opticalLink(), readErrorCounter(), readLinkSetting(), readLinkSetting2(), readLinkStatus(), readTimeStamp(), writeLinkSetting(), and writeLinkSetting2().
log4cpp::Category* pit_driver_opticalLink::logDriverOpticalLink [private] |
Pointer to the logger object.
Definition at line 71 of file pit_driver_opticalLink.h.
Referenced by decodeLinkSetting(), getFoChannel(), pit_driver_opticalLink(), setConfiguration(), writeFoMask(), and writeLinkDelay().
int pit_driver_opticalLink::linkRequired [private] |
Data member storing if the FastOR data of this optical link are required in the present PIT configuration.
Definition at line 80 of file pit_driver_opticalLink.h.
Referenced by decodeLinkSetting(), isLinkRequired(), pit_driver_opticalLink(), refreshLinkRequired(), and writeFoMask().
DimService* pit_driver_opticalLink::serviceLinkRequired [private] |
DIM Services publishing if the FastOR data of this optical link are required (pit_driver_opticalLink::linkRequired data member).
Definition at line 83 of file pit_driver_opticalLink.h.
Referenced by pit_driver_opticalLink(), refreshLinkRequired(), writeFoMask(), and ~pit_driver_opticalLink().
int pit_driver_opticalLink::linkError [private] |
Data member storing if the G-Link stream of this optical link is not correctly received.
Definition at line 86 of file pit_driver_opticalLink.h.
Referenced by pit_driver_opticalLink().
DimService* pit_driver_opticalLink::serviceLinkError [private] |
DIM Services publishing the pit_driver_opticalLink::linkRequired data member.
Definition at line 89 of file pit_driver_opticalLink.h.
Referenced by pit_driver_opticalLink(), and ~pit_driver_opticalLink().
int pit_driver_opticalLink::linkLocked [private] |
Data member storing if the G-Link stream of the MCM connected to this link is correctly decoded.
Definition at line 92 of file pit_driver_opticalLink.h.
Referenced by decodeLinkStatus(), pit_driver_opticalLink(), and readLinkLocked().
DimService* pit_driver_opticalLink::serviceLinkLocked [private] |
DIM Services publishing the pit_driver_opticalLink::linkLocked data member.
Definition at line 95 of file pit_driver_opticalLink.h.
Referenced by pit_driver_opticalLink(), refreshStatusServices(), and ~pit_driver_opticalLink().
int pit_driver_opticalLink::linkPhase [private] |
Phase of communication incoming from MCM (units: 25 ns clock periods; range: 0,3; -1 error).
This is the delay (nnumber of 25 ns clock perdiods) between the pit internal master timing clock and the received MCM communication stream, starting with transmission slot 0. It is measured in the pit. 0 means slot 0 arrives simultaneously to master clock pulse; 1, 2, 3 means that slot 0 is 1, 2 or 3 preiods after master clock pulse. NO DIM service is associated with this Data member storing the phase of the communication stream incoming from MCM
This is the delay (in number of 25 ns BC clock cycles and modulo 4) between the PIT internal master timing clock and the transmission slot 0 of the decoded MCM communication stream. This value is measured in the PIT electronics. 0 means slot 0 arrives simultaneously to the PIT timer strobe pulse. NO DIM Service is associated with this
Definition at line 110 of file pit_driver_opticalLink.h.
Referenced by decodeLinkStatus(), and readLinkPhase().
int pit_driver_opticalLink::linkDelay [private] |
Delay added to the FastOR data stream incoming from MCM (number of 25 ns BC clock cycles).
NO DIM service is associated with this
Definition at line 114 of file pit_driver_opticalLink.h.
Referenced by decodeLinkSetting(), readLinkDelay(), and setConfiguration().
unsigned int pit_driver_opticalLink::foMask [private] |
Data member storing the FastOR mask (10 bits) of the chips processed by the link corresponding to this.
NO DIM service is associated with this.
Definition at line 118 of file pit_driver_opticalLink.h.
Referenced by decodeLinkSetting(), getFoMask(), pit_driver_opticalLink(), and readFoMask().
const unsigned int pit_driver_opticalLink::FOMASK_OFFSET = 0 [static, private] |
Bit offset of the FastOR mask bits.
Definition at line 119 of file pit_driver_opticalLink.h.
Referenced by decodeLinkSetting().
const unsigned int pit_driver_opticalLink::FOMASK_BITLENGTH = 10 [static, private] |
Bit length of the FastOR mask.
Definition at line 120 of file pit_driver_opticalLink.h.
Referenced by decodeLinkSetting(), and writeFoMask().
const unsigned int pit_driver_opticalLink::ALL_CHIP_MASKED = 0x000003FF [static, private] |
Definition at line 121 of file pit_driver_opticalLink.h.
Referenced by decodeLinkSetting(), pit_driver_opticalLink(), refreshLinkRequired(), and writeFoMask().
unsigned int pit_driver_opticalLink::udfFoPattern [private] |
Data member storing the User Defined FastOR register (10 bits) of the link corresponding to this.
NO DIM service is associated with this.
Definition at line 125 of file pit_driver_opticalLink.h.
Referenced by decodeLinkSetting(), getUdfFoPattern(), pit_driver_opticalLink(), and readUdfFoPattern().
const unsigned int pit_driver_opticalLink::UDF_FO_PATTERN_OFFSET = 10 [static, private] |
Bit offset of the UDF FO Pattern.
Definition at line 126 of file pit_driver_opticalLink.h.
Referenced by decodeLinkSetting(), and writeUdfFoPattern().
const unsigned int pit_driver_opticalLink::UDF_FO_PATTERN_BITLENGTH = 10 [static, private] |
Bit length of the UDF FO Pattern.
Definition at line 127 of file pit_driver_opticalLink.h.
Referenced by decodeLinkSetting(), and writeUdfFoPattern().
const unsigned int pit_driver_opticalLink::ALL_CHIP_NOT_FORCED = 0x0000000 [static, private] |
bool pit_driver_opticalLink::udfEnable [private] |
Status of the User Defined FastOR functionality enable bit.
Definition at line 135 of file pit_driver_opticalLink.h.
Referenced by decodeLinkSetting(), and readEnUdFastors().
const unsigned int pit_driver_opticalLink::UDF_FO_ENABLE_OFFSET = 20 [static, private] |
Bit offset of the UDF FO enable bit.
Definition at line 136 of file pit_driver_opticalLink.h.
Referenced by decodeLinkSetting(), and writeEnUdFastors().
const unsigned int pit_driver_opticalLink::UDF_FO_ENABLE_BITLENGTH = 1 [static, private] |
Bit length of the UDF FO enable bit.
Definition at line 137 of file pit_driver_opticalLink.h.
Referenced by decodeLinkSetting(), and writeEnUdFastors().
bool pit_driver_opticalLink::autoCountersEnable [private] |
Status of the bit enabling the automatic start and stop of the link counters.
Definition at line 141 of file pit_driver_opticalLink.h.
Referenced by decodeLinkSetting(), and getCountersAutoEnable().
const unsigned int pit_driver_opticalLink::AUTOCOUNTERS_OFFSET = 24 [static, private] |
Bit offset of the auto_counters enable bit.
Definition at line 142 of file pit_driver_opticalLink.h.
Referenced by decodeLinkSetting(), and setCountersAutoEnable().
const unsigned int pit_driver_opticalLink::AUTOCOUNTERS_BITLENGTH = 1 [static, private] |
Bit offset of the auto_counters enable bit.
Definition at line 143 of file pit_driver_opticalLink.h.
Referenced by decodeLinkSetting().
unsigned int pit_driver_opticalLink::selfMaskingEnable [private] |
Status of the 10 bits enabling the FastOR long pulses self-masking functionality.
Definition at line 147 of file pit_driver_opticalLink.h.
Referenced by pit_driver_opticalLink(), and readSelfMaskingEnable().
const unsigned int pit_driver_opticalLink::SELFMASKING_OFFSET = 22 [static, private] |
Bit offset of the self_masking_enable bits.
Definition at line 148 of file pit_driver_opticalLink.h.
Referenced by readSelfMaskingEnable(), and writeSelfMaskingEnable().
const unsigned int pit_driver_opticalLink::SELFMASKING_BITLENGTH = 10 [static, private] |
Bit length of the UDF FO Pattern.
Definition at line 149 of file pit_driver_opticalLink.h.
Referenced by writeSelfMaskingEnable().
const unsigned int pit_driver_opticalLink::ALL_SELFMASKING_OFF = 0x000 [static] |
A useful bit mask to ease the resetting of the ten bits of the Self Masking Enable field.
Definition at line 425 of file pit_driver_opticalLink.h.
Referenced by pit_driver::executeCommand(), and pit_driver_opticalLink().
const unsigned int pit_driver_opticalLink::ALL_SELFMASKING_ON = 0x3FF [static] |
A useful bit mask to ease the setting of the ten bits of the Self Masking Enable field.
Definition at line 426 of file pit_driver_opticalLink.h.
Referenced by pit_driver::executeCommand(), and writeSelfMaskingEnable().