cloudFPGA (cF) API
1.0
The documentation of the source code of cloudFPGA (cF)
|
This module handles the control flow interface between the SHELL and the ROLE. More...
Files | |
file | tcp_shell_if.cpp |
: TCP Shell Interface (TSIF) | |
file | tcp_shell_if.hpp |
: TCP Shell Interface (TSIF) | |
file | tcp_shell_if_top.cpp |
: Top level with I/O ports for TCP Shell Interface (TSIF) | |
file | tcp_shell_if_top.hpp |
: Top of TCP Shell Interface (TSIF) | |
file | simu_tcp_shell_if_env.cpp |
: Simulation environment for the TCP Shell Interface (TSIF). | |
file | simu_tcp_shell_if_env.hpp |
: Simulation environment for the TCP Shell Interface (TSIF). | |
file | test_tcp_shell_if.cpp |
: Testbench for the TCP Shell Interface (TSIF). | |
file | test_tcp_shell_if.hpp |
: Testbench for the TCP Shell Interface (TSIF). | |
file | test_tcp_shell_if_top.cpp |
: Testbench for the toplevel of the TCP Shell Interface (TSIF). | |
file | test_tcp_shell_if_top.hpp |
: Testbench for the toplevel of TCP Shell Interface (TSIF). | |
Classes | |
class | ForwardCmd |
class | InterruptEntry |
class | InterruptQuery |
Macros | |
#define | THIS_NAME "TSIF" |
#define | TRACE_OFF 0x0000 |
#define | TRACE_IRB 1 << 1 |
#define | TRACE_RDP 1 << 2 |
#define | TRACE_WRP 1 << 3 |
#define | TRACE_LSN 1 << 4 |
#define | TRACE_CON 1 << 5 |
#define | TRACE_RNH 1 << 6 |
#define | TRACE_RRH 1 << 7 |
#define | TRACE_RRM 1 << 8 |
#define | TRACE_ALL 0xFFFF |
#define | DEBUG_LEVEL (TRACE_OFF) |
#define | RECV_MODE_LSN_PORT 8800 |
#define | XMIT_MODE_LSN_PORT 8801 |
#define | ECHO_MOD2_LSN_PORT 8802 |
#define | ECHO_MODE_LSN_PORT 8803 |
#define | IPERF_LSN_PORT 5001 |
#define | IPREF3_LSN_PORT 5201 |
#define | FIXME_DEFAULT_HOST_IP4_ADDR 0x0A0CC832 |
#define | FIXME_DEFAULT_HOST_LSN_PORT 8803+0x8000 |
#define | GEN_CHK0 0x48692066726f6d20 |
#define | GEN_CHK1 0x464d4b553630210a |
#define | THIS_NAME "SIM" |
#define | TRACE_OFF 0x0000 |
#define | TRACE_TOE 1 << 1 |
#define | TRACE_TOE_LSN 1 << 2 |
#define | TRACE_TOE_OPN 1 << 3 |
#define | TRACE_TOE_RXP 1 << 4 |
#define | TRACE_TOE_TXP 1 << 5 |
#define | TRACE_TAF 1 << 6 |
#define | TRACE_MMIO 1 << 7 |
#define | TRACE_DDSK 1 << 8 |
#define | TRACE_DDSP 1 << 9 |
#define | TRACE_ALL 0xFFFF |
#define | DEBUG_LEVEL (TRACE_OFF) |
#define | DEFAULT_FPGA_IP4_ADDR 0x0A0CC801 |
#define | DEFAULT_FPGA_LSN_PORT 0x0057 |
#define | DEFAULT_HOST_IP4_ADDR 0x0A0CC832 |
#define | DEFAULT_HOST_TCP_SRC_PORT 0x80 |
#define | DEFAULT_SESSION_ID 0 |
#define | DEFAULT_SESSION_LEN 32 |
#define | THIS_NAME "TB_TSIF" |
#define | TRACE_OFF 0x0000 |
#define | TRACE_DDC 1 << 1 |
#define | TRACE_ALL 0xFFFF |
#define | DEBUG_LEVEL (TRACE_OFF | TRACE_DDC) |
#define | THIS_NAME "TB_TSIF_TOP" |
#define | TRACE_OFF 0x0000 |
#define | TRACE_DDC 1 << 1 |
#define | TRACE_ALL 0xFFFF |
#define | DEBUG_LEVEL (TRACE_OFF) |
Enumerations | |
enum | DropCode { NOP =0 , GEN } |
enum | QueryCmd { GET =0 , PUT , POST } |
Functions | |
template<class Type > | |
void | pStreamDataMover (stream< Type > &si, stream< Type > &so) |
Stream Data Mover - Moves data chunks from incoming stream to outgoing stream with blocking read and write access methods. More... | |
void | pConnect (CmdBit *piSHL_Enable, stream< SockAddr > &siRDp_OpnSockReq, stream< Ly4Len > &siRDp_TxCountReq, stream< Ly4Len > &soWRp_TxBytesReq, stream< SessionId > &soWRp_TxSessId, stream< TcpAppOpnReq > &soSHL_OpnReq, stream< TcpAppOpnRep > &siSHL_OpnRep, stream< TcpAppClsReq > &soSHL_ClsReq) |
Connect (COn). More... | |
void | pListen (CmdBit *piSHL_Enable, stream< TcpAppLsnReq > &soSHL_LsnReq, stream< TcpAppLsnRep > &siSHL_LsnRep) |
Listen(LSn) More... | |
void | pInputReadBuffer (CmdBit *piSHL_Enable, stream< TcpAppData > &siSHL_Data, stream< TcpAppMeta > &siSHL_Meta, stream< TcpAppData > &soRDp_Data, stream< TcpAppMeta > &soRDp_Meta) |
Input Read Buffer (IRb) More... | |
void | pReadNotificationHandler (CmdBit *piSHL_Enable, stream< TcpAppNotif > &siSHL_Notif, stream< TcpAppNotif > &soRRh_Notif) |
Read Notification Handler (RNh) More... | |
void | pReadRequestHandler (CmdBit *piSHL_Enable, stream< TcpAppNotif > &siRNh_Notif, stream< SigBit > &siRDp_DequSig, stream< TcpAppRdReq > &soRRm_DReq, stream< ForwardCmd > &soRDp_FwdCmd, stream< ap_uint< 16 > > &soDBG_freeSpace) |
Read Request Handler (RRh) More... | |
void | pReadRequestMover (CmdBit *piSHL_Enable, stream< TcpAppRdReq > &siRRh_DReq, stream< TcpAppRdReq > &soSHL_DReq) |
Read Request Mover (RRm) More... | |
void | pReadPath (CmdBit *piSHL_Enable, stream< TcpAppData > &siSHL_Data, stream< TcpAppMeta > &siSHL_Meta, stream< ForwardCmd > &siRRh_FwdCmd, stream< SockAddr > &soCOn_OpnSockReq, stream< TcpDatLen > &soCOn_TxCountReq, stream< SigBit > &soRRh_DequSig, stream< TcpAppData > &soTAF_Data, stream< TcpSessId > &soTAF_SessId, stream< TcpDatLen > &soTAF_DatLen, stream< ap_uint< 32 > > &soDBG_SinkCount) |
Read Path (RDp) More... | |
void | pWritePath (CmdBit *piSHL_Enable, stream< TcpAppData > &siTAF_Data, stream< TcpSessId > &siTAF_SessId, stream< TcpDatLen > &siTAF_DatLen, stream< TcpDatLen > &siCOn_TxBytesReq, stream< SessionId > &siCOn_TxSessId, stream< TcpAppData > &soSHL_Data, stream< TcpAppSndReq > &soSHL_SndReq, stream< TcpAppSndRep > &siSHL_SndRep) |
Write Path (WRp) More... | |
void | tcp_shell_if (CmdBit *piSHL_Mmio_En, stream< TcpAppData > &siTAF_Data, stream< TcpSessId > &siTAF_SessId, stream< TcpDatLen > &siTAF_DatLen, stream< TcpAppData > &soTAF_Data, stream< TcpSessId > &soTAF_SessId, stream< TcpDatLen > &soTAF_DatLen, stream< TcpAppNotif > &siSHL_Notif, stream< TcpAppRdReq > &soSHL_DReq, stream< TcpAppData > &siSHL_Data, stream< TcpAppMeta > &siSHL_Meta, stream< TcpAppLsnReq > &soSHL_LsnReq, stream< TcpAppLsnRep > &siSHL_LsnRep, stream< TcpAppData > &soSHL_Data, stream< TcpAppSndReq > &soSHL_SndReq, stream< TcpAppSndRep > &siSHL_SndRep, stream< TcpAppOpnReq > &soSHL_OpnReq, stream< TcpAppOpnRep > &siSHL_OpnRep, stream< TcpAppClsReq > &soSHL_ClsReq, stream< ap_uint< 32 > > &soDBG_SinkCnt, stream< ap_uint< 16 > > &soDBG_InpBufSpace) |
TCP Shell Interface (TSIF) More... | |
void | tcp_shell_if_top (CmdBit *piSHL_Mmio_En, stream< TcpAppData > &siTAF_Data, stream< TcpSessId > &siTAF_SessId, stream< TcpDatLen > &siTAF_DatLen, stream< TcpAppData > &soTAF_Data, stream< TcpSessId > &soTAF_SessId, stream< TcpDatLen > &soTAF_DatLen, stream< TcpAppNotif > &siSHL_Notif, stream< TcpAppRdReq > &soSHL_DReq, stream< TcpAppData > &siSHL_Data, stream< TcpAppMeta > &siSHL_Meta, stream< TcpAppLsnReq > &soSHL_LsnReq, stream< TcpAppLsnRep > &siSHL_LsnRep, stream< TcpAppData > &soSHL_Data, stream< TcpAppSndReq > &soSHL_SndReq, stream< TcpAppSndRep > &siSHL_SndRep, stream< TcpAppOpnReq > &soSHL_OpnReq, stream< TcpAppOpnRep > &siSHL_OpnRep, stream< TcpAppClsReq > &soSHL_ClsReq, stream< ap_uint< 32 > > &soDBG_SinkCnt, stream< ap_uint< 16 > > &soDBG_InpBufSpace) |
Top of TCP Shell Interface (TSIF) More... | |
void | stepSim () |
Increment the simulation counter. More... | |
void | increaseSimTime (unsigned int cycles) |
Increase the simulation time of the testbench. More... | |
bool | drainDebugSinkCounter (stream< ap_uint< 32 > > &ss, string ssName) |
Empty the DebugSinkCounter stream and throw it away. More... | |
bool | drainDebugSpaceCounter (stream< ap_uint< 16 > > &ss, string ssName) |
Empty the DebugSpaceCounter stream and check its last value. More... | |
void | pTAF (ofstream &ofTAF_Data, stream< TcpAppData > &siTSIF_Data, stream< TcpSessId > &siTSIF_SessId, stream< TcpDatLen > &siTSIF_DatLen, stream< TcpAppData > &soTSIF_Data, stream< TcpSessId > &soTSIF_Meta, stream< TcpSessId > &soTSIF_DLen) |
Emulate the behavior of the ROLE/TcpAppFlash (TAF). More... | |
void | pMMIO (StsBit *piSHL_Ready, CmdBit *poTSIF_Enable) |
Emulate the behavior of the SHELL & MMIO. More... | |
void | pTOE (int &nrErr, ofstream &ofTAF_Gold, ofstream &ofTOE_Gold, ofstream &ofTOE_Data, TcpDatLen echoDatLen, SockAddr testSock, TcpDatLen testDatLen, StsBit *poMMIO_Ready, stream< TcpAppNotif > &soTSIF_Notif, stream< TcpAppRdReq > &siTSIF_DReq, stream< TcpAppData > &soTSIF_Data, stream< TcpAppMeta > &soTSIF_Meta, stream< TcpAppLsnReq > &siTSIF_LsnReq, stream< TcpAppLsnRep > &soTSIF_LsnRep, stream< TcpAppData > &siTSIF_Data, stream< TcpAppSndReq > &siTSIF_SndReq, stream< TcpAppSndRep > &soTSIF_SndRep, stream< TcpAppOpnReq > &siTSIF_OpnReq, stream< TcpAppOpnRep > &soTSIF_OpnRep) |
Emulate behavior of the SHELL/NTS/TCP Offload Engine (TOE). More... | |
template<typename T > | |
bool | drainDebugCounter (stream< T > &ss, string ssName) |
Empty a debug stream and throw it away. More... | |
int | main (int argc, char *argv[]) |
Main function for the test of the TCP Shell Interface (TSIF). More... | |
This module handles the control flow interface between the SHELL and the ROLE.
#define DEBUG_LEVEL (TRACE_OFF) |
Definition at line 81 of file tcp_shell_if.cpp.
#define DEBUG_LEVEL (TRACE_OFF) |
Definition at line 73 of file simu_tcp_shell_if_env.cpp.
Definition at line 61 of file test_tcp_shell_if.cpp.
#define DEBUG_LEVEL (TRACE_OFF) |
Definition at line 62 of file test_tcp_shell_if_top.cpp.
#define DEFAULT_FPGA_IP4_ADDR 0x0A0CC801 |
Definition at line 61 of file simu_tcp_shell_if_env.hpp.
#define DEFAULT_FPGA_LSN_PORT 0x0057 |
Definition at line 62 of file simu_tcp_shell_if_env.hpp.
#define DEFAULT_HOST_IP4_ADDR 0x0A0CC832 |
Definition at line 63 of file simu_tcp_shell_if_env.hpp.
#define DEFAULT_HOST_TCP_SRC_PORT 0x80 |
Definition at line 64 of file simu_tcp_shell_if_env.hpp.
#define DEFAULT_SESSION_ID 0 |
Definition at line 66 of file simu_tcp_shell_if_env.hpp.
#define DEFAULT_SESSION_LEN 32 |
Definition at line 67 of file simu_tcp_shell_if_env.hpp.
#define ECHO_MOD2_LSN_PORT 8802 |
Definition at line 87 of file tcp_shell_if.hpp.
#define ECHO_MODE_LSN_PORT 8803 |
Definition at line 88 of file tcp_shell_if.hpp.
#define FIXME_DEFAULT_HOST_IP4_ADDR 0x0A0CC832 |
Definition at line 92 of file tcp_shell_if.hpp.
#define FIXME_DEFAULT_HOST_LSN_PORT 8803+0x8000 |
Definition at line 93 of file tcp_shell_if.hpp.
#define GEN_CHK0 0x48692066726f6d20 |
Definition at line 101 of file tcp_shell_if.hpp.
#define GEN_CHK1 0x464d4b553630210a |
Definition at line 102 of file tcp_shell_if.hpp.
#define IPERF_LSN_PORT 5001 |
Definition at line 89 of file tcp_shell_if.hpp.
#define IPREF3_LSN_PORT 5201 |
Definition at line 90 of file tcp_shell_if.hpp.
#define RECV_MODE_LSN_PORT 8800 |
Definition at line 85 of file tcp_shell_if.hpp.
#define THIS_NAME "TSIF" |
Definition at line 69 of file tcp_shell_if.cpp.
#define THIS_NAME "SIM" |
Definition at line 60 of file simu_tcp_shell_if_env.cpp.
#define THIS_NAME "TB_TSIF" |
Definition at line 57 of file test_tcp_shell_if.cpp.
#define THIS_NAME "TB_TSIF_TOP" |
Definition at line 51 of file test_tcp_shell_if_top.cpp.
#define TRACE_ALL 0xFFFF |
Definition at line 80 of file tcp_shell_if.cpp.
#define TRACE_ALL 0xFFFF |
Definition at line 72 of file simu_tcp_shell_if_env.cpp.
#define TRACE_ALL 0xFFFF |
Definition at line 60 of file test_tcp_shell_if.cpp.
#define TRACE_ALL 0xFFFF |
Definition at line 60 of file test_tcp_shell_if_top.cpp.
#define TRACE_CON 1 << 5 |
Definition at line 76 of file tcp_shell_if.cpp.
#define TRACE_DDC 1 << 1 |
Definition at line 59 of file test_tcp_shell_if.cpp.
#define TRACE_DDC 1 << 1 |
Definition at line 59 of file test_tcp_shell_if_top.cpp.
#define TRACE_DDSK 1 << 8 |
Definition at line 70 of file simu_tcp_shell_if_env.cpp.
#define TRACE_DDSP 1 << 9 |
Definition at line 71 of file simu_tcp_shell_if_env.cpp.
#define TRACE_IRB 1 << 1 |
Definition at line 72 of file tcp_shell_if.cpp.
#define TRACE_LSN 1 << 4 |
Definition at line 75 of file tcp_shell_if.cpp.
#define TRACE_MMIO 1 << 7 |
Definition at line 69 of file simu_tcp_shell_if_env.cpp.
#define TRACE_OFF 0x0000 |
Definition at line 71 of file tcp_shell_if.cpp.
#define TRACE_OFF 0x0000 |
Definition at line 62 of file simu_tcp_shell_if_env.cpp.
#define TRACE_OFF 0x0000 |
Definition at line 58 of file test_tcp_shell_if.cpp.
#define TRACE_OFF 0x0000 |
Definition at line 58 of file test_tcp_shell_if_top.cpp.
#define TRACE_RDP 1 << 2 |
Definition at line 73 of file tcp_shell_if.cpp.
#define TRACE_RNH 1 << 6 |
Definition at line 77 of file tcp_shell_if.cpp.
#define TRACE_RRH 1 << 7 |
Definition at line 78 of file tcp_shell_if.cpp.
#define TRACE_RRM 1 << 8 |
Definition at line 79 of file tcp_shell_if.cpp.
#define TRACE_TAF 1 << 6 |
Definition at line 68 of file simu_tcp_shell_if_env.cpp.
#define TRACE_TOE 1 << 1 |
Definition at line 63 of file simu_tcp_shell_if_env.cpp.
#define TRACE_TOE_LSN 1 << 2 |
Definition at line 64 of file simu_tcp_shell_if_env.cpp.
#define TRACE_TOE_OPN 1 << 3 |
Definition at line 65 of file simu_tcp_shell_if_env.cpp.
#define TRACE_TOE_RXP 1 << 4 |
Definition at line 66 of file simu_tcp_shell_if_env.cpp.
#define TRACE_TOE_TXP 1 << 5 |
Definition at line 67 of file simu_tcp_shell_if_env.cpp.
#define TRACE_WRP 1 << 3 |
Definition at line 74 of file tcp_shell_if.cpp.
#define XMIT_MODE_LSN_PORT 8801 |
Definition at line 86 of file tcp_shell_if.hpp.
enum DropCode |
enum QueryCmd |
bool drainDebugCounter | ( | stream< T > & | ss, |
string | ssName | ||
) |
Empty a debug 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 71 of file test_tcp_shell_if.cpp.
bool drainDebugSinkCounter | ( | stream< ap_uint< 32 > > & | ss, |
string | ssName | ||
) |
Empty the DebugSinkCounter 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 107 of file simu_tcp_shell_if_env.cpp.
bool drainDebugSpaceCounter | ( | stream< ap_uint< 16 > > & | ss, |
string | ssName | ||
) |
Empty the DebugSpaceCounter stream and check its last value.
[in/out] | ss A ref to the stream to drain. | |
[in] | ssName | The name of the stream to drain. |
Definition at line 134 of file simu_tcp_shell_if_env.cpp.
void increaseSimTime | ( | unsigned int | cycles | ) |
Increase the simulation time of the testbench.
[in] | The | number of cycles to increase. |
Definition at line 95 of file simu_tcp_shell_if_env.cpp.
int main | ( | int | argc, |
char * | argv[] | ||
) |
Main function for the test of the TCP Shell Interface (TSIF).
Main function for the test of the TCP Shell Interface (TSIF) TOP.
This test take 0,1,2,3 or 4 parameters in the following order:
[in] | The | number of bytes to generate in 'Echo' or "Dump' mode [1:65535]. |
[in] | The | IPv4 address to open (must be in the range [0x00000000:0xFFFFFFFF]. |
[in] | The | TCP port number to open (must be in the range [0:65535]. |
[in] | The | number of bytes to generate in 'Tx' test mode [1:65535] or '0' to simply open a port w/o triggering the Tx test mode. |
Definition at line 102 of file test_tcp_shell_if.cpp.
void pConnect | ( | CmdBit * | piSHL_Enable, |
stream< SockAddr > & | siRDp_OpnSockReq, | ||
stream< Ly4Len > & | siRDp_TxCountReq, | ||
stream< Ly4Len > & | soWRp_TxBytesReq, | ||
stream< SessionId > & | soWRp_TxSessId, | ||
stream< TcpAppOpnReq > & | soSHL_OpnReq, | ||
stream< TcpAppOpnRep > & | siSHL_OpnRep, | ||
stream< TcpAppClsReq > & | soSHL_ClsReq | ||
) |
Connect (COn).
[in] | piSHL_Enable | Enable signal from [SHELL]. |
[in] | siRDp_OpnSockReq | The remote socket to connect from ReadPath(RDp). |
[in] | siRDp_TxCountReq | The #bytes to be transmitted after connection is opened. |
[out] | soWRp_TxBytesReq | The #bytes to be transmitted to WritePath (WRp). |
[out] | soWRp_TxSessId | The session id of the active opened connection to [WRp]. |
[out] | soSHL_OpnReq | Open connection request to [SHELL]. |
[in] | siSHL_OpnRep | Open connection reply from [SHELL]. |
[out] | soSHL_ClsReq | Close connection request to [SHELL]. |
This process connects the FPGA in client mode to a remote server which socket address is specified by 'siRDp_OpnSockReq'. Alternatively, the process is also used to trigger the TxPath (TXp) to transmit a segment to the newly opened connection. The switch between opening a connection and sending traffic a remote host is defined by the value of the 'siRDp_TxCountReq' input: 1) If 'siRDp_TxCountReq' == 0, the process opens a new connection with the remote host specified by 'siRDp_OpnSockReq'. 2) If 'siRDp_TxCountReq' != 0, the process triggers the TxPath (TXp) to transmit a segment to the LAST opened connection. The number of bytes to transmit is specified by 'siRDp_TxCountReq'.
Definition at line 127 of file tcp_shell_if.cpp.
void pInputReadBuffer | ( | CmdBit * | piSHL_Enable, |
stream< TcpAppData > & | siSHL_Data, | ||
stream< TcpAppMeta > & | siSHL_Meta, | ||
stream< TcpAppData > & | soRDp_Data, | ||
stream< TcpAppMeta > & | soRDp_Meta | ||
) |
Input Read Buffer (IRb)
[in] | piSHL_Enable | Enable signal from [SHELL]. |
[in] | siSHL_Data | Data stream from [SHELL]. |
[in] | siSHL_Meta | Session Id from [SHELL]. |
[out] | soRDp_Data | Data stream to ReadPath (RDp). |
[out] | soRDp_Meta | Metadata stream [RDp]. |
This process implements an input FIFO buffer as a stream. The goal is to provision a buffer to store all the bytes that were requested by the ReadRequestHandler (RRh) process. FYI, if this user process does not absorb the incoming data stream fast enough, the [TOE] will start dropping segments on his side to avoid any blocking situation.
Definition at line 1033 of file tcp_shell_if.cpp.
void pListen | ( | CmdBit * | piSHL_Enable, |
stream< TcpAppLsnReq > & | soSHL_LsnReq, | ||
stream< TcpAppLsnRep > & | siSHL_LsnRep | ||
) |
Listen(LSn)
[in] | piSHL_Enable | Enable signal from [SHELL]. |
[out] | soSHL_LsnReq | Listen port request to [SHELL]. |
[in] | siSHL_LsnRep | Listen port reply from [SHELL]. |
Definition at line 267 of file tcp_shell_if.cpp.
Emulate the behavior of the SHELL & MMIO.
[in] | piSHL_Ready | Ready signal from [SHELL]. |
[out] | poTSIF_Enable | Enable signal to TSIF. |
Definition at line 211 of file simu_tcp_shell_if_env.cpp.
void pReadNotificationHandler | ( | CmdBit * | piSHL_Enable, |
stream< TcpAppNotif > & | siSHL_Notif, | ||
stream< TcpAppNotif > & | soRRh_Notif | ||
) |
Read Notification Handler (RNh)
[in] | piSHL_Enable | Enable signal from [SHELL]. |
[in] | siSHL_Notif | A new Rx data notification from [SHELL]. |
[out] | soRRh_Notif | The notification forwarded to ReadRequestHandler (RRh). |
This process waits for a notification from [TOE] indicating the availability of new data for the TcpApplication Flash (TAF) process of the [ROLE]. If the TCP segment length of the notification message is greater than 0, the data segment is valid and the notification is accepted. The notification is then pushed into a FIFO for later processing by the [RRh]. This process runs with II=1 in order to never miss an incoming notification.
Definition at line 1074 of file tcp_shell_if.cpp.
void pReadPath | ( | CmdBit * | piSHL_Enable, |
stream< TcpAppData > & | siSHL_Data, | ||
stream< TcpAppMeta > & | siSHL_Meta, | ||
stream< ForwardCmd > & | siRRh_FwdCmd, | ||
stream< SockAddr > & | soCOn_OpnSockReq, | ||
stream< TcpDatLen > & | soCOn_TxCountReq, | ||
stream< SigBit > & | soRRh_DequSig, | ||
stream< TcpAppData > & | soTAF_Data, | ||
stream< TcpSessId > & | soTAF_SessId, | ||
stream< TcpDatLen > & | soTAF_DatLen, | ||
stream< ap_uint< 32 > > & | soDBG_SinkCount | ||
) |
Read Path (RDp)
[in] | piSHL_Enable | Enable signal from [SHELL]. |
[in] | siSHL_Data | Data stream from [SHELL]. |
[in] | siSHL_Meta | Session Id from [SHELL]. |
[in] | siRRh_FwdCmd | A command to keep/drop a stream from ReadRequestHandler (RRh). |
[out] | soCOn_OpnSockReq | The remote socket to open to Connect (COn). |
[out] | soCOn_TxCountReq | The #bytes to be transmitted once connection is opened by [COn]. |
[out] | soRRh_DequSig | Signals the dequeue of a chunk to ReadRequestHandler (RRh). |
[out] | soTAF_Data | Data stream to [TAF]. |
[out] | soTAF_SessId | The session-id to [TAF]. |
[out] | soTAF_DatLen | The data-length to [TAF]. |
[out] | soDBG_SinkCount | Counts the number of sinked bytes (for debug). |
This process waits for new data to read and either forwards them to the TcpApplicationFlash (TAF) process or drops them based on the 'action' field of the 'siRRh_FwdCmd' command.
Definition at line 1347 of file tcp_shell_if.cpp.
void pReadRequestHandler | ( | CmdBit * | piSHL_Enable, |
stream< TcpAppNotif > & | siRNh_Notif, | ||
stream< SigBit > & | siRDp_DequSig, | ||
stream< TcpAppRdReq > & | soRRm_DReq, | ||
stream< ForwardCmd > & | soRDp_FwdCmd, | ||
stream< ap_uint< 16 > > & | soDBG_freeSpace | ||
) |
Read Request Handler (RRh)
[in] | piSHL_Enable | Enable signal from [SHELL]. |
[in] | siRNh_Notif | A new Rx data notification from ReadNotifHandler (RNh). |
[in] | siRDp_DequSig | Signals the dequeue of a chunk from ReadPath (RDp). |
[out] | soRRm_DReq | A data read request to ReadRequestMover (RRm). |
[out] | soRDp_FwdCmd | A command telling the ReadPath (RDp) to keep/drop a stream. |
The [RRh] consists of 2 sub-processes: 1) pRxBufferManager (Rbm) keeps tracks of the free space in the Rx buffer. 2) pRxDataRequester (Rdr) dequeues the notifications from a FiFo, assesses the available space in the Rx buffer and requests one or multiple data read requests from the [SHELL] accordingly. The rule is as follows: #RequestedBytes = min(NotifDatLen, max(AvailableSpace, cMinDataReqLen).
For testing purposes, the TCP destination port is also evaluated here and one of the following actions is taken upon its value:
Definition at line 1140 of file tcp_shell_if.cpp.
void pReadRequestMover | ( | CmdBit * | piSHL_Enable, |
stream< TcpAppRdReq > & | siRRh_DReq, | ||
stream< TcpAppRdReq > & | soSHL_DReq | ||
) |
Read Request Mover (RRm)
[out] | siRRh_DReq | A data read request from ReadRequestHandler (RRh). |
[out] | soSHL_DReq | The TCP data request forwarded to [SHELL]. |
Dequeues the read requests form a FiFo and forwards them to the [SHELL] in blocking read and write access modes.
Definition at line 1299 of file tcp_shell_if.cpp.
void pStreamDataMover | ( | stream< Type > & | si, |
stream< Type > & | so | ||
) |
Stream Data Mover - Moves data chunks from incoming stream to outgoing stream with blocking read and write access methods.
[in] | si | Stream in. |
[out] | so | Stream out. |
Definition at line 91 of file tcp_shell_if.cpp.
void pTAF | ( | ofstream & | ofTAF_Data, |
stream< TcpAppData > & | siTSIF_Data, | ||
stream< TcpSessId > & | siTSIF_SessId, | ||
stream< TcpDatLen > & | siTSIF_DatLen, | ||
stream< TcpAppData > & | soTSIF_Data, | ||
stream< TcpSessId > & | soTSIF_Meta, | ||
stream< TcpSessId > & | soTSIF_DLen | ||
) |
Emulate the behavior of the ROLE/TcpAppFlash (TAF).
[in] | ofTAF_Data | A ref to the output TxApp file to write to. |
[in] | siTSIF_Data | Data stream from TcpShellInterface (TSIF). |
[in] | siTSIF_SessId | Session-id from [TSIF]. |
[in] | siTSIF_DatLen | Data-length from [TSIF]. |
[out] | soTSIF_Data | Data stream to [TSIF]. |
[out] | soTSIF_SessId | Session-id to [TSIF]. |
[out] | soTSIF_DatLen | Data-length to [TSIF]. |
ALWAYS READ INCOMING DATA STREAM AND STORE IT TO FILE.
SIMULATION ENVIRONMENT FUNCTIONS
Definition at line 175 of file simu_tcp_shell_if_env.cpp.
void pTOE | ( | int & | nrErr, |
ofstream & | ofTAF_Gold, | ||
ofstream & | ofTOE_Gold, | ||
ofstream & | ofTOE_Data, | ||
TcpDatLen | echoDatLen, | ||
SockAddr | testSock, | ||
TcpDatLen | testDatLen, | ||
StsBit * | poMMIO_Ready, | ||
stream< TcpAppNotif > & | soTSIF_Notif, | ||
stream< TcpAppRdReq > & | siTSIF_DReq, | ||
stream< TcpAppData > & | soTSIF_Data, | ||
stream< TcpAppMeta > & | soTSIF_Meta, | ||
stream< TcpAppLsnReq > & | siTSIF_LsnReq, | ||
stream< TcpAppLsnRep > & | soTSIF_LsnRep, | ||
stream< TcpAppData > & | siTSIF_Data, | ||
stream< TcpAppSndReq > & | siTSIF_SndReq, | ||
stream< TcpAppSndRep > & | soTSIF_SndRep, | ||
stream< TcpAppOpnReq > & | siTSIF_OpnReq, | ||
stream< TcpAppOpnRep > & | soTSIF_OpnRep | ||
) |
Emulate behavior of the SHELL/NTS/TCP Offload Engine (TOE).
[in] | nrErr | A ref to the error counter of main. |
[in] | ofTAF_Gold | A ref to the TAF gold file to write. |
[in] | ofTOE_Gold | A ref to the TOE gold file to write. |
[in] | ofTOE_Data | A ref to the TOE data file to write. |
[in] | echoDatLen | The length of the echo data to generate. |
[in] | testSock | The destination socket to send traffic to. |
[in] | tcpDataLen | The length of the TCP payload to generate. |
[out] | poMMIO_Ready | Ready signal to [MMIO]. |
[out] | soTSIF_Notif | Notification to TcpShellInterface (TSIF). |
[in] | siTSIF_DReq | Data read request from [TSIF]. |
[out] | soTSIF_Data | Data to [TSIF]. |
[out] | soTSIF_Meta | Session Id to [TSIF]. |
[in] | siTSIF_LsnReq | Listen port request from [TSIF]. |
[out] | soTSIF_LsnRep | Listen port reply to [TSIF]. |
Definition at line 248 of file simu_tcp_shell_if_env.cpp.
void pWritePath | ( | CmdBit * | piSHL_Enable, |
stream< TcpAppData > & | siTAF_Data, | ||
stream< TcpSessId > & | siTAF_SessId, | ||
stream< TcpDatLen > & | siTAF_DatLen, | ||
stream< TcpDatLen > & | siCOn_TxBytesReq, | ||
stream< SessionId > & | siCOn_TxSessId, | ||
stream< TcpAppData > & | soSHL_Data, | ||
stream< TcpAppSndReq > & | soSHL_SndReq, | ||
stream< TcpAppSndRep > & | siSHL_SndRep | ||
) |
Write Path (WRp)
[in] | piSHL_Enable | Enable signal from [SHELL]. |
[in] | siTAF_Data | Tx data stream from [ROLE/TAF]. |
[in] | siTAF_SessId | The session Id from [ROLE/TAF]. |
[in] | siTAF_DatLen | The data length from [ROLE/TAF]. |
[in] | siCOn_TxBytesReq | The #bytes to be transmitted on the active opened connection from Connect(COn). |
[in] | siCOn_SessId | The session id of the active opened connection from [COn]. |
[out] | soSHL_Data | Tx data to [SHELL]. |
[out] | soSHL_SndReq | Request to send to [SHELL]. |
[in] | siSHL_SndRep | Send reply from [SHELL]. |
This process waits for new data to be forwarded from the TcpAppFlash (TAF) or for a transmit test command from Connect(COn). Upon reception of one of these two requests, the process issues a request to send message and waits for its reply. A request to send consists of a session-id and a data-length information. A send reply consists of a session-id, a data-length, the amount of space left in TCP Tx buffer and an error code. 1) If the return code is 'NO_ERROR', the process is allowed to send the amount of requested bytes. 2) If the return code is 'NO_SPACE', there is not enough space available in the TCP Tx buffer of the session. The process will retry its request after a short delay but may give up after a maximum number f trials. 3) If the return code is 'NO_CONNECTION', the process will abandon the transmission because there is no established connection for session-id.
Definition at line 1496 of file tcp_shell_if.cpp.
void stepSim | ( | ) |
Increment the simulation counter.
SIMULATION UTILITY HELPERS
Definition at line 78 of file simu_tcp_shell_if_env.cpp.
void tcp_shell_if | ( | CmdBit * | piSHL_Mmio_En, |
stream< TcpAppData > & | siTAF_Data, | ||
stream< TcpSessId > & | siTAF_SessId, | ||
stream< TcpDatLen > & | siTAF_DatLen, | ||
stream< TcpAppData > & | soTAF_Data, | ||
stream< TcpSessId > & | soTAF_SessId, | ||
stream< TcpDatLen > & | soTAF_DatLen, | ||
stream< TcpAppNotif > & | siSHL_Notif, | ||
stream< TcpAppRdReq > & | soSHL_DReq, | ||
stream< TcpAppData > & | siSHL_Data, | ||
stream< TcpAppMeta > & | siSHL_Meta, | ||
stream< TcpAppLsnReq > & | soSHL_LsnReq, | ||
stream< TcpAppLsnRep > & | siSHL_LsnRep, | ||
stream< TcpAppData > & | soSHL_Data, | ||
stream< TcpAppSndReq > & | soSHL_SndReq, | ||
stream< TcpAppSndRep > & | siSHL_SndRep, | ||
stream< TcpAppOpnReq > & | soSHL_OpnReq, | ||
stream< TcpAppOpnRep > & | siSHL_OpnRep, | ||
stream< TcpAppClsReq > & | soSHL_ClsReq, | ||
stream< ap_uint< 32 > > & | soDBG_SinkCnt, | ||
stream< ap_uint< 16 > > & | soDBG_InpBufSpace | ||
) |
TCP Shell Interface (TSIF)
[in] | piSHL_Mmio_En | Enable signal from [SHELL/MMIO]. |
[in] | siTAF_Data | TCP data stream from TcpAppFlash (TAF). |
[in] | siTAF_SessId | TCP session Id from [TAF]. |
[out] | soTAF_Data | TCP data stream to [TAF]. |
[out] | soTAF_SessId | TCP session Id to [TAF]. |
[in] | siSHL_Notif | TCP data notification from [SHELL]. |
[out] | soSHL_DReq | TCP data request to [SHELL]. |
[in] | siSHL_Data | TCP data stream from [SHELL]. |
[in] | siSHL_Meta | TCP metadata from [SHELL]. |
[out] | soSHL_LsnReq | TCP listen port request to [SHELL]. |
[in] | siSHL_LsnRep | TCP listen port acknowledge from [SHELL]. |
[out] | soSHL_Data | TCP data stream to [SHELL]. |
[out] | soSHL_SndReq | TCP send request to [SHELL]. |
[in] | siSHL_SndRep | TCP send reply from [SHELL]. |
[out] | soSHL_OpnReq | TCP open connection request to [SHELL]. |
[in] | siSHL_OpnRep | TCP open connection reply from [SHELL]. |
[out] | soSHL_ClsReq | TCP close connection request to [SHELL]. |
[out] | soDBG_SinkCnt | Counts the number of sinked bytes (for debug). |
ENTITY - TCP SHELL INTERFACE (TSIF)
Definition at line 1691 of file tcp_shell_if.cpp.
void tcp_shell_if_top | ( | CmdBit * | piSHL_Mmio_En, |
stream< TcpAppData > & | siTAF_Data, | ||
stream< TcpSessId > & | siTAF_SessId, | ||
stream< TcpDatLen > & | siTAF_DatLen, | ||
stream< TcpAppData > & | soTAF_Data, | ||
stream< TcpSessId > & | soTAF_SessId, | ||
stream< TcpDatLen > & | soTAF_DatLen, | ||
stream< TcpAppNotif > & | siSHL_Notif, | ||
stream< TcpAppRdReq > & | soSHL_DReq, | ||
stream< TcpAppData > & | siSHL_Data, | ||
stream< TcpAppMeta > & | siSHL_Meta, | ||
stream< TcpAppLsnReq > & | soSHL_LsnReq, | ||
stream< TcpAppLsnRep > & | siSHL_LsnRep, | ||
stream< TcpAppData > & | soSHL_Data, | ||
stream< TcpAppSndReq > & | soSHL_SndReq, | ||
stream< TcpAppSndRep > & | siSHL_SndRep, | ||
stream< TcpAppOpnReq > & | soSHL_OpnReq, | ||
stream< TcpAppOpnRep > & | siSHL_OpnRep, | ||
stream< TcpAppClsReq > & | soSHL_ClsReq, | ||
stream< ap_uint< 32 > > & | soDBG_SinkCnt, | ||
stream< ap_uint< 16 > > & | soDBG_InpBufSpace | ||
) |
Top of TCP Shell Interface (TSIF)
[in] | piSHL_Mmio_En | Enable signal from [SHELL/MMIO]. |
[in] | siTAF_Data | TCP data stream from TcpAppFlash (TAF). |
[in] | siTAF_SessId | TCP session Id from [TAF]. |
[out] | soTAF_Data | TCP data stream to [TAF]. |
[out] | soTAF_SessId | TCP session Id to [TAF]. |
[in] | siSHL_Notif | TCP data notification from [SHELL]. |
[out] | soSHL_DReq | TCP data request to [SHELL]. |
[in] | siSHL_Data | TCP data stream from [SHELL]. |
[in] | siSHL_Meta | TCP metadata from [SHELL]. |
[out] | soSHL_LsnReq | TCP listen port request to [SHELL]. |
[in] | siSHL_LsnRep | TCP listen port acknowledge from [SHELL]. |
[out] | soSHL_Data | TCP data stream to [SHELL]. |
[out] | soSHL_SndReq | TCP send request to [SHELL]. |
[in] | siSHL_SndRep | TCP send reply from [SHELL]. |
[out] | soSHL_OpnReq | TCP open connection request to [SHELL]. |
[in] | siSHL_OpnRep | TCP open connection reply from [SHELL]. |
[out] | soSHL_ClsReq | TCP close connection request to [SHELL]. |
[out] | soDBG_SinkCnt | Counts the number of sinked bytes (for debug). |
ENTITY - TOP of TCP SHELL INTERFACE (TSIF)
Definition at line 186 of file tcp_shell_if_top.cpp.
const int cDepth_COnToWRp_TxBytesReq = 2 |
Definition at line 53 of file tcp_shell_if.hpp.
const int cDepth_COnToWRp_TxSessId = cDepth_COnToWRp_TxBytesReq |
Definition at line 54 of file tcp_shell_if.hpp.
const int cDepth_IRbToRDp_Data = 256 |
Definition at line 42 of file tcp_shell_if.hpp.
const int cDepth_IRbToRDp_Meta = 256 |
Definition at line 43 of file tcp_shell_if.hpp.
const int cDepth_RDpToCOn_OpnSockReq = 2 |
Definition at line 50 of file tcp_shell_if.hpp.
const int cDepth_RDpToCOn_TxCountReq = cDepth_RDpToCOn_OpnSockReq |
Definition at line 51 of file tcp_shell_if.hpp.
const int cDepth_RDpToRRh_Dequeue = 4 |
Definition at line 49 of file tcp_shell_if.hpp.
const int cDepth_RNhToRRh_Notif = 64 |
Definition at line 45 of file tcp_shell_if.hpp.
const int cDepth_RRhToRDp_FwdCmd = 8 |
Definition at line 46 of file tcp_shell_if.hpp.
const int cDepth_RRhToRRm_DReq = cDepth_RRhToRDp_FwdCmd |
Definition at line 47 of file tcp_shell_if.hpp.
const int cGraceTime = 2500 |
Definition at line 48 of file simu_tcp_shell_if_env.hpp.
const int cIBuffBytes = cDepth_IRbToRDp_Data * (ARW/8) |
Definition at line 61 of file tcp_shell_if.hpp.
const int cMaxSessions = TOE_MAX_SESSIONS |
Definition at line 59 of file tcp_shell_if.hpp.
const int cMinDataReqLen = 128 |
Definition at line 62 of file tcp_shell_if.hpp.
const int cMinWAIT = cMaxSessions |
Definition at line 53 of file simu_tcp_shell_if_env.hpp.
const int cNrSegToSend = 5 |
Definition at line 50 of file simu_tcp_shell_if_env.hpp.
const int cNrSessToSend = 2 |
Definition at line 51 of file simu_tcp_shell_if_env.hpp.
const int cSimToeStartupDelay = 1000 |
Definition at line 47 of file simu_tcp_shell_if_env.hpp.
|
extern |
Definition at line 152 of file tb_nal.cpp.
bool gFatalError = false |
Definition at line 43 of file test_tcp_shell_if.hpp.
bool gFatalError = false |
Definition at line 43 of file test_tcp_shell_if_top.hpp.
|
extern |
Definition at line 69 of file test_arp.hpp.
|
extern |
Definition at line 69 of file test_arp.hpp.
unsigned int gMaxSimCycles = cSimToeStartupDelay + cGraceTime |
Definition at line 44 of file test_tcp_shell_if.hpp.
|
extern |
Definition at line 69 of file test_arp.hpp.
unsigned int gMaxSimCycles = cSimToeStartupDelay + cGraceTime |
Definition at line 44 of file test_tcp_shell_if_top.hpp.
|
extern |
GLOBAL VARIABLES USED BY THE SIMULATION ENVIRONMENT
Definition at line 150 of file tb_nal.cpp.
|
extern |
GLOBAL VARIABLES USED BY THE SIMULATION ENVIRONMENT
Definition at line 150 of file tb_nal.cpp.
unsigned int gSimCycCnt = 0 |
GLOBAL VARIABLES USED BY THE SIMULATION ENVIRONMENT
Definition at line 41 of file test_tcp_shell_if.hpp.
|
extern |
GLOBAL VARIABLES USED BY THE SIMULATION ENVIRONMENT
Definition at line 150 of file tb_nal.cpp.
unsigned int gSimCycCnt = 0 |
GLOBAL VARIABLES USED BY THE SIMULATION ENVIRONMENT
Definition at line 41 of file test_tcp_shell_if_top.hpp.
|
extern |
ARCHITECTURE DIRECTIVE The ReadRequestHandler (RRh) of TSIF can be implemented with an interrupt handler and scheduler approach by setting the following pre-processor directive. HELPERS FOR THE DEBUGGING TRACES .e.g: DEBUG_LEVEL = (MDL_TRACE | IPS_TRACE)
HELPERS FOR THE DEBUGGING TRACES .e.g: DEBUG_LEVEL = (MDL_TRACE | IPS_TRACE)
Definition at line 151 of file tb_nal.cpp.
|
extern |
HELPERS FOR THE DEBUGGING TRACES .e.g: DEBUG_LEVEL = (MDL_TRACE | IPS_TRACE)
Definition at line 151 of file tb_nal.cpp.
bool gTraceEvent = false |
HELPERS FOR THE DEBUGGING TRACES .e.g: DEBUG_LEVEL = (MDL_TRACE | IPS_TRACE)
Definition at line 42 of file test_tcp_shell_if.hpp.
bool gTraceEvent = false |
HELPERS FOR THE DEBUGGING TRACES .e.g: DEBUG_LEVEL = (MDL_TRACE | IPS_TRACE)
Definition at line 42 of file test_tcp_shell_if_top.hpp.