17#ifndef __ROGUE_UTILITIES_PRBS_H__
18#define __ROGUE_UTILITIES_PRBS_H__
50 static const uint32_t MaxBytes = 64;
113 uint32_t lastRxCount_;
114 uint64_t lastRxBytes_;
115 struct timeval lastRxTime_;
119 uint32_t lastTxCount_;
120 uint64_t lastTxBytes_;
121 struct timeval lastTxTime_;
126 std::shared_ptr<rogue::Logging> rxLog_;
127 std::shared_ptr<rogue::Logging> txLog_;
130 std::thread* txThread_;
134 void flfsr(uint8_t* data);
139 static double updateTime(
struct timeval* last);
152 static std::shared_ptr<rogue::utilities::Prbs>
create();
180 void setTaps(uint32_t tapCnt, uint8_t* taps);
211 void enable(uint32_t size);
324 void acceptFrame(std::shared_ptr<rogue::interfaces::stream::Frame> frame);
328typedef std::shared_ptr<rogue::utilities::Prbs>
PrbsPtr;
Stream slave endpoint and default frame pool.
PRBS generator/checker that can act as both stream master and slave.
void resetCount()
Resets RX/TX counters and statistics.
uint64_t getTxBytes()
Returns TX byte count.
void enable(uint32_t size)
Enables periodic background frame generation.
void checkPayload(bool state)
Enables or disables payload checking.
uint32_t getTxCount()
Returns TX frame count.
void setTaps(uint32_t tapCnt, uint8_t *taps)
Configures LFSR taps.
void setTxPeriod(uint32_t txPeriod)
Sets background TX period.
uint32_t getRxCount()
Returns RX frame count.
double getRxBw()
Returns computed RX bandwidth.
Prbs()
Constructs a PRBS instance with default taps and width.
uint32_t getTxErrors()
Returns TX error count.
uint32_t getTxPeriod()
Returns configured background TX period.
uint64_t getRxBytes()
Returns RX byte count.
double getTxRate()
Returns computed TX frame rate.
void acceptFrame(std::shared_ptr< rogue::interfaces::stream::Frame > frame)
Accepts a frame from an upstream master.
void genFrame(uint32_t size)
Generates and transmits one PRBS frame.
void disable()
Disables periodic background frame generation.
void sendCount(bool state)
Enables or disables transmission of sequence counters in payload.
bool getRxEnable()
Returns whether RX checking is enabled.
static std::shared_ptr< rogue::utilities::Prbs > create()
Creates a PRBS generator/checker instance.
uint32_t getRxErrors()
Returns RX error count.
static void setup_python()
Registers Python bindings for this class.
void genPayload(bool state)
Enables or disables payload generation.
double getTxBw()
Returns computed TX bandwidth.
void setWidth(uint32_t width)
Sets generator/checker data width.
void setTapsPy(boost::python::object p)
Configures LFSR taps from a Python sequence.
void setRxEnable(bool state)
Enables or disables RX checking.
double getRxRate()
Returns computed RX frame rate.
~Prbs()
Destroys the PRBS instance and stops background generation.
std::shared_ptr< rogue::utilities::Prbs > PrbsPtr