cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
test_rx_engine.cpp File Reference

: Testbench for RX Engine (RXe) of the TCP Offload Engine (TOE). More...

#include "test_rx_engine.hpp"
Include dependency graph for test_rx_engine.cpp:

Go to the source code of this file.

Macros

#define THIS_NAME   "TB"
 
#define TRACE_OFF   0x0000
 
#define TRACE_CAM   1 << 1
 
#define TRACE_IPRX   1 << 2
 
#define TRACE_IPTX   1 << 3
 
#define TRACE_MAIN   1 << 4
 
#define TRACE_RXMEM   1 << 5
 
#define TRACE_TAIF   1 << 6
 
#define TRACE_TAr   1 << 7
 
#define TRACE_TAs   1 << 8
 
#define TRACE_Tac   1 << 9
 
#define TRACE_Tae   1 << 10
 
#define TRACE_Tal   1 << 11
 
#define TRACE_TXMEM   1 << 12
 
#define TRACE_ALL   0xFFFF
 
#define DEBUG_LEVEL   (TRACE_OFF)
 

Functions

void stepSim ()
 Increment the simulation counter. More...
 
void increaseSimTime (unsigned int cycles)
 Increase the simulation time of the testbench. More...
 
const char * myCamAccessToString (int initiator)
 Convert an access CAM initiator into a string. More...
 
template<typename T >
int drainMmioDropCounter (stream< T > &ss, string ssName)
 Empty a DropCounter stream and throw it away. More...
 
void pEmulateCam (stream< CamSessionLookupRequest > &siTOE_SssLkpReq, stream< CamSessionLookupReply > &soTOE_SssLkpRep, stream< CamSessionUpdateRequest > &siTOE_SssUpdReq, stream< CamSessionUpdateReply > &soTOE_SssUpdRep)
 Emulate the behavior of the Content Addressable Memory (TOECAM). More...
 
void pEmulateRxBufMem (DummyMemory *memory, int &nrError, stream< DmCmd > &siTOE_RxP_WrCmd, stream< AxisApp > &siTOE_RxP_Data, stream< DmSts > &soTOE_RxP_WrSts, stream< DmCmd > &siTOE_RxP_RdCmd, stream< AxisApp > &soTOE_RxP_Data)
 Emulate the behavior of the Receive DDR4 Buffer Memory (RXMEM). More...
 
void pEmulateTxBufMem (DummyMemory *memory, int &nrError, stream< DmCmd > &siTOE_TxP_WrCmd, stream< AxisApp > &siTOE_TxP_Data, stream< DmSts > &soTOE_TxP_WrSts, stream< DmCmd > &siTOE_TxP_RdCmd, stream< AxisApp > &soTOE_TxP_Data)
 Emulate the behavior of the Transmit DDR4 Buffer Memory (TXMEM). More...
 
bool setGlobalParameters (const char *callerName, unsigned int startupDelay, ifstream &inputFile)
 Parse the input test file and set the global parameters of the TB. More...
 
void cmdSetCommandParser (const char *callerName, vector< string > stringVector)
 Parse and handle a 'COMMAND/SET' request. More...
 
void cmdTestCommandParser (const char *callerName, vector< string > stringVector)
 Parse and handle a 'COMMAND/TEST' request. More...
 
int pIPRX_InjectAckNumber (SimIp4Packet &ipRxPacket, map< SocketPair, TcpAckNum > &sessAckList)
 Take the ACK number of a session and inject it into the sequence number field of the current packet. More...
 
void pIPRX_FeedTOE (deque< SimIp4Packet > &ipRxPacketizer, int &ipRxPktCounter, stream< AxisIp4 > &soTOE_Data, map< SocketPair, TcpAckNum > &sessAckList)
 Feed TOE with an IP packet. More...
 
void pIPRX (ifstream &ifIPRX_Data, ofstream &ofTAIF_Gold, bool &testRxPath, int &ipRxPktCounter, int &tcpBytCntr_IPRX_TOE, deque< SimIp4Packet > &ipRxPacketizer, map< SocketPair, TcpAckNum > &sessAckList, StsBit &piTOE_Ready, stream< AxisIp4 > &soTOE_Data)
 Emulate the behavior of the IP Rx Path (IPRX). More...
 
bool pIPTX_Parse (SimIp4Packet &ipTxPacket, map< SocketPair, TcpAckNum > &sessAckList, deque< SimIp4Packet > &ipRxPacketizer)
 Parse the TCP/IP packets generated by the TOE. More...
 
void pIPTX (StsBit &piTOE_Ready, stream< AxisIp4 > &siTOE_Data, ofstream &ofIPTX_Data1, ofstream &ofIPTX_Data2, map< SocketPair, TcpAckNum > &sessAckList, int &pktCounter_TOE_IPTX, int &tcpBytCntr_TOE_IPTX, deque< SimIp4Packet > &ipRxPacketizer)
 Emulate the behavior of the IP Tx Handler (IPTX). More...
 
bool pTcpAppListen (TcpPort lsnPortNum, set< TcpPort > &openedPorts, stream< TcpAppLsnReq > &soTOE_LsnReq, stream< TcpAppLsnRep > &siTOE_LsnRep)
 TCP Application Listen (Tal). Requests TOE to listen on a new port. More...
 
bool pTcpAppConnect (int &nrError, SocketPair &aSocketPair, map< SocketPair, SessionId > &openSessList, stream< SockAddr > &soTOE_OpnReq, stream< TcpAppOpnRep > &siTOE_OpnRep)
 TCP Application Connect (Tac). Requests TOE to open a new connection to a HOST socket. More...
 
void pTcpAppEcho (int &nrError, ofstream &ofIPTX_Gold2, int &apRxBytCntr, stream< TcpAppData > &soTOE_Data, stream< TcpAppSndReq > &soTOE_SndReq, stream< TcpAppSndRep > &siTOE_SndRep, stream< TcpAppData > &siTAr_Data, stream< TcpAppSndReq > &siTAr_SndReq)
 TCP Application Echo (Tae). Performs an echo loopback between the receive and send parts of the TCP Application. More...
 
void pTAIF_Recv (int &nrError, char &testMode, ofstream &ofTAIF_Data, int &appTxBytCntr, StsBit &piTOE_Ready, stream< TcpAppLsnReq > &soTOE_LsnReq, stream< TcpAppLsnRep > &siTOE_LsnRep, stream< TcpAppNotif > &siTOE_Notif, stream< TcpAppRdReq > &soTOE_DReq, stream< TcpAppData > &siTOE_Data, stream< TcpAppMeta > &siTOE_Meta, stream< TcpAppData > &soTAs_Data, stream< TcpAppSndReq > &soTAs_SndReq)
 TCP Application Receive (TAr). Emulates the Rx process of the TAIF. More...
 
void pTAIF_Send (int &nrError, char &testMode, bool &testTxPath, Ip4Address &toeIpAddress, ifstream &ifTAIF_Data, ofstream &ofIPTX_Gold2, int &apRxBytCntr, StsBit &piTOE_Ready, stream< TcpAppOpnReq > &soTOE_OpnReq, stream< TcpAppOpnRep > &siTOE_OpnRep, stream< TcpAppData > &soTOE_Data, stream< TcpAppSndReq > &soTOE_SndReq, stream< TcpAppSndRep > &siTOE_SndRep, stream< TcpAppClsReq > &soTOE_ClsReq, stream< TcpAppData > &siTAr_Data, stream< TcpAppSndReq > &siTAr_SndReq)
 TCP Application Send (TAs). Emulates the Tx process of the TAIF. More...
 
void pTAIF (bool &testTxPath, char &testMode, int &nrError, Ip4Address &toeIpAddress, ifstream &ifTAIF_Data, ofstream &ofTAIF_Data, ofstream &ofIPTX_Gold2, int &appRxBytCntr, int &appTxBytCntr, StsBit &piTOE_Ready, stream< TcpAppLsnReq > &soTOE_LsnReq, stream< TcpAppLsnRep > &siTOE_LsnRep, stream< TcpAppNotif > &siTOE_Notif, stream< TcpAppRdReq > &soTOE_DReq, stream< TcpAppData > &siTOE_Data, stream< TcpAppMeta > &siTOE_Meta, stream< TcpAppOpnReq > &soTOE_OpnReq, stream< TcpAppOpnRep > &siTOE_OpnRep, stream< TcpAppData > &soTOE_Data, stream< TcpAppSndReq > &soTOE_SndReq, stream< TcpAppSndRep > &siTOE_SndRep, stream< TcpAppClsReq > &soTOE_ClsReq)
 Emulates the behavior of the TCP application interface (TAIF). More...
 
void toe_top_wrap (Ip4Addr piMMIO_IpAddr, stream< StsBit > &soMMIO_RxMemWrErr, stream< ap_uint< 8 > > &soMMIO_NotifDropCnt, stream< ap_uint< 8 > > &soMMIO_MetaDropCnt, stream< ap_uint< 8 > > &soMMIO_DataDropCnt, stream< ap_uint< 8 > > &soMMIO_CrcDropCnt, stream< ap_uint< 8 > > &soMMIO_SessDropCnt, stream< ap_uint< 8 > > &soMMIO_OooDropCnt, StsBit &poNTS_Ready, stream< AxisIp4 > &siIPRX_Data, stream< AxisIp4 > &soIPTX_Data, stream< TcpAppNotif > &soTAIF_Notif, stream< TcpAppRdReq > &siTAIF_DReq, stream< TcpAppData > &soTAIF_Data, stream< TcpAppMeta > &soTAIF_Meta, stream< TcpAppLsnReq > &siTAIF_LsnReq, stream< TcpAppLsnRep > &soTAIF_LsnRep, stream< TcpAppData > &siTAIF_Data, stream< TcpAppSndReq > &siTAIF_SndReq, stream< TcpAppSndRep > &soTAIF_SndRep, stream< TcpAppOpnReq > &siTAIF_OpnReq, stream< TcpAppOpnRep > &soTAIF_OpnRep, stream< TcpAppClsReq > &siTAIF_ClsReq, stream< DmCmd > &soMEM_RxP_RdCmd, stream< AxisApp > &siMEM_RxP_Data, stream< DmSts > &siMEM_RxP_WrSts, stream< DmCmd > &soMEM_RxP_WrCmd, stream< AxisApp > &soMEM_RxP_Data, stream< DmCmd > &soMEM_TxP_RdCmd, stream< AxisApp > &siMEM_TxP_Data, stream< DmSts > &siMEM_TxP_WrSts, stream< DmCmd > &soMEM_TxP_WrCmd, stream< AxisApp > &soMEM_TxP_Data, stream< CamSessionLookupRequest > &soCAM_SssLkpReq, stream< CamSessionLookupReply > &siCAM_SssLkpRep, stream< CamSessionUpdateRequest > &soCAM_SssUpdReq, stream< CamSessionUpdateReply > &siCAM_SssUpdRep, stream< ap_uint< 16 > > &soDBG_SssRelCnt, stream< ap_uint< 16 > > &soDBG_SssRegCnt, stream< RxBufPtr > &soDBG_RxFreeSpace, stream< ap_uint< 32 > > &soDBG_TcpIpRxByteCnt, stream< ap_uint< 8 > > &soDBG_OooDebug)
 A wrapper for the Toplevel of the TCP Offload Engine (TOE). More...
 
int main (int argc, char *argv[])
 Main (does use any param). More...
 

Variables

const char * camAccessorStrings [] = { "RXe", "TAi" }
 

Detailed Description

: Testbench for RX Engine (RXe) of the TCP Offload Engine (TOE).

System: : cloudFPGA Component : NTS, TCP Offload Engine (TOE) Language : Vivado HLS

Definition in file test_rx_engine.cpp.