31 #include <hls_stream.h>
34 #include "../src/nal.hpp"
35 #include "../../simulation_utils.hpp"
36 #include "../../NTS/nts_utils.hpp"
45 #define DEBUG_TRACE true
51 #define THIS_NAME "TB"
53 #define TRACE_OFF 0x0000
54 #define TRACE_TOE 1 << 1
55 #define TRACE_ROLE 1 << 2
56 #define TRACE_ALL 0xFFFF
58 #define DEBUG_LEVEL (TRACE_TOE | TRACE_ROLE)
63 #define MAX_SIM_CYCLES 450
70 #define DEFAULT_FPGA_IP4_ADDR 0x0A0CC801
71 #define DEFAULT_FPGA_LSN_PORT 0x0057
72 #define DEFAULT_HOST_IP4_ADDR 0x0A0CC832
73 #define DEFAULT_HOST_LSN_PORT 0x80
75 #define DEFAULT_SESSION_ID 42
76 #define DEFAULT_SESSION_LEN 32
79 #define DEFAULT_TCP_LEN_REP 16
202 printf(
"[%4.4d] STEP DUT \n",
simCnt);
214 bool setInputDataStream(stream<UdpAppData> &sDataStream,
const string dataStreamName,
const string inpFileName) {
216 ifstream inpFileStream;
217 string datFile =
"../../../../test/" + inpFileName;
220 inpFileStream.open(datFile.c_str());
221 if ( !inpFileStream ) {
222 cout <<
"### ERROR : Could not open the input data file " << datFile << endl;
227 while (inpFileStream) {
229 if (!inpFileStream.eof()) {
231 getline(inpFileStream, strLine);
241 sscanf(strLine.c_str(),
"%llx %x %d", &newd, &newk, &newl);
250 if (sDataStream.full()) {
251 printf(
"### ERROR : Stream is full. Cannot write stream with data from file \"%s\".\n", inpFileName.c_str());
254 sDataStream.write(udpWord);
256 printf(
"[%4.4d] TB is filling input stream [%s] - Data write = {D=0x%16.16llX, K=0x%2.2X, L=%d} \n",
257 simCnt, dataStreamName.c_str(),
264 inpFileStream.close();
269 bool setInputDataStream(stream<NetworkWord> &sDataStream,
const string dataStreamName,
const string inpFileName) {
271 ifstream inpFileStream;
272 string datFile =
"../../../../test/" + inpFileName;
275 inpFileStream.open(datFile.c_str());
276 if ( !inpFileStream ) {
277 cout <<
"### ERROR : Could not open the input data file " << datFile << endl;
282 while (inpFileStream) {
284 if (!inpFileStream.eof()) {
286 getline(inpFileStream, strLine);
296 sscanf(strLine.c_str(),
"%llx %x %d", &newd, &newk, &newl);
305 if (sDataStream.full()) {
306 printf(
"### ERROR : Stream is full. Cannot write stream with data from file \"%s\".\n", inpFileName.c_str());
309 sDataStream.write(udpWord);
311 printf(
"[%4.4d] TB is filling input stream [%s] - Data write = {D=0x%16.16llX, K=0x%2.2X, L=%d} \n",
312 simCnt, dataStreamName.c_str(),
313 udpWord.
tdata.to_uint64(), udpWord.
tkeep.to_int(), udpWord.
tlast.to_int());
319 inpFileStream.close();
333 bool setInputMetaStream(stream<UdpAppMeta> &sMetaStream,
const string dataStreamName,
const string inpFileName) {
335 ifstream inpFileStream;
336 string datFile =
"../../../../test/" + inpFileName;
341 inpFileStream.open(datFile.c_str());
342 if ( !inpFileStream ) {
343 cout <<
"### ERROR : Could not open the input data file " << datFile << endl;
348 while (inpFileStream) {
350 if (!inpFileStream.eof()) {
352 getline(inpFileStream, strLine);
353 if (strLine.empty())
continue;
354 sscanf(strLine.c_str(),
"%llx %x %d", &udpWord.
tdata, &udpWord.
tkeep, &udpWord.
tlast);
364 if (sMetaStream.full()) {
365 printf(
"### ERROR : Stream is full. Cannot write stream with data from file \"%s\".\n", inpFileName.c_str());
369 sMetaStream.write(udpMeta);
371 printf(
"[%4.4d] TB is filling input stream [%s] - Metadata = {{SP=0x%4.4X,SA=0x%8.8X} {DP=0x%4.4X,DA=0x%8.8X}} \n",
372 simCnt, dataStreamName.c_str(),
380 inpFileStream.close();
397 sDataStream.read(*udpWord);
410 bool readMetaStream(stream <UdpAppMeta> &sMetaStream,
const string metaStreamName,
413 sMetaStream.read(*udpMeta);
415 printf(
"[%4.4d] TB is draining output stream [%s] - Metadata = {{SP=0x%4.4X,SA=0x%8.8X} {DP=0x%4.4X,DA=0x%8.8X}} \n",
416 simCnt, metaStreamName.c_str(),
434 sPLenStream.read(*udpPLen);
436 printf(
"[%4.4d] TB is draining output stream [%s] - Payload length = %d from DUT.\n",
437 simCnt, plenStreamName.c_str(), udpPLen->to_int());
450 if (!outFileStream.is_open()) {
451 printf(
"### ERROR : Output file stream is not open. \n");
454 outFileStream << hex << noshowbase <<
uppercase << setfill(
'0') << setw(16) << udpWord->
getTData().to_uint64();
455 outFileStream <<
" ";
456 outFileStream << hex << noshowbase << nouppercase << setfill(
'0') << setw(2) << udpWord->
getTKeep().to_int();
457 outFileStream <<
" ";
458 outFileStream << setw(1) << udpWord->
getTLast().to_int() <<
"\n";
463 if (!outFileStream.is_open()) {
464 printf(
"### ERROR : Output file stream is not open. \n");
467 outFileStream << hex << noshowbase <<
uppercase << setfill(
'0') << setw(16) << udpWord->
tdata.to_uint64();
468 outFileStream <<
" ";
469 outFileStream << hex << noshowbase << nouppercase << setfill(
'0') << setw(2) << udpWord->
tkeep.to_int();
470 outFileStream <<
" ";
471 outFileStream << setw(1) << udpWord->
tlast.to_int() <<
"\n";
484 if (!outFileStream.is_open()) {
485 printf(
"### ERROR : Output file stream is not open. \n");
488 outFileStream << hex << noshowbase << setfill(
'0') << setw(4) << udpMeta->
udpSrcPort.to_int();
489 outFileStream <<
" ";
490 outFileStream << hex << noshowbase << setfill(
'0') << setw(8) << udpMeta->
ip4SrcAddr.to_int();
491 outFileStream <<
" ";
492 outFileStream << hex << noshowbase << setfill(
'0') << setw(4) << udpMeta->
udpDstPort.to_int();
493 outFileStream <<
" ";
494 outFileStream << hex << noshowbase << setfill(
'0') << setw(8) << udpMeta->
ip4DstAddr.to_int();
495 outFileStream <<
"\n";
508 if (!outFileStream.is_open()) {
509 printf(
"### ERROR : Output file stream is not open. \n");
512 outFileStream << hex << noshowbase << setfill(
'0') << setw(4) << udpPLen->to_int();
513 outFileStream <<
"\n";
527 const string dataStreamName,
const string outFileName)
530 ofstream outFileStream;
531 string datFile =
"../../../../test/" + outFileName;
536 outFileStream.open(datFile.c_str());
537 if ( !outFileStream ) {
538 cout <<
"### ERROR : Could not open the output data file " << datFile << endl;
543 while (!sDataStream.empty()) {
546 printf(
"[%4.4d] TB is draining output stream [%s] - Data read = {D=0x%16.16llX, K=0x%2.2X, L=%d} \n",
547 simCnt, dataStreamName.c_str(),
557 outFileStream.close();
563 const string dataStreamName,
const string outFileName)
566 ofstream outFileStream;
567 string datFile =
"../../../../test/" + outFileName;
572 outFileStream.open(datFile.c_str());
573 if ( !outFileStream ) {
574 cout <<
"### ERROR : Could not open the output data file " << datFile << endl;
579 while (!sDataStream.empty()) {
583 printf(
"[%4.4d] TB is draining output stream [%s] - Data read = {D=0x%16.16llX, K=0x%2.2X, L=%d} \n",
584 simCnt, dataStreamName.c_str(),
593 outFileStream.close();
608 const string metaStreamName,
const string outFileName)
611 ofstream outFileStream;
612 string datFile =
"../../../../test/" + outFileName;
617 outFileStream.open(datFile.c_str());
618 if ( !outFileStream ) {
619 cout <<
"### ERROR : Could not open the output data file " << datFile << endl;
624 while (!sMetaStream.empty()) {
634 outFileStream.close();
649 const string plenStreamName,
const string outFileName)
652 ofstream outFileStream;
653 string datFile =
"../../../../test/" + outFileName;
658 outFileStream.open(datFile.c_str());
659 if ( !outFileStream ) {
660 cout <<
"### ERROR : Could not open the output data file " << datFile << endl;
665 while (!sPLenStream.empty()) {
675 outFileStream.close();
695 stream<NetworkWord> &siTRIF_Data,
696 stream<TcpSessId> &siTRIF_SessId,
698 stream<NetworkWord> &soTRIF_Data,
699 stream<TcpSessId> &soTRIF_SessId)
709 if (!siTRIF_SessId.empty() and !soTRIF_SessId.full()) {
711 tcpSessId = siTRIF_SessId.read();
712 soTRIF_SessId.write(tcpSessId);
714 printf(
"FMC received sessionID: %d\n", tcpSessId.to_uint());
718 if (!siTRIF_Data.empty() && !soTRIF_Data.full()) {
719 siTRIF_Data.read(currWord);
723 soTRIF_Data.write(currWord);
724 if (currWord.
tlast == 1) {
748 stream<NetworkWord> &siTRIF_Data,
749 stream<NetworkMetaStream> &siTRIF_meta,
751 stream<NetworkWord> &soTRIF_Data,
752 stream<NetworkMetaStream> &soTRIF_meta)
763 if (!siTRIF_meta.empty() && !soTRIF_meta.full()) {
764 siTRIF_meta.read(meta_stream_in);
766 meta_stream_out.
tkeep = 0xFFFF;
767 meta_stream_out.
tlast = 1;
778 soTRIF_meta.write(meta_stream_out);
783 if (!siTRIF_Data.empty() && !soTRIF_Data.full()) {
784 siTRIF_Data.read(currWord);
788 soTRIF_Data.write(currWord);
792 printf(
"[%4.4d] \tERROR: pROLE cant write to NRC.\n",
simCnt);
843 stream<TcpAppNotif> &soTRIF_Notif,
844 stream<TcpAppRdReq> &siTRIF_DReq,
845 stream<TcpAppData> &soTRIF_Data,
846 stream<TcpAppMeta> &soTRIF_SessId,
848 stream<TcpAppLsnReq> &siTRIF_LsnReq,
849 stream<TcpAppLsnRep> &soTRIF_LsnAck,
851 stream<TcpAppData> &siTRIF_Data,
852 stream<TcpAppSndReq> &siTRIF_SndReq,
853 stream<TcpAppSndRep> &soTRIF_SndRep,
855 stream<TcpAppOpnReq> &siTRIF_OpnReq,
856 stream<TcpAppOpnRep> &soTRIF_OpnRep)
866 if (!siTRIF_LsnReq.empty()) {
867 siTRIF_LsnReq.read(appLsnPortReq);
869 appLsnPortReq.to_int());
877 if (!soTRIF_LsnAck.full()) {
878 soTRIF_LsnAck.write(
true);
883 printWarn(
myLsnName,
"Cannot send listen reply back to [TRIF] because stream is full.\n");
898 if (!siTRIF_OpnReq.empty()) {
899 siTRIF_OpnReq.read(HostSockAddr);
900 printInfo(
myOpnName,
"Received a request to open the following remote socket address:\n");
906 if (!soTRIF_OpnRep.full()) {
907 soTRIF_OpnRep.write(opnReply);
911 printWarn(
myOpnName,
"Cannot send open connection reply back to [TRIF] because stream is full.\n");
930 if (!soTRIF_Notif.full()) {
939 if (!siTRIF_DReq.empty()) {
941 printInfo(
myRxpName,
"Received a data read request from [TRIF] (sessId=%d, segLen=%d).\n",
950 if (!soTRIF_SessId.full()) {
961 if (!soTRIF_Data.full()) {
969 printf(
"[TB-INFO-2] NRC not ready to receive TCP data.\n");
974 if (!soTRIF_Data.full()) {
1016 if (!siTRIF_SndReq.empty() && !soTRIF_SndRep.full()) {
1018 siTRIF_SndReq.read(app_req);
1019 curr_sessId = app_req.
sessId;
1022 printInfo(
myTxpName,
"Receiving TX Request for session #%d with length %d; \t Approve up to length %d\n",
1032 soTRIF_SndRep.write(app_rep);
1039 if( !siTRIF_Data.empty())
1042 siTRIF_Data.read(appData);
1058 if (!siTRIF_Data.empty()) {
1060 siTRIF_Data.read(appData);
1091 printf(
"#####################################################\n");
1092 printf(
"## TESTBENCH 'tb_nrc' STARTS HERE ##\n");
1093 printf(
"#####################################################\n");
1167 printf(
"#####################################################\n");
1168 printf(
"## MAIN LOOP STARTS HERE ##\n");
1169 printf(
"#####################################################\n");
1190 printf(
"[%4.4d] NRC->UOE_OpnReq : DUT is requesting to open a port.\n",
simCnt);
1192 printf(
"[%4.4d] NRC->UOE_OpnAck : TB acknowledges the port opening.\n",
simCnt);
1204 printf(
"### ERROR : Failed to set input data stream \"sROLE_DataStream\". \n");
1214 printf(
"### ERROR : Failed to set input data stream \"sUOE_DataStream\". \n");
1269 printf(
"Role received NRCmeta stream from rank %d.\n", (
int) tmp_meta.
tdata.
src_rank);
1307 printf(
"-- [@%4.4d] -----------------------------\n",
gSimCycCnt);
1315 printf(
"[TB-ERROR] RXP engine is not in expected state!\n");
1335 printf(
"[TB-ERROR] RXP engine is not in expected state!\n");
1355 printf(
"[TB-ERROR] RXP engine is not in expected state!\n");
1374 printf(
"=== Drain OpenReq: ");
1382 printf(
"## End of simulation at cycle=%3d. \n",
simCnt);
1387 printf(
"-- [@%4.4d] -----------------------------\n",
gSimCycCnt);
1388 printf(
"############################################################################\n");
1389 printf(
"## TESTBENCH 'tb_nal' ENDS HERE ##\n");
1398 printf(
"############################################################################\n\n");
1424 printf(
"=== Draining leftover TCP request: ");
1434 int rc1 = system(
"diff --brief -w -i -y ../../../../test/ofsURIF_Role_Data.dat \
1435 ../../../../test/ifsUDMX_Urif_Data.dat");
1437 printf(
"## Error : File \'ofsURIF_Role_Data.dat\' does not match \'ifsUDMX_Urif_Data.dat\'.\n");
1439 int rc2 = system(
"diff --brief -w -i -y ../../../../test/ofsURIF_Udmx_Data.dat \
1440 ../../../../test/ifsROLE_Urif_Data.dat");
1442 printf(
"## Error : File \'ofsURIF_Udmx_Data.dat\' does not match \'ifsROLE_Urif_Data.dat\'.\n");
1445 printf(
"#####################################################\n");
1447 printf(
"## ERROR - TESTBENCH FAILED (RC=%d) !!! ##\n", nrErr);
1449 printf(
"## SUCCESSFULL END OF TESTBENCH (RC=0) ##\n");
1451 printf(
"#####################################################\n");
void setTLast(tLast last)
tData getTData(int leHi=64 -1, int leLo=0) const
LE_tKeep getLE_TKeep(int leHi=64/8-1, int leLo=0) const
LE_tData getLE_TData(int leHi=64 -1, int leLo=0) const
void setTKeep(tKeep keep)
tKeep getTKeep(int leHi=64/8-1, int leLo=0) const
void setTData(tData data)
LE_tLast getLE_TLast() const
bool setInputDataStream(stream< UdpAppData > &sDataStream, const string dataStreamName, const string inpFileName)
Initialize an input data stream from a file.
bool readMetaStream(stream< UdpAppMeta > &sMetaStream, const string metaStreamName, UdpAppMeta *udpMeta)
Read an output metadata stream from the DUT.
stream< UdpAppMeta > sNRC_UOE_Meta("sNRC_UOE_Meta")
stream< NetworkWord > sNRC_Role_Tcp_data("sNRC_Role_Tcp_data")
stream< TcpAppLsnRep > sTOE_Nrc_LsnAck("sTOE_Nrc_LsnAck")
#define NUMBER_CONFIG_WORDS
stream< TcpAppData > sTOE_Nrc_Data("sTOE_Nrc_Data")
#define DEFAULT_HOST_LSN_PORT
stream< UdpAppDLen > sUOE_NRC_DLen("sUOE_NRC_DLen")
stream< TcpAppSndRep > sTOE_Nrc_SndRep("sTOE_NRC_SndRep")
#define DEFAULT_SESSION_ID
#define DEFAULT_TCP_LEN_REP
int tcp_timout_packet_drop
ap_uint< 1 > layer_7_enabled
stream< NetworkWord > sFMC_Nrc_Tcp_data("sFMC_Nrc_Tcp_data")
stream< TcpAppRdReq > sNRC_Toe_DReq("sNrc_TOE_DReq")
stream< NetworkWord > sNRC_Role_Data("sNRC_Role_Data")
stream< NetworkMetaStream > sROLE_Nrc_Tcp_meta("sROLE_Nrc_Tcp_meta")
#define NUMBER_STATUS_WORDS
int tcp_packets_expected_timeout
void pROLE(stream< NetworkWord > &siTRIF_Data, stream< NetworkMetaStream > &siTRIF_meta, stream< NetworkWord > &soTRIF_Data, stream< NetworkMetaStream > &soTRIF_meta)
Emulate the behavior of the ROLE.
stream< NetworkWord > sNRC_FMC_Tcp_data("sNRC_FMC_Tcp_data")
bool dumpMetaToFile(UdpAppMeta *udpMeta, ofstream &outFileStream)
Dump a metadata information to a file.
stream< NetworkMetaStream > sNRC_Role_Tcp_meta("sNRC_Role_Tcp_meta")
bool readDataStream(stream< UdpAppData > &sDataStream, UdpAppData *udpWord)
Read data from a stream.
stream< TcpAppData > sNRC_Toe_Data("sNRC_TOE_Data")
enum RoleFsmStates roleFsmState
stream< TcpAppLsnReq > sNRC_Toe_LsnReq("sNRC_TOE_LsnReq")
void pTOE(int &nrErr, stream< TcpAppNotif > &soTRIF_Notif, stream< TcpAppRdReq > &siTRIF_DReq, stream< TcpAppData > &soTRIF_Data, stream< TcpAppMeta > &soTRIF_SessId, stream< TcpAppLsnReq > &siTRIF_LsnReq, stream< TcpAppLsnRep > &soTRIF_LsnAck, stream< TcpAppData > &siTRIF_Data, stream< TcpAppSndReq > &siTRIF_SndReq, stream< TcpAppSndRep > &soTRIF_SndRep, stream< TcpAppOpnReq > &siTRIF_OpnReq, stream< TcpAppOpnRep > &soTRIF_OpnRep)
stream< TcpAppMeta > sTOE_Nrc_SessId("sTOE_Nrc_SessId")
stream< NetworkMetaStream > soUdp_meta("soUdp_meta")
void pFMC(stream< NetworkWord > &siTRIF_Data, stream< TcpSessId > &siTRIF_SessId, stream< NetworkWord > &soTRIF_Data, stream< TcpSessId > &soTRIF_SessId)
Emulate the behavior of the FMC.
stream< UdpAppData > sUOE_NRC_Data("sUOE_NRC_Data")
#define DEFAULT_SESSION_LEN
stream< UdpAppData > sNRC_UOE_Data("sNRC_UOE_Data")
bool dumpDataToFile(UdpAppData *udpWord, ofstream &outFileStream)
Dump a data word to a file.
enum RxFsmStates rxFsmState
stream< StsBool > sUOE_NRC_LsnRep("sUOE_NRC_LsnRep")
ap_uint< 1 > sNTS_Nrc_ready
#define NAL_STATUS_MRT_VERSION
bool readPLenStream(stream< UdpPLen > &sPLenStream, const string plenStreamName, UdpPLen *udpPLen)
Read an output payload length stream from the DUT.
ap_uint< 32 > sMMIO_CfrmIp4Addr
stream< TcpSessId > sFMC_Nrc_Tcp_sessId("sFMC_Nrc_Tcp_sessId")
bool getOutputMetaStream(stream< UdpAppMeta > &sMetaStream, const string metaStreamName, const string outFileName)
Fill an output file with metadata from an output stream.
stream< TcpAppClsReq > sNRC_Toe_ClsReq("sNRC_TOE_ClsReq")
void nal_main(ap_uint< 32 > ctrlLink[64+16+16], ap_uint< 1 > *layer_4_enabled, ap_uint< 1 > *layer_7_enabled, ap_uint< 1 > *role_decoupled, ap_uint< 1 > *piNTS_ready, ap_uint< 16 > *piMMIO_FmcLsnPort, ap_uint< 32 > *piMMIO_CfrmIp4Addr, ap_uint< 32 > *myIpAddress, ap_uint< 32 > *pi_udp_rx_ports, stream< NetworkWord > &siUdp_data, stream< NetworkWord > &soUdp_data, stream< NetworkMetaStream > &siUdp_meta, stream< NetworkMetaStream > &soUdp_meta, ap_uint< 32 > *pi_tcp_rx_ports, stream< NetworkWord > &siTcp_data, stream< NetworkMetaStream > &siTcp_meta, stream< NetworkWord > &soTcp_data, stream< NetworkMetaStream > &soTcp_meta, stream< NetworkWord > &siFMC_data, stream< TcpSessId > &siFMC_SessId, stream< NetworkWord > &soFMC_data, stream< TcpSessId > &soFMC_SessId, stream< UdpPort > &soUOE_LsnReq, stream< StsBool > &siUOE_LsnRep, stream< UdpPort > &soUOE_ClsReq, stream< StsBool > &siUOE_ClsRep, stream< UdpAppData > &siUOE_Data, stream< UdpAppMeta > &siUOE_Meta, stream< UdpAppDLen > &siUOE_DLen, stream< UdpAppData > &soUOE_Data, stream< UdpAppMeta > &soUOE_Meta, stream< UdpAppDLen > &soUOE_DLen, stream< TcpAppNotif > &siTOE_Notif, stream< TcpAppRdReq > &soTOE_DReq, stream< TcpAppData > &siTOE_Data, stream< TcpAppMeta > &siTOE_SessId, stream< TcpAppLsnReq > &soTOE_LsnReq, stream< TcpAppLsnRep > &siTOE_LsnRep, stream< TcpAppData > &soTOE_Data, stream< TcpAppSndReq > &soTOE_SndReq, stream< TcpAppSndRep > &siTOE_SndRep, stream< TcpAppOpnReq > &soTOE_OpnReq, stream< TcpAppOpnRep > &siTOE_OpnRep, stream< TcpAppClsReq > &soTOE_ClsReq)
Main process of the Network Abstraction Layer (NAL)
ap_uint< 1 > layer_4_enabled
stream< UdpAppMeta > sUOE_NRC_Meta("sUOE_NRC_Meta")
stream< StsBool > sUOE_NRC_ClsRep("sUOE_NRC_ClsRep")
stream< UdpPort > sNRC_UOE_ClsReq("sNRC_UOE_ClsReq")
stream< NetworkWord > sROLE_NRC_Data("sROLE_NRC_Data")
ap_uint< 32 > s_tcp_rx_ports
stream< NetworkWord > sROLE_Nrc_Tcp_data("sROLE_Nrc_Tcp_data")
ap_uint< 16 > sMMIO_FmcLsnPort
stream< TcpAppOpnRep > sTOE_Nrc_OpnRep("sTOE_NRC_OpenRep")
#define DEFAULT_HOST_IP4_ADDR
ap_uint< 1 > role_decoupled
stream< UdpPort > sNRC_UOE_LsnReq("sNRC_UOE_LsnReq")
stream< NetworkMetaStream > siUdp_meta("siUdp_meta")
stream< TcpAppNotif > sTOE_Nrc_Notif("sTOE_Nrc_Notif")
#define NAL_CONFIG_MRT_VERSION
ap_uint< 32 > myIpAddress
ap_uint< 32 > ctrlLink[64+16+16]
bool setInputMetaStream(stream< UdpAppMeta > &sMetaStream, const string dataStreamName, const string inpFileName)
Initialize an input meta stream from a file.
Ip4Addr hostIp4Addr
Emulate the behavior of the TCP Offload Engine (TOE).
void stepDut()
Run a single iteration of the DUT model.
bool getOutputPLenStream(stream< UdpPLen > &sPLenStream, const string plenStreamName, const string outFileName)
Fill an output file with payload length from an output stream.
bool dumpPLenToFile(UdpPLen *udpPLen, ofstream &outFileStream)
Dump a payload length information to a file.
stream< TcpSessId > sNRC_FMC_Tcp_sessId("sNRC_FMC_Tcp_sessId")
stream< TcpAppSndReq > sNRC_Toe_SndReq("sNRC_TOE_SndReq")
int main()
Main Testbench Loop; Emulates also the behavior of the UDP Offload Engine (UOE).
stream< TcpAppOpnReq > sNRC_Toe_OpnReq("sNRC_Toe_OpnReq")
stream< UdpAppDLen > sNRC_UOE_DLen("sNRC_UOE_DLen")
ap_uint< 32 > s_udp_rx_ports
bool getOutputDataStream(stream< UdpAppData > &sDataStream, const string dataStreamName, const string outFileName)
Fill an output file with data from an output stream.
void printSockAddr(const char *callerName, SockAddr sockAddr)
Print a socket address.
#define printInfo(callerName, format,...)
A macro to print an information message.
#define printWarn(callerName, format,...)
A macro to print a warning message.
#define concat3(firstCharConst, secondCharConst, thirdCharConst)
void uppercase(ap_uint< 32 > *pi_rank, ap_uint< 32 > *pi_size, stream< NetworkWord > &siSHL_This_Data, stream< NetworkWord > &soTHIS_Shl_Data, stream< NetworkMetaStream > &siNrc_meta, stream< NetworkMetaStream > &soNrc_meta, ap_uint< 32 > *po_rx_ports)
Main process of the Uppercase Application directives.
void printAxiWord(const char *callerName, AxisRaw chunk)
Prints one chunk of a data stream (used for debugging).