JLab Pipeline TD Library  3v6.1
Status

Functions

int tdSlot (unsigned int i)
 Convert an index into a slot number, where the index is the element of an array of TDs in the order in which they were initialized. More...
 
unsigned int tdSlotMask ()
 Return the VME Slot mask of initialized TDs. More...
 
int tdCheckAddresses ()
 Test of register map. More...
 
void tdStatus (int id, int pflag)
 Print some status information of the TD to standard out. More...
 
int tdGetPortName (int id, int iport, char **name)
 Get the current specified port name. More...
 
int tdSavePortNames (char *filename)
 Save the current port names to a file (with file name: filename) More...
 
void tdPrintPortNames ()
 Print the current port names to standard out. More...
 
void tdGStatus (int pflag)
 Print a summary of all configured TD modules and ports to standard out. More...
 
int tdGetFirmwareVersion (int id)
 Get the Firmware Version. More...
 
int tdSetSyncSource (int id, unsigned int sync)
 Set the Sync source mask. More...
 
unsigned int tdGetSerialNumber (int id, char **rSN)
 Get the Module Serial Number. More...
 
unsigned int tdGetLiveTime (int id)
 Return the current "live" time of the module. More...
 
unsigned int tdGetBusyTime (int id)
 Return the current "busy" time of the module. More...
 
int tdSyncResetRequestStatus (int id, int pflag)
 Status of SyncReset Request received bits. More...
 
int tdGetConnectedFiberMask (int id)
 Returns the mask of fiber channels that report a "connected" status from a TI. More...
 
int tdGetTrigSrcEnabledFiberMask (int id)
 Returns the mask of fiber channels that report a "connected" status from a TI has it's trigger source enabled. More...
 
int tdGetCrateID (int id, int port)
 Get the crate ID of the selected port. More...
 
int tdGetPortTrigSrcEnabled (int id, int port)
 Get the trigger sources enabled bits of the selected port. More...
 
int tdGetSlaveBlocklevel (int id, int port)
 Get the blocklevel of the TI Slave on the selected port. More...
 
void tdSlaveStatus (int id, int pflag)
 Print a summary of all fiber port connections to potential TI Slaves. More...
 
unsigned int tdGetBlockStatus (int id, int port, int pflag)
 Obtain the status of blocks sent readout acknowledges received from the TI Slaves. More...
 
unsigned int tdGetTrigCount (int id)
 Return the number of triggers received from the trigger supervisor. More...
 
unsigned int tdGetBusyCounter (int id, int busysrc)
 Return BUSY counter for specified Busy Source. More...
 
int tdPrintBusyCounters (int id)
 Print the BUSY counters for all busy sources. More...
 

Detailed Description

Function Documentation

◆ tdCheckAddresses()

◆ tdGetBlockStatus()

unsigned int tdGetBlockStatus ( int  id,
int  port,
int  pflag 
)

Obtain the status of blocks sent readout acknowledges received from the TI Slaves.

Parameters
idSlot number
portPort number (1-8)
pflag
  • !0: Print to standard out
Returns
16 bit integer with the following:
  • bits 0-7: The number of blocks sent to the TI Slave that have not been acknowedged.
  • bits 8-15: The number of blocks that have been acknowedged, but still require a readout acknowledge.

References TD_A24RegStruct::blockStatus, TD_A24RegStruct::fiber, TD_BLOCKSTATUS_NBLOCKS_NEEDACK0, TD_BLOCKSTATUS_NBLOCKS_NEEDACK1, TD_BLOCKSTATUS_NBLOCKS_READY0, TD_BLOCKSTATUS_NBLOCKS_READY1, tdID, TDLOCK, and TDUNLOCK.

◆ tdGetBusyCounter()

unsigned int tdGetBusyCounter ( int  id,
int  busysrc 
)

Return BUSY counter for specified Busy Source.

Parameters
idSlot number
busysrc
  • 0: SWA
  • 1: SWB
  • 2: P2
  • 3: FP-FTDC
  • 4: FP-FADC
  • 5: FP
  • 6: Unused
  • 7: Loopack
  • 8-15: Fiber 1-8
Returns
  • Busy counter for specified busy source

References TD_A24RegStruct::busy_scaler1, TD_A24RegStruct::busy_scaler2, tdID, TDLOCK, and TDUNLOCK.

◆ tdGetBusyTime()

unsigned int tdGetBusyTime ( int  id)

Return the current "busy" time of the module.

Parameters
idSlot number
Returns
The current live time in units of 7.68 us

References TD_A24RegStruct::busytime, tdID, TDLOCK, and TDUNLOCK.

◆ tdGetConnectedFiberMask()

int tdGetConnectedFiberMask ( int  id)

Returns the mask of fiber channels that report a "connected" status from a TI.

Parameters
idSlot number
Returns
mask of fiber channels that report "connected"

References TD_A24RegStruct::fiber, TD_FIBER_CONNECTED_MASK, tdID, TDLOCK, and TDUNLOCK.

◆ tdGetCrateID()

int tdGetCrateID ( int  id,
int  port 
)

Get the crate ID of the selected port.

Parameters
idSlot number
port
  • 1-8: Fiber port 1-8
Returns
port Crate ID if successful, ERROR otherwise

References TD_A24RegStruct::hfbr_tiID, TD_ID_CRATEID_MASK, tdID, TDLOCK, and TDUNLOCK.

Referenced by tdSetPortNamesFromCrateID().

◆ tdGetFirmwareVersion()

int tdGetFirmwareVersion ( int  id)

Get the Firmware Version.

Parameters
idSlot number
Returns
Firmware Version if successful, ERROR otherwise

References TD_A24RegStruct::JTAGFPGABase, TD_A24RegStruct::reset, TD_RESET_JTAG, tdID, TDLOCK, and TDUNLOCK.

Referenced by tdInit().

◆ tdGetLiveTime()

unsigned int tdGetLiveTime ( int  id)

Return the current "live" time of the module.

Parameters
idSlot number
Returns
The current live time in units of 7.68 us

References TD_A24RegStruct::livetime, tdID, TDLOCK, and TDUNLOCK.

◆ tdGetPortName()

int tdGetPortName ( int  id,
int  iport,
char **  name 
)

Get the current specified port name.

Parameters
idSlot Number
iportPort Number
nameWhere to return port name
Returns
OK if successful, otherwise ERROR.

References TD_MAX_FIBER_PORTS, and tdID.

◆ tdGetPortTrigSrcEnabled()

int tdGetPortTrigSrcEnabled ( int  id,
int  port 
)

Get the trigger sources enabled bits of the selected port.

Parameters
idSlot number
port
  • 1-8: Fiber port 1-8
Returns
bitmask
  • 0 - P0
  • 1 - Fiber 1
  • 2 - Loopback
  • 3 - TRG (FP)
  • 4 - VME
  • 5 - TS Inputs (FP)
  • 6 - TS (rev 2)
  • 7 - Internal Pulser

References TD_A24RegStruct::hfbr_tiID, TD_ID_TRIGSRC_ENABLE_MASK, tdID, TDLOCK, and TDUNLOCK.

◆ tdGetSerialNumber()

unsigned int tdGetSerialNumber ( int  id,
char **  rSN 
)

Get the Module Serial Number.

Parameters
idSlot number
rSNPointer to string to pass Serial Number
Returns
SerialNumber if successful, ERROR otherwise

References TD_A24RegStruct::JTAGPROMBase, TD_A24RegStruct::reset, TD_RESET_JTAG, tdID, TDLOCK, and TDUNLOCK.

◆ tdGetSlaveBlocklevel()

int tdGetSlaveBlocklevel ( int  id,
int  port 
)

Get the blocklevel of the TI Slave on the selected port.

Parameters
idSlot number
port
  • 1-8: Fiber port 1-8
Returns
port blocklevel if successful, ERROR otherwise

References TD_A24RegStruct::hfbr_tiID, TD_ID_BLOCKLEVEL_MASK, tdID, TDLOCK, and TDUNLOCK.

◆ tdGetTrigCount()

unsigned int tdGetTrigCount ( int  id)

Return the number of triggers received from the trigger supervisor.

Parameters
idSlot number
Returns
trigger count if successful, otherwise ERROR

References tdID, TDLOCK, TDUNLOCK, and TD_A24RegStruct::trigCount.

◆ tdGetTrigSrcEnabledFiberMask()

int tdGetTrigSrcEnabledFiberMask ( int  id)

Returns the mask of fiber channels that report a "connected" status from a TI has it's trigger source enabled.

Parameters
idSlot number
Returns
mask of fiber channels that report "enabled" trigger source

References TD_A24RegStruct::fiber, TD_FIBER_TRIGSRC_ENABLED_MASK, tdID, TDLOCK, and TDUNLOCK.

◆ tdGStatus()

◆ tdPrintBusyCounters()

int tdPrintBusyCounters ( int  id)

Print the BUSY counters for all busy sources.

Parameters
idSlot number
Returns
  • OK if successful, otherwise ERROR;

References TD_A24RegStruct::busy_scaler1, TD_A24RegStruct::busy_scaler2, tdID, TDLOCK, and TDUNLOCK.

◆ tdPrintPortNames()

void tdPrintPortNames ( )

Print the current port names to standard out.

References TD_MAX_FIBER_PORTS, TD_MAX_PORTNAME_CHARS, and TD_MAX_VME_SLOTS.

◆ tdSavePortNames()

int tdSavePortNames ( char *  filename)

Save the current port names to a file (with file name: filename)

Format is the same which is expected by tdLoadPortNames(...)

Parameters
filenameName of output file
Returns
OK if successful, otherwise ERROR.

References TD_MAX_FIBER_PORTS, TD_MAX_PORTNAME_CHARS, and TD_MAX_VME_SLOTS.

◆ tdSetSyncSource()

int tdSetSyncSource ( int  id,
unsigned int  sync 
)

Set the Sync source mask.

Parameters
idSlot number
sync- MASK indicating the sync source
  • 0: P0
  • 1: HFBR1
  • 2: HFBR5
  • 3: FP
  • 4: LOOPBACK
Returns
OK if successful, ERROR otherwise

References TD_SYNC_SOURCEMASK, tdID, TDLOCK, and TDUNLOCK.

Referenced by tdInit().

◆ tdSlaveStatus()

◆ tdSlot()

int tdSlot ( unsigned int  i)

Convert an index into a slot number, where the index is the element of an array of TDs in the order in which they were initialized.

Parameters
iInteger referring to the order of which TDs were initialized
Returns
Slot number if Successfull, otherwise ERROR.

References nTD, and tdID.

Referenced by tdGSetPortNamesFromCrateID(), tdGSetTriggerLock(), and tdGStatus().

◆ tdSlotMask()

unsigned int tdSlotMask ( )

Return the VME Slot mask of initialized TDs.

Returns
Slot Mask if successful

References nTD, and tdID.

◆ tdStatus()

void tdStatus ( int  id,
int  pflag 
)

Print some status information of the TD to standard out.

Parameters
pflag
  • >0: print out raw registers
Returns
OK if successful, ERROR otherwise

References TD_A24RegStruct::adr24, TD_A24RegStruct::adr32, TD_A24RegStruct::blockBuffer, TD_A24RegStruct::blocklevel, TD_A24RegStruct::blockStatus, TD_A24RegStruct::boardID, TD_A24RegStruct::busy, TD_A24RegStruct::busytime, TD_A24RegStruct::fiber, TD_A24RegStruct::fiber_busy, TD_A24RegStruct::inputCounter, TD_A24RegStruct::intsetup, TD_A24RegStruct::livetime, TD_A24RegStruct::output, TD_A24RegStruct::sync, TD_BLOCKLEVEL_MASK, TD_BLOCKSTATUS_NBLOCKS_NEEDACK0, TD_BLOCKSTATUS_NBLOCKS_NEEDACK1, TD_BLOCKSTATUS_NBLOCKS_READY0, TD_BLOCKSTATUS_NBLOCKS_READY1, TD_BOARDID_CRATEID_MASK, TD_BUSY_HFBR1, TD_BUSY_HFBR2, TD_BUSY_HFBR3, TD_BUSY_HFBR4, TD_BUSY_HFBR5, TD_BUSY_HFBR6, TD_BUSY_HFBR7, TD_BUSY_HFBR8, TD_BUSY_LOOPBACK, TD_BUSY_MONITOR_HFBR1, TD_BUSY_MONITOR_HFBR2, TD_BUSY_MONITOR_HFBR3, TD_BUSY_MONITOR_HFBR4, TD_BUSY_MONITOR_HFBR5, TD_BUSY_MONITOR_HFBR6, TD_BUSY_MONITOR_HFBR7, TD_BUSY_MONITOR_HFBR8, TD_BUSY_MONITOR_LOOPBACK, TD_BUSY_MONITOR_P2, TD_BUSY_MONITOR_TRIG_LOST, TD_BUSY_P2, TD_BUSY_SOURCEMASK, TD_BUSY_TRIGGER_LOCK, TD_FIBER_BUSY_HFBR1, TD_FIBER_BUSY_HFBR2, TD_FIBER_BUSY_HFBR3, TD_FIBER_BUSY_HFBR4, TD_FIBER_BUSY_HFBR5, TD_FIBER_BUSY_HFBR6, TD_FIBER_BUSY_HFBR7, TD_FIBER_BUSY_HFBR8, TD_FIBER_CONNECTED_TI, TD_FIBER_MASK, TD_FIBER_TRIGSRC_ENABLED_TI, TD_SYNC_FP, TD_SYNC_HFBR1, TD_SYNC_HFBR5, TD_SYNC_LOOPBACK, TD_SYNC_P0, TD_SYNC_SOURCEMASK, TD_TRIGSRC_ENABLE, TD_TRIGSRC_FPTRG, TD_TRIGSRC_HFBR1, TD_TRIGSRC_LOOPBACK, TD_TRIGSRC_P0, TD_TRIGSRC_PULSER, TD_TRIGSRC_SOURCEMASK, TD_TRIGSRC_TSINPUTS, TD_TRIGSRC_TSREV2, TD_TRIGSRC_VME, tdA24Offset, tdID, tdLatchTimers(), TDLOCK, tdSlaveMask, TDUNLOCK, TD_A24RegStruct::trigCount, TD_A24RegStruct::trigDelay, TD_A24RegStruct::trigsrc, TD_A24RegStruct::tsInput, and TD_A24RegStruct::vmeControl.

◆ tdSyncResetRequestStatus()

int tdSyncResetRequestStatus ( int  id,
int  pflag 
)

Status of SyncReset Request received bits.

Parameters
idSlot number
pflagPrint to standard out if not 0
Returns
Port mask of SyncReset Request received (port 1 = bit 0), otherwise ERROR;

References TD_A24RegStruct::rocEnable, TD_ROCENABLE_SYNCRESET_REQUEST_MONITOR_MASK, tdID, TDLOCK, and TDUNLOCK.