cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
udp_app_flash

This module implements a set of UDP-oriented tests and functions. More...

Collaboration diagram for udp_app_flash:

Files

file  udp_app_flash.cpp
 : UDP Application Flash (UAF)
 
file  udp_app_flash.hpp
 : UDP Application Flash (UAF)
 
file  udp_app_flash_top.cpp
 : Top level with I/O ports for UDP Application Flash (UAF)
 
file  udp_app_flash_top.hpp
 : Top of UDP Application Flash (UAF)
 
file  simu_udp_app_flash_env.cpp
 : Simulation environment for the UDP Application Flash (UAF).
 
file  test_udp_app_flash.cpp
 : Testbench for UDP Application Flash (UAF).
 
file  test_udp_app_flash.hpp
 : Testbench for the UDP Application Flash (UAF).
 
file  test_udp_app_flash_top.cpp
 : Testbench for toplevel of the UDP Application Flash.
 
file  test_udp_app_flash_top.hpp
 : Testbench for toplevel of the UDP Application Flash.
 

Macros

#define THIS_NAME   "UAF"
 
#define TRACE_OFF   0x0000
 
#define TRACE_ESF   1 << 1
 
#define TRACE_RXP   1 << 2
 
#define TRACE_TXP   1 << 3
 
#define TRACE_ALL   0xFFFF
 
#define DEBUG_LEVEL   (TRACE_OFF)
 
#define MTU   1500
 
#define ECHO_PATH_THRU_PORT   8803
 
#define THIS_NAME   "SIM"
 
#define TRACE_OFF   0x0000
 
#define TRACE_USIF   1 << 1
 
#define TRACE_UAF   1 << 2
 
#define TRACE_CGTF   1 << 3
 
#define TRACE_DUMTF   1 << 4
 
#define TRACE_ALL   0xFFFF
 
#define DEBUG_LEVEL   (TRACE_OFF)
 
#define TB_MAX_CYCLES   500
 
#define TB_GRACE_TIME   500
 
#define VALID   true
 
#define UNVALID   false
 
#define DEBUG_TRACE   true
 
#define ENABLED   (ap_uint<1>)1
 
#define DISABLED   (ap_uint<1>)0
 
#define DEFAULT_FPGA_IP4_ADDR   0x0A0CC801
 
#define DEFAULT_FPGA_LSN_PORT   0x2263
 
#define DEFAULT_FPGA_SND_PORT   0xA263
 
#define DEFAULT_HOST_IP4_ADDR   0x0A0CC832
 
#define DEFAULT_HOST_LSN_PORT   0x80
 
#define DEFAULT_HOST_SND_PORT   0x8080
 
#define DEFAULT_DATAGRAM_LEN   32
 
#define THIS_NAME   "TB_UAF"
 
#define THIS_NAME   "TB_UAF_TOP"
 

Enumerations

enum  EchoCtrl {
  ECHO_PATH_THRU = 0 , ECHO_STORE_FWD = 1 , ECHO_OFF = 2 , ECHO_PATH_THRU = 0 ,
  ECHO_STORE_FWD = 1 , ECHO_OFF = 2 , ECHO_PATH_THRU = 0 , ECHO_STORE_FWD = 1 ,
  ECHO_OFF = 2 , ECHO_PATH_THRU = 0 , ECHO_STORE_FWD = 1 , ECHO_OFF = 2 ,
  ECHO_PATH_THRU = 0 , ECHO_STORE_FWD = 1 , ECHO_OFF = 2 , ECHO_PATH_THRU = 0 ,
  ECHO_STORE_FWD = 1 , ECHO_OFF = 2 , ECHO_PATH_THRU = 0 , ECHO_STORE_FWD = 1 ,
  ECHO_OFF = 2 , ECHO_STORE_FWD = 0 , ECHO_PATH_THRU = 1 , ECHO_CTRL_DISABLED = 0 ,
  ECHO_PATH_THRU = 1 , ECHO_STORE_FWD = 2 , ECHO_OFF = 3
}
 

Functions

void stepDut ()
 Run a single iteration of the DUT model. More...
 
bool setInputDataStream (stream< UdpWord > &sDataStream, const string dataStreamName, const string inpFileName)
 Initialize an input data stream from a file. More...
 
bool readDataStream (stream< UdpWord > &sDataStream, UdpWord *udpWord)
 Read data from a stream. More...
 
bool dumpDataToFile (UdpWord *udpWord, ofstream &outFileStream)
 Dump a data word to a file. More...
 
bool getOutputDataStream (stream< UdpWord > &sDataStream, const string dataStreamName, const string outFileName)
 Fill an output file with data from an output stream. More...
 
void pUdpEchoStoreAndForward (CmdBit *piSHL_Enable, stream< UdpAppData > &siRXp_Data, stream< UdpAppMeta > &siRXp_Meta, stream< UdpAppDLen > &siRXp_DLen, stream< UdpAppData > &soTXp_Data, stream< UdpAppMeta > &soTXp_Meta, stream< UdpAppDLen > &soTXp_DLen)
 Echo loopback between the Rx and Tx ports of the UDP connection. More...
 
void pUdpTxPath (CmdBit *piSHL_Mmio_Enable, stream< UdpAppData > &siEPt_Data, stream< UdpAppMeta > &siEPt_Meta, stream< UdpAppDLen > &siEPt_DLen, stream< UdpAppData > &siESf_Data, stream< UdpAppMeta > &siESf_Meta, stream< UdpAppDLen > &siESf_DLen, stream< UdpAppData > &soUSIF_Data, stream< UdpAppMeta > &soUSIF_Meta, stream< UdpAppDLen > &soUSIF_DLen)
 Transmit Path - From THIS to USIF. More...
 
void pUdpRxPath (CmdBit *piSHL_Mmio_Enable, stream< UdpAppData > &siUSIF_Data, stream< UdpAppMeta > &siUSIF_Meta, stream< UdpAppDLen > &siUSIF_DLen, stream< UdpAppData > &soEPt_Data, stream< UdpAppMeta > &soEPt_Meta, stream< UdpAppDLen > &soEPt_DLen, stream< UdpAppData > &soESf_Data, stream< UdpAppMeta > &soESf_Meta, stream< UdpAppDLen > &soESf_DLen)
 UDP Receive Path (RXp) - From SHELL->ROLE/USIF to THIS. More...
 
void udp_app_flash (CmdBit *piSHL_Mmio_En, stream< UdpAppData > &siUSIF_Data, stream< UdpAppMeta > &siUSIF_Meta, stream< UdpAppDLen > &siUSIF_DLen, stream< UdpAppData > &soUSIF_Data, stream< UdpAppMeta > &soUSIF_Meta, stream< UdpAppDLen > &soUSIF_DLen)
 Main process of the UDP Application Flash (UAF) More...
 
void udp_app_flash_top (CmdBit *piSHL_Mmio_En, stream< UdpAppData > &siUSIF_Data, stream< UdpAppMeta > &siUSIF_Meta, stream< UdpAppDLen > &siUSIF_DLen, stream< UdpAppData > &soUSIF_Data, stream< UdpAppMeta > &soUSIF_Meta, stream< UdpAppDLen > &soUSIF_DLen)
 Top of UDP Application Flash (UAF) More...
 
void stepSim ()
 Increment the simulation counter. More...
 
void increaseSimTime (unsigned int cycles)
 Increase the simulation time of the testbench. More...
 
bool readDatagramFromFile (const char *myName, SimUdpDatagram &appDatagram, ifstream &ifsData, SocketPair &sockPair, queue< UdpAppMeta > &udpMetaQueue, queue< UdpAppDLen > &udpDLenQueue, int &inpChunks, int &inpDgrms, int &inpBytes)
 Read a datagram from a DAT file. More...
 
int createGoldenTxFiles (EchoCtrl tbCtrlMode, string inpData_FileName, queue< UdpAppMeta > &udpMetaQueue, queue< UdpAppDLen > &udpDLenQueue, string outData_GoldName, string outMeta_GoldName, string outDLen_GoldName)
 Create the golden UDP Tx files from an input test file. More...
 
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. 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 a UdpDLen stream to a DAT file. More...
 
int main (int argc, char *argv[])
 Main function for the test of the UDP Application Flash (UAF). More...
 

Variables

bool gTraceEvent
 
unsigned int gSimCycCnt
 
bool gTraceEvent
 
bool gFatalError
 
unsigned int gMaxSimCycles
 
unsigned int gSimCycCnt
 
unsigned int gMaxSimCycles
 
unsigned int gSimCycCnt = 0
 
bool gTraceEvent = false
 
bool gFatalError = false
 
unsigned int gMaxSimCycles = 500 + 500
 
unsigned int gSimCycCnt
 
unsigned int gMaxSimCycles
 
unsigned int gSimCycCnt = 0
 
bool gTraceEvent = false
 
bool gFatalError = false
 
unsigned int gMaxSimCycles = 500 + 500
 

Detailed Description

This module implements a set of UDP-oriented tests and functions.

Macro Definition Documentation

◆ DEBUG_LEVEL [1/2]

#define DEBUG_LEVEL   (TRACE_OFF)

Definition at line 67 of file udp_app_flash.cpp.

◆ DEBUG_LEVEL [2/2]

#define DEBUG_LEVEL   (TRACE_OFF)

Definition at line 68 of file simu_udp_app_flash_env.cpp.

◆ DEBUG_TRACE

#define DEBUG_TRACE   true

Definition at line 50 of file simu_udp_app_flash_env.hpp.

◆ DEFAULT_DATAGRAM_LEN

#define DEFAULT_DATAGRAM_LEN   32

Definition at line 69 of file simu_udp_app_flash_env.hpp.

◆ DEFAULT_FPGA_IP4_ADDR

#define DEFAULT_FPGA_IP4_ADDR   0x0A0CC801

Definition at line 62 of file simu_udp_app_flash_env.hpp.

◆ DEFAULT_FPGA_LSN_PORT

#define DEFAULT_FPGA_LSN_PORT   0x2263

Definition at line 63 of file simu_udp_app_flash_env.hpp.

◆ DEFAULT_FPGA_SND_PORT

#define DEFAULT_FPGA_SND_PORT   0xA263

Definition at line 64 of file simu_udp_app_flash_env.hpp.

◆ DEFAULT_HOST_IP4_ADDR

#define DEFAULT_HOST_IP4_ADDR   0x0A0CC832

Definition at line 65 of file simu_udp_app_flash_env.hpp.

◆ DEFAULT_HOST_LSN_PORT

#define DEFAULT_HOST_LSN_PORT   0x80

Definition at line 66 of file simu_udp_app_flash_env.hpp.

◆ DEFAULT_HOST_SND_PORT

#define DEFAULT_HOST_SND_PORT   0x8080

Definition at line 67 of file simu_udp_app_flash_env.hpp.

◆ DISABLED

#define DISABLED   (ap_uint<1>)0

Definition at line 53 of file simu_udp_app_flash_env.hpp.

◆ ECHO_PATH_THRU_PORT

#define ECHO_PATH_THRU_PORT   8803

Definition at line 63 of file udp_app_flash.hpp.

◆ ENABLED

#define ENABLED   (ap_uint<1>)1

Definition at line 52 of file simu_udp_app_flash_env.hpp.

◆ MTU

#define MTU   1500

Definition at line 51 of file udp_app_flash.hpp.

◆ TB_GRACE_TIME

#define TB_GRACE_TIME   500

Definition at line 47 of file simu_udp_app_flash_env.hpp.

◆ TB_MAX_CYCLES

#define TB_MAX_CYCLES   500

Definition at line 46 of file simu_udp_app_flash_env.hpp.

◆ THIS_NAME [1/4]

#define THIS_NAME   "UAF"

Definition at line 60 of file udp_app_flash.cpp.

◆ THIS_NAME [2/4]

#define THIS_NAME   "SIM"

HELPERS FOR THE DEBUGGING TRACES .e.g: DEBUG_LEVEL = (TRACE_USIF | TRACE_UAF)

Definition at line 60 of file simu_udp_app_flash_env.cpp.

◆ THIS_NAME [3/4]

#define THIS_NAME   "TB_UAF"

Definition at line 52 of file test_udp_app_flash.cpp.

◆ THIS_NAME [4/4]

#define THIS_NAME   "TB_UAF_TOP"

Definition at line 52 of file test_udp_app_flash_top.cpp.

◆ TRACE_ALL [1/2]

#define TRACE_ALL   0xFFFF

Definition at line 66 of file udp_app_flash.cpp.

◆ TRACE_ALL [2/2]

#define TRACE_ALL   0xFFFF

Definition at line 67 of file simu_udp_app_flash_env.cpp.

◆ TRACE_CGTF

#define TRACE_CGTF   1 << 3

Definition at line 65 of file simu_udp_app_flash_env.cpp.

◆ TRACE_DUMTF

#define TRACE_DUMTF   1 << 4

Definition at line 66 of file simu_udp_app_flash_env.cpp.

◆ TRACE_ESF

#define TRACE_ESF   1 << 1

Definition at line 63 of file udp_app_flash.cpp.

◆ TRACE_OFF [1/2]

#define TRACE_OFF   0x0000

Definition at line 62 of file udp_app_flash.cpp.

◆ TRACE_OFF [2/2]

#define TRACE_OFF   0x0000

Definition at line 62 of file simu_udp_app_flash_env.cpp.

◆ TRACE_RXP

#define TRACE_RXP   1 << 2

Definition at line 64 of file udp_app_flash.cpp.

◆ TRACE_TXP

#define TRACE_TXP   1 << 3

Definition at line 65 of file udp_app_flash.cpp.

◆ TRACE_UAF

#define TRACE_UAF   1 << 2

Definition at line 64 of file simu_udp_app_flash_env.cpp.

◆ TRACE_USIF

#define TRACE_USIF   1 << 1

Definition at line 63 of file simu_udp_app_flash_env.cpp.

◆ UNVALID

#define UNVALID   false

Definition at line 49 of file simu_udp_app_flash_env.hpp.

◆ VALID

#define VALID   true

Definition at line 48 of file simu_udp_app_flash_env.hpp.

Enumeration Type Documentation

◆ EchoCtrl

enum EchoCtrl

SHELL/MMIO/EchoCtrl - Config Register

Enumerator
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 
ECHO_STORE_FWD 
ECHO_PATH_THRU 
ECHO_CTRL_DISABLED 
ECHO_PATH_THRU 
ECHO_STORE_FWD 
ECHO_OFF 

Definition at line 44 of file udp_app_flash.hpp.

44  {
46  ECHO_PATH_THRU = 1,
47  ECHO_STORE_FWD = 2,
48  ECHO_OFF = 3
49 };
@ ECHO_STORE_FWD
@ ECHO_CTRL_DISABLED
@ ECHO_OFF
@ ECHO_PATH_THRU

Function Documentation

◆ createGoldenTxFiles()

int createGoldenTxFiles ( EchoCtrl  tbCtrlMode,
string  inpData_FileName,
queue< UdpAppMeta > &  udpMetaQueue,
queue< UdpAppDLen > &  udpDLenQueue,
string  outData_GoldName,
string  outMeta_GoldName,
string  outDLen_GoldName 
)

Create the golden UDP Tx files from an input test file.

Parameters
[in]tbCtrlModeThe testbench mode of operation.
[in]inpData_FileNameThe input data file to generate from.
[out]udpMetaQueueA ref to a container queue which holds the sequence of UDP socket-pairs.
[out]udpDLenQueueA ref to a container queue which holds the sequence of UDP datagram lengths.
[in]outData_GoldNameThe output datagram gold file to create.
[in]outMeta_GoldNameThe output metadata gold file to create.
[in]outDLen_GoldNameThe output data len gold file to create.
Returns
NTS_ OK if successful, otherwise NTS_KO.

Definition at line 177 of file simu_udp_app_flash_env.cpp.

185 {
186  const char *myName = concat3(THIS_NAME, "/", "CGTF");
187 
188  const Ip4Addr hostDefaultIp4Address = 0x0A0CC832; // 10.012.200.50
189  const Ip4Addr fpgaDefaultIp4Address = 0x0A0CC807; // 10.012.200.7
190  const UdpPort fpgaDefaultUdpLsnPort = ECHO_PATH_THRU_PORT;
191  const UdpPort hostDefaultUdpLsnPort = fpgaDefaultUdpLsnPort;
192  const UdpPort hostDefaultUdpSndPort = 32768+ECHO_PATH_THRU_PORT; // 41571
193  const UdpPort fpgaDefaultUdpSndPort = hostDefaultUdpSndPort;
194 
195  ifstream ifsData;
196  ofstream ofsDataGold;
197  ofstream ofsMetaGold;
198  ofstream ofsDLenGold;
199 
200  char currPath[FILENAME_MAX];
201  int ret=NTS_OK;
202  int inpChunks=0, outChunks=0;
203  int inpDgrms=0, outDgrms=0;
204  int inpBytes=0, outBytes=0;
205 
206  //-- STEP-1 : OPEN INPUT TEST FILE ----------------------------------------
207  if (not isDatFile(inpData_FileName)) {
208  printError(myName, "Cannot create golden files from input file \'%s\' because file is not of type \'.dat\'.\n",
209  inpData_FileName.c_str());
210  return(NTS_KO);
211  }
212  else {
213  ifsData.open(inpData_FileName.c_str());
214  if (!ifsData) {
215  getcwd(currPath, sizeof(currPath));
216  printError(myName, "Cannot open the file: %s \n\t (FYI - The current working directory is: %s) \n",
217  inpData_FileName.c_str(), currPath);
218  return(NTS_KO);
219  }
220  }
221 
222  //-- STEP-2 : OPEN THE OUTPUT GOLD FILES ----------------------------------
223  remove(outData_GoldName.c_str());
224  remove(outMeta_GoldName.c_str());
225  remove(outDLen_GoldName.c_str());
226  if (!ofsDataGold.is_open()) {
227  ofsDataGold.open (outData_GoldName.c_str(), ofstream::out);
228  if (!ofsDataGold) {
229  printFatal(THIS_NAME, "Could not open the output gold file \'%s\'. \n",
230  outData_GoldName.c_str());
231  }
232  }
233  if (!ofsMetaGold.is_open()) {
234  ofsMetaGold.open (outMeta_GoldName.c_str(), ofstream::out);
235  if (!ofsMetaGold) {
236  printFatal(THIS_NAME, "Could not open the output gold file \'%s\'. \n",
237  outMeta_GoldName.c_str());
238  }
239  }
240  if (!ofsDLenGold.is_open()) {
241  ofsDLenGold.open (outDLen_GoldName.c_str(), ofstream::out);
242  if (!ofsDLenGold) {
243  printFatal(THIS_NAME, "Could not open the output gold file \'%s\'. \n",
244  outDLen_GoldName.c_str());
245  }
246  }
247 
248  //-- STEP-3 : READ AND PARSE THE INPUT TEST FILE --------------------------
249  SockAddr hostSock = SockAddr(hostDefaultIp4Address, hostDefaultUdpSndPort);
250  SockAddr fpgaSock = SockAddr(fpgaDefaultIp4Address, fpgaDefaultUdpLsnPort);
251  int dgmCnt = 0;
252  do {
253  SimUdpDatagram appDatagram(8);
254  SocketPair currSockPair(hostSock, fpgaSock);
255  UdpAppDLen udpAppDLen = 0;
256  bool endOfDgm=false;
257  //-- Retrieve one APP datagram from input DAT file (can be up to 2^16-1 bytes)
258  endOfDgm = readDatagramFromFile(myName, appDatagram, ifsData,
259  currSockPair, udpMetaQueue, udpDLenQueue,
260  inpChunks, inpDgrms, inpBytes);
261  if (endOfDgm) {
262  //-- Swap the IP_SA/IP_DA but keep UDP_SP/UDP/DP as is
263  SocketPair goldSockPair(SockAddr(currSockPair.dst.addr, currSockPair.src.port),
264  SockAddr(currSockPair.src.addr, currSockPair.dst.port));
265  // Dump the socket pair to file
266  if (tbCtrlMode == ECHO_CTRL_DISABLED) {
267  writeSocketPairToFile(goldSockPair, ofsMetaGold);
268  if (DEBUG_LEVEL & TRACE_CGTF) {
269  printInfo(myName, "Writing new socket-pair to gold file:\n");
270  printSockPair(myName, goldSockPair);
271  }
272  }
273 
274  // Dump the data len to file
275  if (tbCtrlMode == ECHO_CTRL_DISABLED) {
276  UdpAppDLen appDLen;
277  if (currSockPair.dst.port == ECHO_PATH_THRU_PORT) {
278  //-- The traffic will be forwarded in 'ECHO-CUT-THRU' mode
279  // [TODO] if (dgmCnt % 2) {
280  // [TODO] //-- Datagram counter is an ODD value
281  // [TODO] //-- Enable the 'STREAMING-MODE' by setting 'DLen' to zero.
282  // [TODO] appDLen = 0;
283  // [TODO] }
284  // [TODO] else {
285  appDLen = appDatagram.length() - UDP_HEADER_LEN;
286  // [TODO] }
287  }
288  else {
289  appDLen = appDatagram.length() - UDP_HEADER_LEN;
290  }
291 
299  writeApUintToFile(appDLen, ofsDLenGold);
300  if (DEBUG_LEVEL & TRACE_CGTF) {
301  printInfo(myName, "Writing new datagram len (%d) to gold file:\n", appDLen.to_int());
302  }
303  }
304 
305  // Dump UDP datagram payload to gold file
306  if (tbCtrlMode == ECHO_CTRL_DISABLED) {
307  if (appDatagram.writePayloadToDatFile(ofsDataGold) == false) {
308  printError(myName, "Failed to write UDP payload to GOLD file.\n");
309  ret = NTS_KO;
310  }
311  else {
312  outDgrms += 1;
313  outChunks += appDatagram.size();
314  outBytes += appDatagram.length();
315  }
316  }
317  dgmCnt++;
318  } // End-of:if (endOfDgm) {
319 
320  } while(ifsData.peek() != EOF);
321 
322  //-- STEP-4: CLOSE FILES
323  ifsData.close();
324  ofsDataGold.close();
325  ofsMetaGold.close();
326  ofsDLenGold.close();
327 
328  //-- STEP-5: PRINT RESULTS
329  printInfo(myName, "Done with the creation of the golden file.\n");
330  printInfo(myName, "\tProcessed %5d chunks in %4d datagrams, for a total of %6d bytes.\n",
331  inpChunks, inpDgrms, inpBytes);
332  printInfo(myName, "\tGenerated %5d chunks in %4d datagrams, for a total of %6d bytes.\n",
333  outChunks, outDgrms, outBytes);
334  return NTS_OK;
335 }
Class UDP Datagram.
UdpLen UdpAppDLen
Definition: nal.hpp:255
ap_uint< 16 > UdpPort
Definition: nal.hpp:249
bool writeApUintToFile(ap_uint< D > &data, ofstream &outFileStream)
Dump an AP_UINT to a file.
bool isDatFile(string fileName)
Checks if a file has a ".dat" extension.
Definition: SimNtsUtils.cpp:52
bool writeSocketPairToFile(SocketPair &socketPair, ofstream &outFileStream)
Dump a SocketPair to a file.
#define NTS_KO
Definition: nts_types.hpp:56
#define printError(callerName, format,...)
A macro to print an error message.
Definition: nts_utils.hpp:195
ap_uint< 32 > Ip4Addr
Definition: AxisIp4.hpp:169
#define NTS_OK
Definition: nts_types.hpp:55
#define printInfo(callerName, format,...)
A macro to print an information message.
Definition: nts_utils.hpp:169
#define UDP_HEADER_LEN
Definition: AxisUdp.hpp:81
#define concat3(firstCharConst, secondCharConst, thirdCharConst)
Definition: nts_utils.hpp:161
void printSockPair(const char *callerName, SocketPair sockPair)
Print a socket pair association.
Definition: nts_utils.cpp:114
#define printFatal(callerName, format,...)
A macro to print a fatal error message and exit.
Definition: nts_utils.hpp:208
#define ECHO_PATH_THRU_PORT
bool readDatagramFromFile(const char *myName, SimUdpDatagram &appDatagram, ifstream &ifsData, SocketPair &sockPair, queue< UdpAppMeta > &udpMetaQueue, queue< UdpAppDLen > &udpDLenQueue, int &inpChunks, int &inpDgrms, int &inpBytes)
Read a datagram from a DAT file.
#define TRACE_CGTF
#define THIS_NAME
#define DEBUG_LEVEL
out
Definition: test.py:12
Here is the call graph for this function:

◆ createUdpRxTraffic()

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.

Parameters
[in/out]ssData A ref to the data stream to set.
[in]ssDataNameThe name of the data stream to set.
[in/out]ssMeta A ref to the metadata stream to set.
[in]ssMetaNameThe name of the metadata stream to set.
[in/out]ssDLen A ref to the data len stream to set.
[in]ssDLenNameThe name of the data len stream to set.
[in]datFileNameThe path to the DAT file to read from.
[in]metaQueueA ref to a queue of metadata.
[in]dlenQueueA ref to a queue of data len.
[out]nrChunksA ref to the number of fed chunks.
Returns
NTS_ OK if successful, otherwise NTS_KO.

Definition at line 353 of file simu_udp_app_flash_env.cpp.

361 {
362 
363  int nrUSIF_UAF_MetaChunks = 0;
364  int nrUSIF_UAF_MetaGrams = 0;
365  int nrUSIF_UAF_MetaBytes = 0;
366 
367  //-- STEP-1: FEED AXIS DATA STREAM FROM DAT FILE --------------------------
368  int nrDataChunks=0, nrDataGrams=0, nrDataBytes=0;
369  if (feedAxisFromFile(ssData, ssDataName, datFile,
370  nrDataChunks, nrDataGrams, nrDataBytes)) {
371  printInfo(THIS_NAME, "Done with the creation of UDP-Data traffic as a stream:\n");
372  printInfo(THIS_NAME, "\tGenerated %d chunks in %d datagrams, for a total of %d bytes.\n\n",
373  nrDataChunks, nrDataGrams, nrDataBytes);
374  nrFeededChunks = nrDataChunks;
375  }
376  else {
377  printError(THIS_NAME, "Failed to create UDP-Data traffic as input stream. \n");
378  return NTS_KO;
379  }
380 
381  //-- STEP-2: FEED METADATA STREAM FROM QUEUE ------------------------------
382  while (!metaQueue.empty()) {
383  ssMeta.write(metaQueue.front());
384  metaQueue.pop();
385  }
386 
387  //-- STEP-3: FEED DATA LEN STREAM ROM QUEUE -------------------------------
388  while (!dlenQueue.empty()) {
389  ssDLen.write(dlenQueue.front());
390  dlenQueue.pop();
391  }
392 
393  return NTS_OK;
394 
395 } // End-of: createUdpRxTraffic()
bool feedAxisFromFile(stream< AXIS_T > &ss, const string ssName, string datFile, int &nrChunks, int &nrFrames, int &nrBytes)
Initialize an Axi4-Stream (Axis) from a DAT file.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ drainUdpDLenStreamToFile()

bool drainUdpDLenStreamToFile ( stream< UdpAppDLen > &  ss,
string  ssName,
string  datFile,
int &  nrChunks,
int &  nrFrames,
int &  nrBytes 
)

Empty a UdpDLen stream to a DAT file.

Parameters
[in/out]ss A ref to the UDP data len to drain.
[in]ssNameThe name of the data len stream to drain.
[in]fileNameThe DAT file to write to.
[outnrChunks A ref to the number of written chunks.
[out]nrFramesA ref to the number of written AXI4 streams.
[out]nrBytesA ref to the number of written bytes.
Returns
NTS_OK if successful, otherwise NTS_KO.

Definition at line 472 of file simu_udp_app_flash_env.cpp.

473  {
474  ofstream outFileStream;
475  char currPath[FILENAME_MAX];
476  UdpAppDLen udpDLen;
477 
478  const char *myName = concat3(THIS_NAME, "/", "DUDTF");
479 
480  //-- REMOVE PREVIOUS FILE
481  remove(ssName.c_str());
482 
483  //-- OPEN FILE
484  if (!outFileStream.is_open()) {
485  outFileStream.open(datFile.c_str(), ofstream::out);
486  if (!outFileStream) {
487  printError(THIS_NAME, "Cannot open the file: \'%s\'.\n", datFile.c_str());
488  return(NTS_KO);
489  }
490  }
491 
492  // Assess that file has ".dat" extension
493  if ( datFile.find_last_of ( '.' ) != string::npos ) {
494  string extension ( datFile.substr( datFile.find_last_of ( '.' ) + 1 ) );
495  if (extension != "dat") {
496  printError(THIS_NAME, "Cannot dump SocketPair stream to file \'%s\' because file is not of type \'DAT\'.\n", datFile.c_str());
497  outFileStream.close();
498  return(NTS_KO);
499  }
500  }
501 
502  //-- READ FROM STREAM AND WRITE TO FILE
503  while (!(ss.empty())) {
504  ss.read(udpDLen);
505  writeApUintToFile(udpDLen, outFileStream);
506  nrChunks++;
507  nrBytes += 2;
508  nrFrames++;
509  if (DEBUG_LEVEL & TRACE_DUMTF) {
510  printInfo(myName, "Writing new datagram length file. Len=%d.\n", udpDLen.to_int());
511  }
512  }
513 
514  //-- CLOSE FILE
515  outFileStream.close();
516 
517  return(NTS_OK);
518 }
#define TRACE_DUMTF
Here is the call graph for this function:

◆ drainUdpMetaStreamToFile()

bool drainUdpMetaStreamToFile ( stream< UdpAppMeta > &  ss,
string  ssName,
string  datFile,
int &  nrChunks,
int &  nrFrames,
int &  nrBytes 
)

Empty an UdpMeta stream to a DAT file.

Parameters
[in/out]ss A ref to the UDP metadata stream to drain.
[in]ssNameThe name of the UDP metadata stream to drain.
[in]fileNameThe DAT file to write to.
[outnrChunks A ref to the number of written chunks.
[out]nrFramesA ref to the number of written AXI4 streams.
[out]nrBytesA ref to the number of written bytes.
Returns
NTS_OK if successful, otherwise NTS_KO.

Definition at line 409 of file simu_udp_app_flash_env.cpp.

410  {
411  ofstream outFileStream;
412  char currPath[FILENAME_MAX];
413  UdpAppMeta udpMeta;
414 
415  const char *myName = concat3(THIS_NAME, "/", "DUMTF");
416 
417  //-- REMOVE PREVIOUS FILE
418  remove(ssName.c_str());
419 
420  //-- OPEN FILE
421  if (!outFileStream.is_open()) {
422  outFileStream.open(datFile.c_str(), ofstream::out);
423  if (!outFileStream) {
424  printError(THIS_NAME, "Cannot open the file: \'%s\'.\n", datFile.c_str());
425  return(NTS_KO);
426  }
427  }
428 
429  // Assess that file has ".dat" extension
430  if ( datFile.find_last_of ( '.' ) != string::npos ) {
431  string extension ( datFile.substr( datFile.find_last_of ( '.' ) + 1 ) );
432  if (extension != "dat") {
433  printError(THIS_NAME, "Cannot dump SocketPair stream to file \'%s\' because file is not of type \'DAT\'.\n", datFile.c_str());
434  outFileStream.close();
435  return(NTS_KO);
436  }
437  }
438 
439  //-- READ FROM STREAM AND WRITE TO FILE
440  while (!(ss.empty())) {
441  ss.read(udpMeta);
442  SocketPair socketPair(SockAddr(udpMeta.ip4SrcAddr, udpMeta.udpSrcPort),
443  SockAddr(udpMeta.ip4DstAddr, udpMeta.udpDstPort));
444  writeSocketPairToFile(socketPair, outFileStream);
445  nrChunks++;
446  nrBytes += 12;
447  nrFrames++;
448  if (DEBUG_LEVEL & TRACE_DUMTF) {
449  printInfo(myName, "Writing new socket-pair to file:\n");
450  printSockPair(myName, socketPair);
451  }
452  }
453 
454  //-- CLOSE FILE
455  outFileStream.close();
456 
457  return(NTS_OK);
458 }
Ly4Port udpDstPort
Definition: nts.hpp:229
Ly4Port udpSrcPort
Definition: nts.hpp:227
Ip4Addr ip4SrcAddr
Definition: nts.hpp:226
Ip4Addr ip4DstAddr
Definition: nts.hpp:228
Here is the call graph for this function:

◆ dumpDataToFile()

bool dumpDataToFile ( UdpWord udpWord,
ofstream &  outFileStream 
)

Dump a data word to a file.

Parameters
[in]udpWord,apointer to the data word to dump.
[in]outFileStream,theoutput file stream to write to.
Returns
OK if successful, otherwise KO.

Definition at line 162 of file test_triangle_app.cpp.

162  {
163  if (!outFileStream.is_open()) {
164  printf("### ERROR : Output file stream is not open. \n");
165  return(KO);
166  }
167  outFileStream << hex << noshowbase << setfill('0') << setw(16) << udpWord->tdata.to_uint64();
168  outFileStream << " ";
169  outFileStream << hex << noshowbase << setfill('0') << setw(2) << udpWord->tkeep.to_int();
170  outFileStream << " ";
171  outFileStream << setw(1) << udpWord->tlast.to_int() << "\n";
172  return(OK);
173 }
ap_uint< 64 > tdata
ap_uint< 1 > tlast
ap_uint< 8 > tkeep
#define OK
#define KO
Here is the caller graph for this function:

◆ getOutputDataStream()

bool getOutputDataStream ( stream< UdpWord > &  sDataStream,
const string  dataStreamName,
const string  outFileName 
)

Fill an output file with data from an output stream.

Parameters
[in]sDataStream,theoutput data stream to set.
[in]dataStreamName,thename of the data stream.
[in]outFileName,thename of the output file to write to.
Returns
OK if successful, otherwise KO.

Definition at line 185 of file test_triangle_app.cpp.

187 {
188  string strLine;
189  ofstream outFileStream;
190  string datFile = "../../../../test/" + outFileName;
191  UdpWord udpWord;
192  bool rc = OK;
193 
194  //-- STEP-1 : OPEN FILE
195  outFileStream.open(datFile.c_str());
196  if ( !outFileStream ) {
197  cout << "### ERROR : Could not open the output data file " << datFile << endl;
198  return(KO);
199  }
200 
201  //-- STEP-2 : EMPTY STREAM AND DUMP DATA TO FILE
202  while (!sDataStream.empty()) {
203  if (readDataStream(sDataStream, &udpWord) == VALID) {
204  // Print DUT/Data to console
205  printf("[%4.4d] TB is draining output stream [%s] - Data read = {D=0x%16.16llX, K=0x%2.2X, L=%d} \n",
206  simCnt, dataStreamName.c_str(),
207  udpWord.tdata.to_long(), udpWord.tkeep.to_int(), udpWord.tlast.to_int());
208  if (!dumpDataToFile(&udpWord, outFileStream)) {
209  rc = KO;
210  break;
211  }
212  }
213  }
214 
215  //-- STEP-3: CLOSE FILE
216  outFileStream.close();
217 
218  return(rc);
219 }
bool readDataStream(stream< UdpWord > &sDataStream, UdpWord *udpWord)
Read data from a stream.
bool dumpDataToFile(UdpWord *udpWord, ofstream &outFileStream)
Dump a data word to a file.
int simCnt
#define VALID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ increaseSimTime()

void increaseSimTime ( unsigned int  cycles)

Increase the simulation time of the testbench.

Parameters
[in]Thenumber of cycles to increase.

Definition at line 89 of file simu_udp_app_flash_env.cpp.

89  {
90  gMaxSimCycles += cycles;
91 }
unsigned int gMaxSimCycles
Definition: test_arp.hpp:69

◆ main()

int main ( int  argc,
char *  argv[] 
)

Main function for the test of the UDP Application Flash (UAF).

Main function for the test of the UDP Application Flash (UAF) TOP.

Definition at line 62 of file test_udp_app_flash.cpp.

62  {
63 
64  gSimCycCnt = 0;
65 
66  //------------------------------------------------------
67  //-- TESTBENCH LOCAL VARIABLES
68  //------------------------------------------------------
69  int nrErr = 0;
70  EchoCtrl tbCtrlMode = ECHO_CTRL_DISABLED;
71 
72  //------------------------------------------------------
73  //-- NONE-STREAM-BASED INTERFACES
74  //------------------------------------------------------
75  // INFO - The UAF is specified to use the block-level IO protocol
76  // 'ap_ctrl_none'. This core uses also a few configurations signals
77  // which are not stream-based and which prevent the design from
78  // being verified in C/RTL co-simulation mode. In oder to comply
79  // with the 'Interface Synthesis Requirements' of UG902, the design
80  // is compiled with a preprocessor macro that statically defines the
81  // testbench mode of operation. This avoid the following error issued
82  // when trying to C/RTL co-simulate this component:
83  // @E [SIM-345] Cosim only supports the following 'ap_ctrl_none'
84  // designs: (1) combinational designs; (2) pipelined design with
85  // task interval of 1; (3) designs with array streaming or
86  // hls_stream ports.
87  // @E [SIM-4] *** C/RTL co-simulation finished: FAIL **
88  //------------------------------------------------------
89  CmdBit sSHL_UAF_Mmio_Enable = CMD_ENABLE;
90 #if TB_MODE == 0
91  ap_uint<2> sSHL_UAF_Mmio_EchoCtrl = ECHO_CTRL_DISABLED;
92  ap_uint<1> sSHL_UAF_Mmio_PostPktEn = 0;
93  ap_uint<1> sSHL_UAF_Mmio_CaptPktEn = 0;
94 #elif TB_MODE == 1
95  ap_uint<2> sSHL_UAF_Mmio_EchoCtrl = ECHO_PATH_THRU;
96  ap_uint<1> sSHL_UAF_Mmio_PostPktEn = 0;
97  ap_uint<1> sSHL_UAF_Mmio_CaptPktEn = 0;
98 #elif TB_MODE == 2
99  ap_uint<2> sSHL_UAF_Mmio_EchoCtrl = ECHO_STORE_FWD;
100  ap_uint<1> sSHL_UAF_Mmio_PostPktEn = 0;
101  ap_uint<1> sSHL_UAF_Mmio_CaptPktEn = 0;
102 #else
103  ap_uint<2> sSHL_UAF_Mmio_EchoCtrl = ECHO_OFF;
104  ap_uint<1> sSHL_UAF_Mmio_PostPktEn = 0;
105  ap_uint<1> sSHL_UAF_Mmio_CaptPktEn = 0;
106 #endif
107 
108  //------------------------------------------------------
109  //-- DUT STREAM INTERFACES and RELATED VARIABLEs
110  //------------------------------------------------------
111  stream<UdpAppData> ssUSIF_UAF_Data ("ssUSIF_UAF_Data");
112  stream<UdpAppMeta> ssUSIF_UAF_Meta ("ssUSIF_UAF_Meta");
113  stream<UdpAppDLen> ssUSIF_UAF_DLen ("ssUSIF_UAF_DLen");
114  stream<UdpAppData> ssUAF_USIF_Data ("ssUAF_USIF_Data");
115  stream<UdpAppMeta> ssUAF_USIF_Meta ("ssUAF_USIF_Meta");
116  stream<UdpAppDLen> ssUAF_USIF_DLen ("ssUAF_USIF_DLen");
117 
118  //------------------------------------------------------
119  //-- PARSING THE TESBENCH ARGUMENTS
120  //------------------------------------------------------
121  if (argc < 3) {
122  printFatal(THIS_NAME, "Expected a minimum of 2 parameters with the following synopsis:\n \t\t mode(0|1|2) siUAF_<Filename>.dat\n");
123  }
124  tbCtrlMode = EchoCtrl(atoi(argv[1]));
125  if (tbCtrlMode != sSHL_UAF_Mmio_EchoCtrl) {
126  printFatal(THIS_NAME, "tbCtrlMode (%d) does not match TB_MODE (%d). Modify the CFLAG and re-compile.\n", tbCtrlMode, TB_MODE);
127  }
128 
129  switch (tbCtrlMode) {
130  case ECHO_CTRL_DISABLED:
131  break;
132  case ECHO_PATH_THRU:
133  case ECHO_STORE_FWD:
134  case ECHO_OFF:
135  printFatal(THIS_NAME, "The 'ECHO' mode %d is no longer supported since the removal of the MMIO EchoCtrl bits. \n", tbCtrlMode);
136  break;
137  default:
138  printFatal(THIS_NAME, "Unknown testing mode '%d' (or not yet implemented). \n");
139  }
140 
141  printf("#####################################################\n");
142  printf("## TESTBENCH STARTS HERE ##\n");
143  printf("#####################################################\n");
144  printInfo(THIS_NAME, "This testbench will be executed with the following parameters: \n");
145  printInfo(THIS_NAME, "\t==> TB Mode = %c\n", *argv[1]);
146  for (int i=2; i<argc; i++) {
147  printInfo(THIS_NAME, "\t==> Param[%d] = %s\n", (i-1), argv[i]);
148  }
149  printf("\n");
150 
151  if (tbCtrlMode == ECHO_CTRL_DISABLED) {
152 
153  //-- DUT OUTPUT TRAFFIC AS STREAMS ------------------------------
154  ofstream ofsUSIF_Data; // APP data streams delivered to USIF
155  const char *ofsUSIF_Data_FileName = "../../../../test/simOutFiles/soUSIF_Data.dat";
156  ofstream ofsUSIF_Meta; // APP meta streams delivered to USIF
157  const char *ofsUSIF_Meta_FileName = "../../../../test/simOutFiles/soUSIF_Meta.dat";
158  ofstream ofsUSIF_DLen; // APP data len streams delivered to USIF
159  const char *ofsUSIF_DLen_FileName = "../../../../test/simOutFiles/soUSIF_DLen.dat";
160 
161  string ofsUSIF_Data_Gold_FileName = "../../../../test/simOutFiles/soUSIF_Data_Gold.dat";
162  string ofsUSIF_Meta_Gold_FileName = "../../../../test/simOutFiles/soUSIF_Meta_Gold.dat";
163  string ofsUSIF_DLen_Gold_FileName = "../../../../test/simOutFiles/soUSIF_DLen_Gold.dat";
164 
165  //-- STEP-1: The setting of the ECHO mode is already done via CFLAGS
166  printInfo(THIS_NAME, "### TEST_MODE = ECHO_CTRL_DISABLED #########\n");
167 
168  //-- STEP-2: Remove previous old files and open new files
169  if (not isDatFile(ofsUSIF_Data_FileName)) {
170  printError(THIS_NAME, "File \'%s\' is not of type \'DAT\'.\n", ofsUSIF_Data_FileName);
171  nrErr++;
172  }
173  else {
174  remove(ofsUSIF_Data_FileName);
175  }
176  if (not isDatFile(ofsUSIF_Meta_FileName)) {
177  printError(THIS_NAME, "File \'%s\' is not of type \'DAT\'.\n", ofsUSIF_Meta_FileName);
178  nrErr++;
179  }
180  else {
181  remove(ofsUSIF_Meta_FileName);
182  if (!ofsUSIF_Meta.is_open()) {
183  ofsUSIF_Meta.open(ofsUSIF_Meta_FileName, ofstream::out);
184  if (!ofsUSIF_Meta) {
185  printError(THIS_NAME, "Cannot open the file: \'%s\'.\n", ofsUSIF_Meta_FileName);
186  nrErr++;
187  }
188  }
189  }
190  if (not isDatFile(ofsUSIF_DLen_FileName)) {
191  printError(THIS_NAME, "File \'%s\' is not of type \'DAT\'.\n", ofsUSIF_DLen_FileName);
192  nrErr++;
193  }
194  else {
195  remove(ofsUSIF_DLen_FileName);
196  if (!ofsUSIF_DLen.is_open()) {
197  ofsUSIF_DLen.open(ofsUSIF_DLen_FileName, ofstream::out);
198  if (!ofsUSIF_DLen) {
199  printError(THIS_NAME, "Cannot open the file: \'%s\'.\n", ofsUSIF_DLen_FileName);
200  nrErr++;
201  }
202  }
203  }
204 
205  //-- STEP-3: Create golden Tx files
206  queue<UdpAppMeta> udpMetaQueue;
207  queue<UdpAppDLen> udpDLenQueue;
208  if (NTS_OK == createGoldenTxFiles(tbCtrlMode, string(argv[2]), udpMetaQueue, udpDLenQueue,
209  ofsUSIF_Data_Gold_FileName, ofsUSIF_Meta_Gold_FileName, ofsUSIF_DLen_Gold_FileName) != NTS_OK) {
210  printError(THIS_NAME, "Failed to create golden Tx files. \n");
211  nrErr++;
212  }
213 
214  //-- STEP-4: Create the USIF->UAF INPUT {Data,Meta} as streams
215  int nrUSIF_UAF_Chunks=0;
216  if (not createUdpRxTraffic(ssUSIF_UAF_Data, "ssUSIF_UAF_Data",
217  ssUSIF_UAF_Meta, "ssUSIF_UAF_Meta",
218  ssUSIF_UAF_DLen, "ssUSIF_UAF_DLen",
219  string(argv[2]),
220  udpMetaQueue, udpDLenQueue,
221  nrUSIF_UAF_Chunks)) {
222  printFatal(THIS_NAME, "Failed to create the USIF->UAF traffic as streams.\n");
223  }
224 
225  //-- STEP-5: Run simulation
226  int tbRun = (nrErr == 0) ? (nrUSIF_UAF_Chunks + TB_GRACE_TIME) : 0;
227  while (tbRun) {
229  //-- SHELL / Mmio Interfaces
230  &sSHL_UAF_Mmio_Enable,
231  //[NOT_USED] sSHL_UAF_Mmio_EchoCtrl,
232  //[NOT_USED] sSHL_UAF_Mmio_PostPktEn,
233  //[NOT_USED] sSHL_UAF_Mmio_CaptPktEn,
234  //-- USIF / Rx Data Interfaces
235  ssUSIF_UAF_Data,
236  ssUSIF_UAF_Meta,
237  ssUSIF_UAF_DLen,
238  //-- USIF / Tx Data Interfaces
239  ssUAF_USIF_Data,
240  ssUAF_USIF_Meta,
241  ssUAF_USIF_DLen);
242  tbRun--;
243  stepSim();
244  }
245 
246  printInfo(THIS_NAME, "############################################################################\n");
247  printInfo(THIS_NAME, "## TESTBENCH 'test_udp_app_flash' ENDS HERE ##\n");
248  printInfo(THIS_NAME, "############################################################################\n");
249  stepSim();
250 
251  //-- STEP-6a: Drain UAF-->USIF DATA OUTPUT STREAM
252  int nrUAF_USIF_DataChunks=0, nrUAF_USIF_DataGrams=0, nrUAF_USIF_DataBytes=0;
253  if (not drainAxisToFile(ssUAF_USIF_Data, "ssUAF_USIF_Data",
254  ofsUSIF_Data_FileName, nrUAF_USIF_DataChunks, nrUAF_USIF_DataGrams, nrUAF_USIF_DataBytes)) {
255  printError(THIS_NAME, "Failed to drain UAF-to-USIF data traffic from DUT. \n");
256  nrErr++;
257  }
258  else {
259  printInfo(THIS_NAME, "Done with the draining of the UAF-to-USIF data traffic:\n");
260  printInfo(THIS_NAME, "\tReceived %d chunks in %d datagrams, for a total of %d bytes.\n\n",
261  nrUAF_USIF_DataChunks, nrUAF_USIF_DataGrams, nrUAF_USIF_DataBytes);
262  }
263  //-- STEP-6b: Drain UAF-->USIF META OUTPUT STREAM
264  int nrUAF_USIF_MetaChunks=0, nrUAF_USIF_MetaGrams=0, nrUAF_USIF_MetaBytes=0;
265  if (not drainUdpMetaStreamToFile(ssUAF_USIF_Meta, "ssUAF_USIF_Meta",
266  ofsUSIF_Meta_FileName, nrUAF_USIF_MetaChunks, nrUAF_USIF_MetaGrams, nrUAF_USIF_MetaBytes)) {
267  printError(THIS_NAME, "Failed to drain UAF-to-USIF meta traffic from DUT. \n");
268  nrErr++;
269  }
270  //-- STEP-6c: Drain UAF-->USIF DLEN OUTPUT STREAM
271  int nrUAF_USIF_DLenChunks=0, nrUAF_USIF_DLenGrams=0, nrUAF_USIF_DLenBytes=0;
272  if (not drainUdpDLenStreamToFile(ssUAF_USIF_DLen, "ssUAF_USIF_DLen",
273  ofsUSIF_DLen_FileName, nrUAF_USIF_DLenChunks, nrUAF_USIF_DLenGrams, nrUAF_USIF_DLenBytes)) {
274  printError(THIS_NAME, "Failed to drain UAF-to-USIF dlen traffic from DUT. \n");
275  nrErr++;
276  }
277 
278  //-- STEP-7: Compare output DAT vs gold DAT
279  int res;
280  ifstream ifsFile;
281 
282  ifsFile.open(ofsUSIF_Data_FileName, ofstream::in);
283  if (!ifsFile) {
284  printError(THIS_NAME, "Cannot open the file: \'%s\'.\n", ofsUSIF_Data_FileName);
285  nrErr++;
286  }
287  else if (not (ifsFile.peek() == ifstream::traits_type::eof())) {
288  res = myDiffTwoFiles(std::string(ofsUSIF_Data_FileName),
289  std::string(ofsUSIF_Data_Gold_FileName));
290  if (res) {
291  printError(THIS_NAME, "File \'%s\' does not match \'%s\'.\n", \
292  ofsUSIF_Data_FileName, ofsUSIF_Data_Gold_FileName.c_str());
293  nrErr += 1;
294  }
295  }
296  else {
297  printError(THIS_NAME, "File \"%s\" is empty.\n", ofsUSIF_Data_FileName);
298  nrErr++;
299  }
300  ifsFile.close();
301 
302  ifsFile.open(ofsUSIF_DLen_FileName, ofstream::in);
303  if (!ifsFile) {
304  printError(THIS_NAME, "Cannot open the file: \'%s\'.\n", ofsUSIF_DLen_FileName);
305  nrErr++;
306  }
307  else if (not (ifsFile.peek() == ifstream::traits_type::eof())) {
308  res = myDiffTwoFiles(std::string(ofsUSIF_DLen_FileName),
309  std::string(ofsUSIF_DLen_Gold_FileName));
310  if (res) {
311  printError(THIS_NAME, "File \'%s\' does not match \'%s\'.\n", \
312  ofsUSIF_DLen_FileName, ofsUSIF_DLen_Gold_FileName.c_str());
313  nrErr += 1;
314  }
315  }
316  else {
317  printError(THIS_NAME, "File \"%s\" is empty.\n", ofsUSIF_DLen_FileName);
318  nrErr++;
319  }
320  ifsFile.close();
321 
322  } // End-of: if (tbCtrlMode == ECHO_CTRL_DISABLED) {
323 
324 
325  //---------------------------------------------------------------
326  //-- PRINT TESTBENCH STATUS
327  //---------------------------------------------------------------
328  printf("\n\n");
329  printInfo(THIS_NAME, "This testbench was executed with the following parameters: \n");
330  printInfo(THIS_NAME, "\t==> TB Mode = %c\n", *argv[1]);
331  for (int i=2; i<argc; i++) {
332  printInfo(THIS_NAME, "\t==> Param[%d] = %s\n", (i-1), argv[i]);
333  }
334 
335  if (nrErr) {
336  printError(THIS_NAME, "###########################################################\n");
337  printError(THIS_NAME, "#### TEST BENCH FAILED : TOTAL NUMBER OF ERROR(S) = %2d ####\n", nrErr);
338  printError(THIS_NAME, "###########################################################\n\n");
339 
340  printInfo(THIS_NAME, "FYI - You may want to check for \'ERROR\' and/or \'WARNING\' alarms in the LOG file...\n\n");
341  }
342  else {
343  printInfo(THIS_NAME, "#############################################################\n");
344  printInfo(THIS_NAME, "#### SUCCESSFUL END OF TEST ####\n");
345  printInfo(THIS_NAME, "#############################################################\n");
346  }
347 
348  return nrErr;
349 
350 }
EchoCtrl
Definition: memtest.hpp:49
#define TB_GRACE_TIME
Definition: test_arp.hpp:54
void stepSim()
Increment the simulation counter.
Definition: test_arp.cpp:54
bool drainAxisToFile(stream< AXIS_T > &ss, const string ssName, string datFile, int &nrChunks, int &nrFrames, int &nrBytes)
Empty an Axi4-Stream (Axis) to a DAT file.
int myDiffTwoFiles(string dataFileName, string goldFileName)
Compares 2 files line-by-line, up to length of the 2nd file.
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.
Definition: test_uoe.cpp:381
bool drainUdpDLenStreamToFile(stream< UdpAppDLen > &ss, string ssName, string datFile, int &nrChunks, int &nrFrames, int &nrBytes)
Empty an UdpDLen stream to a DAT file.
Definition: test_uoe.cpp:142
bool drainUdpMetaStreamToFile(stream< UdpAppMeta > &ss, string ssName, string datFile, int &nrChunks, int &nrFrames, int &nrBytes)
Empty an UdpMeta stream to a DAT file.
Definition: test_uoe.cpp:74
#define CMD_ENABLE
Definition: nts_types.hpp:63
ap_uint< 1 > CmdBit
Definition: nts_types.hpp:108
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.
unsigned int gSimCycCnt
Definition: tb_nal.cpp:150
void udp_app_flash(CmdBit *piSHL_Mmio_En, stream< UdpAppData > &siUSIF_Data, stream< UdpAppMeta > &siUSIF_Meta, stream< UdpAppDLen > &siUSIF_DLen, stream< UdpAppData > &soUSIF_Data, stream< UdpAppMeta > &soUSIF_Meta, stream< UdpAppDLen > &soUSIF_DLen)
Main process of the UDP Application Flash (UAF)
Here is the call graph for this function:

◆ pUdpEchoStoreAndForward()

void pUdpEchoStoreAndForward ( CmdBit piSHL_Enable,
stream< UdpAppData > &  siRXp_Data,
stream< UdpAppMeta > &  siRXp_Meta,
stream< UdpAppDLen > &  siRXp_DLen,
stream< UdpAppData > &  soTXp_Data,
stream< UdpAppMeta > &  soTXp_Meta,
stream< UdpAppDLen > &  soTXp_DLen 
)

Echo loopback between the Rx and Tx ports of the UDP connection.

Parameters
[in]piSHL_EnableEnable signal from [SHELL].
[in]siRXp_DataUDP datagram from RxPath (RXp).
[in]siRXp_MetaUDP metadata from [RXp].
[in]siRXp_DLenUDP data len from [RXp].
[out]soTXp_DataUDP datagram to TxPath (TXp).
[out]soTXp_MetaUDP metadata to [TXp].
[out]soTXp_DLenUDP data len to [TXp].

The echo is said to operate in "store-and-forward" mode because every received packet is stored into the DDR4 memory before being read again from the DDR4 and and sent back.

[TODO - Implement this process as a real store-and-forward]

Definition at line 87 of file udp_app_flash.cpp.

95 {
96  //-- DIRECTIVES FOR THIS PROCESS ------------------------------------------
97  #pragma HLS INLINE off
98  #pragma HLS PIPELINE II=1 enable_flush
99 
100  const char *myName = concat3(THIS_NAME, "/", "ESf");
101 
102  //-- STATIC CONTROL VARIABLES (with RESET) ---------------------------------
103  static enum FsmStates { ESF_META=0, ESF_STREAM } \
104  esf_fsmState = ESF_META;
105  #pragma HLS reset variable=esf_fsmState
106  static UdpAppDLen esf_byteCnt;
107  #pragma HLS reset variable=esf_byteCnt
108 
109  if (*piSHL_Enable != 1) {
110  return;
111  }
112 
113  //=====================================================
114  //== PROCESS DATA FORWARDING
115  //=====================================================
116  if ( !siRXp_Data.empty() and !soTXp_Data.full() ) {
117  UdpAppData appData = siRXp_Data.read();
118  soTXp_Data.write(appData);
119  esf_byteCnt += appData.getLen();
120  if (appData.getTLast()) {
121  esf_byteCnt = 0;
122  }
123  }
124 
125  //=====================================================
126  //== PROCESS META FORWARDING
127  //=====================================================
128  if ( !siRXp_Meta.empty() and !soTXp_Meta.full() and
129  !siRXp_DLen.empty() and !soTXp_DLen.full() ) {
130  UdpAppMeta appMeta = siRXp_Meta.read();
131  UdpAppDLen appDLen = siRXp_DLen.read();
132  soTXp_Meta.write(appMeta);
133  soTXp_DLen.write(appDLen);
134  }
135 } // End-of: pEchoStoreAndForward()
tLast getTLast() const
Definition: AxisRaw.hpp:219
int getLen() const
Definition: AxisRaw.hpp:411
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pUdpRxPath()

void pUdpRxPath ( CmdBit piSHL_Mmio_Enable,
stream< UdpAppData > &  siUSIF_Data,
stream< UdpAppMeta > &  siUSIF_Meta,
stream< UdpAppDLen > &  siUSIF_DLen,
stream< UdpAppData > &  soEPt_Data,
stream< UdpAppMeta > &  soEPt_Meta,
stream< UdpAppDLen > &  soEPt_DLen,
stream< UdpAppData > &  soESf_Data,
stream< UdpAppMeta > &  soESf_Meta,
stream< UdpAppDLen > &  soESf_DLen 
)

UDP Receive Path (RXp) - From SHELL->ROLE/USIF to THIS.

Parameters
[in]piSHL_Mmio_EnableEnable signal from [SHELL].
[in]piSHL_Mmio_EchoCtrlConfiguration of the echo function.
[in]siUSIF_DataDatagram from UdpShellInterface (USIF).
[in]siUSIF_MetaMetadata from [USIF].
[in]siUSIF_DLenData len from [USIF].
[out]soEPt_DataDatagram to EchoPassTrough (EPt).
[out]soEPt_MetaMetadata to [EPt].
[out]soEPt_DLenData len to [EPt].
[out]soESf_DataDatagram to EchoStoreAndForward (ESf).
[out]soESf_MetaMetadata to [ESf].
[out]soESf_DLenMetadata to [ESf].

This Process waits for a new datagram to read and forwards it to the EchoPathThrough (EPt) or EchoStoreAndForward (ESf) process upon the setting of the UDP destination port.

Warning
When operating with AP_FIFOs instead of AXIS interfaces, it may be necessary to drain the incoming FIFos after a reset (see e.g. the state RXP_DRAIN_INPUT_FIFOS)

Definition at line 351 of file udp_app_flash.cpp.

363 {
364  //-- DIRECTIVES FOR THIS PROCESS -------------------------------------------
365  #pragma HLS INLINE off
366  #pragma HLS PIPELINE II=1 enable_flush
367 
368  const char *myName = concat3(THIS_NAME, "/", "RXp");
369 
370  //-- STATIC CONTROL VARIABLES (with RESET) ---------------------------------
371  static enum FsmStates { RXP_IDLE=0, RXP_META_EPT, RXP_META_ESF,
372  RXP_DATA_EPT, RXP_DATA_ESF,
373  RXP_DLEN_EPT, RXP_DLEN_ESF,
374  RXP_DRAIN_INPUT_FIFOS } \
375  rxp_fsmState = RXP_IDLE;
376  #pragma HLS reset variable=rxp_fsmState
377 
378  //-- STATIC DATAFLOW VARIABLES ---------------------------------------------
379  static UdpAppMeta rxp_appMeta;
380  static UdpAppDLen rxp_appDLen;
381  static UdpAppDLen rxp_byteCnt;
382 
383  //-- DYNAMIC VARIABLES -----------------------------------------------------
384  UdpAppData appData;
385 
386  switch (rxp_fsmState) {
387  case RXP_IDLE:
388  if (*piSHL_Mmio_Enable == CMD_DISABLE) {
389  rxp_fsmState = RXP_DRAIN_INPUT_FIFOS;
390  }
391  else if (!siUSIF_Meta.empty() and !siUSIF_DLen.empty()) {
392  siUSIF_Meta.read(rxp_appMeta);
393  siUSIF_DLen.read(rxp_appDLen);
394  rxp_byteCnt = 0;
395  switch (rxp_appMeta.udpDstPort) {
396  case ECHO_PATH_THRU_PORT:
397  // (DstPort == 8803) Echo this traffic in path-through mode
398  if (DEBUG_LEVEL & TRACE_RXP) { printInfo(myName, "Entering Rx path-through mode (DstPort=%4.4d)\n", rxp_appMeta.udpDstPort.to_uint()); }
399  rxp_fsmState = RXP_META_EPT;
400  break;
401  default:
402  // (DstPort != 8803) Echo this traffic in store-and-forward mode
403  if (DEBUG_LEVEL & TRACE_RXP) { printInfo(myName, "Entering Rx store-and-forward mode (DstPort=%4.4d)\n", rxp_appMeta.udpDstPort.to_uint()); }
404  rxp_fsmState = RXP_META_ESF;
405  break;
406  }
407  }
408  break;
409  case RXP_DRAIN_INPUT_FIFOS:
410  // Drain all the incoming FIFOs as long as MMIO control signal is disabled
411  if(!siUSIF_Data.empty()) {
412  siUSIF_Data.read();
413  }
414  else if(!siUSIF_Meta.empty()) {
415  siUSIF_Meta.read();
416  }
417  else if(!siUSIF_DLen.empty()) {
418  siUSIF_DLen.read();
419  }
420  else {
421  rxp_fsmState = RXP_IDLE;
422  }
423  break;
424  case RXP_META_EPT:
425  if (!soEPt_Meta.full()) {
426  //-- Forward incoming metadata to pEchoPathThrough
427  soEPt_Meta.write(rxp_appMeta);
428  rxp_fsmState = RXP_DATA_EPT;
429  }
430  break;
431  case RXP_META_ESF:
432  if (!soESf_Meta.full()) {
433  //-- Forward incoming metadata to pEchoStoreAndForward
434  soESf_Meta.write(rxp_appMeta);
435  rxp_fsmState = RXP_DATA_ESF;
436  }
437  break;
438  case RXP_DATA_EPT:
439  if (!siUSIF_Data.empty() and !soEPt_Data.full()) {
440  //-- Read incoming data and forward to pEchoPathThrough
441  siUSIF_Data.read(appData);
442  soEPt_Data.write(appData);
443  rxp_byteCnt = rxp_byteCnt + appData.getLen();
444  if (appData.getTLast()) {
445  rxp_fsmState = RXP_DLEN_EPT;
446  }
447  }
448  break;
449  case RXP_DATA_ESF:
450  if (!siUSIF_Data.empty() and !soESf_Data.full()) {
451  //-- Read incoming data and forward to pEchoStoreAndForward
452  siUSIF_Data.read(appData);
453  soESf_Data.write(appData);
454  rxp_byteCnt = rxp_byteCnt + appData.getLen();
455  if (appData.getTLast()) {
456  rxp_fsmState = RXP_DLEN_ESF;
457  }
458  }
459  break;
460  case RXP_DLEN_EPT:
461  if (!soEPt_DLen.full()) {
462  //-- Forward the computed data length to pEchoPathThrough
463  if (rxp_byteCnt != rxp_appDLen) {
464  printFatal(myName, "Received number of bytes (%d) differs from the advertised data length (%d)\n", rxp_byteCnt.to_uint(), rxp_appDLen.to_uint());
465  }
466  soEPt_DLen.write(rxp_byteCnt);
467  rxp_fsmState = RXP_IDLE;
468  }
469  break;
470  case RXP_DLEN_ESF:
471  if (!soESf_DLen.full()) {
472  //-- Forward the computed data length to pEchoPathThrough
473  if (rxp_byteCnt != rxp_appDLen) {
474  printFatal(myName, "Received number of bytes (%d) differs from the advertised data length (%d)\n", rxp_byteCnt.to_uint(), rxp_appDLen.to_uint());
475  }
476  soESf_DLen.write(rxp_byteCnt);
477  rxp_fsmState = RXP_IDLE;
478  }
479  break;
480  } // End-of: switch (rxp_fsmState) {
481 
482 } // End-of: pRxPath()
#define CMD_DISABLE
Definition: nts_types.hpp:64
#define TRACE_RXP
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pUdpTxPath()

void pUdpTxPath ( CmdBit piSHL_Mmio_Enable,
stream< UdpAppData > &  siEPt_Data,
stream< UdpAppMeta > &  siEPt_Meta,
stream< UdpAppDLen > &  siEPt_DLen,
stream< UdpAppData > &  siESf_Data,
stream< UdpAppMeta > &  siESf_Meta,
stream< UdpAppDLen > &  siESf_DLen,
stream< UdpAppData > &  soUSIF_Data,
stream< UdpAppMeta > &  soUSIF_Meta,
stream< UdpAppDLen > &  soUSIF_DLen 
)

Transmit Path - From THIS to USIF.

Parameters
[in]piSHL_Mmio_EnableEnable signal from [SHELL].
[in]piSHL_Mmio_EchoCtrlConfiguration of the echo function.
[in]siEPt_DataDatagram from pEchoPassTrough (EPt).
[in]siEPt_MetaMetadata from [EPt].
[in]siEPt_DLenData len from [EPt].
[in]siESf_DataDatagram from pEchoStoreAndForward (ESf).
[in]siESf_MetaMetadata from [ESf].
[in]siESf_DLenData len from [ESf].
[out]soUSIF_DataDatagram to UdpShellInterface (USIF).
[out]soUSIF_MetaMetadata to [USIF].
[out]soUSIF_DLenData len to [USIF].

The 'EchoPathThrough' forwards the datagrams in either DATAGRAM_MODE or STREAMING_MODE. The mode is defined by the content of the 'DLen' field: 1) DATAGRAM_MODE: If the 'DLen' field is loaded with a length != 0, this length is used as reference for handling the incoming datagram. If the length is larger than 1472 bytes (.i.e, MTU-IP_HEADER_LEN-UDP_HEADER_LEN), the UDP Offload Engine (UOE) of the NTS is expected to split the incoming datagram and generate as many sub-datagrams as required to transport all 'DLen' bytes over Ethernet. frames. 2) STREAMING_MODE: If the 'DLen' field is configured with a length==0, the corresponding stream is expected to be forwarded by the UOE of the NTS based on the same metadata information until the 'TLAST' bit of the data stream is set. In this mode, the UOE will wait for the reception of 1472 bytes before generating a new UDP-over-IPv4 packet, unless the 'TLAST' bit of the data stream is set.

Definition at line 168 of file udp_app_flash.cpp.

180 {
181  //-- DIRECTIVES FOR THIS PROCESS -------------------------------------------
182  #pragma HLS INLINE off
183  #pragma HLS PIPELINE II=1 enable_flush
184 
185  const char *myName = concat3(THIS_NAME, "/", "TXp");
186 
187  //-- STATIC CONTROL VARIABLES (with RESET) ---------------------------------
188  static enum FsmStates { TXP_IDLE=0, TXP_META,
189  TXP_DATA_EPT, TXP_DATA_ESF, TXP_DRAIN_INPUT_FIFOS } \
190  txp_fsmState = TXP_IDLE;
191  #pragma HLS reset variable=txp_fsmState
192  static enum DgmMode { STRM_MODE=0, DGRM_MODE } \
193  txp_fwdMode = DGRM_MODE;
194  #pragma HLS reset variable=txp_fwdMode
195 
196  //-- STATIC DATAFLOW VARIABLES ---------------------------------------------
197  static ap_int<17> txp_lenCnt;
198  static UdpAppMeta txp_appMeta;
199  static UdpAppDLen txp_appDLen;
200  static enum EchoMode { EPT_MODE=0, ESF_MODE } \
201  txp_echoMode = EPT_MODE;
202 
203  //-- DYNAMIC VARIABLES -----------------------------------------------------
204  UdpAppData appData;
205 
206  switch (txp_fsmState) {
207  case TXP_IDLE:
208  if (*piSHL_Mmio_Enable == CMD_DISABLE) {
209  txp_fsmState = TXP_DRAIN_INPUT_FIFOS;
210  }
211  else if (!siEPt_Meta.empty() and !siEPt_DLen.empty()) {
212  txp_appMeta = siEPt_Meta.read();
213  txp_appDLen = siEPt_DLen.read();
214  txp_echoMode = EPT_MODE;
215  txp_fsmState = TXP_META;
216  }
217  else if (!siESf_Meta.empty() and !siESf_DLen.empty()) {
218  txp_appMeta = siESf_Meta.read();
219  txp_appDLen = siESf_DLen.read();
220  txp_echoMode = ESF_MODE;
221  txp_fsmState = TXP_META;
222  }
223  if (txp_appDLen == 0) {
224  txp_fwdMode = STRM_MODE;
225  txp_lenCnt = 0;
226  }
227  else {
228  txp_fwdMode = DGRM_MODE;
229  txp_lenCnt = txp_appDLen;
230  }
231  break;
232  case TXP_META:
233  if (!soUSIF_Meta.full() and !soUSIF_DLen.full()) {
234  // Swap IP_SA/IP_DA as well as UPD_SP/UDP_DP
235  UdpAppMeta udpMeta(txp_appMeta.ip4DstAddr, txp_appMeta.udpDstPort,
236  txp_appMeta.ip4SrcAddr, txp_appMeta.udpSrcPort);
237  soUSIF_Meta.write(udpMeta);
238  soUSIF_DLen.write(txp_appDLen);
239  if (txp_echoMode == EPT_MODE) {
240  txp_fsmState = TXP_DATA_EPT;
241  }
242  else {
243  txp_fsmState = TXP_DATA_ESF;
244  }
245  }
246  break;
247  case TXP_DATA_EPT:
248  if (!siEPt_Data.empty() and !soUSIF_Data.full()) {
249  appData = siEPt_Data.read();
250  if (txp_fwdMode == STRM_MODE) {
251  txp_lenCnt = txp_lenCnt + appData.getLen(); // Just for tracing
252  if (appData.getTLast()) {
253  txp_fsmState = TXP_IDLE;
254  if (DEBUG_LEVEL & TRACE_TXP) {
255  printInfo(myName, "ECHO_PATH_THRU + STREAM MODE - Finished forwarding %d bytes.\n", txp_lenCnt.to_uint());
256  }
257  }
258  }
259  else {
260  txp_lenCnt = txp_lenCnt - appData.getLen();
261  if ((txp_lenCnt <= 0) or (appData.getTLast())) {
262  txp_fsmState = TXP_IDLE;
263  if (DEBUG_LEVEL & TRACE_TXP) {
264  printInfo(myName, "ECHO_PATH_THRU + DATAGRAM MODE - Finished datagram forwarding.\n");
265  }
266  }
267  else {
268  appData.setTLast(0);
269  }
270  }
271  soUSIF_Data.write(appData);
272  }
273  break;
274  case TXP_DATA_ESF:
275  if (!siESf_Data.empty() and !soUSIF_Data.full()) {
276  appData = siESf_Data.read();
277  if (txp_fwdMode == STRM_MODE) {
278  txp_lenCnt = txp_lenCnt + appData.getLen(); // Just for tracing
279  if (appData.getTLast()) {
280  txp_fsmState = TXP_IDLE;
281  if (DEBUG_LEVEL & TRACE_TXP) {
282  printInfo(myName, "ECHO_STORE_FWD + STREAM MODE - Finished forwarding %d bytes.\n", txp_lenCnt.to_uint());
283  }
284  }
285  }
286  else {
287  txp_lenCnt = txp_lenCnt - appData.getLen();
288  if ((txp_lenCnt <= 0) or (appData.getTLast())) {
289  txp_fsmState = TXP_IDLE;
290  if (DEBUG_LEVEL & TRACE_TXP) {
291  printInfo(myName, "ECHO_STORE_FWD + DATAGRAM MODE - Finished datagram forwarding.\n");
292  }
293  }
294  else {
295  appData.setTLast(0);
296  }
297  }
298  soUSIF_Data.write(appData);
299  }
300  break;
301  case TXP_DRAIN_INPUT_FIFOS:
302  // Drain all the incoming FIFOs as long as MMIO control signal is disabled
303  if(!siEPt_Data.empty()) {
304  siEPt_Data.read();
305  }
306  else if(!siEPt_Meta.empty()) {
307  siEPt_Meta.read();
308  }
309  else if(!siEPt_DLen.empty()) {
310  siEPt_Meta.read();
311  }
312  else if(!siESf_Data.empty()) {
313  siEPt_Data.read();
314  }
315  else if(!siESf_Meta.empty()) {
316  siEPt_Meta.read();
317  }
318  else if(!siESf_DLen.empty()) {
319  siEPt_Meta.read();
320  }
321  else {
322  txp_fsmState = TXP_IDLE;
323  }
324  break;
325  } // End-of: switch (txp_fsmState) {
326 
327 } // End-of: pTxPath()
void setTLast(tLast last)
Definition: AxisRaw.hpp:246
#define TRACE_TXP
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readDatagramFromFile()

bool readDatagramFromFile ( const char *  myName,
SimUdpDatagram appDatagram,
ifstream &  ifsData,
SocketPair sockPair,
queue< UdpAppMeta > &  udpMetaQueue,
queue< UdpAppDLen > &  udpDLenQueue,
int &  inpChunks,
int &  inpDgrms,
int &  inpBytes 
)

Read a datagram from a DAT file.

Parameters
[in]myNameThe name of the caller process.
[in]appDatagramA reference to the datagram to read.
[in]ifsDataThe input file stream to read from.
[out]sockPairA ref to the current active socket pair.
[out]udpMetaQueueA ref to a container queue which holds the sequence of UDP socket-pairs.
[out]udpDLenQueueA ref to a container queue which holds the sequence of UDP data lengths.
[out]inpChunksA ref to the number of processed chunks.
[out]inptDgrmsA ref to the number of processed datagrams.
[out]inpBytesA ref to the number of processed bytes.
Returns
true if successful, otherwise false.

SIMULATION ENVIRONMENT FUNCTIONS

Definition at line 107 of file simu_udp_app_flash_env.cpp.

111  {
112 
113  string stringBuffer;
114  vector<string> stringVector;
115  UdpAppData udpAppData;
116  UdpAppDLen udpAppDLen=0;
117  bool endOfDgm=false;
118  bool rc;
119 
120  do {
121  //-- Read one line at a time from the input test DAT file
122  getline(ifsData, stringBuffer);
123  stringVector = myTokenizer(stringBuffer, ' ');
124  //-- Read the Host Socket Address from line (if present)
125  rc = readHostSocketFromLine(sockPair.src, stringBuffer);
126  if (rc) {
127  if (DEBUG_LEVEL & TRACE_CGTF) {
128  printInfo(myName, "Read a new HOST socket address from DAT file:\n");
129  printSockAddr(myName, sockPair.src);
130  }
131  }
132  //-- Read the Fpga Socket Address from line (if present)
133  rc = readFpgaSocketFromLine(sockPair.dst, stringBuffer);
134  if (rc) {
135  if (DEBUG_LEVEL & TRACE_CGTF) {
136  printInfo(myName, "Read a new FPGA socket address from DAT file:\n");
137  printSockAddr(myName, sockPair.dst);
138  }
139  }
140  //-- Read an AxiWord from line
141  rc = readAxisRawFromLine(udpAppData, stringBuffer);
142  if (rc) {
143  appDatagram.pushChunk(AxisUdp(udpAppData.getLE_TData(),
144  udpAppData.getLE_TKeep(),
145  udpAppData.getLE_TLast()));
146  inpChunks++;
147  inpBytes += udpAppData.getLen();
148  udpAppDLen += udpAppData.getLen();
149  if (udpAppData.getLE_TLast() == 1) {
150  inpDgrms++;
151  udpMetaQueue.push(UdpAppMeta(sockPair.src.addr, sockPair.src.port,
152  sockPair.dst.addr, sockPair.dst.port));
153  udpDLenQueue.push(udpAppDLen);
154  endOfDgm = true;
155  }
156  }
157  } while ((ifsData.peek() != EOF) && (!endOfDgm));
158 
159  return endOfDgm;
160 }
LE_tKeep getLE_TKeep(int leHi=64/8-1, int leLo=0) const
Definition: AxisRaw.hpp:264
LE_tData getLE_TData(int leHi=64 -1, int leLo=0) const
Definition: AxisRaw.hpp:260
LE_tLast getLE_TLast() const
Definition: AxisRaw.hpp:268
void pushChunk(AxisUdp udpChunk)
Ip4Addr addr
Definition: nts_types.hpp:209
Ly4Port port
Definition: nts_types.hpp:210
SockAddr dst
Definition: nts_types.hpp:249
SockAddr src
Definition: nts_types.hpp:248
bool readHostSocketFromLine(SockAddr &hostSock, string stringBuffer)
Retrieve a Host socket from a string.
bool readFpgaSocketFromLine(SockAddr &fpgaSock, string stringBuffer)
Retrieve an Fpga socket from a string.
bool readAxisRawFromLine(AxisRaw &axisRaw, string stringBuffer)
Retrieve an AxisRaw chunk from a string.
vector< string > myTokenizer(string strBuff, char delimiter)
Brakes a string into tokens by using the 'delimiter' character.
void printSockAddr(const char *callerName, SockAddr sockAddr)
Print a socket address.
Definition: nts_utils.cpp:174
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readDataStream()

bool readDataStream ( stream< UdpWord > &  sDataStream,
UdpWord udpWord 
)

Read data from a stream.

Parameters
[in]sDataStream,theoutput data stream to read.
[in]dataStreamName,thename of the data stream.
[out]udpWord,apointer to the storage location of the data to read.
Returns
VALID if a data was read, otherwise UNVALID.

Definition at line 147 of file test_triangle_app.cpp.

147  {
148  // Get the DUT/Data results
149  sDataStream.read(*udpWord);
150  return(VALID);
151 }
Here is the caller graph for this function:

◆ setInputDataStream()

bool setInputDataStream ( stream< UdpWord > &  sDataStream,
const string  dataStreamName,
const string  inpFileName 
)

Initialize an input data stream from a file.

Parameters
[in]sDataStream,theinput data stream to set.
[in]dataStreamName,thename of the data stream.
[in]inpFileName,thename of the input file to read from.
Returns
OK if successful, otherwise KO.

Definition at line 93 of file test_triangle_app.cpp.

93  {
94  string strLine;
95  ifstream inpFileStream;
96  string datFile = "../../../../test/" + inpFileName;
97  UdpWord udpWord;
98 
99  //-- STEP-1 : OPEN FILE
100  inpFileStream.open(datFile.c_str());
101  if ( !inpFileStream ) {
102  cout << "### ERROR : Could not open the input data file " << datFile << endl;
103  return(KO);
104  }
105 
106  //-- STEP-2 : SET DATA STREAM
107  while (inpFileStream) {
108 
109  if (!inpFileStream.eof()) {
110 
111  getline(inpFileStream, strLine);
112  if (strLine.empty()) continue;
113  sscanf(strLine.c_str(), "%llx %x %d", &udpWord.tdata, &udpWord.tkeep, &udpWord.tlast);
114 
115  // Write to sDataStream
116  if (sDataStream.full()) {
117  printf("### ERROR : Stream is full. Cannot write stream with data from file \"%s\".\n", inpFileName.c_str());
118  return(KO);
119  } else {
120  sDataStream.write(udpWord);
121  // Print Data to console
122  printf("[%4.4d] TB is filling input stream [%s] - Data write = {D=0x%16.16llX, K=0x%2.2X, L=%d} \n",
123  simCnt, dataStreamName.c_str(),
124  udpWord.tdata.to_long(), udpWord.tkeep.to_int(), udpWord.tlast.to_int());
125  }
126  }
127  }
128 
129  //-- STEP-3: CLOSE FILE
130  inpFileStream.close();
131 
132  return(OK);
133 }
Here is the caller graph for this function:

◆ stepDut()

void stepDut ( )

Run a single iteration of the DUT model.

Returns
Nothing.

Definition at line 74 of file test_triangle_app.cpp.

74  {
76  &node_rank, &size,
80  simCnt++;
81  printf("[%4.4d] STEP DUT \n", simCnt);
82 }
stream< NetworkMetaStream > siUdp_meta("siUdp_meta")
ap_uint< 32 > size
stream< NetworkMetaStream > soUdp_meta("soUdp_meta")
stream< UdpWord > sUAF_Shl_Data("sUAF_Shl_Data")
stream< UdpWord > sSHL_Uaf_Data("sSHL_Uaf_Data")
ap_uint< 32 > s_udp_rx_ports
ap_uint< 32 > node_rank
void triangle_app(ap_uint< 32 > *pi_rank, ap_uint< 32 > *pi_size, stream< NetworkWord > &siNrc_data, stream< NetworkWord > &soNrc_data, stream< NetworkMetaStream > &siNrc_meta, stream< NetworkMetaStream > &soNrc_meta, ap_uint< 32 > *po_rx_ports)
Main process of the UDP/TCP Triangle Application. This HLS IP receives a packet and forwards it to th...
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stepSim()

void stepSim ( )

Increment the simulation counter.

SIMULATION UTILITY HELPERS

Definition at line 73 of file simu_udp_app_flash_env.cpp.

73  {
74  gSimCycCnt++;
75  if (gTraceEvent || ((gSimCycCnt % 1000) == 0)) {
76  printInfo(THIS_NAME, "-- [@%4.4d] -----------------------------\n", gSimCycCnt);
77  gTraceEvent = false;
78  }
79  else if (0) {
80  printInfo(THIS_NAME, "------------------- [@%d] ------------\n", gSimCycCnt);
81  }
82 }
bool gTraceEvent
Definition: tb_nal.cpp:151

◆ udp_app_flash()

void udp_app_flash ( CmdBit piSHL_Mmio_En,
stream< UdpAppData > &  siUSIF_Data,
stream< UdpAppMeta > &  siUSIF_Meta,
stream< UdpAppDLen > &  siUSIF_DLen,
stream< UdpAppData > &  soUSIF_Data,
stream< UdpAppMeta > &  soUSIF_Meta,
stream< UdpAppDLen > &  soUSIF_DLen 
)

Main process of the UDP Application Flash (UAF)

Parameters
[in]piSHL_Mmio_EnEnable signal from [SHELL/MMIO].
[in]piSHL_Mmio_EchoCtrlConfigures the echo function.
[in]piSHL_Mmio_PostPktEnEnables posting of UDP packets.
[in]piSHL_Mmio_CaptPktEnEnables capture of UDP packets.
[in]siUSIF_DataUDP datagram from UdpShellInterface (USIF).
[in]siUSIF_MetaUDP metadata from [USIF].
[in]siUSIF_DLenUDP data len from [USIF].
[out]soUSIF_DataUDP datagram to [USIF].
[out]soUSIF_MetaUDP metadata to [USIF].
[out]soUSIF_DLenUDP data len to [USIF].

@info This core is designed with non-blocking read and write streams in mind. FYI, this is the normal way of operation for an internal stream and for an interface using the 'ap_fifo' protocol.

Warning
This core will not work properly if operated with a handshake interface(ap_hs) or an AXI-Stream interface (axis) because these two interfaces do not support non-blocking accesses.

ENTITY - UDP APPLICATION FLASH (UAF)

Definition at line 506 of file udp_app_flash.cpp.

529 {
530  //-- DIRECTIVES FOR THIS PROCESS -------------------------------------------
531  #pragma HLS DATAFLOW
532  #pragma HLS INLINE off
533 
534  //--------------------------------------------------------------------------
535  //-- LOCAL STREAMS (Sorted by the name of the modules which generate them)
536  //--------------------------------------------------------------------------
537 
538  //-- Rx Path (RXp) ---------------------------------------------------------
539  static stream<UdpAppData> ssRXpToTXp_Data ("ssRXpToTXp_Data");
540  #pragma HLS STREAM variable=ssRXpToTXp_Data depth=2048
541  static stream<UdpAppMeta> ssRXpToTXp_Meta ("ssRXpToTXp_Meta");
542  #pragma HLS STREAM variable=ssRXpToTXp_Meta depth=64
543  static stream<UdpAppDLen> ssRXpToTXp_DLen ("ssRXpToTXp_DLen");
544  #pragma HLS STREAM variable=ssRXpToTXp_DLen depth=64
545 
546  static stream<UdpAppData> ssRXpToESf_Data ("ssRXpToESf_Data");
547  #pragma HLS STREAM variable=ssRXpToESf_Data depth=1024
548  static stream<UdpAppMeta> ssRXpToESf_Meta ("ssRXpToESf_Meta");
549  #pragma HLS STREAM variable=ssRXpToESf_Meta depth=32
550  static stream<UdpAppDLen> ssRXpToESf_DLen ("ssRXpToESf_DLen");
551  #pragma HLS STREAM variable=ssRXpToESf_DLen depth=32
552 
553  //-- Echo Store and Forward (ESf) ------------------------------------------
554  static stream<UdpAppData> ssESfToTXp_Data ("ssESfToTXp_Data");
555  #pragma HLS STREAM variable=ssESfToTXp_Data depth=1024
556  static stream<UdpAppMeta> ssESfToTXp_Meta ("ssESfToTXp_Meta");
557  #pragma HLS STREAM variable=ssESfToTXp_Meta depth=32
558  static stream<UdpAppDLen> ssESfToTXp_DLen ("ssESfToTXp_DLen");
559  #pragma HLS STREAM variable=ssESfToTXp_DLen depth=32
560 
561  //-- PROCESS FUNCTIONS ----------------------------------------------------
562  //
563  //
564  // +----------+
565  // +-------->| pESf |----------+
566  // | +----------+ |
567  // | --------+ |
568  // | +--------> sEPt |---------+ |
569  // | | --------+ | |
570  // +--+--+--+--+ +--+--+--+--+
571  // | pRXp | | pTXp |
572  // +------+----+ +-----+-----+
573  // /|\ |
574  // | |
575  // | |
576  // | \|/
577  //
578  //-------------------------------------------------------------------------
579  pUdpRxPath(
580  piSHL_Mmio_En,
581  //[NOT_USED] piSHL_Mmio_EchoCtrl,
582  siUSIF_Data,
583  siUSIF_Meta,
584  siUSIF_DLen,
585  ssRXpToTXp_Data,
586  ssRXpToTXp_Meta,
587  ssRXpToTXp_DLen,
588  ssRXpToESf_Data,
589  ssRXpToESf_Meta,
590  ssRXpToESf_DLen);
591 
593  piSHL_Mmio_En,
594  ssRXpToESf_Data,
595  ssRXpToESf_Meta,
596  ssRXpToESf_DLen,
597  ssESfToTXp_Data,
598  ssESfToTXp_Meta,
599  ssESfToTXp_DLen);
600 
601  pUdpTxPath(
602  piSHL_Mmio_En,
603  //[NOT_USED] piSHL_Mmio_EchoCtrl,
604  ssRXpToTXp_Data,
605  ssRXpToTXp_Meta,
606  ssRXpToTXp_DLen,
607  ssESfToTXp_Data,
608  ssESfToTXp_Meta,
609  ssESfToTXp_DLen,
610  soUSIF_Data,
611  soUSIF_Meta,
612  soUSIF_DLen);
613 
614 }
void pUdpTxPath(CmdBit *piSHL_Mmio_Enable, stream< UdpAppData > &siEPt_Data, stream< UdpAppMeta > &siEPt_Meta, stream< UdpAppDLen > &siEPt_DLen, stream< UdpAppData > &siESf_Data, stream< UdpAppMeta > &siESf_Meta, stream< UdpAppDLen > &siESf_DLen, stream< UdpAppData > &soUSIF_Data, stream< UdpAppMeta > &soUSIF_Meta, stream< UdpAppDLen > &soUSIF_DLen)
Transmit Path - From THIS to USIF.
void pUdpRxPath(CmdBit *piSHL_Mmio_Enable, stream< UdpAppData > &siUSIF_Data, stream< UdpAppMeta > &siUSIF_Meta, stream< UdpAppDLen > &siUSIF_DLen, stream< UdpAppData > &soEPt_Data, stream< UdpAppMeta > &soEPt_Meta, stream< UdpAppDLen > &soEPt_DLen, stream< UdpAppData > &soESf_Data, stream< UdpAppMeta > &soESf_Meta, stream< UdpAppDLen > &soESf_DLen)
UDP Receive Path (RXp) - From SHELL->ROLE/USIF to THIS.
void pUdpEchoStoreAndForward(CmdBit *piSHL_Enable, stream< UdpAppData > &siRXp_Data, stream< UdpAppMeta > &siRXp_Meta, stream< UdpAppDLen > &siRXp_DLen, stream< UdpAppData > &soTXp_Data, stream< UdpAppMeta > &soTXp_Meta, stream< UdpAppDLen > &soTXp_DLen)
Echo loopback between the Rx and Tx ports of the UDP connection.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ udp_app_flash_top()

void udp_app_flash_top ( CmdBit piSHL_Mmio_En,
stream< UdpAppData > &  siUSIF_Data,
stream< UdpAppMeta > &  siUSIF_Meta,
stream< UdpAppDLen > &  siUSIF_DLen,
stream< UdpAppData > &  soUSIF_Data,
stream< UdpAppMeta > &  soUSIF_Meta,
stream< UdpAppDLen > &  soUSIF_DLen 
)

Top of UDP Application Flash (UAF)

INTERFACE SYNTHESIS DIRECTIVES

Parameters
[in]piSHL_Mmio_EchoCtrlConfigures the echo function.
[in]piSHL_Mmio_PostPktEnEnables posting of UDP packets.
[in]piSHL_Mmio_CaptPktEnEnables capture of UDP packets.
[in]siUSIF_DataUDP datagram from UdpShellInterface (USIF).
[in]siUSIF_MetaUDP metadata from [USIF].
[in]siUSIF_DLenUDP data len from [USIF].
[out]soUSIF_DataUDP datagram to [USIF].
[out]soUSIF_MetaUDP metadata to [USIF].
[out]soUSIF_DLenUDP data len to [USIF].

@info This toplevel exemplifies the instantiation of a core that uses AP_FIFO interfaces instead of AXIS.

ENTITY - UDP APPLICATION FLASH TOP (UAF_TOP)

Definition at line 130 of file udp_app_flash_top.cpp.

152 {
153  //-- DIRECTIVES FOR THE INTERFACES ----------------------------------------
154  #pragma HLS INTERFACE ap_ctrl_none port=return
155 
156  #if defined TAF_USE_NON_FIFO_IO
157  #pragma HLS INTERFACE ap_stable register port=piSHL_Mmio_EchoCtrl name=piSHL_Mmio_EchoCtrl
158  #pragma HLS INTERFACE ap_stable port=piSHL_Mmio_PostPktEn
159  #pragma HLS INTERFACE ap_stable port=piSHL_Mmio_CaptPktEn
160  #endif
161 
162  #if defined (UAF_USE_AP_FIFO)
163  //-- [USIF] INTERFACES ------------------------------------------------------
164  #pragma HLS INTERFACE ap_fifo port=siUSIF_Data name=siUSIF_Data
165  #pragma HLS DATA_PACK variable=siUSIF_Data
166  #pragma HLS INTERFACE ap_fifo port=siUSIF_Meta name=siUSIF_Meta
167  #pragma HLS DATA_PACK variable=siUSIF_Meta
168  #pragma HLS INTERFACE ap_fifo port=siUSIF_DLen name=siUSIF_DLen
169 
170  #pragma HLS INTERFACE ap_fifo port=soUSIF_Data name=soUSIF_Data
171  #pragma HLS DATA_PACK variable=soUSIF_Data
172  #pragma HLS INTERFACE ap_fifo port=soUSIF_Meta name=soUSIF_Meta
173  #pragma HLS DATA_PACK variable=soUSIF_Meta
174  #pragma HLS INTERFACE ap_fifo port=soUSIF_DLen name=soUSIF_DLen
175  #else
176  //-- [USIF] INTERFACES ------------------------------------------------------
177  #pragma HLS INTERFACE axis off port=siUSIF_Data name=siUSIF_Data
178  #pragma HLS INTERFACE axis off port=siUSIF_Meta name=siUSIF_Meta
179  #pragma HLS DATA_PACK variable=siUSIF_Meta
180  #pragma HLS INTERFACE axis off port=siUSIF_DLen name=siUSIF_DLen
181 
182  #pragma HLS INTERFACE axis off port=soUSIF_Data name=soUSIF_Data
183  #pragma HLS INTERFACE axis off port=soUSIF_Meta name=soUSIF_Meta
184  #pragma HLS DATA_PACK variable=soUSIF_Meta
185  #pragma HLS INTERFACE axis off port=soUSIF_DLen name=soUSIF_DLen
186  #endif
187 
188  //-- DIRECTIVES FOR THIS PROCESS -------------------------------------------
189 #if HLS_VERSION == 2017
190  #pragma HLS DATAFLOW
191 #else
192  #pragma HLS DATAFLOW disable_start_propagation
193 #endif
194  #pragma HLS INTERFACE ap_ctrl_none port=return
195 
196  //-- INSTANTIATE TOPLEVEL --------------------------------------------------
197  udp_app_flash (
198  //-- SHELL / Mmio Interfaces
199  piSHL_Mmio_En,
200  #if defined UAF_USE_NON_FIFO_IO
201  piSHL_Mmio_EchoCtrl,
202  piSHL_Mmio_PostPktEn,
203  piSHL_Mmio_CaptPktEn,
204  #endif
205  //-- USIF / Rx Data Interfaces
206  siUSIF_Data,
207  siUSIF_Meta,
208  siUSIF_DLen,
209  //-- USIF / Tx Data Interfaces
210  soUSIF_Data,
211  soUSIF_Meta,
212  soUSIF_DLen);
213 
214 }
Here is the call graph for this function:

Variable Documentation

◆ gFatalError [1/3]

bool gFatalError
extern

Definition at line 152 of file tb_nal.cpp.

◆ gFatalError [2/3]

bool gFatalError = false

Definition at line 46 of file test_udp_app_flash.hpp.

◆ gFatalError [3/3]

bool gFatalError = false

Definition at line 43 of file test_udp_app_flash_top.hpp.

◆ gMaxSimCycles [1/5]

unsigned int gMaxSimCycles
extern

Definition at line 69 of file test_arp.hpp.

◆ gMaxSimCycles [2/5]

unsigned int gMaxSimCycles
extern

Definition at line 69 of file test_arp.hpp.

◆ gMaxSimCycles [3/5]

unsigned int gMaxSimCycles = 500 + 500

Definition at line 47 of file test_udp_app_flash.hpp.

◆ gMaxSimCycles [4/5]

unsigned int gMaxSimCycles
extern

Definition at line 69 of file test_arp.hpp.

◆ gMaxSimCycles [5/5]

unsigned int gMaxSimCycles = 500 + 500

Definition at line 44 of file test_udp_app_flash_top.hpp.

◆ gSimCycCnt [1/5]

unsigned int gSimCycCnt
extern

GLOBAL VARIABLES USED BY THE SIMULATION ENVIRONMENT

Definition at line 150 of file tb_nal.cpp.

◆ gSimCycCnt [2/5]

unsigned int gSimCycCnt
extern

GLOBAL VARIABLES USED BY THE SIMULATION ENVIRONMENT

Definition at line 150 of file tb_nal.cpp.

◆ gSimCycCnt [3/5]

unsigned int gSimCycCnt = 0

GLOBAL VARIABLES USED BY THE SIMULATION ENVIRONMENT

Definition at line 44 of file test_udp_app_flash.hpp.

◆ gSimCycCnt [4/5]

unsigned int gSimCycCnt
extern

GLOBAL VARIABLES USED BY THE SIMULATION ENVIRONMENT

Definition at line 150 of file tb_nal.cpp.

◆ gSimCycCnt [5/5]

unsigned int gSimCycCnt = 0

GLOBAL VARIABLES USED BY THE SIMULATION ENVIRONMENT

Definition at line 41 of file test_udp_app_flash_top.hpp.

◆ gTraceEvent [1/4]

bool gTraceEvent
extern

HELPERS FOR THE DEBUGGING TRACES .e.g: DEBUG_LEVEL = (RXP_TRACE | ESF_TRACE)

HELPERS FOR THE DEBUGGING TRACES .e.g: DEBUG_LEVEL = (MDL_TRACE | IPS_TRACE)

Definition at line 151 of file tb_nal.cpp.

◆ gTraceEvent [2/4]

bool gTraceEvent
extern

HELPERS FOR THE DEBUGGING TRACES .e.g: DEBUG_LEVEL = (MDL_TRACE | IPS_TRACE)

Definition at line 151 of file tb_nal.cpp.

◆ gTraceEvent [3/4]

bool gTraceEvent = false

HELPERS FOR THE DEBUGGING TRACES .e.g: DEBUG_LEVEL = (MDL_TRACE | IPS_TRACE)

Definition at line 45 of file test_udp_app_flash.hpp.

◆ gTraceEvent [4/4]

bool gTraceEvent = false

HELPERS FOR THE DEBUGGING TRACES .e.g: DEBUG_LEVEL = (MDL_TRACE | IPS_TRACE)

Definition at line 42 of file test_udp_app_flash_top.hpp.