pflib v3.14.1-2-g276c487
Pretty Fine HGCROC Interaction Library
Loading...
Searching...
No Matches
pflib::zcu::ZCUOptoLink Class Reference
Inheritance diagram for pflib::zcu::ZCUOptoLink:
[legend]
Collaboration diagram for pflib::zcu::ZCUOptoLink:
[legend]

Public Member Functions

 ZCUOptoLink (const std::string &name, int ilink, bool isdaq)
 
virtual int ilink ()
 which optical link does this represent?
 
virtual bool is_bidirectional ()
 is this link bidirectional (e.g. a DAQ lpGBT)
 
virtual void soft_reset_link () override
 soft reset that should not have side-effects
 
virtual void reset_link ()
 reset a given optical link, may have side-effects
 
virtual void run_linktrick ()
 
virtual bool get_rx_polarity ()
 
virtual bool get_tx_polarity ()
 
virtual void set_rx_polarity (bool polarity)
 
virtual void set_tx_polarity (bool polarity)
 
virtual std::map< std::string, uint32_t > opto_status ()
 
virtual std::map< std::string, uint32_t > opto_rates ()
 
virtual lpGBT_ConfigTransportlpgbt_transport ()
 
::pflib::UIOcoder ()
 
virtual int get_elink_tx_mode (int elink)
 there are four TX elinks configured in the coder block
 
virtual void set_elink_tx_mode (int elink, int mode)
 
virtual void capture_ec (int mode, std::vector< uint8_t > &tx, std::vector< uint8_t > &rx)
 
virtual void capture_ic (int mode, std::vector< uint8_t > &tx, std::vector< uint8_t > &rx)
 

Private Attributes

std::unique_ptr<::pflib::zcu::lpGBT_ICEC_Simpletransport_
 
::pflib::UIO transright_
 
::pflib::UIO coder_
 
int ilink_
 
bool isdaq_
 
logging::logger the_log_
 

Constructor & Destructor Documentation

◆ ZCUOptoLink()

pflib::zcu::ZCUOptoLink::ZCUOptoLink ( const std::string & name,
int ilink,
bool isdaq )

The actual UIO device we connect to depends on if we are connecting to the DATA path or the TRIG path. In the final system, the DATA and TRIG path firmwares live on different chips, so we mimic that here by having the DATA and TRIG path firmwares at least reside in different blocks. 'standardLpGBTpair-N' -> slow control and DATA path for pair N (0 or 1) 'trigpath-N' -> TRIG path for pair N So if this opto link is labeled as TRIG (isdaq == false), then we use trigpath-N instead of the provided coder_name. However, we still use the provided coder_name for the I2C transport since the slow control for the TRIG path chips will still proceed via the standardLpGBTpair-N firmware.

Note
The provided coder_name can be something besides standardLpGBTpair-N when we are testing the LpGBT mezzanine with a special ZCU connector and firmware.

Member Function Documentation

◆ capture_ec()

void pflib::zcu::ZCUOptoLink::capture_ec ( int mode,
std::vector< uint8_t > & tx,
std::vector< uint8_t > & rx )
virtual

Implements pflib::OptoLink.

◆ capture_ic()

void pflib::zcu::ZCUOptoLink::capture_ic ( int mode,
std::vector< uint8_t > & tx,
std::vector< uint8_t > & rx )
virtual

Implements pflib::OptoLink.

◆ get_elink_tx_mode()

int pflib::zcu::ZCUOptoLink::get_elink_tx_mode ( int elink)
virtual

there are four TX elinks configured in the coder block

Implements pflib::OptoLink.

◆ get_rx_polarity()

bool pflib::zcu::ZCUOptoLink::get_rx_polarity ( )
virtual

Implements pflib::OptoLink.

◆ get_tx_polarity()

bool pflib::zcu::ZCUOptoLink::get_tx_polarity ( )
virtual

Implements pflib::OptoLink.

◆ ilink()

virtual int pflib::zcu::ZCUOptoLink::ilink ( )
inlinevirtual

which optical link does this represent?

Implements pflib::OptoLink.

◆ is_bidirectional()

virtual bool pflib::zcu::ZCUOptoLink::is_bidirectional ( )
inlinevirtual

is this link bidirectional (e.g. a DAQ lpGBT)

Reimplemented from pflib::OptoLink.

◆ lpgbt_transport()

virtual lpGBT_ConfigTransport & pflib::zcu::ZCUOptoLink::lpgbt_transport ( )
inlinevirtual

Implements pflib::OptoLink.

◆ opto_rates()

std::map< std::string, uint32_t > pflib::zcu::ZCUOptoLink::opto_rates ( )
virtual

Implements pflib::OptoLink.

◆ opto_status()

std::map< std::string, uint32_t > pflib::zcu::ZCUOptoLink::opto_status ( )
virtual

The LINK_ERRORS are not being incremented when a known error is injected, so without a future firmware patch, we are electing to ignore them. retval[prefix + " LINK_ERRORS"] = coder_.read(4 + (ilink_ % 2)) & 0xFFFFFF;

Implements pflib::OptoLink.

◆ reset_link()

void pflib::zcu::ZCUOptoLink::reset_link ( )
virtual

reset a given optical link, may have side-effects

This reset actually affects all links (SFPs) in a block (quad) connected to the ZCU.

The entire quad shares the same reset and status bits.

After BUFFBYPASS_DONE, then we reset the decoder (which depends on the link), IC, and EC (which are for a daq/trg link pair).

Implements pflib::OptoLink.

◆ run_linktrick()

void pflib::zcu::ZCUOptoLink::run_linktrick ( )
virtual

Reimplemented from pflib::OptoLink.

◆ set_elink_tx_mode()

void pflib::zcu::ZCUOptoLink::set_elink_tx_mode ( int elink,
int mode )
virtual

Implements pflib::OptoLink.

◆ set_rx_polarity()

void pflib::zcu::ZCUOptoLink::set_rx_polarity ( bool polarity)
virtual

Implements pflib::OptoLink.

◆ set_tx_polarity()

void pflib::zcu::ZCUOptoLink::set_tx_polarity ( bool polarity)
virtual

Implements pflib::OptoLink.

◆ soft_reset_link()

void pflib::zcu::ZCUOptoLink::soft_reset_link ( )
overridevirtual

soft reset that should not have side-effects

reset the decoder for the current link

Reimplemented from pflib::OptoLink.


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