pflib v2.7.0-1-gd371ab6a
Polarfire Interaction Library
|
WishboneTarget for configuring the elinks. More...
#include <Elinks.h>
Public Member Functions | |
Elinks (WishboneInterface *wb, int target=tgt_Elinks) | |
wrap the wishbone interface and use the tgt_Elinks target | |
int | nlinks () const |
Get the number of links stored in this class. More... | |
void | markActive (int ilink, bool active) |
Mark a specific link as active (or inactive) depending on input. More... | |
bool | isActive (int ilink) const |
Check if a link is active. More... | |
std::vector< uint8_t > | spy (int ilink) |
spy into the passed link More... | |
void | setBitslip (int ilink, int bitslip) |
set the bitslip value for the link More... | |
void | setBitslipAuto (int ilink, bool enable) |
enable auto-setting of bitslip value More... | |
bool | isBitslipAuto (int ilink) |
check if a link is auto-setting the bitslip More... | |
int | getBitslip (int ilink) |
Get the bitslip value for a given link. More... | |
uint32_t | getStatusRaw (int ilink) |
Get the status of the input link. More... | |
void | clearErrorCounters (int ilink) |
Clear the error counters for the input link. More... | |
void | readCounters (int link, uint32_t &nonidles, uint32_t &resyncs) |
Decode the counters for non-idles and resyncs from the status bytes for the input link. More... | |
void | resetHard () |
Hard reset the links. | |
void | setupBigspy (int mode, int ilink, int presamples) |
Prepare for a big spy of the link. More... | |
void | getBigspySetup (int &mode, int &ilink, int &presamples) |
Read the current setup for a bigspy. More... | |
bool | bigspyDone () |
Check if the current bigspy is done. More... | |
std::vector< uint32_t > | bigspy () |
Readout the bigspy and return the data. More... | |
void | scanAlign (int ilink) |
scan the input link attempting to align it More... | |
void | setDelay (int ilink, int idelay) |
Set the delay for the input link. More... | |
Public Member Functions inherited from pflib::WishboneTarget | |
WishboneTarget (WishboneInterface *wb, int target) | |
simply store pointer to interface and target we will interact with | |
int | target_type () |
Get the Wishbone target type/flavor by number. | |
std::string | target_type_str () |
Get the Wishbone target type/flavor by name if known. | |
int | firmware_version () |
Get the subblock firmware version. | |
Private Attributes | |
int | n_links |
number of links available, read from chip | |
std::vector< bool > | m_linksActive |
which links are "active", set by user | |
std::vector< int > | phaseDelay |
UNUSED. | |
Additional Inherited Members | |
Protected Member Functions inherited from pflib::WishboneTarget | |
void | wb_write (uint32_t addr, uint32_t data) |
Write data to an address on the target stored within us. More... | |
uint32_t | wb_read (uint32_t addr) |
Read data from address on the target stored within us. More... | |
void | wb_rmw (uint32_t addr, uint32_t data, uint32_t mask) |
Read the word at the address and then put our data bits into that address using the provided mask. More... | |
Protected Attributes inherited from pflib::WishboneTarget | |
WishboneInterface * | wb_ |
Handle to the interface. | |
int | target_ |
Target id. | |
WishboneTarget for configuring the elinks.
std::vector< uint32_t > pflib::Elinks::bigspy | ( | ) |
Readout the bigspy and return the data.
bool pflib::Elinks::bigspyDone | ( | ) |
Check if the current bigspy is done.
void pflib::Elinks::clearErrorCounters | ( | int | ilink | ) |
Clear the error counters for the input link.
[in] | ilink | link index |
void pflib::Elinks::getBigspySetup | ( | int & | mode, |
int & | ilink, | ||
int & | presamples | ||
) |
Read the current setup for a bigspy.
[out] | mode | type of bigspy to setup |
[out] | ilink | link index |
[out] | presamples | number of presamples |
int pflib::Elinks::getBitslip | ( | int | ilink | ) |
Get the bitslip value for a given link.
[in] | ilink | link index |
uint32_t pflib::Elinks::getStatusRaw | ( | int | ilink | ) |
Get the status of the input link.
[in] | ilink | link index |
|
inline |
Check if a link is active.
[in] | ilink | link index |
bool pflib::Elinks::isBitslipAuto | ( | int | ilink | ) |
check if a link is auto-setting the bitslip
[in] | ilink | link index |
|
inline |
Mark a specific link as active (or inactive) depending on input.
If the passed link index is outside the range of valid links, then this does nothing.
[in] | ilink | link index |
[in] | active | true if link is active |
|
inline |
Get the number of links stored in this class.
This value is read at construction time using the passed WishboneInterface
void pflib::Elinks::readCounters | ( | int | link, |
uint32_t & | nonidles, | ||
uint32_t & | resyncs | ||
) |
Decode the counters for non-idles and resyncs from the status bytes for the input link.
[in] | link | link index |
[out] | nonidles | set to the number of non-idles |
[out] | resyncs | set to the number or resyncs |
void pflib::Elinks::scanAlign | ( | int | ilink | ) |
scan the input link attempting to align it
[in] | ilink | link index |
void pflib::Elinks::setBitslip | ( | int | ilink, |
int | bitslip | ||
) |
set the bitslip value for the link
[in] | ilink | link index |
[in] | bitslip | value for bitslip |
void pflib::Elinks::setBitslipAuto | ( | int | ilink, |
bool | enable | ||
) |
enable auto-setting of bitslip value
This overrides any manual setting of the bitslip value.
[in] | ilink | link index |
[in] | enable | true if you want the auto-setting enabled |
void pflib::Elinks::setDelay | ( | int | ilink, |
int | idelay | ||
) |
Set the delay for the input link.
[in] | ilink | link index |
[in] | idelay | delay to use |
void pflib::Elinks::setupBigspy | ( | int | mode, |
int | ilink, | ||
int | presamples | ||
) |
std::vector< uint8_t > pflib::Elinks::spy | ( | int | ilink | ) |
spy into the passed link
[in] | ilink | link index |