#include <spdRouter.h>
Public Member Functions | |
void | reset (void) |
void | writeL0L1Time (UInt32 value) |
ViStatus | setMcmStimuly (UInt8 channelInRouter, UInt32 enable, UInt32 ColumnToSet=1) |
SpdRouter (unsigned routNumber, VMEAccess *vmeDriver) | |
~SpdRouter (void) | |
ViStatus | SendTrigger (UInt32 triggerN, bool delay=true, bool l2y=true, bool l1=true, bool tp=true) |
ViStatus | WriteHeader (UInt32 data[], UInt32 size) |
ViStatus | setBusyFlag (bool busy) |
bool | getIdleFlag () |
ViStatus | setStopSM (bool stopSM) |
bool | getStopSM () |
unsigned | getRouterNumber () |
getter for the router number | |
ViStatus | dataResetHS () |
vector< RouterError > | readErrorList () |
UInt32 | readErrorMask () |
void | writeErrorMask (UInt32 mask) |
void | resetHalfStave (unsigned halfstave) |
void | writeControlReg (UInt32 regValue) |
UInt32 | readControlReg () |
void | writeHalfStaveMask (unsigned mask) |
void | resetDetector () |
void | writeLrxFastorL1Delay (unsigned lrx, UInt32 fastorDelay) |
void | configureRouter (UInt32 options, UInt32 ctlrReg, UInt32 L0L1, UInt32 lrxFoDelays[]) |
UInt32 | readRouterBusyTimes (UInt32 values[]) |
void | resetJtagcontrollers () |
void | checkJtagIdles () |
Method to check all idles in all the jtag controllers. | |
bool | isJtagIdle (int hs) |
Checks if one jtag controller is in idle. | |
Private Attributes | |
DimService * | serviceRouterError |
int | routerError |
spdLogger * | log |
unsigned int | routerNumber |
intenal member storing the router number | |
RoutIntAddr | routerAddresses |
internal member class to store the router addresses | |
VMEAccess * | vmeDriver |
vme access class, will act as the lower level driver | |
Classes | |
struct | RouterError |
simple struct to hold one router error More... |
THis is an higher level class to handle routers has clear methods to perform all router opetarions
SpdRouter::SpdRouter | ( | unsigned | routNumber, | |
VMEAccess * | vmeDriver | |||
) |
constructor of the class
routNumber,: | number of the router | |
vmeDriver,: | VMEAcess class to get the vme access |
SpdRouter::~SpdRouter | ( | void | ) |
void SpdRouter::reset | ( | void | ) |
Performs a router reset and the reset of all lrx in this router
void SpdRouter::writeL0L1Time | ( | UInt32 | value | ) |
writes the LoL1 time i nthe router
Sets the memc stimuly, will stop router state machine and write in the correct link receiver the settings
channelInRouter | : chanel in this router to enable the mcm stimuly (0-5) | |
enable,: | 1 -> enable mcm stimly, 0 -> disable it | |
column | to set (parameter to set in the mcm stimuly register see documentation of the router/lrx to be sure) |
ViStatus SpdRouter::SendTrigger | ( | UInt32 | triggerN, | |
bool | delay = true , |
|||
bool | l2y = true , |
|||
bool | l1 = true , |
|||
bool | tp = true | |||
) |
method to send triggers to one router, by default all trigger types are true
triggerN,: | number of triggers to send | |
delay,: | delay option | |
l2y,: | level 2 yes trigger option | |
l1,: | level 1 trigger | |
tp,: | test pulse trigger |
Method to write a raw data in the calibration header in one router
data,: | array of 32 bit words to write | |
size,: | number of words to write |
ViStatus SpdRouter::setBusyFlag | ( | bool | busy | ) |
method to set the busy flag reads the control register of the router and writes the same value just setting the flag
bool SpdRouter::getIdleFlag | ( | ) |
method to return if a router is idle or not reads the control register 2 and makes an and with 0x4
ViStatus SpdRouter::setStopSM | ( | bool | stopSM | ) |
Stets the stop state machine bit in the control register
bool SpdRouter::getStopSM | ( | ) |
method to get if a router has the stop machine stopped or not reads the control register 2 and makes an and with 0x400
unsigned SpdRouter::getRouterNumber | ( | ) | [inline] |
getter for the router number
ViStatus SpdRouter::dataResetHS | ( | ) |
vector< SpdRouter::RouterError > SpdRouter::readErrorList | ( | ) |
Method to read the error list from the router memory It will read the router memory and parse each error (4 32 bit registers) word0 = Errors_counting [23:12], bc_id [11:0] word1 = Errors Class [31:10] , Error Name [9:0] word2 = Detail 1[31:0] word3 = Detail 2[31:0]
UInt32 SpdRouter::readErrorMask | ( | ) |
Method to read the error mask register of one router this is address 0xf0, the format of this register bits its the following: 0 Enable / Disable Error Handling 1 Mask ' TTCRX and QPLL link error 2 Mask ' Trigger Errors from TSM 3 Mask ' Timeout BC Reset error 4 Mask ' Trigger error from Router FSM 5 Mask ' Fatal error DAQ from Router DAQ FSM 6 Mask ' Error Optical link (RxReady & RxError) 7 Mask ' Rx Error (HS optical link) 8 Mask ' Error Format (HS error format optical communication) 9 Mask ' Error Data Transfer (HS error optical data transfer not coherent) 10 Mask ' Error Control Int (command not properly recognized from the MCM) 11 Mask ' Error Event Number (Error in MCM Event Number) 12 Mask ' HS_0 Global Error (Idle, Busy violation, link RX fatal errors, etc) 13 Mask ' HS_1 Global Errors ( // ) 14 Mask ' HS_2 Global Errors ( // ) 15 Mask ' HS_3 Global Errors ( // ) 16 Mask ' HS_4 Global Errors ( // ) 17 Mask ' HS_5 Global Errors ( // ) 18 Mask ' HSs Timeout during data acquisitions 19 Mask ' Error Data Format ( from Router Data Format Check) 20 Mask ' Error FastOR in Data Stream ( Fast OR not coherent in the Data Stream) 21 .. 32 XXXX don't care
void SpdRouter::writeErrorMask | ( | UInt32 | mask | ) |
Writes the a maks value in the error mask register
void SpdRouter::resetHalfStave | ( | unsigned | halfstave | ) |
will send a router reset only to one halfstave it writes in the router control register masking all other channels, sends the router reset and then rewrites the original router control
void SpdRouter::writeControlReg | ( | UInt32 | regValue | ) |
writes the value in the control register of the router control reg information: bit 0 : DPM Sample mode bit 1 : no data to DAQ bits 2-7 : HS 0-5 mask (0 -> hs ennabled, 1 -> hs masked) bit 8: Busy flag bit 9 : enable TP in L0 bit 10: stop all state machine bit 19 : enable router header bit 20: enable orbit counter bit 21: exclude ttc
UInt32 SpdRouter::readControlReg | ( | ) |
reads the contends of the control register in ther router
void SpdRouter::writeHalfStaveMask | ( | unsigned | mask | ) |
Will write the router halfstave mask i nthw control reg
void SpdRouter::resetDetector | ( | ) |
Will all enabled hs in the router
void SpdRouter::writeLrxFastorL1Delay | ( | unsigned | lrx, | |
UInt32 | fastorDelay | |||
) |
Function to write the fastor L1 delay in one link receiver
lrx,: | link receiver number 0-2 | |
fastorDelay | - the L1 fastor delay |
void SpdRouter::configureRouter | ( | UInt32 | options, | |
UInt32 | ctlrReg, | |||
UInt32 | L0L1, | |||
UInt32 | lrxFoDelays[] | |||
) |
Function to configure a router It peforms a router and lrx resets write the control register, sets L0L1 time and the fastorL1 time for all the lrx
options | : bit0 enable router reset, bit1 configure router, bit2 L0L1 time, bit3 lrx fastor L1 time | |
ctlrReg,: | router control reg | |
L0L1 | time | |
lrxFoDelays | fastor L1 delay for al link receivers (0-2) |
Function read the router busy times it receives as input an array that is filled inside
values | array to be filled inside: 0 = busy daq, 1= busy router, 2 = busy HS, 3 = busy trigger |
void SpdRouter::resetJtagcontrollers | ( | ) |
Resets all jtag controlllers Send the command to the common jtag controllers area to reset the routers its resets the JTAG state machine, FIFOs and channel address
void SpdRouter::checkJtagIdles | ( | ) |
Method to check all idles in all the jtag controllers.
Loops to over the 6 jtag controllers and logs if they are not in idle
bool SpdRouter::isJtagIdle | ( | int | hs | ) |
Checks if one jtag controller is in idle.
Reads the idle bit in one jtag controller status register
hs | jtag controller number (0-6) |
DimService* SpdRouter::serviceRouterError [private] |
Dim service displaying if there are router errors in the memory or not
int SpdRouter::routerError [private] |
Internal member to keep the status of the router error, connected with serviceRouterError
spdLogger* SpdRouter::log [private] |
Logging instance for the spd router
unsigned int SpdRouter::routerNumber [private] |
intenal member storing the router number
RoutIntAddr SpdRouter::routerAddresses [private] |
internal member class to store the router addresses
VMEAccess* SpdRouter::vmeDriver [private] |
vme access class, will act as the lower level driver