cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
udp_shell_if.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2016 -- 2021 IBM Corporation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
48 #include "udp_shell_if.hpp"
49 
50 using namespace hls;
51 using namespace std;
52 
53 
57 #ifndef __SYNTHESIS__
58  extern bool gTraceEvent;
59 #endif
60 
61 #define THIS_NAME "USIF" // UdpShellInterface
62 
63 #define TRACE_OFF 0x0000
64 #define TRACE_RDP 1 << 1
65 #define TRACE_WRP 1 << 2
66 #define TRACE_SAM 1 << 3
67 #define TRACE_LSN 1 << 4
68 #define TRACE_CLS 1 << 5
69 #define TRACE_ALL 0xFFFF
70 #define DEBUG_LEVEL (TRACE_OFF)
71 
72 enum DropCmd {KEEP_CMD=false, DROP_CMD};
73 
74 //---------------------------------------------------------
75 //-- DEFAULT LOCAL FPGA AND FOREIGN HOST SOCKETS
76 //-- By default, the following sockets will be used by the
77 //-- UDP Role Interface, unless the user specifies new ones
78 //-- via TBD.
79 //-- FYI --> 8803 is the ZIP code of Ruschlikon ;-)
80 //---------------------------------------------------------
81 #define DEFAULT_FPGA_LSN_PORT 0x2263 // ROLE listens on port = 8803
82 
83 
84 
104 void pListen(
105  CmdBit *piSHL_Enable,
106  stream<UdpPort> &soSHL_LsnReq,
107  stream<StsBool> &siSHL_LsnRep)
108 {
109  //-- DIRECTIVES FOR THIS PROCESS ------------------------------------------
110  #pragma HLS INLINE off
111  #pragma HLS PIPELINE II=1 enable_flush
112 
113  const char *myName = concat3(THIS_NAME, "/", "LSn");
114 
115  //-- STATIC CONTROL VARIABLES (with RESET) --------------------------------
116  static enum FsmStates { LSN_IDLE, LSN_SEND_REQ, LSN_WAIT_REP, LSN_DONE } \
117  lsn_fsmState=LSN_IDLE;
118  #pragma HLS reset variable=lsn_fsmState
119  static ap_uint<3> lsn_i = 0;
120  #pragma HLS reset variable=lsn_i
121 
122  //-- STATIC ARRAYS --------------------------------------------------------
123  static const UdpPort LSN_PORT_TABLE[6] = { RECV_MODE_LSN_PORT, XMIT_MODE_LSN_PORT,
126  #pragma HLS RESOURCE variable=LSN_PORT_TABLE core=ROM_1P
127 
128  //-- STATIC DATAFLOW VARIABLES --------------------------------------------
129  static ap_uint<8> lsn_watchDogTimer;
130 
131  switch (lsn_fsmState) {
132  case LSN_IDLE:
133  if (*piSHL_Enable != 1) {
134  return;
135  }
136  else {
137  if (lsn_i == 0) {
138  lsn_fsmState = LSN_SEND_REQ;
139  }
140  else {
141  //-- Port are already opened
142  lsn_fsmState = LSN_DONE;
143  }
144  }
145  break;
146  case LSN_SEND_REQ:
147  if (!soSHL_LsnReq.full()) {
148  switch (lsn_i) {
149  case 0:
150  soSHL_LsnReq.write(RECV_MODE_LSN_PORT);
151  break;
152  case 1:
153  soSHL_LsnReq.write(XMIT_MODE_LSN_PORT);
154  break;
155  case 2:
156  soSHL_LsnReq.write(ECHO_MOD2_LSN_PORT);
157  break;
158  case 3:
159  soSHL_LsnReq.write(ECHO_MODE_LSN_PORT);
160  break;
161  case 4:
162  soSHL_LsnReq.write(IPERF_LSN_PORT);
163  break;
164  case 5:
165  soSHL_LsnReq.write(IPREF3_LSN_PORT);
166  break;
167  }
168  if (DEBUG_LEVEL & TRACE_LSN) {
169  printInfo(myName, "Server is requested to listen on port #%d (0x%4.4X).\n",
170  LSN_PORT_TABLE[lsn_i].to_uint(), LSN_PORT_TABLE[lsn_i].to_uint());
171  }
172  #ifndef __SYNTHESIS__
173  lsn_watchDogTimer = 10;
174  #else
175  lsn_watchDogTimer = 100;
176  #endif
177  lsn_fsmState = LSN_WAIT_REP;
178  }
179  else {
180  printWarn(myName, "Cannot send a listen port request to [UOE] because stream is full!\n");
181  }
182  break;
183  case LSN_WAIT_REP:
184  lsn_watchDogTimer--;
185  if (!siSHL_LsnRep.empty()) {
186  UdpAppLsnRep listenDone;
187  siSHL_LsnRep.read(listenDone);
188  if (listenDone) {
189  printInfo(myName, "Received OK listen reply from [UOE] for port %d.\n", LSN_PORT_TABLE[lsn_i].to_uint());
190  if (lsn_i == sizeof(LSN_PORT_TABLE)/sizeof(LSN_PORT_TABLE[0])-1) {
191  lsn_fsmState = LSN_DONE;
192  }
193  else {
194  //-- Set next listen port number
195  lsn_i += 1;
196  lsn_fsmState = LSN_SEND_REQ;
197  }
198  }
199  else {
200  printWarn(myName, "UOE denied listening on port %d (0x%4.4X).\n",
201  LSN_PORT_TABLE[lsn_i].to_uint(), LSN_PORT_TABLE[lsn_i].to_uint());
202  lsn_fsmState = LSN_SEND_REQ;
203  }
204  }
205  else {
206  if (lsn_watchDogTimer == 0) {
207  printError(myName, "Timeout: Server failed to listen on port %d %d (0x%4.4X).\n",
208  LSN_PORT_TABLE[lsn_i].to_uint(), LSN_PORT_TABLE[lsn_i].to_uint());
209  //-- Try next listen port number
210  lsn_i += 1;
211  lsn_fsmState = LSN_SEND_REQ;
212  }
213  }
214  break;
215  case LSN_DONE:
216  break;
217  } // End-of: switch()
218 } // End-of: pListen()
219 
220 
227 void pClose(
228  CmdBit *piSHL_Enable,
229  stream<UdpPort> &soSHL_ClsReq,
230  stream<StsBool> &siSHL_ClsRep)
231 {
232  //-- DIRECTIVES FOR THIS PROCESS ------------------------------------------
233  #pragma HLS INLINE off
234  #pragma HLS PIPELINE II=1 enable_flush
235 
236  const char *myName = concat3(THIS_NAME, "/", "CLs");
237 
238  //-- STATIC CONTROL VARIABLES (with RESET) --------------------------------
239  static enum FsmStates { CLS_IDLE, CLS_SEND_REQ, CLS_WAIT_REP, CLS_DONE } \
240  cls_fsmState=CLS_IDLE;
241  #pragma HLS reset variable=cls_fsmState
242 
243  //-- STATIC DATAFLOW VARIABLES --------------------------------------------
244 
245  switch (cls_fsmState) {
246  case CLS_IDLE:
247  if (*piSHL_Enable != 1) {
248  if (!siSHL_ClsRep.empty()) {
249  // Drain any potential status data
250  siSHL_ClsRep.read();
251  printWarn(myName, "Draining unexpected residue from the \'ClsRep\' stream.\n");
252  }
253  return;
254  }
255  else {
256  cls_fsmState = CLS_SEND_REQ;
257  }
258  break;
259  case CLS_SEND_REQ:
260  if (!soSHL_ClsReq.full()) {
261  // [FIXME-Must take the port # from a CfgReg] - DEFAULT_FPGA_LSN_PORT;
262  // In the mean time, close a fake port to avoid the logic to be synthesized away.
263  UdpPort udpClosePort = 0xDEAD;
264  soSHL_ClsReq.write(udpClosePort);
265  if (DEBUG_LEVEL & TRACE_CLS) {
266  printInfo(myName, "SHELL/NTS/USIF is requesting to close port #%d (0x%4.4X).\n",
267  udpClosePort.to_int(), udpClosePort.to_int());
268  }
269  cls_fsmState = CLS_WAIT_REP;
270  }
271  else {
272  printWarn(myName, "Cannot send a listen port request to [UOE] because stream is full!\n");
273  }
274  break;
275  case CLS_WAIT_REP:
276  if (!siSHL_ClsRep.empty()) {
277  StsBool isOpened;
278  siSHL_ClsRep.read(isOpened);
279  if (not isOpened) {
280  printInfo(myName, "Received close acknowledgment from [UOE].\n");
281  cls_fsmState = CLS_DONE;
282  }
283  else {
284  printWarn(myName, "UOE denied closing the port %d (0x%4.4X) which is still opened.\n",
286  cls_fsmState = CLS_SEND_REQ;
287  }
288  }
289  break;
290  case CLS_DONE:
291  break;
292  }
293 } // End-of: pClose()
294 
295 
296 
322  CmdBit *piSHL_Enable,
323  stream<UdpAppData> &siSHL_Data,
324  stream<UdpAppMeta> &siSHL_Meta,
325  stream<UdpAppDLen> &siSHL_DLen,
326  stream<UdpAppData> &soUAF_Data,
327  stream<UdpAppMeta> &soUAF_Meta,
328  stream<UdpAppDLen> &soUAF_DLen,
329  stream<SocketPair> &soWRp_SockPair,
330  stream<UdpAppDLen> &soWRp_DReq)
331 {
332  //-- DIRECTIVES FOR THIS PROCESS -------------------------------------------
333  #pragma HLS INLINE off
334  #pragma HLS PIPELINE II=1 enable_flush
335 
336  const char *myName = concat3(THIS_NAME, "/", "RDp");
337 
338  //-- STATIC CONTROL VARIABLES (with RESET) ---------------------------------
339  static enum FsmStates { RDP_IDLE=0, RDP_FWD_META, RDP_FWD_STREAM, RDP_SINK_STREAM, RDP_8801 } \
340  rdp_fsmState = RDP_IDLE;
341  #pragma HLS reset variable=rdp_fsmState
342 
343  //-- STATIC DATAFLOW VARIABLES ---------------------------------------------
344  static UdpAppMeta rdp_appMeta;
345  static UdpAppDLen rdp_appDLen;
346 
347  //-- DYNAMIC VARIABLES -----------------------------------------------------
348  UdpAppData appData;
349 
350  if (*piSHL_Enable != 1) {
351  return;
352  }
353 
354  switch (rdp_fsmState ) {
355  case RDP_IDLE:
356  if (!siSHL_Meta.empty() and !siSHL_DLen.empty()) {
357  siSHL_Meta.read(rdp_appMeta);
358  siSHL_DLen.read(rdp_appDLen);
359  switch (rdp_appMeta.udpDstPort) {
360  case RECV_MODE_LSN_PORT:
361  // (DstPort == 8800) Sink this traffic stream
362  if (DEBUG_LEVEL & TRACE_RDP) { printInfo(myName, "Entering Rx test mode (DstPort=%4.4d)\n", rdp_appMeta.udpDstPort.to_uint()); }
363  rdp_fsmState = RDP_SINK_STREAM;
364  break;
365  case XMIT_MODE_LSN_PORT:
366  // (DstPort == 8801) Enter the Tx test mode
367  if (DEBUG_LEVEL & TRACE_RDP) { printInfo(myName, "Entering Tx test mode (DstPort=%4.4d)\n", rdp_appMeta.udpDstPort.to_uint()); }
368  rdp_fsmState = RDP_8801;
369  break;
370  default:
371  // Forward the incoming stream to [TAF]
372  rdp_fsmState = RDP_FWD_META;
373  break;
374  }
375  }
376  break;
377  case RDP_FWD_META:
378  if (!soUAF_Meta.full() and !soUAF_DLen.full()) {
379  soUAF_Meta.write(rdp_appMeta);
380  soUAF_DLen.write(rdp_appDLen);
381  rdp_fsmState = RDP_FWD_STREAM;
382  }
383  break;
384  case RDP_FWD_STREAM:
385  if (!siSHL_Data.empty() and !soUAF_Data.full()) {
386  siSHL_Data.read(appData);
387  soUAF_Data.write(appData);
388  if (appData.getLE_TLast()) {
389  rdp_fsmState = RDP_IDLE;
390  }
391  if (DEBUG_LEVEL & TRACE_RDP) { printAxisRaw(myName, "soUAF_Data =", appData); }
392  }
393  break;
394  case RDP_SINK_STREAM:
395  if (!siSHL_Data.empty()) {
396  siSHL_Data.read(appData);
397  if (appData.getLE_TLast()) {
398  rdp_fsmState = RDP_IDLE;
399  }
400  if (DEBUG_LEVEL & TRACE_RDP) { printAxisRaw(myName, "Dropping siSHL_Data =", appData); }
401  }
402  break;
403  case RDP_8801:
404  if (!siSHL_Data.empty() and !soWRp_SockPair.full() and !soWRp_DReq.full()) {
405  // Extract the remote socket address and the requested #bytes to transmit
406  siSHL_Data.read(appData);
407  SockAddr srcSockAddr(rdp_appMeta.ip4DstAddr, rdp_appMeta.udpDstPort);
408  SockAddr dstSockAddr(byteSwap32(appData.getLE_TData(31, 0)), // IP4 address
409  byteSwap16(appData.getLE_TData(47, 32))); // TCP port
410  Ly4Len bytesToSend = byteSwap16(appData.getLE_TData(63, 48));
411  // Forward socket-pair information to [WRp]
412  soWRp_SockPair.write(SocketPair(srcSockAddr, dstSockAddr));
413  // Forward the extracted number of bytes to transmit
414  soWRp_DReq.write(bytesToSend);
415  if (DEBUG_LEVEL & TRACE_RDP) {
416  printInfo(myName, "Received request for Tx test mode to generate a segment of length=%d and to send it to socket:\n",
417  bytesToSend.to_int());
418  printSockAddr(myName, dstSockAddr);
419  }
420  if (appData.getLE_TLast()) {
421  rdp_fsmState = RDP_IDLE;
422  }
423  else {
424  rdp_fsmState = RDP_SINK_STREAM;
425  }
426  }
427  }
428 } // End-of: pReadPath()
429 
430 
431 
452  CmdBit *piSHL_Enable,
453  stream<UdpAppData> &siUAF_Data,
454  stream<UdpAppMeta> &siUAF_Meta,
455  stream<UdpAppDLen> &siUAF_DLen,
456  stream<SocketPair> &siRDp_SockPair,
457  stream<UdpAppDLen> &siRDp_DReq,
458  stream<UdpAppData> &soSHL_Data,
459  stream<UdpAppMeta> &soSHL_Meta,
460  stream<UdpAppDLen> &soSHL_DLen)
461 {
462  //-- DIRECTIVES FOR THIS PROCESS -------------------------------------------
463  #pragma HLS INLINE off
464  #pragma HLS PIPELINE II=1 enable_flush
465 
466  const char *myName = concat3(THIS_NAME, "/", "WRp");
467 
468  //-- STATIC CONTROL VARIABLES (with RESET) ---------------------------------
469  static enum FsmStates { WRP_IDLE=0, WRP_STREAM, WRP_8801 } \
470  wrp_fsmState=WRP_IDLE;
471  #pragma HLS reset variable=wrp_fsmState
472  static enum GenChunks { CHK0=0, CHK1, } \
473  wrp_genChunk=CHK0;
474  #pragma HLS reset variable=wrp_genChunk
475 
476  //-- STATIC DATAFLOW VARIABLES ---------------------------------------------
477  static UdpAppDLen wrp_appDReq;
478 
479  //-- DYNAMIC VARIABLES -----------------------------------------------------
480  UdpAppMeta appMeta;
481  SocketPair tstSockPair;
482  UdpAppDLen appDLen;
483  UdpAppData appData;
484 
485  if (*piSHL_Enable != 1) {
486  return;
487  }
488 
489  switch (wrp_fsmState) {
490  case WRP_IDLE:
491  //-- Always give priority to the Tx test generator (for testing reasons)
492  if (!siRDp_SockPair.empty() and !siRDp_DReq.empty() and
493  !soSHL_Meta.full() and !soSHL_DLen.full()) {
494  siRDp_SockPair.read(tstSockPair);
495  siRDp_DReq.read(wrp_appDReq);
496  soSHL_Meta.write(tstSockPair);
497  soSHL_DLen.write(wrp_appDReq);
498  if (DEBUG_LEVEL & TRACE_WRP) {
499  printInfo(myName, "Received a Tx test request of length %d from RDp.\n", wrp_appDReq.to_uint());
500  printSockPair(myName, tstSockPair);
501  }
502  if (wrp_appDReq != 0) {
503  wrp_fsmState = WRP_8801;
504  wrp_genChunk = CHK0;
505  }
506  else {
507  wrp_fsmState = WRP_IDLE;
508  }
509  }
510  else if (!siUAF_Meta.empty() and !siUAF_DLen.empty() and
511  !soSHL_Meta.full() and !soSHL_DLen.full()) {
512  //-- Read the metadata and the length provided by [ROLE/UAF]
513  siUAF_Meta.read(appMeta);
514  siUAF_DLen.read(appDLen);
515  soSHL_Meta.write(appMeta);
516  soSHL_DLen.write(appDLen);
517  if (DEBUG_LEVEL & TRACE_WRP) {
518  printInfo(myName, "Received a datagram of length %d from ROLE.\n", appDLen.to_uint());
519  printSockPair(myName, SocketPair(SockAddr(appMeta.ip4SrcAddr, appMeta.udpSrcPort),
520  SockAddr(appMeta.ip4DstAddr, appMeta.udpDstPort)));
521  }
522  wrp_fsmState = WRP_STREAM;
523  }
524 
525  break;
526  case WRP_STREAM:
527  if (!siUAF_Data.empty() and !soSHL_Data.full()) {
528  siUAF_Data.read(appData);
529  soSHL_Data.write(appData);
530  if (DEBUG_LEVEL & TRACE_WRP) { printAxisRaw(myName, "soSHL_Data = ", appData); }
531  if(appData.getTLast())
532  wrp_fsmState = WRP_IDLE;
533  }
534  break;
535  case WRP_8801:
536  if (!soSHL_Data.full()) {
537  UdpAppData currChunk(0,0,0);
538  if (wrp_appDReq > 8) {
539  currChunk.setLE_TKeep(0xFF);
540  wrp_appDReq -= 8;
541  }
542  else {
543  currChunk.setLE_TKeep(lenToLE_tKeep(wrp_appDReq));
544  currChunk.setLE_TLast(TLAST);
545  wrp_fsmState = WRP_IDLE;
546  }
547  switch (wrp_genChunk) {
548  case CHK0: // Send 'Hi from '
549  currChunk.setTData(GEN_CHK0);
550  wrp_genChunk = CHK1;
551  break;
552  case CHK1: // Send 'FMKU60!\n'
553  currChunk.setTData(GEN_CHK1);
554  wrp_genChunk = CHK0;
555  break;
556  }
557  currChunk.clearUnusedBytes();
558  soSHL_Data.write(currChunk);
559  }
560  break;
561  }
562 } // End-of: pWritePath()
563 
564 
565 
595 
596  //------------------------------------------------------
597  //-- SHELL / Mmio Interface
598  //------------------------------------------------------
599  CmdBit *piSHL_Mmio_En,
600 
601  //------------------------------------------------------
602  //-- SHELL / Control Port Interfaces
603  //------------------------------------------------------
604  stream<UdpPort> &soSHL_LsnReq,
605  stream<StsBool> &siSHL_LsnRep,
606  stream<UdpPort> &soSHL_ClsReq,
607  stream<StsBool> &siSHL_ClsRep,
608 
609  //------------------------------------------------------
610  //-- SHELL / Rx Data Interfaces
611  //------------------------------------------------------
612  stream<UdpAppData> &siSHL_Data,
613  stream<UdpAppMeta> &siSHL_Meta,
614  stream<UdpAppDLen> &siSHL_DLen,
615 
616  //------------------------------------------------------
617  //-- SHELL / Tx Data Interfaces
618  //------------------------------------------------------
619  stream<UdpAppData> &soSHL_Data,
620  stream<UdpAppMeta> &soSHL_Meta,
621  stream<UdpAppDLen> &soSHL_DLen,
622 
623  //------------------------------------------------------
624  //-- UAF / Tx Data Interfaces
625  //------------------------------------------------------
626  stream<UdpAppData> &siUAF_Data,
627  stream<UdpAppMeta> &siUAF_Meta,
628  stream<UdpAppDLen> &siUAF_DLen,
629 
630  //------------------------------------------------------
631  //-- UAF / Rx Data Interfaces
632  //------------------------------------------------------
633  stream<UdpAppData> &soUAF_Data,
634  stream<UdpAppMeta> &soUAF_Meta,
635  stream<UdpAppDLen> &soUAF_DLen)
636 {
637  //-- DIRECTIVES FOR THIS PROCESS ------------------------------------------
638  #pragma HLS DATAFLOW
639  #pragma HLS INLINE
640  #pragma HLS INTERFACE ap_ctrl_none port=return
641 
642  //-------------------------------------------------------------------------
643  //-- LOCAL STREAMS (Sorted by the name of the modules which generate them)
644  //-------------------------------------------------------------------------
645 
646  //-- Read Path (RDp)
647  static stream<SocketPair> ssRDpToWRp_SockPair ("ssRDpToWRp_SockPair");
648  #pragma HLS STREAM variable=ssRDpToWRp_SockPair depth=2
649  static stream<UdpAppDLen> ssRDpToWRp_DReq ("ssRDpToWRp_DReq");
650  #pragma HLS STREAM variable=ssRDpToWRp_DReq depth=2
651 
652  //-- PROCESS FUNCTIONS ----------------------------------------------------
653  pListen(
654  piSHL_Mmio_En,
655  soSHL_LsnReq,
656  siSHL_LsnRep);
657 
658  pClose(
659  piSHL_Mmio_En,
660  soSHL_ClsReq,
661  siSHL_ClsRep);
662 
663  pReadPath(
664  piSHL_Mmio_En,
665  siSHL_Data,
666  siSHL_Meta,
667  siSHL_DLen,
668  soUAF_Data,
669  soUAF_Meta,
670  soUAF_DLen,
671  ssRDpToWRp_SockPair,
672  ssRDpToWRp_DReq);
673 
674  pWritePath(
675  piSHL_Mmio_En,
676  siUAF_Data,
677  siUAF_Meta,
678  siUAF_DLen,
679  ssRDpToWRp_SockPair,
680  ssRDpToWRp_DReq,
681  soSHL_Data,
682  soSHL_Meta,
683  soSHL_DLen);
684 
685 }
686 
tLast getTLast() const
Definition: AxisRaw.hpp:219
void clearUnusedBytes()
Definition: AxisRaw.hpp:391
LE_tData getLE_TData(int leHi=64 -1, int leLo=0) const
Definition: AxisRaw.hpp:260
void setLE_TLast(LE_tLast last)
Definition: AxisRaw.hpp:280
void setTData(tData data)
Definition: AxisRaw.hpp:228
void setLE_TKeep(LE_tKeep keep, int leHi=64/8-1, int leLo=0)
Definition: AxisRaw.hpp:276
LE_tLast getLE_TLast() const
Definition: AxisRaw.hpp:268
Ly4Port udpDstPort
Definition: nts.hpp:229
Ly4Port udpSrcPort
Definition: nts.hpp:227
Ip4Addr ip4SrcAddr
Definition: nts.hpp:226
Ip4Addr ip4DstAddr
Definition: nts.hpp:228
UdpLen UdpAppDLen
Definition: nal.hpp:255
bool StsBool
Definition: nal.hpp:246
DropCmd
Definition: nal.hpp:125
ap_uint< 16 > UdpPort
Definition: nal.hpp:249
@ LSN_IDLE
Definition: nal.hpp:146
@ LSN_SEND_REQ
Definition: nal.hpp:146
@ LSN_DONE
Definition: nal.hpp:146
@ CLS_IDLE
Definition: nal.hpp:162
#define printError(callerName, format,...)
A macro to print an error message.
Definition: nts_utils.hpp:195
LE_tKeep lenToLE_tKeep(ap_uint< 4 > noValidBytes)
A function to set a number of '1' in an 8-bit field. It is used here to set the number of valid bytes...
Definition: nts_utils.cpp:307
void printAxisRaw(const char *callerName, AxisRaw chunk)
Prints an Axis raw data chunk (used for debugging).
Definition: nts_utils.cpp:46
ap_uint< 16 > Ly4Len
Definition: nts_types.hpp:202
void printSockAddr(const char *callerName, SockAddr sockAddr)
Print a socket address.
Definition: nts_utils.cpp:174
#define printInfo(callerName, format,...)
A macro to print an information message.
Definition: nts_utils.hpp:169
ap_uint< 1 > CmdBit
Definition: nts_types.hpp:108
#define printWarn(callerName, format,...)
A macro to print a warning message.
Definition: nts_utils.hpp:182
#define concat3(firstCharConst, secondCharConst, thirdCharConst)
Definition: nts_utils.hpp:161
StsBool UdpAppLsnRep
Definition: nts.hpp:259
void printSockPair(const char *callerName, SocketPair sockPair)
Print a socket pair association.
Definition: nts_utils.cpp:114
#define TLAST
Definition: AxisRaw.hpp:116
#define GEN_CHK0
#define GEN_CHK1
#define RECV_MODE_LSN_PORT
#define XMIT_MODE_LSN_PORT
#define ECHO_MOD2_LSN_PORT
#define IPERF_LSN_PORT
#define IPREF3_LSN_PORT
#define ECHO_MODE_LSN_PORT
#define DEFAULT_FPGA_LSN_PORT
#define TRACE_CLS
void pWritePath(CmdBit *piSHL_Enable, stream< UdpAppData > &siUAF_Data, stream< UdpAppMeta > &siUAF_Meta, stream< UdpAppDLen > &siUAF_DLen, stream< SocketPair > &siRDp_SockPair, stream< UdpAppDLen > &siRDp_DReq, stream< UdpAppData > &soSHL_Data, stream< UdpAppMeta > &soSHL_Meta, stream< UdpAppDLen > &soSHL_DLen)
Write Path (WRp) - From ROLE/UAF to SHELL/NTS/UOE.
void udp_shell_if(CmdBit *piSHL_Mmio_En, stream< UdpPort > &soSHL_LsnReq, stream< StsBool > &siSHL_LsnRep, stream< UdpPort > &soSHL_ClsReq, stream< StsBool > &siSHL_ClsRep, stream< UdpAppData > &siSHL_Data, stream< UdpAppMeta > &siSHL_Meta, stream< UdpAppDLen > &siSHL_DLen, stream< UdpAppData > &soSHL_Data, stream< UdpAppMeta > &soSHL_Meta, stream< UdpAppDLen > &soSHL_DLen, stream< UdpAppData > &siUAF_Data, stream< UdpAppMeta > &siUAF_Meta, stream< UdpAppDLen > &siUAF_DLen, stream< UdpAppData > &soUAF_Data, stream< UdpAppMeta > &soUAF_Meta, stream< UdpAppDLen > &soUAF_DLen)
Main process of the UDP Shell Interface (USIF).
bool gTraceEvent
Definition: tb_nal.cpp:151
#define THIS_NAME
void pReadPath(CmdBit *piSHL_Enable, stream< UdpAppData > &siSHL_Data, stream< UdpAppMeta > &siSHL_Meta, stream< UdpAppDLen > &siSHL_DLen, stream< UdpAppData > &soUAF_Data, stream< UdpAppMeta > &soUAF_Meta, stream< UdpAppDLen > &soUAF_DLen, stream< SocketPair > &soWRp_SockPair, stream< UdpAppDLen > &soWRp_DReq)
Read Path (RDp) - From SHELL/UOE to ROLE/UAF.
void pClose(CmdBit *piSHL_Enable, stream< UdpPort > &soSHL_ClsReq, stream< StsBool > &siSHL_ClsRep)
Request the SHELL/NTS/UOE to close a previously opened port.
#define TRACE_RDP
#define DEBUG_LEVEL
void pListen(CmdBit *piSHL_Enable, stream< UdpPort > &soSHL_LsnReq, stream< StsBool > &siSHL_LsnRep)
Listen(LSn)
#define TRACE_LSN
#define TRACE_WRP
@ KEEP_CMD
@ DROP_CMD
ap_uint< 32 > byteSwap32(ap_uint< 32 > inputVector)
Definition: udp.cpp:78
ap_uint< 16 > byteSwap16(ap_uint< 16 > inputVector)
Definition: udp.cpp:82
: UDP Shell Interface (USIF).