Protocol++® (Protocolpp®)  v5.7.0
InterfacePP::jtestbenchbuf Class Reference
Inheritance diagram for InterfacePP::jtestbenchbuf:
Collaboration diagram for InterfacePP::jtestbenchbuf:

Public Member Functions

 jtestbenchbuf (ProtocolPP::platform_t platform, uint64_t seed, bool use_crypto, int responders, std::shared_ptr< jlogger > &logger, std::shared_ptr< ProtocolPP::jdata > &indata, std::shared_ptr< jring< ringflow >> &fring, std::shared_ptr< jring< ringin >> &iring, std::shared_ptr< jring< ringout >> &oring, std::shared_ptr< ProtocolPP::jbuffer< uint8_t, 256 >> &mem, std::string &burstlen, ProtocolPP::endian_t endianess=ProtocolPP::BIG)
 
virtual ~jtestbenchbuf ()=default
 standard deconstructor
 
std::pair< bool, uintptr_t > get_mem (std::string packet, uint32_t length)
 
void write (uintptr_t address, uint32_t data)
 
void write (uintptr_t address, uint64_t data)
 
void write (std::string packet, uintptr_t bufptr, uint8_t *data, uint32_t length)
 
std::pair< bool, uintptr_t > write (std::string packet, uint8_t *data, uint32_t length)
 
std::pair< bool, uintptr_t > write (std::string packet, uint32_t *data, uint32_t length)
 
uint32_t read (uintptr_t address)
 
void read (uintptr_t address, uint8_t *data, uint32_t length)
 
void read (uintptr_t address, uint32_t *data, uint32_t length)
 
void free (uintptr_t address)
 
 jtestbenchbuf (jtestbenchbuf &rhs)=delete
 
 jtestbenchbuf (const jtestbenchbuf &rhs)=delete
 
- Public Member Functions inherited from InterfacePP::jproducerbuf
 jproducerbuf (ProtocolPP::platform_t platform, uint64_t seed, bool use_crypto, int responders, std::shared_ptr< jlogger > &logger, std::shared_ptr< ProtocolPP::jdata > &indata, std::shared_ptr< jring< ringflow >> &fring, std::shared_ptr< jring< ringin >> &iring, std::shared_ptr< jring< ringout >> &oring, std::shared_ptr< ProtocolPP::jbuffer< uint8_t, 256 >> &mem, std::string &burstlen, ProtocolPP::endian_t endianess=ProtocolPP::BIG)
 
virtual ~jproducerbuf ()=default
 standard deconstructor
 
void setup (ProtocolPP::jstream &stream)
 
bool issue (std::shared_ptr< ProtocolPP::jpacket > &packet)
 
void release (const std::string &stream)
 
int get_mode ()
 
void run ()
 run the testbench and issue packets
 
void process ()
 process the packets, status, post-processing
 
uint32_t get_status (std::string &packet)
 
uint64_t get_field (ProtocolPP::field_t field)
 
 jproducerbuf ()=delete
 don't use these
 
 jproducerbuf (jproducerbuf &rhs)=delete
 
 jproducerbuf (const jproducerbuf &rhs)=delete
 

Additional Inherited Members

- Protected Attributes inherited from InterfacePP::jproducerbuf
std::shared_ptr< ProtocolPP::jbuffer< uint8_t, 256 > > m_memory
 shared buffer memory
 

Constructor & Destructor Documentation

◆ jtestbenchbuf()

InterfacePP::jtestbenchbuf::jtestbenchbuf ( ProtocolPP::platform_t  platform,
uint64_t  seed,
bool  use_crypto,
int  responders,
std::shared_ptr< jlogger > &  logger,
std::shared_ptr< ProtocolPP::jdata > &  indata,
std::shared_ptr< jring< ringflow >> &  fring,
std::shared_ptr< jring< ringin >> &  iring,
std::shared_ptr< jring< ringout >> &  oring,
std::shared_ptr< ProtocolPP::jbuffer< uint8_t, 256 >> &  mem,
std::string &  burstlen,
ProtocolPP::endian_t  endianess = ProtocolPP::BIG 
)

jtestbenchbuf uses protocol++ to drive packets into a ring which can then be read by any device that supports a ring

Parameters
platform- Platform to connect testbench to (W.A.S.P or SEC)
seed- seed for the testbench
use_crypto- use cryptographic quality random numbers
responders- number of responders used
logger- object to print output
indata- JDATA object containing flows and packets
fring- Software ring for the flows
iring- Software ring for the input packets
oring- Software ring for the output packets
mem- shared dynamic memory
burstlen- length of packet burst, can be range (i.e., "1..20") or single value
endianess- Endianess of the platform to support

Member Function Documentation

◆ free()

void InterfacePP::jtestbenchbuf::free ( uintptr_t  address)
virtual

Free buffers in memory

Parameters
address- Address to for linked-list of buffers to free

Implements InterfacePP::jproducerbuf.

◆ get_mem()

std::pair<bool, uintptr_t> InterfacePP::jtestbenchbuf::get_mem ( std::string  packet,
uint32_t  length 
)
virtual

Retrieve pointer to uninitialized memory

Parameters
packet- Name of packet to write data for
length- Length in bytes for memory location
Returns
address to memory

Implements InterfacePP::jproducerbuf.

◆ read() [1/3]

uint32_t InterfacePP::jtestbenchbuf::read ( uintptr_t  address)
virtual

Read function to overload in your testbench

Parameters
address- Address to register
Returns
value of the register

Implements InterfacePP::jproducerbuf.

◆ read() [2/3]

void InterfacePP::jtestbenchbuf::read ( uintptr_t  address,
uint32_t *  data,
uint32_t  length 
)
virtual

Read function to overload in your testbench

Parameters
address- Address to read data from
data- Retrieved data
length- Length of data to read

Implements InterfacePP::jproducerbuf.

◆ read() [3/3]

void InterfacePP::jtestbenchbuf::read ( uintptr_t  address,
uint8_t *  data,
uint32_t  length 
)
virtual

Read function to overload in your testbench

Parameters
address- Address to read data from
data- Retrieved data
length- Length of data to read

Implements InterfacePP::jproducerbuf.

◆ write() [1/5]

std::pair<bool, uintptr_t> InterfacePP::jtestbenchbuf::write ( std::string  packet,
uint32_t *  data,
uint32_t  length 
)
virtual

Write function to overload in your testbench

Parameters
packet- Name of packet to write data for
data- Word oriented data to write
length- length of data to write

Implements InterfacePP::jproducerbuf.

◆ write() [2/5]

std::pair<bool, uintptr_t> InterfacePP::jtestbenchbuf::write ( std::string  packet,
uint8_t *  data,
uint32_t  length 
)
virtual

Write function to overload in your testbench

Parameters
packet- Name of packet to write data for
data- Data to write to memory
length- length of data to write

Implements InterfacePP::jproducerbuf.

◆ write() [3/5]

void InterfacePP::jtestbenchbuf::write ( std::string  packet,
uintptr_t  bufptr,
uint8_t *  data,
uint32_t  length 
)
virtual

Write function to overload in your testbench

Parameters
packet- Name of packet to write data for
bufptr- Pointer to linked buffers
data- Data to write to memory
length- length of data to write

Implements InterfacePP::jproducerbuf.

◆ write() [4/5]

void InterfacePP::jtestbenchbuf::write ( uintptr_t  address,
uint32_t  data 
)
virtual

Write function to overload in your testbench

Parameters
address- Address to write data to
data- Data to write to memory

Implements InterfacePP::jproducerbuf.

◆ write() [5/5]

void InterfacePP::jtestbenchbuf::write ( uintptr_t  address,
uint64_t  data 
)
virtual

Write function to overload in your testbench

Parameters
address- Address to write data to
data- Data to write to memory

Implements InterfacePP::jproducerbuf.


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