cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
harris.cpp
Go to the documentation of this file.
1 
18 
37 #include "../include/harris.hpp"
38 #include "../include/xf_harris_config.h"
39 
40 #ifdef USE_HLSLIB_DATAFLOW
41 #include "../../../../../hlslib/include/hlslib/xilinx/Stream.h"
42 #include "../../../../../hlslib/include/hlslib/xilinx/Simulation.h"
43 #endif
44 
45 #ifdef USE_HLSLIB_STREAM
46 using hlslib::Stream;
47 #endif
48 using hls::stream;
49 
53 fsmStateDDRdef fsmStateDDR = FSM_IDLE; //FSM_WR_PAT_CMD;
54 
55 #ifdef ENABLE_DDR
56 #if TRANSFERS_PER_CHUNK_DIVEND == 0
57 #define TRANSFERS_PER_CHUNK_LAST_BURST TRANSFERS_PER_CHUNK
58 #else
59 #define TRANSFERS_PER_CHUNK_LAST_BURST TRANSFERS_PER_CHUNK_DIVEND
60 #endif
61 #endif
62 
64  ap_uint<32> *pi_rank,
65  ap_uint<32> *pi_size,
66  stream<NodeId> &sDstNode_sig,
67  ap_uint<32> *po_rx_ports
68  )
69 {
70  //-- DIRECTIVES FOR THIS PROCESS ------------------------------------------
71 #pragma HLS inline off
72 //#pragma HLS pipeline II=1 //not necessary
73  //-- STATIC VARIABLES (with RESET) ------------------------------------------
74  static PortFsmType port_fsm = FSM_WRITE_NEW_DATA;
75 #pragma HLS reset variable=port_fsm
76 
77 
78  switch(port_fsm)
79  {
80  default:
81  case FSM_WRITE_NEW_DATA:
82  printf("DEBUG in pPortAndDestionation: port_fsm - FSM_WRITE_NEW_DATA\n");
83  //Triangle app needs to be reset to process new rank
84  if(!sDstNode_sig.full())
85  {
86  NodeId dst_rank = (*pi_rank + 1) % *pi_size;
87  printf("rank: %d; size: %d; \n", (int) *pi_rank, (int) *pi_size);
88  sDstNode_sig.write(dst_rank);
89  port_fsm = FSM_DONE;
90  }
91  break;
92  case FSM_DONE:
93  printf("DEBUG in pPortAndDestionation: port_fsm - FSM_DONE\n");
94  *po_rx_ports = PORTS_OPENED;
95  break;
96  }
97 }
98 
99 
100 
101 
105 void storeWordToArray(uint64_t input, ap_uint<INPUT_PTR_WIDTH> img[IMG_PACKETS],
106  unsigned int *processed_word, unsigned int *image_loaded)
107 {
108  #pragma HLS INLINE
109 
110  img[*processed_word] = (ap_uint<INPUT_PTR_WIDTH>) input;
111  printf("DEBUG in storeWordToArray: input = %u = 0x%16.16llX \n", input, input);
112  printf("DEBUG in storeWordToArray: img[%u]= %u = 0x%16.16llX \n", *processed_word,
113  (uint64_t)img[*processed_word], (uint64_t)img[*processed_word]);
114  if (*processed_word < IMG_PACKETS-1) {
115  *processed_word++;
116  }
117  else {
118  printf("DEBUG in storeWordToArray: WARNING - you've reached the max depth of img[%u]. Will put *processed_word = 0.\n", *processed_word);
119  *processed_word = 0;
120  *image_loaded = 1;
121  }
122 }
123 
124 
125 
130  NetworkWord word,
131  #ifdef USE_HLSLIB_STREAM
132  Stream<Data_t_in, MIN_RX_LOOPS> &img_in_axi_stream,
133  #else
134  //stream<Data_t_in> &img_in_axi_stream,
135  stream<ap_uint<INPUT_PTR_WIDTH>> &img_in_axi_stream,
136  #endif
137  unsigned int *processed_word_rx,
138  unsigned int *processed_bytes_rx,
139  stream<bool> &sImageLoaded
140 )
141 {
142  #pragma HLS INLINE
143  Data_t_in v;
144  const unsigned int loop_cnt = (BITS_PER_10GBITETHRNET_AXI_PACKET/INPUT_PTR_WIDTH);
145  const unsigned int bytes_per_loop = (BYTES_PER_10GBITETHRNET_AXI_PACKET/loop_cnt);
146  unsigned int bytes_with_keep = 0;
147  //v = word.tdata;
148  for (unsigned int i=0; i<loop_cnt; i++) {
149  //#pragma HLS PIPELINE
150  //#pragma HLS UNROLL factor=loop_cnt
151  //printf("DEBUG: Checking: word.tkeep=%u >> %u = %u\n", word.tkeep.to_int(), i, (word.tkeep.to_int() >> i));
152  if ((word.tkeep >> i) == 0) {
153  printf("WARNING: value with tkeep=0 at i=%u\n", i);
154  continue;
155  }
156  v.data = (ap_uint<INPUT_PTR_WIDTH>)(word.tdata >> i*8);
157  v.keep = word.tkeep;
158  v.last = word.tlast;
159  //printf("DEBUG in storeWordToAxiStream: word = %u = 0x%16.16llX \n", v.data, v.data);
160  img_in_axi_stream.write(v.data);
161  bytes_with_keep += bytes_per_loop;
162  }
163  /*
164  if (*processed_word_rx < IMG_PACKETS-1) {
165  (*processed_word_rx)++;
166  }
167  else {
168  printf("DEBUG in storeWordToAxiStream: WARNING - you've reached the max depth of img. Will put *processed_word_rx = 0.\n");
169  *processed_word_rx = 0;
170  }*/
171  if (*processed_bytes_rx < IMGSIZE-BYTES_PER_10GBITETHRNET_AXI_PACKET) {
172  (*processed_bytes_rx) += bytes_with_keep;
173  if (!sImageLoaded.full()) {
174  sImageLoaded.write(false);
175  }
176  }
177  else {
178  printf("DEBUG in storeWordToAxiStream: WARNING - you've reached the max depth of img. Will put *processed_bytes_rx = 0.\n");
179  *processed_bytes_rx = 0;
180  if (!sImageLoaded.full()) {
181  sImageLoaded.write(true);
182  }
183  }
184 }
185 
186 
187 #ifdef ENABLE_DDR
188 
189 
202 void pRXPathDDR(
203  stream<NetworkWord> &siSHL_This_Data,
204  stream<NetworkMetaStream> &siNrc_meta,
205  stream<NetworkMetaStream> &sRxtoTx_Meta,
206  //---- P0 Write Path (S2MM) -----------
207  stream<DmCmd> &soMemWrCmdP0,
208  stream<DmSts> &siMemWrStsP0,
209  stream<Axis<MEMDW_512> > &soMemWriteP0,
210  //---- P1 Memory mapped ---------------
212  NetworkMetaStream meta_tmp,
213  unsigned int *processed_bytes_rx,
214  stream<bool> &sImageLoaded
215  )
216 {
217  //-- DIRECTIVES FOR THIS PROCESS ------------------------------------------
218  #pragma HLS INLINE off
219  #pragma HLS pipeline II=1
220 
221  //-- LOCAL VARIABLES ------------------------------------------------------
222  static NetworkWord netWord;
223 
224  static ap_uint<MEMDW_512> v = 0;
225  //v.data = 0;
226  //v.keep = 0;
227  //v.last = 0;
228  const unsigned int loop_cnt = (MEMDW_512/BITS_PER_10GBITETHRNET_AXI_PACKET);
229  const unsigned int bytes_per_loop = (BYTES_PER_10GBITETHRNET_AXI_PACKET*loop_cnt);
230  static unsigned int cur_transfers_per_chunk;
231  static unsigned int cnt_wr_stream, cnt_wr_img_loaded;
232  static stream<ap_uint<MEMDW_512>> img_in_axi_stream ("img_in_axi_stream");
233  const unsigned int img_in_axi_stream_depth = TRANSFERS_PER_CHUNK; // the AXI burst size
234  #pragma HLS stream variable=img_in_axi_stream depth=img_in_axi_stream_depth
235  static unsigned int ddr_addr_in;
236 
237  // FIXME: Initialize to zero
238  static ap_uint<32> patternWriteNum;
239  static ap_uint<32> timeoutCnt;
240 
241  static Axis<MEMDW_512> memP0;
242  static DmSts memWrStsP0;
243 
244  #pragma HLS reset variable=cur_transfers_per_chunk
245  #pragma HLS reset variable=cnt_wr_stream
246  #pragma HLS reset variable=cnt_wr_img_loaded
247  #pragma HLS reset variable=ddr_addr_in
248  #pragma HLS reset variable=patternWriteNum
249  #pragma HLS reset variable=timeoutCnt
250  #pragma HLS reset variable=memP0
251  #pragma HLS reset variable=memWrStsP0
252 
253  switch(enqueueFSM)
254  {
255  case WAIT_FOR_META:
256  printf("DEBUG in pRXPathDDR: enqueueFSM - WAIT_FOR_META, *processed_bytes_rx=%u\n",
257  *processed_bytes_rx);
258 
259  printf("TOTMEMDW_512=%u\n", TOTMEMDW_512);
260  printf("TRANSFERS_PER_CHUNK=%u\n", TRANSFERS_PER_CHUNK);
261  printf("TRANSFERS_PER_CHUNK_DIVEND=%u\n", TRANSFERS_PER_CHUNK_DIVEND);
262  printf("TRANSFERS_PER_CHUNK_LAST_BURST=%u\n", TRANSFERS_PER_CHUNK_LAST_BURST);
263  //exit(-1);
264 
265  if ( !siNrc_meta.empty() && !sRxtoTx_Meta.full() )
266  {
267  meta_tmp = siNrc_meta.read();
268  meta_tmp.tlast = 1; //just to be sure...
269  sRxtoTx_Meta.write(meta_tmp);
270  if ((*processed_bytes_rx) == 0) {
271  memP0.tdata = 0;
272  memP0.tlast = 0;
273  memP0.tkeep = 0;
274  patternWriteNum = 0;
275  timeoutCnt = 0;
276  cur_transfers_per_chunk = 0;
277  netWord.tlast = 0;
278  netWord.tkeep = 0x0;
279  netWord.tdata = 0x0;
280  ddr_addr_in = 0;
281  cnt_wr_stream = 0;
282  v = 0;
283  memWrStsP0.tag = 0;
284  memWrStsP0.interr = 0;
285  memWrStsP0.decerr = 0;
286  memWrStsP0.slverr = 0;
287  memWrStsP0.okay = 0;
288  }
290  }
291  break;
292 
293  case PROCESSING_PACKET:
294  printf("DEBUG in pRXPathDDR: enqueueFSM - PROCESSING_PACKET, *processed_bytes_rx=%u\n",
295  *processed_bytes_rx);
296  if ( !siSHL_This_Data.empty() )
297  {
298  //-- Read incoming data chunk
299  netWord = siSHL_This_Data.read();
300  printf("DEBUG in pRXPathDDR: Data write = {D=0x%16.16llX, K=0x%2.2X, L=%d} \n",
301  netWord.tdata.to_long(), netWord.tkeep.to_int(), netWord.tlast.to_int());
302  //enqueueFSM = LOAD_IN_STREAM;
303  if ((netWord.tkeep >> cnt_wr_stream) == 0) {
304  printf("WARNING: value with tkeep=0 at cnt_wr_stream=%u\n", cnt_wr_stream);
305  //continue;
306  }
307  v(cnt_wr_stream*64, (cnt_wr_stream+1)*64-1) = netWord.tdata(0,63);
308  if ((cnt_wr_stream++ == loop_cnt-1) || (netWord.tlast == 1)) {
309  if ( !img_in_axi_stream.full() ) {
310  // std::cout << std::hex << v << std::endl; // print hexadecimal value
311  img_in_axi_stream.write(v);
312  }
314  cnt_wr_stream = 0;
315  }
316  }
317  break;
318 
319 /*
320  case LOAD_IN_STREAM:
321  printf("DEBUG in pRXPathDDR: enqueueFSM - LOAD_IN_STREAM\n");
322  printf("DEBUG in pRXPathDDR: Data write = {D=0x%16.16llX, K=0x%2.2X, L=%d} \n",
323  netWord.tdata.to_long(), netWord.tkeep.to_int(), netWord.tlast.to_int());
324  //printf("DEBUG: Checking: netWord.tkeep=%u >> %u = %u\n", netWord.tkeep.to_int(), cnt_wr_stream, (netWord.tkeep.to_int() >> cnt_wr_stream));
325  if ((netWord.tkeep >> cnt_wr_stream) == 0) {
326  printf("WARNING: value with tkeep=0 at cnt_wr_stream=%u\n", cnt_wr_stream);
327  //continue;
328  }
329  v(cnt_wr_stream*64, (cnt_wr_stream+1)*64-1) = netWord.tdata(0,63);
330 
331  if ((cnt_wr_stream++ == loop_cnt-1) || (netWord.tlast == 1)) {
332  if ( !img_in_axi_stream.full() ) {
333  // std::cout << std::hex << v << std::endl; // print hexadecimal value
334  img_in_axi_stream.write(v);
335  }
336  enqueueFSM = FSM_CHK_PROC_BYTES;
337  cnt_wr_stream = 0;
338  }
339  else {
340  if(netWord.tlast == 1) {
341  enqueueFSM = WAIT_FOR_META;
342  }
343  else {
344  enqueueFSM = PROCESSING_PACKET;
345  }
346  }
347  break;
348  */
349 
350  case FSM_CHK_PROC_BYTES:
351  printf("DEBUG in pRXPathDDR: enqueueFSM - FSM_CHK_PROC_BYTES, processed_bytes_rx=%u\n", *processed_bytes_rx);
352  if (*processed_bytes_rx < IMGSIZE-bytes_per_loop) {
353  (*processed_bytes_rx) += bytes_per_loop;
354  }
355  else {
356  printf("DEBUG in pRXPathDDR: WARNING - you've reached the max depth of img. Will put *processed_bytes_rx = 0.\n");
357  *processed_bytes_rx = 0;
358  }
360  break;
361 /*
362  case FSM_CHK_WRT_CHNK_TO_DDR_PND :
363  printf("DEBUG in pRXPathDDR: enqueueFSM - FSM_CHK_WRT_CHNK_TO_DDR_PND\n");
364 
365  // Both when we have a new word for DDR or the net stream ended (*processed_bytes_rx = 0)
366  if ((*processed_bytes_rx) % BPERMDW_512 == 0) {
367  printf("DEBUG in pRXPathDDR: Accumulated %u net words (%u B) to complete a single DDR word\n",
368  KWPERMDW_512, BPERMDW_512);
369  enqueueFSM = FSM_WR_PAT_CMD;
370  }
371  else {
372  printf("ERROR: Should never be here.\n");
373  exit(-1);
374  if(netWord.tlast == 1) {
375  enqueueFSM = WAIT_FOR_META;
376  }
377  else {
378  enqueueFSM = PROCESSING_PACKET;
379  }
380  }
381  break;
382 */
383 case FSM_WR_PAT_CMD:
384  printf("DEBUG in pRXPathDDR: enqueueFSM - FSM_WR_PAT_CMD\n");
385  if ( !soMemWrCmdP0.full() ) {
386  //-- Post a memory write command to SHELL/Mem/Mp0
387  if (*processed_bytes_rx == 0){
388  cur_transfers_per_chunk = TRANSFERS_PER_CHUNK_LAST_BURST;
389  }
390  else {
391  cur_transfers_per_chunk = TRANSFERS_PER_CHUNK;
392  }
393  if (patternWriteNum == 0) { // Write cmd only the fitst time of every burst
394  soMemWrCmdP0.write(DmCmd(ddr_addr_in * BPERMDW_512, cur_transfers_per_chunk*BPERMDW_512)); // Byte-addresable
395  }
396  ddr_addr_in++;
398  }
399  break;
400 
401 case FSM_WR_PAT_LOAD:
402  printf("DEBUG in pRXPathDDR: enqueueFSM - FSM_WR_PAT_LOAD\n");
403  // -- Assemble a 512-bit memory word with input values from stream
404  if (patternWriteNum++ == cur_transfers_per_chunk - 1) {
405  patternWriteNum = 0;
407  }
408  else {
409  if(netWord.tlast == 1) {
411  }
412  else {
414  }
415  }
416  break;
417 
418 case FSM_WR_PAT_DATA:
419  printf("DEBUG in pRXPathDDR: enqueueFSM - FSM_WR_PAT_DATA\n");
420  if (!soMemWriteP0.full()) {
421  //-- Write a memory word to DRAM
422  if (!img_in_axi_stream.empty()) {
423  memP0.tdata = img_in_axi_stream.read();
424  }
425  ap_uint<8> keepVal = 0xFF;
426  memP0.tkeep = (ap_uint<64>) (keepVal, keepVal, keepVal, keepVal, keepVal, keepVal, keepVal, keepVal);
427  if (patternWriteNum++ == cur_transfers_per_chunk - 1) {
428  printf("DEBUG: (patternWriteNum == cur_transfers_per_chunk -1) \n");
429  memP0.tlast = 1;
430  cnt_wr_img_loaded = 0;
431  timeoutCnt = 0;
432  patternWriteNum = 0;
434  }
435  else {
436  memP0.tlast = 0;
437  }
438  soMemWriteP0.write(memP0);
439  }
440  break;
441 
442 case FSM_WR_PAT_STS_A:
443  printf("DEBUG in pRXPathDDR: enqueueFSM - FSM_WR_PAT_STS_A\n");
444  if (!siMemWrStsP0.empty()) {
445  printf(" 1 \n");
446  //-- Get the memory write status for Mem/Mp0
447  siMemWrStsP0.read(memWrStsP0);
449  }
450  else {
451  if (timeoutCnt++ >= CYCLES_UNTIL_TIMEOUT) {
452  memWrStsP0.tag = 0;
453  memWrStsP0.interr = 0;
454  memWrStsP0.decerr = 0;
455  memWrStsP0.slverr = 0;
456  memWrStsP0.okay = 0;
458  }
459  }
460  break;
461 
462 case FSM_WR_PAT_STS_B:
463  printf("DEBUG in pRXPathDDR: enqueueFSM - FSM_WR_PAT_STS_B\n");
464  if ((memWrStsP0.tag = 0x0) && (memWrStsP0.okay == 1)) {
465  if ((*processed_bytes_rx) == 0) {
466  if (!sImageLoaded.full()) {
467  if (cnt_wr_img_loaded++ >= 1) {
468  sImageLoaded.write(false);
470  }
471  else {
472  sImageLoaded.write(true);
473  }
474  }
475  }
476  else {
478  }
479  }
480  else {
481  ; // TODO: handle errors on memWrStsP0
482  }
483  break;
484 
485 case FSM_WR_PAT_STS_C:
486  printf("DEBUG in pRXPathDDR: enqueueFSM - FSM_WR_PAT_STS_C\n");
487  if(netWord.tlast == 1) {
489  }
490  else {
492  }
493  break;
494 }
495 
496 }
497 #endif // ENABLE_DDR
498 
499 
500 
513 void pRXPath(
514  stream<NetworkWord> &siSHL_This_Data,
515  stream<NetworkMetaStream> &siNrc_meta,
516  stream<NetworkMetaStream> &sRxtoTx_Meta,
517  #ifdef USE_HLSLIB_STREAM
518  Stream<Data_t_in, MIN_RX_LOOPS> &img_in_axi_stream,
519  #else // !USE_HLSLIB_STREAM
520  //stream<Data_t_in> &img_in_axi_stream,
521  stream<ap_uint<INPUT_PTR_WIDTH>> &img_in_axi_stream,
522  #endif // USE_HLSLIB_STREAM
523  NetworkMetaStream meta_tmp,
524  unsigned int *processed_word_rx,
525  unsigned int *processed_bytes_rx,
526  stream<bool> &sImageLoaded
527  )
528 {
529  //-- DIRECTIVES FOR THIS PROCESS ------------------------------------------
530  #pragma HLS INLINE off
531  #pragma HLS pipeline II=1
532 
533  //-- LOCAL VARIABLES ------------------------------------------------------
534  static NetworkWord netWord;
535 
536  switch(enqueueFSM)
537  {
538  case WAIT_FOR_META:
539  printf("DEBUG in pRXPath: enqueueFSM - WAIT_FOR_META, *processed_word_rx=%u, *processed_bytes_rx=%u\n",
540  *processed_word_rx, *processed_bytes_rx);
541  if ( !siNrc_meta.empty() && !sRxtoTx_Meta.full() )
542  {
543  meta_tmp = siNrc_meta.read();
544  meta_tmp.tlast = 1; //just to be sure...
545  sRxtoTx_Meta.write(meta_tmp);
547  }
548  break;
549 
550  case PROCESSING_PACKET:
551  printf("DEBUG in pRXPath: enqueueFSM - PROCESSING_PACKET, *processed_word_rx=%u, *processed_bytes_rx=%u\n",
552  *processed_word_rx, *processed_bytes_rx);
553  if ( !siSHL_This_Data.empty() && !img_in_axi_stream.full())
554  {
555  //-- Read incoming data chunk
556  netWord = siSHL_This_Data.read();
557  storeWordToAxiStream(netWord, img_in_axi_stream, processed_word_rx, processed_bytes_rx,
558  sImageLoaded);
559  if(netWord.tlast == 1)
560  {
562  }
563  }
564  break;
565  }
566 }
567 
568 
569 
581  stream<NetworkWord> &sRxpToTxp_Data,
582  #ifdef ENABLE_DDR
583  //---- P1 Memory mapped ---------------
584  membus_t *lcl_mem0,
586  #else // !ENABLE_DDR
587  #ifdef USE_HLSLIB_STREAM
588  Stream<Data_t_in, MIN_RX_LOOPS> &img_in_axi_stream,
589  Stream<Data_t_out, MIN_TX_LOOPS> &img_out_axi_stream,
590  #else // !USE_HLSLIB_STREAM
591  stream<ap_uint<INPUT_PTR_WIDTH>> &img_in_axi_stream,
592  stream<ap_uint<OUTPUT_PTR_WIDTH>> &img_out_axi_stream,
593  #endif // USE_HLSLIB_STREAM
594  #endif // ENABLE_DDR
595 
596 
597  stream<bool> &sImageLoaded
598  )
599 {
600  //-- DIRECTIVES FOR THIS PROCESS ------------------------------------------
601  #pragma HLS INLINE off
602  #pragma HLS pipeline II=1
603 
604  //-- LOCAL VARIABLES ------------------------------------------------------
605  NetworkWord newWord;
606  uint16_t Thresh = 442;
607  float K = 0.04;
608  uint16_t k = K * (1 << 16); // Convert to Q0.16 format
609  static bool accel_called;
610  static unsigned int processed_word_proc;
611  static unsigned int timeoutCntAbs;
612  static unsigned int cnt_i;
613  static membus_t tmp;
614  ap_uint<OUTPUT_PTR_WIDTH> raw64;
615  Data_t_out temp;
616  #ifdef ENABLE_DDR
617  //static stream<ap_uint<OUTPUT_PTR_WIDTH>> img_out_axi_stream ("img_out_axi_stream");
618  //#pragma HLS stream variable=img_out_axi_stream depth=9
619  static unsigned int ddr_addr_out;
620  #pragma HLS reset variable=ddr_addr_out
621  #endif
622 
623  #pragma HLS reset variable=accel_called
624  #pragma HLS reset variable=processed_word_proc
625  #pragma HLS reset variable=timeoutCntAbs
626  #pragma HLS reset variable=cnt_i
627  #pragma HLS reset variable=tmp
628  #pragma HLS reset variable=raw64
629  #pragma HLS reset variable=temp
630 
631  switch(HarrisFSM)
632  {
633  case WAIT_FOR_META:
634  printf("DEBUG in pProcPath: WAIT_FOR_META\n");
635  if (!sImageLoaded.empty())
636  {
637  if (sImageLoaded.read() == true) {
639  accel_called = false;
640  processed_word_proc = 0;
641  #ifdef ENABLE_DDR
642  ddr_addr_out = 0;
643  timeoutCntAbs = 0;
644  cnt_i = 0;
645  #endif
646  }
647  }
648  break;
649 
650  case PROCESSING_PACKET:
651  printf("DEBUG in pProcPath: PROCESSING_PACKET\n");
652  #ifndef ENABLE_DDR
653  if ( !img_in_axi_stream.empty() && !img_out_axi_stream.full() )
654  {
655  #endif
656  if (accel_called == false) {
657  #ifdef ENABLE_DDR
659  #else // ! ENABLE_DDR
660  #ifdef FAKE_Harris
661  fakeCornerHarrisAccelStream(img_in_axi_stream, img_out_axi_stream, MIN_RX_LOOPS, MIN_TX_LOOPS);
662  #else // !FAKE_Harris
663  cornerHarrisAccelStream(img_in_axi_stream, img_out_axi_stream, WIDTH, HEIGHT, Thresh, k);
664  #endif // FAKE_Harris
665  #endif // ENABLE_DDR
666  accel_called = true;
668  }
669  #ifndef ENABLE_DDR
670  }
671  #endif
672  break;
673 
674  #ifdef ENABLE_DDR
676  printf("DEBUG in pProcPath: HARRIS_RETURN_RESULTS, ddr_addr_out=%u\n", ddr_addr_out);
677  if (accel_called == true) {
678 
679  printf("DEBUG in pProcPath: Accumulated %u net words (%u B) to complete a single DDR word\n",
681  tmp = lcl_mem1[ddr_addr_out];
682  ddr_addr_out++;
684  timeoutCntAbs = 0;
685  }
686  break;
687 
689  printf("DEBUG in pProcPath: HARRIS_RETURN_RESULTS_ABSORB_DDR_LAT [%u out of %u]\n", timeoutCntAbs, DDR_LATENCY);
690  if (timeoutCntAbs++ == DDR_LATENCY) {
691  HarrisFSM = HARRIS_RETURN_RESULTS_FWD; //HARRIS_RETURN_RESULTS_UNPACK;
692  cnt_i = 0;
693  }
694  break;
695  /*
696  case HARRIS_RETURN_RESULTS_UNPACK:
697  printf("DEBUG in pProcPath: HARRIS_RETURN_RESULTS_UNPACK, cnt_i=%u\n", cnt_i);
698  //for (unsigned int cnt_i=0; cnt_i<(MEMDW_512/OUTPUT_PTR_WIDTH); cnt_i++) {
699  #if OUTPUT_PTR_WIDTH == 64
700  raw64(0 ,63) = tmp(cnt_i*OUTPUT_PTR_WIDTH , cnt_i*OUTPUT_PTR_WIDTH+63);
701  #endif
702  if ( !img_out_axi_stream.full() ) {
703  img_out_axi_stream.write(raw64);
704  }
705  if (cnt_i == (MEMDW_512/OUTPUT_PTR_WIDTH) - 1) {
706  HarrisFSM = HARRIS_RETURN_RESULTS_FWD;
707  }
708  cnt_i++;
709  //}
710  break;
711  */
713  printf("DEBUG in pProcPath: HARRIS_RETURN_RESULTS_FWD\n");
714  //if ( !img_out_axi_stream.empty() && !sRxpToTxp_Data.full() ) {
715  if ( (cnt_i <= (MEMDW_512/OUTPUT_PTR_WIDTH) - 1) && !sRxpToTxp_Data.full() ) {
716 
717  //temp.data = img_out_axi_stream.read();
718  temp.data(0 ,63) = tmp(cnt_i*OUTPUT_PTR_WIDTH , cnt_i*OUTPUT_PTR_WIDTH+63);
719  if (processed_word_proc++ == MIN_TX_LOOPS-1) {
720  temp.last = 1;
722  }
723  else {
724  temp.last = 0;
725  }
726  //TODO: find why Vitis kernel does not set keep and last by itself
727  temp.keep = 255;
728  newWord = NetworkWord(temp.data, temp.keep, temp.last);
729  sRxpToTxp_Data.write(newWord);
730  cnt_i++;
731  }
732  else {
734  }
735 
736  break;
737 
738  #else // ! ENABLE_DDR
740  printf("DEBUG in pProcPath: HARRIS_RETURN_RESULTS\n");
741  if ( !img_out_axi_stream.empty() && !sRxpToTxp_Data.full() )
742  {
743 
744  temp.data = img_out_axi_stream.read();
745  if ( img_out_axi_stream.empty() )
746  //if (processed_word_proc++ == MIN_TX_LOOPS-1)
747  {
748  temp.last = 1;
750  accel_called = false;
751  }
752  else
753  {
754  temp.last = 0;
755  }
756  //TODO: find why Vitis kernel does not set keep and last by itself
757  temp.keep = 255;
758  newWord = NetworkWord(temp.data, temp.keep, temp.last);
759  sRxpToTxp_Data.write(newWord);
760  }
761  break;
762  #endif // ENABLE_DDR
763  } // end switch
764 
765 }
766 
767 
768 unsigned int sRxpToTxp_DataCounter = 0;
769 
770 
782 void pTXPath(
783  stream<NodeId> &sDstNode_sig,
784  stream<NetworkWord> &soTHIS_Shl_Data,
785  stream<NetworkMetaStream> &soNrc_meta,
786  stream<NetworkWord> &sRxpToTxp_Data,
787  stream<NetworkMetaStream> &sRxtoTx_Meta,
788  unsigned int *processed_word_tx,
789  ap_uint<32> *pi_rank,
790  ap_uint<32> *pi_size
791  )
792 {
793  //-- DIRECTIVES FOR THIS PROCESS ------------------------------------------
794  #pragma HLS INLINE off
795  #pragma HLS pipeline II=1
796 
797  //-- STATIC DATAFLOW VARIABLES ------------------------------------------
798  static NodeId dst_rank;
799 
800  //-- LOCAL VARIABLES ------------------------------------------------------
801  NetworkWord netWordTx;
802  NetworkMeta meta_in = NetworkMeta();
803  NetworkMetaStream meta_out_stream = NetworkMetaStream();
804 
805  #pragma HLS reset variable=dst_rank
806  #pragma HLS reset variable=netWordTx
807 
808  switch(dequeueFSM)
809  {
810  default:
811  case WAIT_FOR_META:
812  if(!sDstNode_sig.empty())
813  {
814  dst_rank = sDstNode_sig.read();
816  //Harris app needs to be reset to process new rank
817  }
818  break;
819 
821  printf("DEBUG in pTXPath: dequeueFSM=%d - WAIT_FOR_STREAM_PAIR, *processed_word_tx=%u\n",
822  dequeueFSM, *processed_word_tx);
823  //-- Forward incoming chunk to SHELL
824  if (*processed_word_tx == MIN_TX_LOOPS) {
825  *processed_word_tx = 0;
826  }
827  /*
828  printf("!sRxpToTxp_Data.empty()=%d\n", !sRxpToTxp_Data.empty());
829  printf("!sRxtoTx_Meta.empty()=%d\n", !sRxtoTx_Meta.empty());
830  printf("!soTHIS_Shl_Data.full()=%d\n", !soTHIS_Shl_Data.full());
831  printf("!soNrc_meta.full()=%d\n", !soNrc_meta.full());
832  */
833 
834  if (( !sRxpToTxp_Data.empty() && !sRxtoTx_Meta.empty()
835  && !soTHIS_Shl_Data.full() && !soNrc_meta.full() ))
836  {
837  netWordTx = sRxpToTxp_Data.read();
838 
839  // in case MTU=8 ensure tlast is set in WAIT_FOR_STREAM_PAIR and don't visit PROCESSING_PACKET
840  if (PACK_SIZE == 8)
841  {
842  netWordTx.tlast = 1;
843  }
844  soTHIS_Shl_Data.write(netWordTx);
845 
846  meta_in = sRxtoTx_Meta.read().tdata;
847  //NetworkMetaStream meta_out_stream = NetworkMetaStream();
848  meta_out_stream.tlast = 1;
849  meta_out_stream.tkeep = 0xFF; //just to be sure
850 
851  meta_out_stream.tdata.dst_rank = dst_rank; //(*pi_rank + 1) % *pi_size;
852  //meta_out_stream.tdata.dst_port = DEFAULT_TX_PORT;
853  meta_out_stream.tdata.src_rank = (NodeId) *pi_rank;
854 
855  // Forcing the SHELL to wait for tlast
856  meta_out_stream.tdata.len = 0;
857 
858  //meta_out_stream.tdata.src_port = DEFAULT_RX_PORT;
859  //printf("rank: %d; size: %d; \n", (int) *pi_rank, (int) *pi_size);
860  //printf("meat_out.dst_rank: %d\n", (int) meta_out_stream.tdata.dst_rank);
861  meta_out_stream.tdata.dst_port = meta_in.src_port;
862  meta_out_stream.tdata.src_port = meta_in.dst_port;
863 
864 
865  //meta_out_stream.tdata.len = meta_in.len;
866  soNrc_meta.write(meta_out_stream);
867 
868  (*processed_word_tx)++;
869  printf("DEBUGGGG: Checking netWordTx.tlast...\n");
870  if(netWordTx.tlast != 1)
871  {
873  }
874  }
875  break;
876 
877  case PROCESSING_PACKET:
878  printf("DEBUG in pTXPath: dequeueFSM=%d - PROCESSING_PACKET, *processed_word_tx=%u\n",
879  dequeueFSM, *processed_word_tx);
880  if( !sRxpToTxp_Data.empty() && !soTHIS_Shl_Data.full())
881  {
882  printf("DEBUGGGG: Reading sRxpToTxp_Data %u\n", sRxpToTxp_DataCounter++);
883  netWordTx = sRxpToTxp_Data.read();
884 
885  (*processed_word_tx)++;
886 
887  // This is a normal termination of the axi stream from vitis functions
888  if ((netWordTx.tlast == 1) || (((*processed_word_tx)*8) % PACK_SIZE == 0))
889  {
890  netWordTx.tlast = 1; // in case it is the 2nd or
891  printf("DEBUGGGG: A netWordTx.tlast=1 ... sRxpToTxp_Data.empty()==%u \n", sRxpToTxp_Data.empty());
893  }
894 
895  // This is our own termination based on the custom MTU we have set in PACK_SIZE.
896  // TODO: We can map PACK_SIZE to a dynamically assigned value either through MMIO or header
897  // in order to have a functional bitstream for any MTU size
898  //if (((*processed_word_tx)*8) % PACK_SIZE == 0)
899  //{
900  // printf("DEBUGGGG: B (*processed_word_tx)*8) % PACK_SIZE == 0 ...\n");
901  // netWordTx.tlast = 1;
902  // dequeueFSM = WAIT_FOR_STREAM_PAIR;
903  //}
904 
905  soTHIS_Shl_Data.write(netWordTx);
906  }
907  break;
908  }
909 }
910 
911 
912 
918 void harris(
919 
920  ap_uint<32> *pi_rank,
921  ap_uint<32> *pi_size,
922  //------------------------------------------------------
923  //-- SHELL / This / UDP/TCP Interfaces
924  //------------------------------------------------------
925  stream<NetworkWord> &siSHL_This_Data,
926  stream<NetworkWord> &soTHIS_Shl_Data,
927  stream<NetworkMetaStream> &siNrc_meta,
928  stream<NetworkMetaStream> &soNrc_meta,
929  ap_uint<32> *po_rx_ports
930 
931  #ifdef ENABLE_DDR
932  ,
933  //------------------------------------------------------
934  //-- SHELL / Role / Mem / Mp0 Interface
935  //------------------------------------------------------
936  //---- Read Path (MM2S) ------------
937  // stream<DmCmd> &soMemRdCmdP0,
938  // stream<DmSts> &siMemRdStsP0,
939  // stream<Axis<MEMDW_512 > > &siMemReadP0,
940  //---- Write Path (S2MM) -----------
941  stream<DmCmd> &soMemWrCmdP0,
942  stream<DmSts> &siMemWrStsP0,
943  stream<Axis<MEMDW_512> > &soMemWriteP0,
944  //------------------------------------------------------
945  //-- SHELL / Role / Mem / Mp1 Interface
946  //------------------------------------------------------
949  #endif
950  )
951 {
952 
953 
954 //-- DIRECTIVES FOR THE BLOCK ---------------------------------------------
955 //#pragma HLS INTERFACE ap_ctrl_none port=return
956 
957 //#pragma HLS INTERFACE ap_stable port=piSHL_This_MmioEchoCtrl
958 
959 #pragma HLS INTERFACE axis register both port=siSHL_This_Data
960 #pragma HLS INTERFACE axis register both port=soTHIS_Shl_Data
961 
962 #pragma HLS INTERFACE axis register both port=siNrc_meta
963 #pragma HLS INTERFACE axis register both port=soNrc_meta
964 
965 #pragma HLS INTERFACE ap_ovld register port=po_rx_ports name=poROL_NRC_Rx_ports
966 
967 #if HLS_VERSION < 20211
968 #pragma HLS INTERFACE ap_stable register port=pi_rank name=piFMC_ROL_rank
969 #pragma HLS INTERFACE ap_stable register port=pi_size name=piFMC_ROL_size
970 #elif HLS_VERSION >= 20211
971  #pragma HLS stable variable=pi_rank
972  #pragma HLS stable variable=pi_size
973 #else
974  printf("ERROR: Invalid HLS_VERSION=%s\n", HLS_VERSION);
975  exit(-1);
976 #endif
977 
978 #ifdef ENABLE_DDR
979 
980 // Bundling: SHELL / Role / Mem / Mp0 / Read Interface
981 // #pragma HLS INTERFACE axis register both port=soMemRdCmdP0
982 // #pragma HLS INTERFACE axis register both port=siMemRdStsP0
983 // #pragma HLS INTERFACE axis register both port=siMemReadP0
984 
985 // #pragma HLS DATA_PACK variable=soMemRdCmdP0 instance=soMemRdCmdP0
986 // #pragma HLS DATA_PACK variable=siMemRdStsP0 instance=siMemRdStsP0
987 
988 // Bundling: SHELL / Role / Mem / Mp0 / Write Interface
989 #pragma HLS INTERFACE axis register both port=soMemWrCmdP0
990 #pragma HLS INTERFACE axis register both port=siMemWrStsP0
991 #pragma HLS INTERFACE axis register both port=soMemWriteP0
992 
993 #if HLS_VERSION <= 20201
994 #pragma HLS DATA_PACK variable=soMemWrCmdP0 instance=soMemWrCmdP0
995 #pragma HLS DATA_PACK variable=siMemWrStsP0 instance=siMemWrStsP0
996 #elif HLS_VERSION >= 20211
997 #pragma HLS aggregate variable=soMemWrCmdP0 compact=bit
998 #pragma HLS aggregate variable=siMemWrStsP0 compact=bit
999 #else
1000  printf("ERROR: Invalid HLS_VERSION=%s\n", HLS_VERSION);
1001  exit(-1);
1002 #endif
1003 
1004 const unsigned int ddr_mem_depth = TOTMEMDW_512;
1005 const unsigned int ddr_latency = DDR_LATENCY;
1006 
1007 
1008 // Max burst size is 1KB, thus with 512bit bus we get 16 burst transactions
1009 const unsigned int max_axi_rw_burst_length = 16;
1010 
1011 // Mapping LCL_MEM0 interface to moMEM_Mp1 channel
1012 #pragma HLS INTERFACE m_axi depth=ddr_mem_depth port=lcl_mem0 bundle=moMEM_Mp1\
1013  max_read_burst_length=max_axi_rw_burst_length max_write_burst_length=max_axi_rw_burst_length offset=direct \
1014  num_read_outstanding=16 num_write_outstanding=16 latency=ddr_latency
1015 
1016 // Mapping LCL_MEM1 interface to moMEM_Mp1 channel
1017 #pragma HLS INTERFACE m_axi depth=ddr_mem_depth port=lcl_mem1 bundle=moMEM_Mp1 \
1018  max_read_burst_length=max_axi_rw_burst_length max_write_burst_length=max_axi_rw_burst_length offset=direct \
1019  num_read_outstanding=16 num_write_outstanding=16 latency=ddr_latency
1020 
1021 #endif
1022 
1023  #pragma HLS DATAFLOW
1024 
1025  //-- LOCAL VARIABLES ------------------------------------------------------
1026  NetworkMetaStream meta_tmp = NetworkMetaStream();
1027  static stream<NetworkWord> sRxpToTxp_Data("sRxpToTxP_Data"); // FIXME: works even with no static
1028  static stream<NetworkMetaStream> sRxtoTx_Meta("sRxtoTx_Meta");
1029  static unsigned int processed_word_rx;
1030  static unsigned int processed_bytes_rx;
1031  static unsigned int processed_word_tx = 0;
1032  static stream<bool> sImageLoaded("sImageLoaded");
1033  static bool skip_read;
1034  static bool write_chunk_to_ddr_pending;
1035  static bool ready_to_accept_new_data;
1036  static bool signal_init;
1037  const int img_in_axi_stream_depth = MIN_RX_LOOPS;
1038  const int img_out_axi_stream_depth = MIN_TX_LOOPS;
1039  const int tot_transfers = TOT_TRANSFERS;
1040 #ifndef ENABLE_DDR
1041 #ifdef USE_HLSLIB_DATAFLOW
1042  static hlslib::Stream<Data_t_in, MIN_RX_LOOPS> img_in_axi_stream ("img_in_axi_stream");
1043  static hlslib::Stream<Data_t_out, MIN_TX_LOOPS> img_out_axi_stream ("img_out_axi_stream");
1044 #else
1045  static stream<ap_uint<INPUT_PTR_WIDTH>> img_in_axi_stream ("img_in_axi_stream");
1046  static stream<ap_uint<OUTPUT_PTR_WIDTH>> img_out_axi_stream ("img_out_axi_stream");
1047 #endif
1048 #endif
1049  //*po_rx_ports = 0x1; //currently work only with default ports...
1050  static stream<NodeId> sDstNode_sig("sDstNode_sig");
1051 
1052 
1053  //-- DIRECTIVES FOR THIS PROCESS ------------------------------------------
1054 #pragma HLS stream variable=sRxtoTx_Meta depth=tot_transfers
1055 #pragma HLS reset variable=enqueueFSM
1056 #pragma HLS reset variable=dequeueFSM
1057 #pragma HLS reset variable=HarrisFSM
1058 #pragma HLS reset variable=processed_word_rx
1059 #pragma HLS reset variable=processed_word_tx
1060 #pragma HLS reset variable=processed_bytes_rx
1061 //#pragma HLS reset variable=image_loaded
1062 #pragma HLS stream variable=sImageLoaded depth=1
1063 #pragma HLS reset variable=skip_read
1064 #pragma HLS reset variable=write_chunk_to_ddr_pending
1065 //#pragma HLS stream variable=sWriteChunkToDdrPending depth=2
1066 #pragma HLS reset variable=ready_to_accept_new_data
1067 #pragma HLS reset variable=signal_init
1068 #pragma HLS STREAM variable=sDstNode_sig depth=1
1069 
1070 #ifndef ENABLE_DDR
1071 #pragma HLS stream variable=img_in_axi_stream depth=img_in_axi_stream_depth
1072 #pragma HLS stream variable=img_out_axi_stream depth=img_out_axi_stream_depth
1073 #else
1074 #pragma HLS reset variable=fsmStateDDR
1075 #endif
1076 
1077 
1078 
1079 
1080 #ifdef USE_HLSLIB_DATAFLOW
1096  // Dataflow functions running in parallel
1097  HLSLIB_DATAFLOW_INIT();
1098 
1099  HLSLIB_DATAFLOW_FUNCTION(pRXPath,
1100  siSHL_This_Data,
1101  siNrc_meta,
1102  sRxtoTx_Meta,
1103  img_in_axi_stream,
1104  meta_tmp,
1105  &processed_word_rx,
1106  &processed_bytes_rx,
1107  //&image_loaded
1108  sImageLoaded
1109  );
1110 
1111  HLSLIB_DATAFLOW_FUNCTION(pProcPath,
1112  sRxpToTxp_Data,
1113 #ifdef ENABLE_DDR
1114  lcl_mem0,
1115  lcl_mem1,
1116 #else
1117  img_in_axi_stream,
1118  img_out_axi_stream,
1119 #endif
1120  &image_loaded
1121  );
1122 
1123  HLSLIB_DATAFLOW_FUNCTION(pTXPath,
1124  soTHIS_Shl_Data,
1125  soNrc_meta,
1126  sRxpToTxp_Data,
1127  sRxtoTx_Meta,
1128  &processed_word_tx,
1129  pi_rank,
1130  pi_size);
1131 
1132  HLSLIB_DATAFLOW_FINALIZE();
1133 
1134 #else // !USE_HLSLIB_DATAFLOW
1135 
1137  pi_rank,
1138  pi_size,
1139  sDstNode_sig,
1140  po_rx_ports
1141  );
1142 
1143 #ifdef ENABLE_DDR
1144 
1145  pRXPathDDR(
1146  siSHL_This_Data,
1147  siNrc_meta,
1148  sRxtoTx_Meta,
1149  //---- P0 Write Path (S2MM) -----------
1150  soMemWrCmdP0,
1151  siMemWrStsP0,
1152  soMemWriteP0,
1153  // ---- P1 Memory mapped --------------
1154  lcl_mem0,
1155  meta_tmp,
1156  &processed_bytes_rx,
1157  sImageLoaded
1158  );
1159 
1160  #else // !ENABLE_DDR
1161 
1162  pRXPath(
1163  siSHL_This_Data,
1164  siNrc_meta,
1165  sRxtoTx_Meta,
1166  img_in_axi_stream,
1167  meta_tmp,
1168  &processed_word_rx,
1169  &processed_bytes_rx,
1170  sImageLoaded
1171  );
1172 
1173 #endif // ENABLE_DDR
1174 
1175  pProcPath(
1176  sRxpToTxp_Data,
1177 #ifdef ENABLE_DDR
1178  lcl_mem0,
1179  lcl_mem1,
1180 #else
1181  img_in_axi_stream,
1182  img_out_axi_stream,
1183 #endif
1184  sImageLoaded
1185  );
1186 
1187  pTXPath(
1188  sDstNode_sig,
1189  soTHIS_Shl_Data,
1190  soNrc_meta,
1191  sRxpToTxp_Data,
1192  sRxtoTx_Meta,
1193  &processed_word_tx,
1194  pi_rank,
1195  pi_size
1196  );
1197 
1198 #endif // USE_HLSLIB_DATAFLOW
1199 }
1200 
1201 
ap_uint< 32 > timeoutCnt
ap_uint< 32 > patternWriteNum
ap_uint< 1 > okay
ap_uint< 1 > decerr
ap_uint< 1 > slverr
ap_uint< 4 > tag
ap_uint< 1 > interr
#define WIDTH
#define IMGSIZE
#define IMG_PACKETS
#define HEIGHT
void pPortAndDestionation(ap_uint< 32 > *pi_rank, ap_uint< 32 > *pi_size, stream< NodeId > &sDstNode_sig, ap_uint< 32 > *po_rx_ports)
Definition: harris.cpp:63
#define TRANSFERS_PER_CHUNK_DIVEND
Definition: harris.hpp:134
uint8_t enqueueFSM
Definition: harris.cpp:50
#define FSM_WR_PAT_STS_B
Definition: harris.hpp:87
void harris(ap_uint< 32 > *pi_rank, ap_uint< 32 > *pi_size, stream< NetworkWord > &siSHL_This_Data, stream< NetworkWord > &soTHIS_Shl_Data, stream< NetworkMetaStream > &siNrc_meta, stream< NetworkMetaStream > &soNrc_meta, ap_uint< 32 > *po_rx_ports)
Main process of the Harris Application directives.
Definition: harris.cpp:918
void storeWordToArray(uint64_t input, ap_uint< 8 > img[16 *16/((64/8))], unsigned int *processed_word, unsigned int *image_loaded)
Store a net word to local memory.
Definition: harris.cpp:105
#define FSM_WR_PAT_LOAD
Definition: harris.hpp:84
#define HARRIS_RETURN_RESULTS_ABSORB_DDR_LAT
Definition: harris.hpp:75
void storeWordToAxiStream(NetworkWord word, stream< ap_uint< 8 >> &img_in_axi_stream, unsigned int *processed_word_rx, unsigned int *processed_bytes_rx, stream< bool > &sImageLoaded)
Store a net word to a local AXI stream.
Definition: harris.cpp:129
#define FSM_WR_PAT_CMD
Definition: harris.hpp:83
uint8_t fsmStateDDR
Definition: harris.cpp:53
uint8_t HarrisFSM
Definition: harris.cpp:52
#define TRANSFERS_PER_CHUNK
Definition: harris.hpp:133
unsigned int sRxpToTxp_DataCounter
Definition: harris.cpp:768
#define BPERMDW_512
Definition: harris.hpp:120
uint8_t dequeueFSM
Definition: harris.cpp:51
void pTXPath(stream< NodeId > &sDstNode_sig, stream< NetworkWord > &soTHIS_Shl_Data, stream< NetworkMetaStream > &soNrc_meta, stream< NetworkWord > &sRxpToTxp_Data, stream< NetworkMetaStream > &sRxtoTx_Meta, unsigned int *processed_word_tx, ap_uint< 32 > *pi_rank, ap_uint< 32 > *pi_size)
Transmit Path - From THIS to SHELL.
Definition: harris.cpp:782
#define KWPERMDW_512
Definition: harris.hpp:121
#define FSM_WR_PAT_DATA
Definition: harris.hpp:85
void pRXPath(stream< NetworkWord > &siSHL_This_Data, stream< NetworkMetaStream > &siNrc_meta, stream< NetworkMetaStream > &sRxtoTx_Meta, stream< ap_uint< 8 >> &img_in_axi_stream, NetworkMetaStream meta_tmp, unsigned int *processed_word_rx, unsigned int *processed_bytes_rx, stream< bool > &sImageLoaded)
Receive Path - From SHELL to THIS.
Definition: harris.cpp:513
#define HARRIS_RETURN_RESULTS_FWD
Definition: harris.hpp:77
#define PORTS_OPENED
Definition: harris.hpp:102
#define fsmStateDDRdef
Definition: harris.hpp:144
#define HARRIS_RETURN_RESULTS
Definition: harris.hpp:74
#define FSM_CHK_PROC_BYTES
Definition: harris.hpp:81
#define FSM_WR_PAT_STS_A
Definition: harris.hpp:86
void pProcPath(stream< NetworkWord > &sRxpToTxp_Data, stream< ap_uint< 8 >> &img_in_axi_stream, stream< ap_uint< 64 >> &img_out_axi_stream, stream< bool > &sImageLoaded)
Processing Path - Main processing FSM for Vitis kernels.
Definition: harris.cpp:580
#define FSM_IDLE
Definition: harris.hpp:79
#define FSM_WR_PAT_STS_C
Definition: harris.hpp:88
void cornerHarrisAccelMem(membus_t *img_inp, membus_t *img_out, int rows, int cols, int threshold, int k)
Top-level accelerated function of the Harris Application with array I/F.
void fakeCornerHarrisAccelStream(hls::stream< ap_axiu< 8, 0, 0, 0 > > &img_in_axi_stream, hls::stream< ap_axiu< 64, 0, 0, 0 > > &img_out_axi_stream, unsigned int min_rx_loops, unsigned int min_tx_loops)
void cornerHarrisAccelStream(hls::stream< ap_uint< 8 >> &img_in_axi_stream, hls::stream< ap_uint< 64 >> &img_out_axi_stream, int rows, int cols, int threshold, int k)
Top-level accelerated function of the Harris Application with array I/F.
#define MIN_TX_LOOPS
#define BITS_PER_10GBITETHRNET_AXI_PACKET
#define MIN_RX_LOOPS
#define INPUT_PTR_WIDTH
#define OUTPUT_PTR_WIDTH
#define BYTES_PER_10GBITETHRNET_AXI_PACKET
#define TOT_TRANSFERS
Definition: config.h:70
#define TRANSFERS_PER_CHUNK_LAST_BURST
Definition: median_blur.cpp:57
#define MEMDW_512
Definition: memtest.hpp:90
#define CYCLES_UNTIL_TIMEOUT
Definition: memtest.hpp:96
#define FSM_WRITE_NEW_DATA
Definition: memtest.hpp:78
#define FSM_DONE
Definition: memtest.hpp:79
#define PacketFsmType
Definition: memtest.hpp:76
#define PortFsmType
Definition: memtest.hpp:80
#define Data_t_out
Definition: memtest.cpp:30
#define DDR_LATENCY
Definition: memtest.hpp:98
#define Data_t_in
Definition: memtest.cpp:29
#define ENABLE_DDR
Definition: memtest.hpp:42
membus_512_t membus_t
Definition: memtest.hpp:92
#define PROCESSING_PACKET
Definition: memtest.hpp:73
#define WAIT_FOR_STREAM_PAIR
Definition: memtest.hpp:72
#define TOTMEMDW_512
Definition: memtest.hpp:93
#define WAIT_FOR_META
Definition: memtest.hpp:71
membus_t lcl_mem0[16384]
membus_t lcl_mem1[16384]
#define PACK_SIZE
Definition: config.h:51
string input
Definition: test.py:9
ap_uint< 8 > NodeId
Definition: network.hpp:82
ap_uint<(D+7)/8 > tkeep
Definition: axi_utils.hpp:49
ap_uint< 1 > tlast
Definition: axi_utils.hpp:50
ap_uint< D > tdata
Definition: axi_utils.hpp:48
ap_uint< 1 > tlast
Definition: network.hpp:111
ap_uint< 8 > tkeep
Definition: network.hpp:110
NetworkMeta tdata
Definition: network.hpp:109
NetworkDataLength len
Definition: network.hpp:99
NodeId dst_rank
Definition: network.hpp:95
NodeId src_rank
Definition: network.hpp:97
NrcPort src_port
Definition: network.hpp:98
NrcPort dst_port
Definition: network.hpp:96
ap_uint< 64 > tdata
Definition: network.hpp:49
ap_uint< 8 > tkeep
Definition: network.hpp:50
ap_uint< 1 > tlast
Definition: network.hpp:51