lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
Pds::Xpm::Module Class Reference

Register map of an XPM, laid out so that member addresses equal register offsets (see locate()), with functions that select a partition, link or AMC through the _index register and read or write fields of the selected registers. More...

#include <Module.hh>

Public Types

enum  { NAmcs =2 }
 Number of AMCs. More...
 
enum  { NDSLinks =14 }
 Number of downstream links. More...
 
enum  { NPartitions =8 }
 Number of partitions. More...
 

Public Member Functions

 Module ()
 Does nothing (the call to init() is commented out).
 
void init ()
 Set the feature revision from the build stamp, print the index register and the configuration and status of every link, route the crossbar outputs BP, RTM0 and RTM1 to FPGA and initialize HsRepeaters 0, 1, 3 and 4.
 
CoreCounts counts () const
 Return the counters of the us and cu timing receivers.
 
bool l0Enabled () const
 Return bit 16 (enable) of the _l0Control register of the selected partition.
 
L0Stats l0Stats (bool) const
 Freeze the counter updates, sample the L0 statistics of the selected partition (the totals and per-link event inhibit counts only when the argument is true, the per-link inhibit time counts always) and the link 0 error count, then unfreeze.
 
unsigned txLinkStat () const
 Return a bit mask of the links (0 to NDSLinks-1) whose transmit-ready bit is set.
 
unsigned rxLinkStat () const
 Return a bit mask of the links (0 to NDSLinks-1) whose receive-ready bit is set.
 
void clearLinks ()
 Clear the enable bit (31) of the configuration of links 0 to NDSLinks-1.
 
LinkStatus linkStatus (unsigned) const
 Select the link and return its status (see LinkStatus).
 
void linkStatus (LinkStatus *) const
 Fill the array with the status of links 0 to 31.
 
unsigned rxLinkErrs (unsigned) const
 Select the link and return its receive error count (status bits 15-0).
 
void resetL0 (bool)
 Set (true) or clear the reset bit (0) of _l0Control of the selected partition.
 
void resetL0 ()
 Pulse the reset bit of _l0Control: set it, wait 1 us, clear it.
 
bool l0Reset () const
 Return the reset bit (0) of _l0Control.
 
void master (bool)
 Set or clear the master bit (30) of _l0Control.
 
bool master () const
 Return the master bit (30) of _l0Control.
 
void setL0Enabled (bool)
 Set or clear the enable bit (16) of _l0Control.
 
bool getL0Enabled () const
 Return the enable bit (16) of _l0Control.
 
void setL0Select_FixedRate (unsigned rate)
 Set the rate selection of _l0Select to fixed-rate mode with marker rate (low 4 bits), keeping the destination selection.
 
void setL0Select_ACRate (unsigned rate, unsigned tsmask)
 Set the rate selection of _l0Select to AC-rate mode with timeslot mask tsmask (6 bits) and marker rate (3 bits), keeping the destination selection.
 
void setL0Select_Sequence (unsigned seq, unsigned bit)
 Set the rate selection of _l0Select to sequence mode with sequencer seq (6 bits) and bit (4 bits), keeping the destination selection.
 
void setL0Select_Destn (unsigned mode, unsigned mask)
 Set the destination selection (upper half) of _l0Select to mode in bit 15 and the low 4 bits of mask, keeping the rate selection.
 
void lockL0Stats (bool)
 Freeze (true) or resume the counter updates by clearing or setting bit 31 of _l0Control.
 
void groupL0Reset (unsigned)
 Select the partition of the lowest set bit of the mask, then write the mask to _groupL0Reset.
 
void groupL0Enable (unsigned)
 Select the partition of the lowest set bit of the mask, then write the mask to _groupL0Enable.
 
void groupL0Disable (unsigned)
 Select the partition of the lowest set bit of the mask, then write the mask to _groupL0Disable.
 
void groupMsgInsert (unsigned)
 Select the partition of the lowest set bit of the mask, then write the mask to _groupMsgInsert.
 
void setRingBChan (unsigned)
 Set the ring buffer link field (bits 13-10) of _index.
 
void dumpPll (unsigned) const
 Select the AMC and print its PLL configuration register and AmcPLL::dump().
 
void dumpTiming (unsigned) const
 Print that it is deprecated; does nothing else.
 
void setVerbose (unsigned)
 Set the file-static verbosity used by setL0Enabled() and l0Stats().
 
void setTimeStamp ()
 Write the current time to _timestamp: seconds since a reference from mktime() in the upper 32 bits and nanoseconds in the lower 32 bits.
 
void setCuInput (unsigned)
 With feature revision 1 or more, route the crossbar outputs FPGA, RTM0 and RTM1 to input v (and print it); otherwise does nothing.
 
void setCuDelay (unsigned)
 With feature revision 1 or more, write v to _cuDelay.
 
void setCuBeamCode (unsigned)
 With feature revision 1 or more, write v to _cuBeamCode.
 
void clearCuFiducialErr (unsigned)
 With feature revision 1 or more and v non-zero, write v to _cuFiducialIntv.
 
void pllBwSel (unsigned, int)
 Select AMC idx and call AmcPLL::BwSel(val).
 
void pllFrqTbl (unsigned, int)
 Select AMC idx and call AmcPLL::FrqTbl(val).
 
void pllFrqSel (unsigned, int)
 Select AMC idx and call AmcPLL::FrqSel(val).
 
void pllRateSel (unsigned, int)
 Select AMC idx and call AmcPLL::RateSel(val).
 
void pllPhsInc (unsigned)
 Select AMC idx and call AmcPLL::PhsInc().
 
void pllPhsDec (unsigned)
 Select AMC idx and call AmcPLL::PhsDec().
 
void pllBypass (unsigned, bool)
 Select AMC idx and call AmcPLL::Bypass(v).
 
void pllReset (unsigned)
 Select AMC idx and call AmcPLL::Reset().
 
int pllBwSel (unsigned) const
 Select AMC idx and return AmcPLL::BwSel().
 
int pllFrqTbl (unsigned) const
 Select AMC idx and return AmcPLL::FrqTbl().
 
int pllFrqSel (unsigned) const
 Select AMC idx and return AmcPLL::FrqSel().
 
int pllRateSel (unsigned) const
 Select AMC idx and return AmcPLL::RateSel().
 
bool pllBypass (unsigned) const
 Select AMC idx and return AmcPLL::Bypass().
 
int pllStatus0 (unsigned) const
 Select AMC idx and return AmcPLL::Status0().
 
int pllCount0 (unsigned) const
 Select AMC idx and return AmcPLL::Count0().
 
int pllStatus1 (unsigned) const
 Select AMC idx and return AmcPLL::Status1().
 
int pllCount1 (unsigned) const
 Select AMC idx and return AmcPLL::Count1().
 
void pllSkew (unsigned, int)
 Select AMC idx and call AmcPLL::Skew(val).
 
PllStats pllStat (unsigned) const
 Select AMC idx and return its PLL status (Status0, Status1, Count0, Count1).
 
void setPartition (unsigned) const
 Set the partition field (bits 3-0) of _index; const although it writes the register.
 
void setLink (unsigned) const
 Set the link field (bits 9-4) of _index; const although it writes the register.
 
void setAmc (unsigned) const
 Set the AMC bit (16) of _index; const although it writes the register.
 
void setInhibit (unsigned)
 Set the inhibit field (bits 21-20) of _index.
 
void setTagStream (unsigned)
 Set the tag stream bit (24) of _index.
 
unsigned getPartition () const
 Return the partition field (bits 3-0) of _index.
 
unsigned getLink () const
 Return the link field (bits 9-4) of _index.
 
unsigned getAmc () const
 Return the AMC bit (16) of _index.
 
unsigned getInhibit () const
 Return the inhibit field (bits 21-20) of _index.
 
unsigned getTagStream () const
 Return the tag stream bit (24) of _index.
 
void linkRxTimeOut (unsigned, unsigned)
 Select the link and set its receive timeout field (bits 17-9 of _dsLinkConfig).
 
unsigned linkRxTimeOut (unsigned) const
 Select the link and return its receive timeout field (bits 17-9).
 
void linkGroupMask (unsigned, unsigned)
 Select the link and set its group mask (bits 7-0 of _dsLinkConfig).
 
unsigned linkGroupMask (unsigned) const
 Select the link and return its group mask (bits 7-0).
 
void linkTrgSrc (unsigned, unsigned)
 Select the link and set its trigger source field (bits 27-24 of _dsLinkConfig).
 
unsigned linkTrgSrc (unsigned) const
 Select the link and return its trigger source field (bits 27-24).
 
void linkLoopback (unsigned, bool)
 Select the link and set or clear its loopback bit (28 of _dsLinkConfig).
 
bool linkLoopback (unsigned) const
 Select the link and return its loopback bit (28).
 
void txLinkReset (unsigned)
 Select the link and pulse its transmit reset bit (29 of _dsLinkConfig) for 10 us.
 
void rxLinkReset (unsigned)
 Select the link and pulse its receive reset bit (30 of _dsLinkConfig) for 10 us.
 
void txLinkPllReset (unsigned)
 Select the link and pulse its transmit PLL reset bit (18 of _dsLinkConfig) for 10 us.
 
void rxLinkPllReset (unsigned)
 Select the link and pulse its receive PLL reset bit (19 of _dsLinkConfig) for 10 us.
 
void rxLinkDump (unsigned) const
 Point the receive ring buffer at the link, clear it, capture for 100 us and print the captured words masked to 20 bits (Cphw::RingBuffer::dump(20)).
 
void linkEnable (unsigned, bool)
 Select the link and set or clear its enable bit (31 of _dsLinkConfig).
 
bool linkEnable (unsigned) const
 Select the link and return its enable bit (31).
 
bool linkRxReady (unsigned) const
 Select the link and return its receive-ready status bit (19 of _dsLinkStatus).
 
bool linkTxReady (unsigned) const
 Select the link and return its transmit-ready status bit (17).
 
bool linkIsXpm (unsigned) const
 Select the link and return its remote-is-XPM status bit (20).
 
bool linkRxErr (unsigned) const
 Select the link and return true if its receive error count (status bits 15-0) is non-zero.
 
void setL0Delay (unsigned)
 Write the delay v to the upper 16 bits of _pipelineDepth and the low 16 bits of v*200 to its lower half.
 
unsigned getL0Delay () const
 Return the upper 16 bits of _pipelineDepth.
 
void setL1TrgClr (unsigned)
 Set bit 0 of _l1config0 to v.
 
unsigned getL1TrgClr () const
 Return bit 0 of _l1config0.
 
void setL1TrgEnb (unsigned)
 Set bit 16 of _l1config0 to v.
 
unsigned getL1TrgEnb () const
 Return bit 16 of _l1config0.
 
void setL1TrgSrc (unsigned)
 Set bits 3-0 of _l1config1 (L1 trigger source link, per the header comment).
 
unsigned getL1TrgSrc () const
 Return bits 3-0 of _l1config1.
 
void setL1TrgWord (unsigned)
 Set bits 12-4 of _l1config1 (L1 trigger word).
 
unsigned getL1TrgWord () const
 Return bits 12-4 of _l1config1.
 
void setL1TrgWrite (unsigned)
 Set bit 16 of _l1config1 (L1 trigger write mask).
 
unsigned getL1TrgWrite () const
 Return bit 16 of _l1config1.
 
void messagePayload (unsigned)
 Write v to _messagePayload of the selected partition.
 
unsigned messagePayload () const
 Return _messagePayload of the selected partition.
 
void messageHdr (unsigned)
 Set bits 7-0 of _message to v (the header comment gives the header as bits 14-0).
 
unsigned messageHdr () const
 Return bits 15-0 of _message.
 
void messageInsert ()
 Set the insert bit (15) of _message.
 
void inhibitInt (unsigned, unsigned)
 Set the interval field of inhibit configuration inh (bits 11-0 of _inhibitConfig) to v - 1.
 
unsigned inhibitInt (unsigned) const
 Return the interval field of inhibit configuration inh plus 1.
 
void inhibitLim (unsigned, unsigned)
 Set the limit field of inhibit configuration inh (bits 15-12) to v - 1.
 
unsigned inhibitLim (unsigned) const
 Return the limit field of inhibit configuration inh plus 1.
 
void inhibitEnb (unsigned, unsigned)
 Set the enable bit (31) of inhibit configuration inh to v.
 
unsigned inhibitEnb (unsigned) const
 Return the enable bit (31) of inhibit configuration inh.
 
XpmSequenceEngine & sequenceEngine ()
 Return a new XpmSequenceEngine for the register space after the receive ring buffer; a new object is allocated on every call and not freed here.
 

Static Public Member Functions

static class Module * locate ()
 Construct a Module with placement new at address 0 and return it, so that member addresses are register offsets for Cphw::Reg accesses.
 
static unsigned feature_rev ()
 Return the feature revision found by init(): 1 if the build stamp contains xtpg, else 0.
 

Public Attributes

Cphw::AxiVersion _version
 AxiVersion block at offset 0 (per the comment); init() reads its build stamp.
 
Cphw::XBar _xbar
 Crossbar (AxiSy56040 at 0x03000000, per the comment); init() and setCuInput() set its outputs.
 
Cphw::TimingRx _usTiming
 TimingRx block at 0x08000000 (per the comment); read by counts() as the us counters.
 
Cphw::TimingRx _cuTiming
 TimingRx block at 0x08400000 (per the comment); read by counts() as the cu counters.
 
Cphw::Reg64 _timestamp
 64-bit timestamp register of the generator block at 0x08800000 (per the comment); written by setTimeStamp().
 
Cphw::Reg64 _pulseId
 64-bit pulse ID register of the generator block.
 
Cphw::Reg _cuDelay
 Delay register written by setCuDelay(); the comment gives 185.7 MHz units and a default of 800*200 clocks.
 
Cphw::Reg _cuBeamCode
 Register written by setCuBeamCode(); the comment calls it the beam-present event code (default 140).
 
Cphw::Reg _cuFiducialIntv
 Register written by clearCuFiducialErr().
 
MmcmPhaseLock _mmcm [3]
 Three MmcmPhaseLock blocks at 0x08900000, 0x08a00000 and 0x08b00000 (per the comment).
 
Cphw::HsRepeater _hsRepeater [6]
 Six HsRepeater blocks from 0x09000000 (per the comment); init() initializes numbers 0, 1, 3 and 4.
 
Cphw::GthRxAlign _usGthAlign
 GthRxAlign block at 0x0B000000 (per the comment); passed to TimingCounts but not read.
 
Cphw::GthRxAlign _cuGthAlign
 GthRxAlign block at 0x0C000000 (per the comment); passed to TimingCounts but not read.
 
Cphw::Reg _paddr
 Register 0x0000: physical link address (read: received address, write: transmit address), per the header comment.
 
Cphw::Reg _index
 Register 0x0004: programming index selecting the partition [3:0], link [9:4], ring buffer link [14:10], AMC [16], inhibit [21:20], tag streaming [24] and the us/cu receive enables [25]/[26] (header comment).
 
Cphw::Reg _dsLinkConfig
 Register 0x0008: configuration of the selected link: group mask [7:0], receive timeout [17:9], PLL resets [18]/[19], trigger source [27:24], loopback [28], resets [29]/[30], enable [31] (header comment).
 
Cphw::Reg _dsLinkStatus
 Register 0x000C (read-only): status of the selected link: receive error count [15:0], reset-done and ready bits [16]-[19], remote-is-XPM [20] (header comment).
 
Cphw::Reg _dsLinkRcvs
 Receive count register of the selected link (bits 31-0, per the header comment).
 
Cphw::AmcPLL _amcPll
 AMC PLL control block at 0x0014; the AMC is selected by _index.
 
Cphw::Reg _l0Control
 Register 0x0018: L0 control of the selected partition: reset [0], enable [16], master [30], enable counter update [31] (header comment).
 
Cphw::Reg _l0Select
 Register 0x001c: L0 selection of the selected partition: rate selection [15:0] and destination selection [31:16]; the rate modes are given by bits [15:14] (header comment).
 
Cphw::Reg64 _l0Enabled
 Register 0x0020 (read-only, 64-bit): clocks enabled for the selected partition (header comment).
 
Cphw::Reg64 _l0Inhibited
 Register 0x0028 (read-only, 64-bit): clocks inhibited for the selected partition.
 
Cphw::Reg64 _numl0
 Register 0x0030 (read-only, 64-bit): number of L0s input for the selected partition.
 
Cphw::Reg64 _numl0Inh
 Register 0x0038 (read-only, 64-bit): number of L0s inhibited.
 
Cphw::Reg64 _numl0Acc
 Register 0x0040 (read-only, 64-bit): number of L0s accepted.
 
Cphw::Reg64 _numl1Acc
 Register 0x0048 (read-only, 64-bit): number of L1s accepted.
 
Cphw::Reg _l1config0
 Register 0x0050: L1 select configuration: trigger clear mask [0], trigger enable mask [16] (header comment).
 
Cphw::Reg _l1config1
 Register 0x0054: L1 trigger source link [3:0], trigger word [12:4], write mask [16] (header comment).
 
Cphw::Reg _analysisRst
 Register 0x0058: analysis tag reset [3:0] for the selected partition (header comment).
 
Cphw::Reg _analysisTag
 Register 0x005c: analysis tag for the selected partition (header comment).
 
Cphw::Reg _analysisPush
 Register 0x0060: analysis push [3:0] for the selected partition (header comment).
 
Cphw::Reg _analysisTagWr
 Register 0x0064 (read-only): analysis tag push counts (header comment).
 
Cphw::Reg _analysisTagRd
 Register 0x0068 (read-only): analysis tag pull counts (header comment).
 
Cphw::Reg _pipelineDepth
 Register 0x006c: pipeline depth for the selected partition; written by setL0Delay().
 
Cphw::Reg _message
 Register 0x0070: message setup: header [14:0], insert [15] (header comment).
 
Cphw::Reg _messagePayload
 Register 0x0074: message payload for the selected partition.
 
Cphw::Reg _remoteLinkId
 Register 0x0078 (read-only): remote link ID, copied into LinkStatus.
 
Cphw::Reg _inhibitConfig [4]
 Registers 0x0080: four inhibit configurations: interval [11:0], limit [15:12], enable [31] (header comment).
 
Cphw::Reg _inhibitEvCounts [32]
 Registers 0x0090 (read-only): inhibit assertions by downstream link (header comment); read by l0Stats().
 
Cphw::Reg _monClk [4]
 Registers 0x0110 (read-only): four monitor clocks: rate [28:0], slow [29], fast [30], lock [31] (header comment).
 
Cphw::Reg _inhibitTmCounts [32]
 Per-link counters following _monClk, read by l0Stats() into linkInhTm; not described in the header.
 
uint32_t _reserved_416 [24]
 Unused padding (24 words) up to register 0x0200.
 
Cphw::Reg _groupL0Reset
 Register 0x0200 (write-only): written with a group mask by groupL0Reset().
 
Cphw::Reg _groupL0Enable
 Register 0x0204 (write-only): written with a group mask by groupL0Enable().
 
Cphw::Reg _groupL0Disable
 Register 0x0208 (write-only): written with a group mask by groupL0Disable().
 
Cphw::Reg _groupMsgInsert
 Register 0x020c (write-only): written with a group mask by groupMsgInsert().
 
MmcmPhaseLock _mmcm_amc
 MmcmPhaseLock block placed after the sequence engine and gthTSim reserved spaces.
 

Detailed Description

Register map of an XPM, laid out so that member addresses equal register offsets (see locate()), with functions that select a partition, link or AMC through the _index register and read or write fields of the selected registers.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Number of AMCs.

Enumerator
NAmcs 

◆ anonymous enum

anonymous enum

Number of downstream links.

Enumerator
NDSLinks 

14; init(), clearLinks(), txLinkStat() and rxLinkStat() loop over this many links.

◆ anonymous enum

anonymous enum

Number of partitions.

Enumerator
NPartitions 

Constructor & Destructor Documentation

◆ Module()

Pds::Xpm::Module::Module ( )

Does nothing (the call to init() is commented out).

Member Function Documentation

◆ clearCuFiducialErr()

void Pds::Xpm::Module::clearCuFiducialErr ( unsigned  )

With feature revision 1 or more and v non-zero, write v to _cuFiducialIntv.

◆ clearLinks()

void Pds::Xpm::Module::clearLinks ( )

Clear the enable bit (31) of the configuration of links 0 to NDSLinks-1.

◆ counts()

CoreCounts Pds::Xpm::Module::counts ( ) const

Return the counters of the us and cu timing receivers.

◆ dumpPll()

void Pds::Xpm::Module::dumpPll ( unsigned  ) const

Select the AMC and print its PLL configuration register and AmcPLL::dump().

◆ dumpTiming()

void Pds::Xpm::Module::dumpTiming ( unsigned  ) const

Print that it is deprecated; does nothing else.

◆ feature_rev()

static unsigned Pds::Xpm::Module::feature_rev ( )
static

Return the feature revision found by init(): 1 if the build stamp contains xtpg, else 0.

◆ getAmc()

unsigned Pds::Xpm::Module::getAmc ( ) const

Return the AMC bit (16) of _index.

◆ getInhibit()

unsigned Pds::Xpm::Module::getInhibit ( ) const

Return the inhibit field (bits 21-20) of _index.

◆ getL0Delay()

unsigned Pds::Xpm::Module::getL0Delay ( ) const

Return the upper 16 bits of _pipelineDepth.

◆ getL0Enabled()

bool Pds::Xpm::Module::getL0Enabled ( ) const

Return the enable bit (16) of _l0Control.

◆ getL1TrgClr()

unsigned Pds::Xpm::Module::getL1TrgClr ( ) const

Return bit 0 of _l1config0.

◆ getL1TrgEnb()

unsigned Pds::Xpm::Module::getL1TrgEnb ( ) const

Return bit 16 of _l1config0.

◆ getL1TrgSrc()

unsigned Pds::Xpm::Module::getL1TrgSrc ( ) const

Return bits 3-0 of _l1config1.

◆ getL1TrgWord()

unsigned Pds::Xpm::Module::getL1TrgWord ( ) const

Return bits 12-4 of _l1config1.

◆ getL1TrgWrite()

unsigned Pds::Xpm::Module::getL1TrgWrite ( ) const

Return bit 16 of _l1config1.

◆ getLink()

unsigned Pds::Xpm::Module::getLink ( ) const

Return the link field (bits 9-4) of _index.

◆ getPartition()

unsigned Pds::Xpm::Module::getPartition ( ) const

Return the partition field (bits 3-0) of _index.

◆ getTagStream()

unsigned Pds::Xpm::Module::getTagStream ( ) const

Return the tag stream bit (24) of _index.

◆ groupL0Disable()

void Pds::Xpm::Module::groupL0Disable ( unsigned  )

Select the partition of the lowest set bit of the mask, then write the mask to _groupL0Disable.

◆ groupL0Enable()

void Pds::Xpm::Module::groupL0Enable ( unsigned  )

Select the partition of the lowest set bit of the mask, then write the mask to _groupL0Enable.

◆ groupL0Reset()

void Pds::Xpm::Module::groupL0Reset ( unsigned  )

Select the partition of the lowest set bit of the mask, then write the mask to _groupL0Reset.

◆ groupMsgInsert()

void Pds::Xpm::Module::groupMsgInsert ( unsigned  )

Select the partition of the lowest set bit of the mask, then write the mask to _groupMsgInsert.

◆ inhibitEnb() [1/2]

unsigned Pds::Xpm::Module::inhibitEnb ( unsigned  ) const

Return the enable bit (31) of inhibit configuration inh.

◆ inhibitEnb() [2/2]

void Pds::Xpm::Module::inhibitEnb ( unsigned  ,
unsigned   
)

Set the enable bit (31) of inhibit configuration inh to v.

◆ inhibitInt() [1/2]

unsigned Pds::Xpm::Module::inhibitInt ( unsigned  ) const

Return the interval field of inhibit configuration inh plus 1.

◆ inhibitInt() [2/2]

void Pds::Xpm::Module::inhibitInt ( unsigned  ,
unsigned   
)

Set the interval field of inhibit configuration inh (bits 11-0 of _inhibitConfig) to v - 1.

◆ inhibitLim() [1/2]

unsigned Pds::Xpm::Module::inhibitLim ( unsigned  ) const

Return the limit field of inhibit configuration inh plus 1.

◆ inhibitLim() [2/2]

void Pds::Xpm::Module::inhibitLim ( unsigned  ,
unsigned   
)

Set the limit field of inhibit configuration inh (bits 15-12) to v - 1.

◆ init()

void Pds::Xpm::Module::init ( )

Set the feature revision from the build stamp, print the index register and the configuration and status of every link, route the crossbar outputs BP, RTM0 and RTM1 to FPGA and initialize HsRepeaters 0, 1, 3 and 4.

◆ l0Enabled()

bool Pds::Xpm::Module::l0Enabled ( ) const

Return bit 16 (enable) of the _l0Control register of the selected partition.

◆ l0Reset()

bool Pds::Xpm::Module::l0Reset ( ) const

Return the reset bit (0) of _l0Control.

◆ l0Stats()

L0Stats Pds::Xpm::Module::l0Stats ( bool  ) const

Freeze the counter updates, sample the L0 statistics of the selected partition (the totals and per-link event inhibit counts only when the argument is true, the per-link inhibit time counts always) and the link 0 error count, then unfreeze.

Note that the link index is changed while sampling.

◆ linkEnable() [1/2]

bool Pds::Xpm::Module::linkEnable ( unsigned  ) const

Select the link and return its enable bit (31).

◆ linkEnable() [2/2]

void Pds::Xpm::Module::linkEnable ( unsigned  ,
bool   
)

Select the link and set or clear its enable bit (31 of _dsLinkConfig).

◆ linkGroupMask() [1/2]

unsigned Pds::Xpm::Module::linkGroupMask ( unsigned  ) const

Select the link and return its group mask (bits 7-0).

◆ linkGroupMask() [2/2]

void Pds::Xpm::Module::linkGroupMask ( unsigned  ,
unsigned   
)

Select the link and set its group mask (bits 7-0 of _dsLinkConfig).

◆ linkIsXpm()

bool Pds::Xpm::Module::linkIsXpm ( unsigned  ) const

Select the link and return its remote-is-XPM status bit (20).

◆ linkLoopback() [1/2]

bool Pds::Xpm::Module::linkLoopback ( unsigned  ) const

Select the link and return its loopback bit (28).

◆ linkLoopback() [2/2]

void Pds::Xpm::Module::linkLoopback ( unsigned  ,
bool   
)

Select the link and set or clear its loopback bit (28 of _dsLinkConfig).

◆ linkRxErr()

bool Pds::Xpm::Module::linkRxErr ( unsigned  ) const

Select the link and return true if its receive error count (status bits 15-0) is non-zero.

◆ linkRxReady()

bool Pds::Xpm::Module::linkRxReady ( unsigned  ) const

Select the link and return its receive-ready status bit (19 of _dsLinkStatus).

◆ linkRxTimeOut() [1/2]

unsigned Pds::Xpm::Module::linkRxTimeOut ( unsigned  ) const

Select the link and return its receive timeout field (bits 17-9).

◆ linkRxTimeOut() [2/2]

void Pds::Xpm::Module::linkRxTimeOut ( unsigned  ,
unsigned   
)

Select the link and set its receive timeout field (bits 17-9 of _dsLinkConfig).

◆ linkStatus() [1/2]

void Pds::Xpm::Module::linkStatus ( LinkStatus *  ) const

Fill the array with the status of links 0 to 31.

◆ linkStatus() [2/2]

LinkStatus Pds::Xpm::Module::linkStatus ( unsigned  ) const

Select the link and return its status (see LinkStatus).

◆ linkTrgSrc() [1/2]

unsigned Pds::Xpm::Module::linkTrgSrc ( unsigned  ) const

Select the link and return its trigger source field (bits 27-24).

◆ linkTrgSrc() [2/2]

void Pds::Xpm::Module::linkTrgSrc ( unsigned  ,
unsigned   
)

Select the link and set its trigger source field (bits 27-24 of _dsLinkConfig).

◆ linkTxReady()

bool Pds::Xpm::Module::linkTxReady ( unsigned  ) const

Select the link and return its transmit-ready status bit (17).

◆ locate()

static class Module * Pds::Xpm::Module::locate ( )
static

Construct a Module with placement new at address 0 and return it, so that member addresses are register offsets for Cphw::Reg accesses.

◆ lockL0Stats()

void Pds::Xpm::Module::lockL0Stats ( bool  )

Freeze (true) or resume the counter updates by clearing or setting bit 31 of _l0Control.

◆ master() [1/2]

bool Pds::Xpm::Module::master ( ) const

Return the master bit (30) of _l0Control.

◆ master() [2/2]

void Pds::Xpm::Module::master ( bool  )

Set or clear the master bit (30) of _l0Control.

◆ messageHdr() [1/2]

unsigned Pds::Xpm::Module::messageHdr ( ) const

Return bits 15-0 of _message.

◆ messageHdr() [2/2]

void Pds::Xpm::Module::messageHdr ( unsigned  )

Set bits 7-0 of _message to v (the header comment gives the header as bits 14-0).

◆ messageInsert()

void Pds::Xpm::Module::messageInsert ( )

Set the insert bit (15) of _message.

◆ messagePayload() [1/2]

unsigned Pds::Xpm::Module::messagePayload ( ) const

Return _messagePayload of the selected partition.

◆ messagePayload() [2/2]

void Pds::Xpm::Module::messagePayload ( unsigned  )

Write v to _messagePayload of the selected partition.

◆ pllBwSel() [1/2]

int Pds::Xpm::Module::pllBwSel ( unsigned  ) const

Select AMC idx and return AmcPLL::BwSel().

◆ pllBwSel() [2/2]

void Pds::Xpm::Module::pllBwSel ( unsigned  ,
int   
)

Select AMC idx and call AmcPLL::BwSel(val).

◆ pllBypass() [1/2]

bool Pds::Xpm::Module::pllBypass ( unsigned  ) const

Select AMC idx and return AmcPLL::Bypass().

◆ pllBypass() [2/2]

void Pds::Xpm::Module::pllBypass ( unsigned  ,
bool   
)

Select AMC idx and call AmcPLL::Bypass(v).

◆ pllCount0()

int Pds::Xpm::Module::pllCount0 ( unsigned  ) const

Select AMC idx and return AmcPLL::Count0().

◆ pllCount1()

int Pds::Xpm::Module::pllCount1 ( unsigned  ) const

Select AMC idx and return AmcPLL::Count1().

◆ pllFrqSel() [1/2]

int Pds::Xpm::Module::pllFrqSel ( unsigned  ) const

Select AMC idx and return AmcPLL::FrqSel().

◆ pllFrqSel() [2/2]

void Pds::Xpm::Module::pllFrqSel ( unsigned  ,
int   
)

Select AMC idx and call AmcPLL::FrqSel(val).

◆ pllFrqTbl() [1/2]

int Pds::Xpm::Module::pllFrqTbl ( unsigned  ) const

Select AMC idx and return AmcPLL::FrqTbl().

◆ pllFrqTbl() [2/2]

void Pds::Xpm::Module::pllFrqTbl ( unsigned  ,
int   
)

Select AMC idx and call AmcPLL::FrqTbl(val).

◆ pllPhsDec()

void Pds::Xpm::Module::pllPhsDec ( unsigned  )

Select AMC idx and call AmcPLL::PhsDec().

◆ pllPhsInc()

void Pds::Xpm::Module::pllPhsInc ( unsigned  )

Select AMC idx and call AmcPLL::PhsInc().

◆ pllRateSel() [1/2]

int Pds::Xpm::Module::pllRateSel ( unsigned  ) const

Select AMC idx and return AmcPLL::RateSel().

◆ pllRateSel() [2/2]

void Pds::Xpm::Module::pllRateSel ( unsigned  ,
int   
)

Select AMC idx and call AmcPLL::RateSel(val).

◆ pllReset()

void Pds::Xpm::Module::pllReset ( unsigned  )

Select AMC idx and call AmcPLL::Reset().

◆ pllSkew()

void Pds::Xpm::Module::pllSkew ( unsigned  ,
int   
)

Select AMC idx and call AmcPLL::Skew(val).

◆ pllStat()

PllStats Pds::Xpm::Module::pllStat ( unsigned  ) const

Select AMC idx and return its PLL status (Status0, Status1, Count0, Count1).

◆ pllStatus0()

int Pds::Xpm::Module::pllStatus0 ( unsigned  ) const

Select AMC idx and return AmcPLL::Status0().

◆ pllStatus1()

int Pds::Xpm::Module::pllStatus1 ( unsigned  ) const

Select AMC idx and return AmcPLL::Status1().

◆ resetL0() [1/2]

void Pds::Xpm::Module::resetL0 ( )

Pulse the reset bit of _l0Control: set it, wait 1 us, clear it.

◆ resetL0() [2/2]

void Pds::Xpm::Module::resetL0 ( bool  )

Set (true) or clear the reset bit (0) of _l0Control of the selected partition.

◆ rxLinkDump()

void Pds::Xpm::Module::rxLinkDump ( unsigned  ) const

Point the receive ring buffer at the link, clear it, capture for 100 us and print the captured words masked to 20 bits (Cphw::RingBuffer::dump(20)).

◆ rxLinkErrs()

unsigned Pds::Xpm::Module::rxLinkErrs ( unsigned  ) const

Select the link and return its receive error count (status bits 15-0).

◆ rxLinkPllReset()

void Pds::Xpm::Module::rxLinkPllReset ( unsigned  )

Select the link and pulse its receive PLL reset bit (19 of _dsLinkConfig) for 10 us.

◆ rxLinkReset()

void Pds::Xpm::Module::rxLinkReset ( unsigned  )

Select the link and pulse its receive reset bit (30 of _dsLinkConfig) for 10 us.

◆ rxLinkStat()

unsigned Pds::Xpm::Module::rxLinkStat ( ) const

Return a bit mask of the links (0 to NDSLinks-1) whose receive-ready bit is set.

◆ sequenceEngine()

XpmSequenceEngine & Pds::Xpm::Module::sequenceEngine ( )

Return a new XpmSequenceEngine for the register space after the receive ring buffer; a new object is allocated on every call and not freed here.

◆ setAmc()

void Pds::Xpm::Module::setAmc ( unsigned  ) const

Set the AMC bit (16) of _index; const although it writes the register.

◆ setCuBeamCode()

void Pds::Xpm::Module::setCuBeamCode ( unsigned  )

With feature revision 1 or more, write v to _cuBeamCode.

◆ setCuDelay()

void Pds::Xpm::Module::setCuDelay ( unsigned  )

With feature revision 1 or more, write v to _cuDelay.

◆ setCuInput()

void Pds::Xpm::Module::setCuInput ( unsigned  )

With feature revision 1 or more, route the crossbar outputs FPGA, RTM0 and RTM1 to input v (and print it); otherwise does nothing.

◆ setInhibit()

void Pds::Xpm::Module::setInhibit ( unsigned  )

Set the inhibit field (bits 21-20) of _index.

◆ setL0Delay()

void Pds::Xpm::Module::setL0Delay ( unsigned  )

Write the delay v to the upper 16 bits of _pipelineDepth and the low 16 bits of v*200 to its lower half.

◆ setL0Enabled()

void Pds::Xpm::Module::setL0Enabled ( bool  )

Set or clear the enable bit (16) of _l0Control.

◆ setL0Select_ACRate()

void Pds::Xpm::Module::setL0Select_ACRate ( unsigned  rate,
unsigned  tsmask 
)

Set the rate selection of _l0Select to AC-rate mode with timeslot mask tsmask (6 bits) and marker rate (3 bits), keeping the destination selection.

◆ setL0Select_Destn()

void Pds::Xpm::Module::setL0Select_Destn ( unsigned  mode,
unsigned  mask 
)

Set the destination selection (upper half) of _l0Select to mode in bit 15 and the low 4 bits of mask, keeping the rate selection.

The header comment describes a 15-bit destination mask, but only 4 bits are kept.

◆ setL0Select_FixedRate()

void Pds::Xpm::Module::setL0Select_FixedRate ( unsigned  rate)

Set the rate selection of _l0Select to fixed-rate mode with marker rate (low 4 bits), keeping the destination selection.

◆ setL0Select_Sequence()

void Pds::Xpm::Module::setL0Select_Sequence ( unsigned  seq,
unsigned  bit 
)

Set the rate selection of _l0Select to sequence mode with sequencer seq (6 bits) and bit (4 bits), keeping the destination selection.

◆ setL1TrgClr()

void Pds::Xpm::Module::setL1TrgClr ( unsigned  )

Set bit 0 of _l1config0 to v.

◆ setL1TrgEnb()

void Pds::Xpm::Module::setL1TrgEnb ( unsigned  )

Set bit 16 of _l1config0 to v.

◆ setL1TrgSrc()

void Pds::Xpm::Module::setL1TrgSrc ( unsigned  )

Set bits 3-0 of _l1config1 (L1 trigger source link, per the header comment).

◆ setL1TrgWord()

void Pds::Xpm::Module::setL1TrgWord ( unsigned  )

Set bits 12-4 of _l1config1 (L1 trigger word).

◆ setL1TrgWrite()

void Pds::Xpm::Module::setL1TrgWrite ( unsigned  )

Set bit 16 of _l1config1 (L1 trigger write mask).

◆ setLink()

void Pds::Xpm::Module::setLink ( unsigned  ) const

Set the link field (bits 9-4) of _index; const although it writes the register.

◆ setPartition()

void Pds::Xpm::Module::setPartition ( unsigned  ) const

Set the partition field (bits 3-0) of _index; const although it writes the register.

◆ setRingBChan()

void Pds::Xpm::Module::setRingBChan ( unsigned  )

Set the ring buffer link field (bits 13-10) of _index.

◆ setTagStream()

void Pds::Xpm::Module::setTagStream ( unsigned  )

Set the tag stream bit (24) of _index.

◆ setTimeStamp()

void Pds::Xpm::Module::setTimeStamp ( )

Write the current time to _timestamp: seconds since a reference from mktime() in the upper 32 bits and nanoseconds in the lower 32 bits.

The reference struct tm has only tm_year (1995) set; its other fields are uninitialized.

◆ setVerbose()

void Pds::Xpm::Module::setVerbose ( unsigned  )

Set the file-static verbosity used by setL0Enabled() and l0Stats().

◆ txLinkPllReset()

void Pds::Xpm::Module::txLinkPllReset ( unsigned  )

Select the link and pulse its transmit PLL reset bit (18 of _dsLinkConfig) for 10 us.

◆ txLinkReset()

void Pds::Xpm::Module::txLinkReset ( unsigned  )

Select the link and pulse its transmit reset bit (29 of _dsLinkConfig) for 10 us.

◆ txLinkStat()

unsigned Pds::Xpm::Module::txLinkStat ( ) const

Return a bit mask of the links (0 to NDSLinks-1) whose transmit-ready bit is set.

Member Data Documentation

◆ _amcPll

Cphw::AmcPLL Pds::Xpm::Module::_amcPll

AMC PLL control block at 0x0014; the AMC is selected by _index.

◆ _analysisPush

Cphw::Reg Pds::Xpm::Module::_analysisPush

Register 0x0060: analysis push [3:0] for the selected partition (header comment).

◆ _analysisRst

Cphw::Reg Pds::Xpm::Module::_analysisRst

Register 0x0058: analysis tag reset [3:0] for the selected partition (header comment).

◆ _analysisTag

Cphw::Reg Pds::Xpm::Module::_analysisTag

Register 0x005c: analysis tag for the selected partition (header comment).

◆ _analysisTagRd

Cphw::Reg Pds::Xpm::Module::_analysisTagRd

Register 0x0068 (read-only): analysis tag pull counts (header comment).

◆ _analysisTagWr

Cphw::Reg Pds::Xpm::Module::_analysisTagWr

Register 0x0064 (read-only): analysis tag push counts (header comment).

◆ _cuBeamCode

Cphw::Reg Pds::Xpm::Module::_cuBeamCode

Register written by setCuBeamCode(); the comment calls it the beam-present event code (default 140).

◆ _cuDelay

Cphw::Reg Pds::Xpm::Module::_cuDelay

Delay register written by setCuDelay(); the comment gives 185.7 MHz units and a default of 800*200 clocks.

◆ _cuFiducialIntv

Cphw::Reg Pds::Xpm::Module::_cuFiducialIntv

Register written by clearCuFiducialErr().

◆ _cuGthAlign

Cphw::GthRxAlign Pds::Xpm::Module::_cuGthAlign

GthRxAlign block at 0x0C000000 (per the comment); passed to TimingCounts but not read.

◆ _cuTiming

Cphw::TimingRx Pds::Xpm::Module::_cuTiming

TimingRx block at 0x08400000 (per the comment); read by counts() as the cu counters.

◆ _dsLinkConfig

Cphw::Reg Pds::Xpm::Module::_dsLinkConfig

Register 0x0008: configuration of the selected link: group mask [7:0], receive timeout [17:9], PLL resets [18]/[19], trigger source [27:24], loopback [28], resets [29]/[30], enable [31] (header comment).

◆ _dsLinkRcvs

Cphw::Reg Pds::Xpm::Module::_dsLinkRcvs

Receive count register of the selected link (bits 31-0, per the header comment).

◆ _dsLinkStatus

Cphw::Reg Pds::Xpm::Module::_dsLinkStatus

Register 0x000C (read-only): status of the selected link: receive error count [15:0], reset-done and ready bits [16]-[19], remote-is-XPM [20] (header comment).

◆ _groupL0Disable

Cphw::Reg Pds::Xpm::Module::_groupL0Disable

Register 0x0208 (write-only): written with a group mask by groupL0Disable().

◆ _groupL0Enable

Cphw::Reg Pds::Xpm::Module::_groupL0Enable

Register 0x0204 (write-only): written with a group mask by groupL0Enable().

◆ _groupL0Reset

Cphw::Reg Pds::Xpm::Module::_groupL0Reset

Register 0x0200 (write-only): written with a group mask by groupL0Reset().

◆ _groupMsgInsert

Cphw::Reg Pds::Xpm::Module::_groupMsgInsert

Register 0x020c (write-only): written with a group mask by groupMsgInsert().

◆ _hsRepeater

Cphw::HsRepeater Pds::Xpm::Module::_hsRepeater[6]

Six HsRepeater blocks from 0x09000000 (per the comment); init() initializes numbers 0, 1, 3 and 4.

◆ _index

Cphw::Reg Pds::Xpm::Module::_index

Register 0x0004: programming index selecting the partition [3:0], link [9:4], ring buffer link [14:10], AMC [16], inhibit [21:20], tag streaming [24] and the us/cu receive enables [25]/[26] (header comment).

◆ _inhibitConfig

Cphw::Reg Pds::Xpm::Module::_inhibitConfig[4]

Registers 0x0080: four inhibit configurations: interval [11:0], limit [15:12], enable [31] (header comment).

◆ _inhibitEvCounts

Cphw::Reg Pds::Xpm::Module::_inhibitEvCounts[32]

Registers 0x0090 (read-only): inhibit assertions by downstream link (header comment); read by l0Stats().

◆ _inhibitTmCounts

Cphw::Reg Pds::Xpm::Module::_inhibitTmCounts[32]

Per-link counters following _monClk, read by l0Stats() into linkInhTm; not described in the header.

◆ _l0Control

Cphw::Reg Pds::Xpm::Module::_l0Control

Register 0x0018: L0 control of the selected partition: reset [0], enable [16], master [30], enable counter update [31] (header comment).

◆ _l0Enabled

Cphw::Reg64 Pds::Xpm::Module::_l0Enabled

Register 0x0020 (read-only, 64-bit): clocks enabled for the selected partition (header comment).

◆ _l0Inhibited

Cphw::Reg64 Pds::Xpm::Module::_l0Inhibited

Register 0x0028 (read-only, 64-bit): clocks inhibited for the selected partition.

◆ _l0Select

Cphw::Reg Pds::Xpm::Module::_l0Select

Register 0x001c: L0 selection of the selected partition: rate selection [15:0] and destination selection [31:16]; the rate modes are given by bits [15:14] (header comment).

◆ _l1config0

Cphw::Reg Pds::Xpm::Module::_l1config0

Register 0x0050: L1 select configuration: trigger clear mask [0], trigger enable mask [16] (header comment).

◆ _l1config1

Cphw::Reg Pds::Xpm::Module::_l1config1

Register 0x0054: L1 trigger source link [3:0], trigger word [12:4], write mask [16] (header comment).

◆ _message

Cphw::Reg Pds::Xpm::Module::_message

Register 0x0070: message setup: header [14:0], insert [15] (header comment).

◆ _messagePayload

Cphw::Reg Pds::Xpm::Module::_messagePayload

Register 0x0074: message payload for the selected partition.

◆ _mmcm

MmcmPhaseLock Pds::Xpm::Module::_mmcm[3]

Three MmcmPhaseLock blocks at 0x08900000, 0x08a00000 and 0x08b00000 (per the comment).

◆ _mmcm_amc

MmcmPhaseLock Pds::Xpm::Module::_mmcm_amc

MmcmPhaseLock block placed after the sequence engine and gthTSim reserved spaces.

◆ _monClk

Cphw::Reg Pds::Xpm::Module::_monClk[4]

Registers 0x0110 (read-only): four monitor clocks: rate [28:0], slow [29], fast [30], lock [31] (header comment).

◆ _numl0

Cphw::Reg64 Pds::Xpm::Module::_numl0

Register 0x0030 (read-only, 64-bit): number of L0s input for the selected partition.

◆ _numl0Acc

Cphw::Reg64 Pds::Xpm::Module::_numl0Acc

Register 0x0040 (read-only, 64-bit): number of L0s accepted.

◆ _numl0Inh

Cphw::Reg64 Pds::Xpm::Module::_numl0Inh

Register 0x0038 (read-only, 64-bit): number of L0s inhibited.

◆ _numl1Acc

Cphw::Reg64 Pds::Xpm::Module::_numl1Acc

Register 0x0048 (read-only, 64-bit): number of L1s accepted.

◆ _paddr

Cphw::Reg Pds::Xpm::Module::_paddr

Register 0x0000: physical link address (read: received address, write: transmit address), per the header comment.

◆ _pipelineDepth

Cphw::Reg Pds::Xpm::Module::_pipelineDepth

Register 0x006c: pipeline depth for the selected partition; written by setL0Delay().

◆ _pulseId

Cphw::Reg64 Pds::Xpm::Module::_pulseId

64-bit pulse ID register of the generator block.

◆ _remoteLinkId

Cphw::Reg Pds::Xpm::Module::_remoteLinkId

Register 0x0078 (read-only): remote link ID, copied into LinkStatus.

◆ _reserved_416

uint32_t Pds::Xpm::Module::_reserved_416[24]

Unused padding (24 words) up to register 0x0200.

◆ _timestamp

Cphw::Reg64 Pds::Xpm::Module::_timestamp

64-bit timestamp register of the generator block at 0x08800000 (per the comment); written by setTimeStamp().

◆ _usGthAlign

Cphw::GthRxAlign Pds::Xpm::Module::_usGthAlign

GthRxAlign block at 0x0B000000 (per the comment); passed to TimingCounts but not read.

◆ _usTiming

Cphw::TimingRx Pds::Xpm::Module::_usTiming

TimingRx block at 0x08000000 (per the comment); read by counts() as the us counters.

◆ _version

Cphw::AxiVersion Pds::Xpm::Module::_version

AxiVersion block at offset 0 (per the comment); init() reads its build stamp.

◆ _xbar

Cphw::XBar Pds::Xpm::Module::_xbar

Crossbar (AxiSy56040 at 0x03000000, per the comment); init() and setCuInput() set its outputs.


The documentation for this class was generated from the following file: