Protocol++® (Protocolpp®)  v5.7.0
InterfacePP::jproducerbuf Class Referenceabstract
Inheritance diagram for InterfacePP::jproducerbuf:

Public Member Functions

 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
 
virtual std::pair< bool, uintptr_t > get_mem (std::string packet, uint32_t length)=0
 
virtual void write (uintptr_t address, uint32_t data)=0
 
virtual void write (uintptr_t address, uint64_t data)=0
 
virtual void write (std::string packet, uintptr_t bufptr, uint8_t *data, uint32_t length)=0
 
virtual std::pair< bool, uintptr_t > write (std::string packet, uint8_t *data, uint32_t length)=0
 
virtual std::pair< bool, uintptr_t > write (std::string packet, uint32_t *data, uint32_t length)=0
 
virtual uint32_t read (uintptr_t address)=0
 
virtual void read (uintptr_t address, uint8_t *data, uint32_t length)=0
 
virtual void read (uintptr_t address, uint32_t *data, uint32_t length)=0
 
virtual void free (uintptr_t address)=0
 
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
 

Protected Attributes

std::shared_ptr< ProtocolPP::jbuffer< uint8_t, 256 > > m_memory
 shared buffer memory
 

Constructor & Destructor Documentation

◆ jproducerbuf()

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 
)

jproducerbuf 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 buffer memory
burstlen- length of burst, can be range (i.e., "1..20") or single value
endianess- Endianess of the platform to support

Member Function Documentation

◆ free()

virtual void InterfacePP::jproducerbuf::free ( uintptr_t  address)
pure virtual

Free buffers in memory

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

Implemented in InterfacePP::jtestbenchbuf.

◆ get_field()

uint64_t InterfacePP::jproducerbuf::get_field ( ProtocolPP::field_t  field)

retrieve the field

Returns
- value of the field

◆ get_mem()

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

Get a chunk of memory

Parameters
packet- name of the packet to write data for
length- Length of memory in bytes
Returns
address to memory

Implemented in InterfacePP::jtestbenchbuf.

◆ get_mode()

int InterfacePP::jproducerbuf::get_mode ( )
Returns
- current mode of operation

◆ get_status()

uint32_t InterfacePP::jproducerbuf::get_status ( std::string &  packet)

retrieve the status word

Returns
- status of the indicated packet

◆ issue()

bool InterfacePP::jproducerbuf::issue ( std::shared_ptr< ProtocolPP::jpacket > &  packet)

Issues the packet into the testbench or system must be overloaded in user's code

Parameters
packet- packet to process
See also
jpacket

◆ read() [1/3]

virtual uint32_t InterfacePP::jproducerbuf::read ( uintptr_t  address)
pure virtual

Read function to overload in your testbench

Parameters
address- Address to register
Returns
value of the register

Implemented in InterfacePP::jtestbenchbuf.

◆ read() [2/3]

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

Read function to overload in your testbench

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

Implemented in InterfacePP::jtestbenchbuf.

◆ read() [3/3]

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

Read function to overload in your testbench

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

Implemented in InterfacePP::jtestbenchbuf.

◆ release()

void InterfacePP::jproducerbuf::release ( const std::string &  stream)

Stream is done, release the stream and deallocate

Parameters
stream- name of the stream to releasae

◆ setup()

void InterfacePP::jproducerbuf::setup ( ProtocolPP::jstream stream)

Setup the stream to process descriptors. Using the security association, program your device to process the flow of packets The security association is accessed as a VOID pointer and must be recast to the correct association type based on the TYPE field in the JSTREAM object

Parameters
stream- Stream object to setup
See also
jstream

◆ write() [1/5]

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

Write function to overload in your testbench

Parameters
packet- name of the packet to write data for
data- Word oriented data to write
length- length of data to write
Returns
address - Address data written to

Implemented in InterfacePP::jtestbenchbuf.

◆ write() [2/5]

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

Write function to overload in your testbench

Parameters
packet- name of the packet to write data for
data- Data to write to memory
length- length of data to write
Returns
address - Address data written to

Implemented in InterfacePP::jtestbenchbuf.

◆ write() [3/5]

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

Write function to overload in your testbench

Parameters
packet- name of the packet to write data for
bufptr- Pointer to linked buffers
data- Data to write to memory
length- length of data to write
Returns
address - Address data written to

Implemented in InterfacePP::jtestbenchbuf.

◆ write() [4/5]

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

Write function to overload in your testbench

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

Implemented in InterfacePP::jtestbenchbuf.

◆ write() [5/5]

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

Write function to overload in your testbench

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

Implemented in InterfacePP::jtestbenchbuf.


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