cloudFPGA (cF) API
1.0
The documentation of the source code of cloudFPGA (cF)
|
Testbench for the UDP Offload Engine (UOE) of the Network Transport Stack (NTS). More...
Macros | |
#define | THIS_NAME "TB" |
#define | TRACE_OFF 0x0000 |
#define | TRACE_CGRF 1 << 1 |
#define | TRACE_CGTF 1 << 2 |
#define | TRACE_DUMTF 1 << 3 |
#define | TRACE_ALL 0xFFFF |
#define | DEBUG_LEVEL (TRACE_OFF) |
#define | TB_MAX_SIM_CYCLES 250000 |
#define | TB_STARTUP_DELAY 0 |
#define | TB_GRACE_TIME 1000 |
Enumerations | |
enum | TestMode { RX_MODE ='0' , TX_DGRM_MODE ='1' , TX_STRM_MODE ='2' , OPEN_MODE ='3' , BIDIR_MODE ='4' , ECHO_MODE ='5' , SPARE_MODE ='6' , DROP_MODE ='7' } |
Functions | |
void | stepSim () |
Increment the simulation counter. More... | |
bool | drainUdpMetaStreamToFile (stream< UdpAppMeta > &ss, string ssName, string datFile, int &nrChunks, int &nrFrames, int &nrBytes) |
Empty an UdpMeta stream to a DAT file. More... | |
bool | drainUdpDLenStreamToFile (stream< UdpAppDLen > &ss, string ssName, string datFile, int &nrChunks, int &nrFrames, int &nrBytes) |
Empty an UdpDLen stream to a DAT file. More... | |
bool | drainMmioDropCounter (stream< ap_uint< 16 > > &ss, string ssName) |
Empty the DropCounter stream and throw it away. More... | |
int | createUdpTxTraffic (stream< AxisApp > &ssData, const string ssDataName, stream< UdpAppMeta > &ssMeta, const string ssMetaName, stream< UdpAppDLen > &ssDLen, const string ssDLenName, string datFile, queue< UdpAppMeta > &metaQueue, queue< UdpAppDLen > &dlenQueue, int &nrFeededChunks) |
Create the UDP Tx traffic as streams from an input test file. More... | |
bool | readDatagramFromFile (const char *myName, SimUdpDatagram &appDatagram, ifstream &ifsData, UdpAppMeta &udpAppMeta, queue< UdpAppMeta > &udpMetaQueue, queue< UdpAppDLen > &updDLenQueue, int &inpChunks, int &inpDgrms, int &inpBytes, char tbMode) |
Read a datagram from a DAT file. More... | |
int | createGoldenTxFiles (string inpData_FileName, string outData_GoldName, queue< UdpAppMeta > &udpMetaQueue, queue< UdpAppDLen > &updDLenQueue, char tbMode) |
Create the golden IPTX reference file from an input UAIF test file. More... | |
int | createGoldenRxFiles (string inpData_FileName, string outData_GoldName, string outMeta_GoldName, string outDLen_GoldName, set< UdpPort > &udpPorts) |
Create the golden Rx APP reference files from an input IPRX test file. More... | |
void | uoe_top_wrap (CmdBit piMMIO_En, stream< ap_uint< 16 > > &soMMIO_DropCnt, stream< StsBool > &soMMIO_Ready, stream< AxisIp4 > &siIPRX_Data, stream< AxisIp4 > &soIPTX_Data, stream< UdpAppLsnReq > &siUAIF_LsnReq, stream< UdpAppLsnRep > &soUAIF_LsnRep, stream< UdpAppClsReq > &siUAIF_ClsReq, stream< UdpAppClsRep > &soUAIF_ClsRep, stream< UdpAppData > &soUAIF_Data, stream< UdpAppMeta > &soUAIF_Meta, stream< UdpAppDLen > &soUAIF_DLen, stream< UdpAppData > &siUAIF_Data, stream< UdpAppMeta > &siUAIF_Meta, stream< UdpAppDLen > &siUAIF_DLen, stream< AxisIcmp > &soICMP_Data) |
A wrapper for the Toplevel of the UDP Offload Engine (UOE) More... | |
int | main (int argc, char *argv[]) |
Main function. More... | |
Variables | |
bool | gTraceEvent = false |
bool | gFatalError = false |
unsigned int | gSimCycCnt = 0 |
unsigned int | gMaxSimCycles = 0 + 250000 |
Testbench for the UDP Offload Engine (UOE) of the Network Transport Stack (NTS).
#define DEBUG_LEVEL (TRACE_OFF) |
Definition at line 46 of file test_uoe.cpp.
#define TB_GRACE_TIME 1000 |
Definition at line 47 of file test_uoe.hpp.
#define TB_MAX_SIM_CYCLES 250000 |
Definition at line 45 of file test_uoe.hpp.
#define TB_STARTUP_DELAY 0 |
Definition at line 46 of file test_uoe.hpp.
#define THIS_NAME "TB" |
Definition at line 39 of file test_uoe.cpp.
#define TRACE_ALL 0xFFFF |
Definition at line 45 of file test_uoe.cpp.
#define TRACE_CGRF 1 << 1 |
Definition at line 42 of file test_uoe.cpp.
#define TRACE_CGTF 1 << 2 |
Definition at line 43 of file test_uoe.cpp.
#define TRACE_DUMTF 1 << 3 |
Definition at line 44 of file test_uoe.cpp.
#define TRACE_OFF 0x0000 |
Definition at line 41 of file test_uoe.cpp.
enum TestMode |
Enumerator | |
---|---|
RX_MODE | |
TX_DGRM_MODE | |
TX_STRM_MODE | |
OPEN_MODE | |
BIDIR_MODE | |
ECHO_MODE | |
SPARE_MODE | |
DROP_MODE |
Definition at line 62 of file test_uoe.hpp.
int createGoldenRxFiles | ( | string | inpData_FileName, |
string | outData_GoldName, | ||
string | outMeta_GoldName, | ||
string | outDLen_GoldName, | ||
set< UdpPort > & | udpPorts | ||
) |
Create the golden Rx APP reference files from an input IPRX test file.
[in] | inpData_FileName | The input data file to generate from. |
[in] | outData_GoldName | The output data gold file to create. |
[in] | outMeta_GoldName | The output meta gold file to create. |
[in] | outDLen_GoldName | The output dlen gold file to create. |
[out] | udpPortSet | A ref to an associative container which holds the UDP destination ports. |
Definition at line 516 of file test_uoe.cpp.
int createGoldenTxFiles | ( | string | inpData_FileName, |
string | outData_GoldName, | ||
queue< UdpAppMeta > & | udpMetaQueue, | ||
queue< UdpAppDLen > & | updDLenQueue, | ||
char | tbMode | ||
) |
Create the golden IPTX reference file from an input UAIF test file.
[in] | inpData_FileName | The input data file to generate from. |
[in] | outData_GoldName | The output data gold file to create. |
[out] | udpMetaQueue | A ref to a container queue which holds a sequence of UDP socket-pairs. |
[out] | udpDLenQueue | A ref to a container queue which holds a sequence of UDP data packet lengths. |
[in] | tbMode | The TB testing mode. |
Definition at line 381 of file test_uoe.cpp.
int createUdpTxTraffic | ( | stream< AxisApp > & | ssData, |
const string | ssDataName, | ||
stream< UdpAppMeta > & | ssMeta, | ||
const string | ssMetaName, | ||
stream< UdpAppDLen > & | ssDLen, | ||
const string | ssDLenName, | ||
string | datFile, | ||
queue< UdpAppMeta > & | metaQueue, | ||
queue< UdpAppDLen > & | dlenQueue, | ||
int & | nrFeededChunks | ||
) |
Create the UDP Tx traffic as streams from an input test file.
[in/out] | ssData A ref to the data stream to set. | |
[in] | ssDataName | The name of the data stream to set. |
[in/out] | ssMeta A ref to the metadata stream to set. | |
[in] | ssMetaName | The name of the metadata stream to set. |
[in/out] | ssDLen A ref to the data-length stream to set. | |
[in] | ssDLenName | The name of the datalength stream to set. |
[in] | datFileName | The path to the DAT file to read from. |
[in] | metaQueue | A ref to a queue of metadata. |
[in] | dlenQueue | A ref to a queue of data-lengths. |
[out] | nrChunks | A ref to the number of feeded chunks. |
Definition at line 235 of file test_uoe.cpp.
bool drainMmioDropCounter | ( | stream< ap_uint< 16 > > & | ss, |
string | ssName | ||
) |
Empty the DropCounter stream and throw it away.
[in/out] | ss A ref to the stream to drain. | |
[in] | ssName | The name of the stream to drain. |
Definition at line 201 of file test_uoe.cpp.
bool drainUdpDLenStreamToFile | ( | stream< UdpAppDLen > & | ss, |
string | ssName, | ||
string | datFile, | ||
int & | nrChunks, | ||
int & | nrFrames, | ||
int & | nrBytes | ||
) |
Empty an UdpDLen stream to a DAT file.
[in/out] | ss A ref to the UDP data length stream to drain. | |
[in] | ssName | The name of the UDP metadata stream to drain. |
[in] | fileName | The DAT file to write to. |
[out | nrChunks A ref to the number of written chunks. | |
[out] | nrFrames | A ref to the number of written AXI4 streams. |
[out] | nrBytes | A ref to the number of written bytes. |
Definition at line 142 of file test_uoe.cpp.
bool drainUdpMetaStreamToFile | ( | stream< UdpAppMeta > & | ss, |
string | ssName, | ||
string | datFile, | ||
int & | nrChunks, | ||
int & | nrFrames, | ||
int & | nrBytes | ||
) |
Empty an UdpMeta stream to a DAT file.
[in/out] | ss A ref to the UDP metadata stream to drain. | |
[in] | ssName | The name of the UDP metadata stream to drain. |
[in] | fileName | The DAT file to write to. |
[out | nrChunks A ref to the number of written chunks. | |
[out] | nrFrames | A ref to the number of written AXI4 streams. |
[out] | nrBytes | A ref to the number of written bytes. |
Definition at line 74 of file test_uoe.cpp.
int main | ( | int | argc, |
char * | argv[] | ||
) |
Main function.
[in] | mode | The test mode (RX_MODE='0', TX_DGRM_MODE='1', TX_STRM_MODE='2', OPEN_MODE='3', BIDIR_MODE='4', ECHO_MODE='5') |
[in] | inpFile1 | The pathname of the 1st input test vector file. |
[in] | inpFile2 | The pathname of the 2nd input test vector file. |
Definition at line 793 of file test_uoe.cpp.
bool readDatagramFromFile | ( | const char * | myName, |
SimUdpDatagram & | appDatagram, | ||
ifstream & | ifsData, | ||
UdpAppMeta & | udpAppMeta, | ||
queue< UdpAppMeta > & | udpMetaQueue, | ||
queue< UdpAppDLen > & | updDLenQueue, | ||
int & | inpChunks, | ||
int & | inpDgrms, | ||
int & | inpBytes, | ||
char | tbMode | ||
) |
Read a datagram from a DAT file.
[in] | myName | The name of the caller process. |
[in] | appDatagram | A reference to the datagram to read. |
[in] | ifsData | The input file stream to read from. |
[in] | udpAppMeta | A ref to the current active socket pair. |
[out] | udpMetaQueue | A ref to a container queue which holds a sequence of UDP socket-pairs. |
[out] | udpDLenQueue | A ref to a container queue which holds a sequence of UDP data packet lengths. |
[out] | inpChunks | A ref to the number of processed chunks. |
[out] | inptDgrms | A ref to the number of processed datagrams. |
[out] | inpBytes | A ref to the number of processed bytes. |
[in] | tbMode | The TB testing mode. |
Definition at line 297 of file test_uoe.cpp.
void stepSim | ( | ) |
Increment the simulation counter.
Definition at line 51 of file test_uoe.cpp.
void uoe_top_wrap | ( | CmdBit | piMMIO_En, |
stream< ap_uint< 16 > > & | soMMIO_DropCnt, | ||
stream< StsBool > & | soMMIO_Ready, | ||
stream< AxisIp4 > & | siIPRX_Data, | ||
stream< AxisIp4 > & | soIPTX_Data, | ||
stream< UdpAppLsnReq > & | siUAIF_LsnReq, | ||
stream< UdpAppLsnRep > & | soUAIF_LsnRep, | ||
stream< UdpAppClsReq > & | siUAIF_ClsReq, | ||
stream< UdpAppClsRep > & | soUAIF_ClsRep, | ||
stream< UdpAppData > & | soUAIF_Data, | ||
stream< UdpAppMeta > & | soUAIF_Meta, | ||
stream< UdpAppDLen > & | soUAIF_DLen, | ||
stream< UdpAppData > & | siUAIF_Data, | ||
stream< UdpAppMeta > & | siUAIF_Meta, | ||
stream< UdpAppDLen > & | siUAIF_DLen, | ||
stream< AxisIcmp > & | soICMP_Data | ||
) |
A wrapper for the Toplevel of the UDP Offload Engine (UOE)
[in] | piMMIO_En | Enable signal from [SHELL/MMIO]. |
[out] | poMMIO_DropCnt | Rx drop counter to [SHELL/MMIO]. |
[out] | soMMIO_Ready | UOE ready stream to [SHELL/MMIO]. |
[in] | siIPRX_Data | IP4 data stream from IpRxHAndler (IPRX). |
[out] | soIPTX_Data | IP4 data stream to IpTxHandler (IPTX). |
[in] | siUAIF_LsnReq | UDP open port request from UdpAppInterface (UAIF). |
[out] | soUAIF_LsnRep | UDP open port reply to UAIF. |
[in] | siUAIF_ClsReq | UDP close port request from [UAIF]. |
[out] | soUAIF_ClsRep | UDP close port reply to UAIF. |
[out] | soUAIF_Data | UDP data stream to [UAIF]. |
[out] | soUAIF_Meta | UDP metadata stream to [UAIF]. |
[in] | siUAIF_Data | UDP data stream from [UAIF]. |
[in] | siUAIF_Meta | UDP metadata stream from [UAIF]. |
[in] | siUAIF_DLen | UDP data length form [UAIF]. |
[out] | soICMP_Data | Data stream to [ICMP]. |
This process is a wrapper for the 'uoe_top' entity. It instantiates such an entity and further connects it with base 'AxisRaw' streams as expected by the 'uoe_top'.
Definition at line 710 of file test_uoe.cpp.
bool gFatalError = false |
Definition at line 55 of file test_uoe.hpp.
unsigned int gMaxSimCycles = 0 + 250000 |
Definition at line 57 of file test_uoe.hpp.
unsigned int gSimCycCnt = 0 |
GLOBAL VARIABLES USED BY THE SIMULATION ENVIRONMENT
Definition at line 56 of file test_uoe.hpp.
bool gTraceEvent = false |
HELPERS FOR THE DEBUGGING TRACES .e.g: DEBUG_LEVEL = (MDL_TRACE | IPS_TRACE)
Definition at line 54 of file test_uoe.hpp.