36 #include <hls_stream.h>
38 #include "../src/udp_app_flash.hpp"
39 #include "../../../../cFDK/SRA/LIB/SHELL/LIB/hls/NTS/SimNtsUtils.hpp"
40 #include "../../../../cFDK/SRA/LIB/SHELL/LIB/hls/NTS/SimAppData.hpp"
41 #include "../../../../cFDK/SRA/LIB/SHELL/LIB/hls/NTS/SimUdpDatagram.hpp"
46 #define TB_MAX_CYCLES 500
47 #define TB_GRACE_TIME 500
50 #define DEBUG_TRACE true
52 #define ENABLED (ap_uint<1>)1
53 #define DISABLED (ap_uint<1>)0
62 #define DEFAULT_FPGA_IP4_ADDR 0x0A0CC801
63 #define DEFAULT_FPGA_LSN_PORT 0x2263
64 #define DEFAULT_FPGA_SND_PORT 0xA263
65 #define DEFAULT_HOST_IP4_ADDR 0x0A0CC832
66 #define DEFAULT_HOST_LSN_PORT 0x80
67 #define DEFAULT_HOST_SND_PORT 0x8080
69 #define DEFAULT_DATAGRAM_LEN 32
85 queue<UdpAppMeta> &udpMetaQueue,
86 queue<UdpAppDLen> &udpDLenQueue,
93 string inpData_FileName,
94 queue<UdpAppMeta> &udpMetaQueue,
95 queue<UdpAppDLen> &udpDLenQueue,
96 string outData_GoldName,
97 string outMeta_GoldName,
98 string outDLen_GoldName);
101 stream<AxisApp> &ssData,
102 const string ssDataName,
103 stream<UdpAppMeta> &ssMeta,
104 const string ssMetaName,
105 stream<UdpAppDLen> &ssDLen,
106 const string ssDLenName,
108 queue<UdpAppMeta> &metaQueue,
109 queue<UdpAppDLen> &dlenQueue,
110 int &nrFeededChunks);
113 stream<UdpAppMeta> &ss,
121 stream<UdpAppDLen> &ss,
void stepSim()
Increment the simulation counter.
void increaseSimTime(unsigned int cycles)
Increase the simulation time of the testbench.
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.
bool drainUdpDLenStreamToFile(stream< UdpAppDLen > &ss, string ssName, string datFile, int &nrChunks, int &nrFrames, int &nrBytes)
Empty an UdpDLen stream to a DAT file.
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.
bool drainUdpMetaStreamToFile(stream< UdpAppMeta > &ss, string ssName, string datFile, int &nrChunks, int &nrFrames, int &nrBytes)
Empty an UdpMeta stream to a DAT file.
int createUdpRxTraffic(stream< AxisApp > &ssData, const string ssDataName, stream< UdpAppMeta > &ssMeta, const string ssMetaName, stream< UdpAppDLen > &ssDLen, const string ssMDLenName, string datFile, queue< UdpAppMeta > &metaQueue, queue< UdpAppDLen > &dlenQueue, int &nrFeededChunks)
Create the UDP Rx traffic as streams from an input test file.