cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
rx_app_interface.cpp
Go to the documentation of this file.
1 
17 
43 
56 #include "rx_app_interface.hpp"
57 
58 using namespace hls;
59 
60 
61 
65 #ifndef __SYNTHESIS__
66  extern bool gTraceEvent;
67 #endif
68 
69 #define THIS_NAME "TOE/RAi"
70 
71 #define TRACE_OFF 0x0000
72 #define TRACE_LAI 1 << 1
73 #define TRACE_ASS 1 << 2
74 #define TRACE_NMX 1 << 3
75 #define TRACE_RAS 1 << 4
76 #define TRACE_MRD 1 << 5
77 #define TRACE_ALL 0xFFFF
78 
79 #define DEBUG_LEVEL (TRACE_OFF)
80 
81 
104  stream<TcpAppNotif> &siRXe_Notif,
105  stream<TcpAppNotif> &siTIm_Notif,
106  stream<TcpAppNotif> &soTAIF_Notif,
107  stream<ap_uint<8> > &soMMIO_NotifDropCnt)
108 {
109  //-- DIRECTIVES FOR THIS PROCESS --------------------------------------------
110  #pragma HLS PIPELINE II=1 enable_flush
111  #pragma HLS INLINE off
112 
113  const char *myName = concat3(THIS_NAME, "/", "Nmx");
114 
115  //-- STATIC CONTROL VARIABLES (with RESET) ---------------------------------
116  static ap_uint<8 > nmx_notifDropCounter=0;
117  #pragma HLS reset variable=nmx_notifDropCounter
118 
119  TcpAppNotif currNotif;
120 
121  if (!siRXe_Notif.empty()) {
122  currNotif = siRXe_Notif.read();
123  if (!soTAIF_Notif.full()) {
124  soTAIF_Notif.write(currNotif);
125  }
126  else {
127  // Drop this notification and increment the Notif Drop Counter
128  nmx_notifDropCounter++;
129  printFatal(myName, "Cannot write 'soTAIF_Notif()'. Stream is full!");
130  }
131  }
132  else if (!siTIm_Notif.empty()) {
133  currNotif = siTIm_Notif.read();
134  if (!soTAIF_Notif.full()) {
135  soTAIF_Notif.write(currNotif);
136  }
137  else {
138  // Drop this notification
139  printFatal(myName, "Cannot write 'soTAIF_Notif()'. Stream is full!");
140  }
141  }
142 
143  //-- ALWAYS
144  if (!soMMIO_NotifDropCnt.full()) {
145  soMMIO_NotifDropCnt.write(nmx_notifDropCounter);
146  }
147  else {
148  printFatal(myName, "Cannot write soMMIO_NotifDropCnt stream...");
149  }
150 }
151 
152 
179  stream<TcpAppRdReq> &siTAIF_DataReq,
180  stream<TcpAppMeta> &soTAIF_Meta,
181  stream<RAiRxSarQuery> &soRSt_RxSarQry,
182  stream<RAiRxSarReply> &siRSt_RxSarRep,
183  stream<DmCmd> &soMrd_MemRdCmd,
184  stream<ap_uint<8> > &soMMIO_MetaDropCnt)
185 {
186  //-- DIRECTIVES FOR THIS PROCESS -------------------------------------------
187  #pragma HLS PIPELINE II=1 enable_flush
188  #pragma HLS INLINE off
189 
190  const char *myName = concat3(THIS_NAME, "/", "Ras");
191 
192  //-- STATIC CONTROL VARIABLES (with RESET) ---------------------------------
193  static enum FsmStates { S0=0, S1 } \
194  ras_fsmState=S0;
195  #pragma HLS RESET variable=ras_fsmState
196  static ap_uint<8 > ras_metaDropCounter=0;
197  #pragma HLS reset variable=ras_metaDropCounter
198 
199  //-- STATIC DATAFLOW VARIABLES ---------------------------------------------
200  static TcpSegLen ras_readLength;
201 
202  switch (ras_fsmState) {
203  case S0:
204  if (!siTAIF_DataReq.empty() and !soRSt_RxSarQry.full()) {
205  TcpAppRdReq appReadRequest = siTAIF_DataReq.read();
206  if (appReadRequest.length != 0) {
207  // Make sure length is not 0, otherwise Data Mover will hang
208  soRSt_RxSarQry.write(RAiRxSarQuery(appReadRequest.sessionID));
209  ras_readLength = appReadRequest.length;
210  ras_fsmState = S1;
211  }
212  else {
213  // Do nothing but return the metadata to avoid blocking the APP
214  if (!soTAIF_Meta.full()) {
215  soTAIF_Meta.write(appReadRequest.sessionID);
216  }
217  else {
218  // Drop this metadata and increment the Meta Drop Counter
219  ras_metaDropCounter++;
220  printFatal(myName, "Cannot write 'soTAIF_Meta()'. Stream is full!");
221  }
222  }
223  }
224  break;
225  case S1:
226  if (!siRSt_RxSarRep.empty() and
227  !soMrd_MemRdCmd.full() and !soRSt_RxSarQry.full()) {
228  RAiRxSarReply rxSarRep = siRSt_RxSarRep.read();
229  // Signal that the data request has been processed by sending the SessId back to [TAIF]
230  if (!soTAIF_Meta.full()) {
231  soTAIF_Meta.write(rxSarRep.sessionID);
232  }
233  else {
234  // Drop this metadata and increment the Meta Drop Counter
235  ras_metaDropCounter++;
236  printFatal(myName, "Cannot write 'soTAIF_Meta()'. Stream is full!");
237  }
238  // Generate a memory buffer read command
239  RxMemPtr memSegAddr = TOE_RX_MEMORY_BASE;
240  memSegAddr(29, 16) = rxSarRep.sessionID(13, 0);
241  memSegAddr(15, 0) = rxSarRep.appd;
242  soMrd_MemRdCmd.write(DmCmd(memSegAddr, ras_readLength));
243  // Update the APP read pointer
244  soRSt_RxSarQry.write(RAiRxSarQuery(rxSarRep.sessionID, rxSarRep.appd+ras_readLength));
245  ras_fsmState = S0;
246  }
247  break;
248  }
249 
250  //-- ALWAYS
251  if (!soMMIO_MetaDropCnt.full()) {
252  soMMIO_MetaDropCnt.write(ras_metaDropCounter);
253  }
254  else {
255  printFatal(myName, "Cannot write soMMIO_MetaDropCnt stream...");
256  }
257 }
258 
259 
276  stream<DmCmd> &siRas_MemRdCmd,
277  stream<DmCmd> &soMEM_RxpRdCmd,
278  stream<FlagBool> &soAss_SplitSeg)
279 {
280  //-- DIRECTIVES FOR THIS PROCESS -------------------------------------------
281  #pragma HLS PIPELINE II=1 enable_flush
282  #pragma HLS INLINE off
283 
284  const char *myName = concat3(THIS_NAME, "/", "Mrd");
285 
286  //-- STATIC CONTROL VARIABLES (with RESET) ---------------------------------
287  static enum FsmState { MRD_1ST_ACCESS=0, MRD_2ND_ACCESS } \
288  mrd_fsmState=MRD_1ST_ACCESS;
289  #pragma HLS RESET variable=mrd_fsmState
290 
291  //-- STATIC DATAFLOW VARIABLES ---------------------------------------------
292  static DmCmd mrd_memRdCmd;
293  static RxBufPtr mrd_firstAccLen;
294  static uint16_t mrd_debugCounter=1;
295 
296  switch (mrd_fsmState) {
297  case MRD_1ST_ACCESS:
298  if (!siRas_MemRdCmd.empty() and !soAss_SplitSeg.full() and !soMEM_RxpRdCmd.full() ) {
299  siRas_MemRdCmd.read(mrd_memRdCmd);
300 
301  if ((mrd_memRdCmd.saddr.range(TOE_WINDOW_BITS-1, 0) + mrd_memRdCmd.btt) > TOE_RX_BUFFER_SIZE) {
302  // This segment was broken in two memory accesses because TCP Rx memory buffer wrapped around
303  mrd_firstAccLen = TOE_RX_BUFFER_SIZE - mrd_memRdCmd.saddr;
304  mrd_fsmState = MRD_2ND_ACCESS;
305 
306  soMEM_RxpRdCmd.write(DmCmd(mrd_memRdCmd.saddr, mrd_firstAccLen));
307  soAss_SplitSeg.write(true);
308 
309  if (DEBUG_LEVEL & TRACE_MRD) {
310  printInfo(myName, "TCP Rx memory buffer wraps around: This segment is broken in two memory accesses.\n");
311  printInfo(myName, "Issuing 1st memory read command #%d - SADDR=0x%9.9lx - BTT=%d\n",
312  mrd_debugCounter, mrd_memRdCmd.saddr.to_ulong(), mrd_firstAccLen.to_uint());
313  }
314  }
315  else {
316  soMEM_RxpRdCmd.write(mrd_memRdCmd);
317  soAss_SplitSeg.write(false);
318 
319  if (DEBUG_LEVEL & TRACE_MRD) {
320  printInfo(myName, "Issuing memory read command #%d - SADDR=0x%9.9lx - BTT=%d\n",
321  mrd_debugCounter, mrd_memRdCmd.saddr.to_ulong(), mrd_memRdCmd.btt.to_uint());
322  mrd_debugCounter++;
323  }
324  }
325  }
326  break;
327  case MRD_2ND_ACCESS:
328  if (!soMEM_RxpRdCmd.full()) {
329  // Update the command to account for the Rx buffer wrap around
330  mrd_memRdCmd.saddr(TOE_WINDOW_BITS-1, 0) = 0;
331  soMEM_RxpRdCmd.write(DmCmd(mrd_memRdCmd.saddr, mrd_memRdCmd.btt - mrd_firstAccLen));
332 
333  mrd_fsmState = MRD_1ST_ACCESS;
334 
335  if (DEBUG_LEVEL & TRACE_MRD) {
336  printInfo(myName, "Issuing 2nd memory read command #%d - SADDR=0x%9.9lx - BTT=%d\n",
337  mrd_debugCounter, mrd_memRdCmd.saddr.to_ulong(),
338  (mrd_memRdCmd.btt - mrd_firstAccLen).to_uint());
339  mrd_debugCounter++;
340  }
341  }
342  break;
343  }
344 }
345 
346 
372  stream<AxisApp> &siMEM_RxP_Data,
373  stream<TcpAppData> &soTAIF_Data,
374  stream<FlagBool> &siMrd_SplitSegFlag,
375  stream<ap_uint<8> > &soMMIO_DataDropCnt)
376 {
377  //-- DIRECTIVES FOR THIS PROCESS -------------------------------------------
378  #pragma HLS PIPELINE II=1 enable_flush
379  #pragma HLS INLINE off
380 
381  const char *myName = concat3(THIS_NAME, "/", "Ass");
382 
383  //-- STATIC CONTROL VARIABLES (with RESET) ---------------------------------
384  static enum FsmState { ASS_IDLE,
385  ASS_FWD_1ST_BUF, ASS_FWD_2ND_BUF,
386  ASS_JOIN_2ND_BUF, ASS_RESIDUE } \
387  ass_fsmState=ASS_IDLE;
388  #pragma HLS RESET variable=ass_fsmState
389  static ap_uint<3> ass_psdHdrChunkCount = 0;
390  #pragma HLS RESET variable=ass_psdHdrChunkCount
391  static ap_uint<16> ass_dataDropCounter=0;
392  #pragma HLS reset variable=ass_dataDropCounter
393 
394  //-- STATIC DATAFLOW VARIABLES ---------------------------------------------
395  static AxisApp ass_prevChunk;
396  static ap_uint<4> ass_memRdOffset;
397  static FlagBool ass_mustJoin;
398 
399  switch(ass_fsmState) {
400  case ASS_IDLE:
401  //-- Handle the very 1st data chunk from the 1st memory buffer
402  if (!siMEM_RxP_Data.empty() and !siMrd_SplitSegFlag.empty()) {
403  siMrd_SplitSegFlag.read(ass_mustJoin);
404  AxisApp currAppChunk = siMEM_RxP_Data.read();
405  if (currAppChunk.getTLast()) {
406  // We are done with the 1st memory buffer
407  if (ass_mustJoin == false) {
408  // The TCP segment was not splitted.
409  // We are done with this segment. Stay in this state.
410  if (!soTAIF_Data.full()) {
411  soTAIF_Data.write(currAppChunk);
412  if (DEBUG_LEVEL & TRACE_ASS) { printAxisRaw(myName, "soTAIF_Data =", currAppChunk); }
413  }
414  else {
415  // Drop this data and increment the Data Drop Counter
416  ass_dataDropCounter++;
417  printFatal(myName, "Cannot write 'soTAIF_Data()'. Stream is full!");
418  }
419  ass_fsmState = ASS_IDLE;
420  }
421  else {
422  // The TCP segment was splitted in two parts
423  ass_memRdOffset = currAppChunk.getLen();
424  if (ass_memRdOffset != 8) {
425  // The last chunk of the 1st memory buffer is not fully populated.
426  // Don't output anything here. Save the current chunk and goto 'ASS_JOIN_2ND'.
427  // There, we will fetch more data to fill in the current chunk.
428  ass_prevChunk = currAppChunk;
429  ass_fsmState = ASS_JOIN_2ND_BUF;
430  }
431  else {
432  // The last chunk of the 1st memory buffer is populated with
433  // 8 valid bytes and is therefore also aligned.
434  // Forward this chunk and goto 'ASS_FWD_2ND_BUF'.
435  if (!soTAIF_Data.full()) {
436  soTAIF_Data.write(currAppChunk);
437  if (DEBUG_LEVEL & TRACE_ASS) { printAxisRaw(myName, "soTAIF_Data =", currAppChunk); }
438  }
439  else {
440  // Drop this data and increment the Data Drop Counter
441  ass_dataDropCounter++;
442  printFatal(myName, "Cannot write 'soTAIF_Data()'. Stream is full!");
443  }
444  ass_fsmState = ASS_FWD_2ND_BUF;
445  }
446  }
447  }
448  else {
449  // The 1st memory buffer contains more than one chunk
450  if (!soTAIF_Data.full()) {
451  soTAIF_Data.write(currAppChunk);
452  if (DEBUG_LEVEL & TRACE_ASS) { printAxisRaw(myName, "soTAIF_Data =", currAppChunk); }
453  }
454  else {
455  // Drop this data and increment the Data Drop Counter
456  ass_dataDropCounter++;
457  printFatal(myName, "Cannot write 'soTAIF_Data()'. Stream is full!");
458  }
459  ass_fsmState = ASS_FWD_1ST_BUF;
460  }
461  }
462  break;
463  case ASS_FWD_1ST_BUF:
464  //-- Forward all the data chunks of the 1st memory buffer
465  if (!siMEM_RxP_Data.empty()) {
466  AxisApp currAppChunk = siMEM_RxP_Data.read();
467 
468  if (currAppChunk.getTLast()) {
469  // We are done with the 1st memory buffer
470  if (ass_mustJoin == false) {
471  // The TCP segment was not splitted.
472  // We are done with this segment. Go back to 'ASS_IDLE'.
473  if (!soTAIF_Data.full()) {
474  soTAIF_Data.write(currAppChunk);
475  if (DEBUG_LEVEL & TRACE_ASS) { printAxisRaw(myName, "soTAIF_Data =", currAppChunk); }
476  }
477  else {
478  // Drop this chunk
479  printFatal(myName, "Cannot write 'soTAIF_Data()'. Stream is full!");
480  }
481  ass_fsmState = ASS_IDLE;
482  }
483  else {
484  // The TCP segment was splitted in two parts
485  ass_memRdOffset = currAppChunk.getLen();
486  // Always clear the last bit of the last chunk of 1st part
487  currAppChunk.setTLast(0);
488  if (ass_memRdOffset != 8) {
489  // The last chunk of the 1st memory buffer is not fully populated.
490  // Don't output anything here. Save the current chunk and goto 'TSS_JOIN_2ND'.
491  // There, we will fetch more data to fill in the current chunk.
492  ass_prevChunk = currAppChunk;
493  ass_fsmState = ASS_JOIN_2ND_BUF;
494  }
495  else {
496  // The last chunk of the 1st memory buffer is populated with
497  // 8 valid bytes and is therefore also aligned.
498  // Forward this chunk and goto 'TSS_FWD_2ND_BUF'.
499  if (!soTAIF_Data.full()) {
500  soTAIF_Data.write(currAppChunk);
501  if (DEBUG_LEVEL & TRACE_ASS) { printAxisRaw(myName, "soTAIF_Data =", currAppChunk); }
502  }
503  else {
504  // Drop this data and increment the Data Drop Counter
505  ass_dataDropCounter++;
506  printFatal(myName, "Cannot write 'soTAIF_Data()'. Stream is full!");
507  }
508  ass_fsmState = ASS_FWD_2ND_BUF;
509  }
510  }
511  }
512  else {
513  // Remain in this state and continue streaming the 1st memory buffer
514  if (!soTAIF_Data.full()) {
515  soTAIF_Data.write(currAppChunk);
516  if (DEBUG_LEVEL & TRACE_ASS) { printAxisRaw(myName, "soTAIF_Data =", currAppChunk); }
517  }
518  else {
519  // Drop this data and increment the Data Drop Counter
520  ass_dataDropCounter++;
521  printFatal(myName, "Cannot write 'soTAIF_Data()'. Stream is full!");
522  }
523  }
524  }
525  break;
526  case ASS_FWD_2ND_BUF:
527  //-- Forward all the data chunks of the 2nd memory buffer
528  if (!siMEM_RxP_Data.empty()) {
529  AxisApp currAppChunk = siMEM_RxP_Data.read();
530  if (!soTAIF_Data.full()) {
531  soTAIF_Data.write(currAppChunk);
532  if (DEBUG_LEVEL & TRACE_ASS) { printAxisRaw(myName, "soTAIF_Data =", currAppChunk); }
533  }
534  else {
535  // Drop this data and increment the Data Drop Counter
536  ass_dataDropCounter++;
537  printFatal(myName, "Cannot write 'soTAIF_Data()'. Stream is full!");
538  }
539  if (currAppChunk.getTLast()) {
540  // We are done with the 2nd memory buffer
541  ass_fsmState = ASS_IDLE;
542  }
543  }
544  break;
545  case ASS_JOIN_2ND_BUF:
546  //-- Join the bytes from the 2nd memory buffer to the stream of bytes of
547  //-- the 1st memory buffer when the 1st buffer was not fully populated.
548  //-- The re-alignment occurs between the previously read chunk stored
549  //-- in 'tss_prevChunk' and the latest chunk stored in 'currAppChunk',
550  //-- and 'tss_memRdOffset' specifies the number of valid bytes in 'tss_prevChunk'.
551  if (!siMEM_RxP_Data.empty()) {
552  AxisApp currAppChunk = siMEM_RxP_Data.read();
553 
554  AxisApp joinedChunk(0,0,0); // [FIXME-Create a join method in AxisRaw]
555  // Set lower-part of the joined chunk with the last bytes of the previous chunk
556  joinedChunk.setLE_TData(ass_prevChunk.getLE_TData(((int)ass_memRdOffset*8)-1, 0),
557  ((int)ass_memRdOffset*8)-1, 0);
558  joinedChunk.setLE_TKeep(ass_prevChunk.getLE_TKeep( (int)ass_memRdOffset -1, 0),
559  (int)ass_memRdOffset -1, 0);
560  // Set higher part of the joined chunk with the first bytes of the current chunk
561  joinedChunk.setLE_TData(currAppChunk.getLE_TData( ARW -1-((int)ass_memRdOffset*8), 0),
562  ARW -1,((int)ass_memRdOffset*8));
563  joinedChunk.setLE_TKeep(currAppChunk.getLE_TKeep((ARW/8)-1- (int)ass_memRdOffset, 0),
564  (ARW/8)-1, (int)ass_memRdOffset);
565  if (currAppChunk.getLE_TKeep()[8-(int)ass_memRdOffset] == 0) {
566  // The entire current chunk fits into the remainder of the previous chunk.
567  // We are done with this 2nd memory buffer.
568  joinedChunk.setLE_TLast(TLAST);
569  ass_fsmState = ASS_IDLE;
570  }
571  else if (currAppChunk.getLE_TLast()) {
572  // This cannot be the last chunk because it doesn't fit into the
573  // available space of the previous chunk. Goto the 'ASS_RESIDUE'
574  // and handle the remainder of this data chunk
575  ass_fsmState = ASS_RESIDUE;
576  }
577 
578  if (!soTAIF_Data.full()) {
579  soTAIF_Data.write(joinedChunk);
580  if (DEBUG_LEVEL & TRACE_ASS) { printAxisRaw(myName, "soTAIF_Data =", joinedChunk); }
581  }
582  else {
583  // Drop this data and increment the Data Drop Counter
584  ass_dataDropCounter++;
585  printFatal(myName, "Cannot write 'soTAIF_Data()'. Stream is full!");
586  }
587 
588  // Move remainder of current chunk to previous chunk
589  ass_prevChunk.setLE_TData(currAppChunk.getLE_TData(64-1, 64-(int)ass_memRdOffset*8),
590  ((int)ass_memRdOffset*8)-1, 0);
591  ass_prevChunk.setLE_TKeep(currAppChunk.getLE_TKeep(8-1, 8-(int)ass_memRdOffset),
592  (int)ass_memRdOffset-1, 0);
593  }
594  break;
595  case ASS_RESIDUE:
596  //-- Output the very last unaligned chunk
597  AxisApp lastChunk = AxisApp(0, 0, TLAST);
598  lastChunk.setLE_TData(ass_prevChunk.getLE_TData(((int)ass_memRdOffset*8)-1, 0),
599  ((int)ass_memRdOffset*8)-1, 0);
600  lastChunk.setLE_TKeep(ass_prevChunk.getLE_TKeep((int)ass_memRdOffset-1, 0),
601  (int)ass_memRdOffset-1, 0);
602 
603  if (!soTAIF_Data.full()) {
604  soTAIF_Data.write(lastChunk);
605  if (DEBUG_LEVEL & TRACE_ASS) { printAxisRaw(myName, "soTAIF_Data =", lastChunk); }
606  }
607  else {
608  // Drop this data and increment the Data Drop Counter
609  ass_dataDropCounter++;
610  printFatal(myName, "Cannot write 'soTAIF_Data()'. Stream is full!");
611  }
612  ass_fsmState = ASS_IDLE;
613  break;
614  } // End-of: switch
615 
616  //-- ALWAYS
617  if (!soMMIO_DataDropCnt.full()) {
618  soMMIO_DataDropCnt.write(ass_dataDropCounter);
619  }
620  else {
621  printFatal(myName, "Cannot write soMMIO_DataDropCnt stream...");
622  }
623 
624 } // End-of: pAppSegmentStitcher
625 
626 
648  stream<TcpAppLsnReq> &siTAIF_LsnReq,
649  stream<TcpAppLsnRep> &soTAIF_LsnRep,
650  stream<TcpPort> &soPRt_LsnReq,
651  stream<RepBit> &siPRt_LsnRep)
652  //stream<TcpPort> &siTAIF_StopLsnReq,
653  //stream<TcpPort> &soPRt_CloseReq,)
654 {
655  //-- DIRECTIVES FOR THIS PROCESS -------------------------------------------
656  #pragma HLS PIPELINE II=1 enable_flush
657  #pragma HLS INLINE off
658 
659  const char *myName = concat3(THIS_NAME, "/", "Lai");
660 
661  //-- STATIC CONTROL VARIABLES (with RESET) ---------------------------------
662  static bool lai_waitForPRtRep=false;
663  #pragma HLS reset variable=lai_waitForPRtRep
664 
665  //-- DYNAMIC VARIABLES -----------------------------------------------------
666  TcpPort listenPort;
667  RepBit listenRep;
668 
669  if (!siTAIF_LsnReq.empty() and !lai_waitForPRtRep) {
670  siTAIF_LsnReq.read(listenPort);
671  soPRt_LsnReq.write(listenPort);
672  lai_waitForPRtRep = true;
673  }
674  else if (!siPRt_LsnRep.empty() and lai_waitForPRtRep) {
675  siPRt_LsnRep.read(listenRep);
676  if (!soTAIF_LsnRep.full()) {
677  soTAIF_LsnRep.write((RepBool)listenRep);
678  }
679  else {
680  // Drop this reply
681  printFatal(myName, "Cannot write 'soTAIF_Meta()'. Stream is full!");
682  }
683  lai_waitForPRtRep = false;
684  }
685 
690 }
691 
692 
730  //-- TAIF / Handshake Interfaces
731  stream<TcpAppNotif> &soTAIF_Notif,
732  stream<TcpAppRdReq> &siTAIF_DataReq,
733  //-- TAIF / Data Stream Interfaces
734  stream<TcpAppData> &soTAIF_Data,
735  stream<TcpAppMeta> &soTAIF_Meta,
736  //-- TAIF / Listen Interfaces
737  stream<TcpAppLsnReq> &siTAIF_LsnReq,
738  stream<TcpAppLsnRep> &soTAIF_LsnRep,
739  //-- PRt / Port Table Interfaces
740  stream<TcpPort> &soPRt_LsnReq,
741  stream<AckBit> &siPRt_LsnAck,
742  //-- RXe / Rx Engine Notification Interface
743  stream<TcpAppNotif> &siRXe_Notif,
744  //-- TIm / Timers Notification Interface
745  stream<TcpAppNotif> &siTIm_Notif,
746  //-- Rx SAR Table Interface
747  stream<RAiRxSarQuery> &soRSt_RxSarReq,
748  stream<RAiRxSarReply> &siRSt_RxSarRep,
749  //-- MEM / DDR4 Memory Interface
750  stream<DmCmd> &soMEM_RxP_RdCmd,
751  stream<AxisApp> &siMEM_RxP_Data,
752  //-- MMIO Interfaces
753  stream<ap_uint<8> > &soMMIO_NotifDropCnt,
754  stream<ap_uint<8> > &soMMIO_MetaDropCnt,
755  stream<ap_uint<8> > &soMMIO_DataDropCnt)
756 {
757  //-- DIRECTIVES FOR THIS PROCESS -------------------------------------------
758  #pragma HLS INLINE
759 
760  //--------------------------------------------------------------------------
761  //-- LOCAL STREAMS (Sorted by the name of the modules which generate them)
762  //--------------------------------------------------------------------------
763 
764  //-- Rx Application Stream (Ras) -------------------------------------------
765  static stream<DmCmd> ssRasToMrd_MemRdCmd ("ssRasToMrd_MemRdCmd");
766  #pragma HLS stream variable=ssRasToMrd_MemRdCmd depth=16
767 
768  //-- Rx Memory Reader (Mrd) ------------------------------------------------
769  static stream<FlagBool> ssMrdToAss_SplitSeg ("ssMrdToAss_SplitSeg");
770  #pragma HLS stream variable=ssMrdToAss_SplitSeg depth=16
771 
772  pRxAppStream(
773  siTAIF_DataReq,
774  soTAIF_Meta,
775  soRSt_RxSarReq,
776  siRSt_RxSarRep,
777  ssRasToMrd_MemRdCmd,
778  soMMIO_MetaDropCnt);
779 
781  ssRasToMrd_MemRdCmd,
782  soMEM_RxP_RdCmd,
783  ssMrdToAss_SplitSeg);
784 
786  siMEM_RxP_Data,
787  soTAIF_Data,
788  ssMrdToAss_SplitSeg,
789  soMMIO_DataDropCnt);
790 
792  siTAIF_LsnReq,
793  soTAIF_LsnRep,
794  soPRt_LsnReq,
795  siPRt_LsnAck);
796 
798  siRXe_Notif,
799  siTIm_Notif,
800  soTAIF_Notif,
801  soMMIO_NotifDropCnt);
802 
803 }
804 
void setTLast(tLast last)
Definition: AxisRaw.hpp:246
tLast getTLast() const
Definition: AxisRaw.hpp:219
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
void setLE_TLast(LE_tLast last)
Definition: AxisRaw.hpp:280
void setLE_TData(LE_tData data, int leHi=64 -1, int leLo=0)
Definition: AxisRaw.hpp:272
int getLen() const
Definition: AxisRaw.hpp:411
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
ap_uint< 40 > saddr
ap_uint< 23 > btt
Definition: mem.hpp:85
SessionId sessionID
Definition: toe.hpp:431
RxBufPtr appd
Definition: toe.hpp:432
TcpDatLen length
Definition: nts.hpp:117
SessionId sessionID
Definition: nts.hpp:116
void pRxMemoryReader(stream< DmCmd > &siRas_MemRdCmd, stream< DmCmd > &soMEM_RxpRdCmd, stream< FlagBool > &soAss_SplitSeg)
Rx Memory Reader (Mrd)
#define TRACE_ASS
void pNotificationMux(stream< TcpAppNotif > &siRXe_Notif, stream< TcpAppNotif > &siTIm_Notif, stream< TcpAppNotif > &soTAIF_Notif, stream< ap_uint< 8 > > &soMMIO_NotifDropCnt)
Rx Notification Multiplexer (Nmx)
#define TRACE_MRD
bool gTraceEvent
Definition: tb_nal.cpp:151
#define THIS_NAME
TcpBufAdr RxBufPtr
Definition: toe.hpp:298
void rx_app_interface(stream< TcpAppNotif > &soTAIF_Notif, stream< TcpAppRdReq > &siTAIF_DataReq, stream< TcpAppData > &soTAIF_Data, stream< TcpAppMeta > &soTAIF_Meta, stream< TcpAppLsnReq > &siTAIF_LsnReq, stream< TcpAppLsnRep > &soTAIF_LsnRep, stream< TcpPort > &soPRt_LsnReq, stream< AckBit > &siPRt_LsnAck, stream< TcpAppNotif > &siRXe_Notif, stream< TcpAppNotif > &siTIm_Notif, stream< RAiRxSarQuery > &soRSt_RxSarReq, stream< RAiRxSarReply > &siRSt_RxSarRep, stream< DmCmd > &soMEM_RxP_RdCmd, stream< AxisApp > &siMEM_RxP_Data, stream< ap_uint< 8 > > &soMMIO_NotifDropCnt, stream< ap_uint< 8 > > &soMMIO_MetaDropCnt, stream< ap_uint< 8 > > &soMMIO_DataDropCnt)
Rx Application Interface (RAi)
#define DEBUG_LEVEL
void pLsnAppInterface(stream< TcpAppLsnReq > &siTAIF_LsnReq, stream< TcpAppLsnRep > &soTAIF_LsnRep, stream< TcpPort > &soPRt_LsnReq, stream< RepBit > &siPRt_LsnRep)
Listen Application Interface (Lai)
void pRxAppStream(stream< TcpAppRdReq > &siTAIF_DataReq, stream< TcpAppMeta > &soTAIF_Meta, stream< RAiRxSarQuery > &soRSt_RxSarQry, stream< RAiRxSarReply > &siRSt_RxSarRep, stream< DmCmd > &soMrd_MemRdCmd, stream< ap_uint< 8 > > &soMMIO_MetaDropCnt)
Rx Application Stream (RAs)
void pAppSegmentStitcher(stream< AxisApp > &siMEM_RxP_Data, stream< TcpAppData > &soTAIF_Data, stream< FlagBool > &siMrd_SplitSegFlag, stream< ap_uint< 8 > > &soMMIO_DataDropCnt)
Application Segment Stitcher (Ass)
ap_uint< 32 > RxMemPtr
Definition: toe.hpp:295
ap_uint< 16 > TcpSegLen
Definition: AxisTcp.hpp:121
ap_uint< 1 > RepBit
Definition: nts_types.hpp:113
void printAxisRaw(const char *callerName, AxisRaw chunk)
Prints an Axis raw data chunk (used for debugging).
Definition: nts_utils.cpp:46
#define ARW
Definition: AxisRaw.hpp:114
bool FlagBool
Definition: nts_types.hpp:124
ap_uint< 16 > TcpPort
Definition: AxisTcp.hpp:105
AxisRaw AxisApp
Definition: nts.hpp:51
#define printInfo(callerName, format,...)
A macro to print an information message.
Definition: nts_utils.hpp:169
bool RepBool
Definition: nts_types.hpp:127
#define concat3(firstCharConst, secondCharConst, thirdCharConst)
Definition: nts_utils.hpp:161
#define printFatal(callerName, format,...)
A macro to print a fatal error message and exit.
Definition: nts_utils.hpp:208
#define TLAST
Definition: AxisRaw.hpp:116
: Rx Application Interface (RAi) of the TCP Offload Engine (TOE)