36 #include "../include/median_blur.hpp"
37 #include "../include/xf_median_blur_config.h"
39 #ifdef USE_HLSLIB_DATAFLOW
40 #include "../../../../../hlslib/include/hlslib/xilinx/Stream.h"
41 #include "../../../../../hlslib/include/hlslib/xilinx/Simulation.h"
44 #ifdef USE_HLSLIB_STREAM
56 #if TRANSFERS_PER_CHUNK_DIVEND == 0
57 #define TRANSFERS_PER_CHUNK_LAST_BURST TRANSFERS_PER_CHUNK
59 #define TRANSFERS_PER_CHUNK_LAST_BURST TRANSFERS_PER_CHUNK_DIVEND
66 ap_uint<32> *po_rx_ports
70 #pragma HLS inline off
71 #pragma HLS pipeline II=1
82 unsigned int *processed_word,
unsigned int *image_loaded)
86 img[*processed_word] = (ap_uint<INPUT_PTR_WIDTH>)
input;
87 printf(
"DEBUG in storeWordToArray: input = %u = 0x%16.16llX \n",
input,
input);
88 printf(
"DEBUG in storeWordToArray: img[%u]= %u = 0x%16.16llX \n", *processed_word,
89 (uint64_t)
img[*processed_word], (uint64_t)
img[*processed_word]);
94 printf(
"DEBUG in storeWordToArray: WARNING - you've reached the max depth of img[%u]. Will put *processed_word = 0.\n", *processed_word);
107 #ifdef USE_HLSLIB_STREAM
108 Stream<Data_t_in, MIN_RX_LOOPS> &img_in_axi_stream,
111 stream<ap_uint<INPUT_PTR_WIDTH>> &img_in_axi_stream,
113 unsigned int *processed_word_rx,
114 unsigned int *processed_bytes_rx,
115 stream<bool> &sImageLoaded
122 unsigned int bytes_with_keep = 0;
124 for (
unsigned int i=0; i<loop_cnt; i++) {
128 if ((word.
tkeep >> i) == 0) {
129 printf(
"WARNING: value with tkeep=0 at i=%u\n", i);
132 v.data = (ap_uint<INPUT_PTR_WIDTH>)(word.
tdata >> i*8);
136 img_in_axi_stream.write(v.data);
137 bytes_with_keep += bytes_per_loop;
148 (*processed_bytes_rx) += bytes_with_keep;
149 if (!sImageLoaded.full()) {
150 sImageLoaded.write(
false);
154 printf(
"DEBUG in storeWordToAxiStream: WARNING - you've reached the max depth of img. Will put *processed_bytes_rx = 0.\n");
155 *processed_bytes_rx = 0;
156 if (!sImageLoaded.full()) {
157 sImageLoaded.write(
true);
179 stream<NetworkWord> &siSHL_This_Data,
180 stream<NetworkMetaStream> &siNrc_meta,
181 stream<NetworkMetaStream> &sRxtoTx_Meta,
183 stream<DmCmd> &soMemWrCmdP0,
184 stream<DmSts> &siMemWrStsP0,
188 unsigned int *processed_bytes_rx,
189 stream<bool> &sImageLoaded
193 #pragma HLS INLINE off
194 #pragma HLS pipeline II=1
195 #pragma HLS interface ap_ctrl_none port=return
200 static ap_uint<MEMDW_512> v = 0;
203 static unsigned int cur_transfers_per_chunk;
204 static unsigned int cnt_wr_stream, cnt_wr_img_loaded;
205 static stream<ap_uint<MEMDW_512>> img_in_axi_stream (
"img_in_axi_stream");
207 #pragma HLS stream variable=img_in_axi_stream depth=img_in_axi_stream_depth
208 static unsigned int ddr_addr_in;
215 static DmSts memWrStsP0;
217 #pragma HLS reset variable=cur_transfers_per_chunk
218 #pragma HLS reset variable=cnt_wr_stream
219 #pragma HLS reset variable=cnt_wr_img_loaded
220 #pragma HLS reset variable=ddr_addr_in
221 #pragma HLS reset variable=patternWriteNum
222 #pragma HLS reset variable=timeoutCnt
223 #pragma HLS reset variable=memP0
224 #pragma HLS reset variable=memWrStsP0
229 printf(
"DEBUG in pRXPathDDR: enqueueFSM - WAIT_FOR_META, *processed_bytes_rx=%u\n",
230 *processed_bytes_rx);
238 if ( !siNrc_meta.empty() && !sRxtoTx_Meta.full() )
240 meta_tmp = siNrc_meta.read();
242 sRxtoTx_Meta.write(meta_tmp);
243 if ((*processed_bytes_rx) == 0) {
249 cur_transfers_per_chunk = 0;
267 printf(
"DEBUG in pRXPathDDR: enqueueFSM - PROCESSING_PACKET, *processed_bytes_rx=%u\n",
268 *processed_bytes_rx);
269 if ( !siSHL_This_Data.empty() )
272 netWord = siSHL_This_Data.read();
273 printf(
"DEBUG in pRXPathDDR: Data write = {D=0x%16.16llX, K=0x%2.2X, L=%d} \n",
274 netWord.
tdata.to_long(), netWord.
tkeep.to_int(), netWord.
tlast.to_int());
276 if ((netWord.
tkeep >> cnt_wr_stream) == 0) {
277 printf(
"WARNING: value with tkeep=0 at cnt_wr_stream=%u\n", cnt_wr_stream);
280 v(cnt_wr_stream*64, (cnt_wr_stream+1)*64-1) = netWord.
tdata(0,63);
281 if ((cnt_wr_stream++ == loop_cnt-1) || (netWord.
tlast == 1)) {
282 if ( !img_in_axi_stream.full() ) {
284 img_in_axi_stream.write(v);
293 printf(
"DEBUG in pRXPathDDR: enqueueFSM - FSM_CHK_PROC_BYTES, processed_bytes_rx=%u\n", *processed_bytes_rx);
294 if (*processed_bytes_rx <
IMGSIZE-bytes_per_loop) {
295 (*processed_bytes_rx) += bytes_per_loop;
298 printf(
"DEBUG in pRXPathDDR: WARNING - you've reached the max depth of img. Will put *processed_bytes_rx = 0.\n");
299 *processed_bytes_rx = 0;
305 printf(
"DEBUG in pRXPathDDR: enqueueFSM - FSM_WR_PAT_CMD\n");
306 if ( !soMemWrCmdP0.full() ) {
308 if (*processed_bytes_rx == 0){
323 printf(
"DEBUG in pRXPathDDR: enqueueFSM - FSM_WR_PAT_LOAD\n");
330 if(netWord.
tlast == 1) {
340 printf(
"DEBUG in pRXPathDDR: enqueueFSM - FSM_WR_PAT_DATA\n");
341 if (!soMemWriteP0.full()) {
343 if (!img_in_axi_stream.empty()) {
344 memP0.
tdata = img_in_axi_stream.read();
346 ap_uint<8> keepVal = 0xFF;
347 memP0.
tkeep = (ap_uint<64>) (keepVal, keepVal, keepVal, keepVal, keepVal, keepVal, keepVal, keepVal);
349 printf(
"DEBUG: (patternWriteNum == cur_transfers_per_chunk -1) \n");
351 cnt_wr_img_loaded = 0;
359 soMemWriteP0.write(memP0);
364 printf(
"DEBUG in pRXPathDDR: enqueueFSM - FSM_WR_PAT_STS_A\n");
365 if (!siMemWrStsP0.empty()) {
368 siMemWrStsP0.read(memWrStsP0);
384 printf(
"DEBUG in pRXPathDDR: enqueueFSM - FSM_WR_PAT_STS_B\n");
385 if ((memWrStsP0.
tag == 0x0) && (memWrStsP0.
okay == 1)) {
386 if ((*processed_bytes_rx) == 0) {
387 if (!sImageLoaded.full()) {
388 if (cnt_wr_img_loaded++ >= 1) {
389 sImageLoaded.write(
false);
393 sImageLoaded.write(
true);
407 printf(
"DEBUG in pRXPathDDR: enqueueFSM - FSM_WR_PAT_STS_C\n");
408 if(netWord.
tlast == 1) {
433 stream<NetworkWord> &siSHL_This_Data,
434 stream<NetworkMetaStream> &siNrc_meta,
435 stream<NetworkMetaStream> &sRxtoTx_Meta,
436 stream<ap_uint<MEMDW_512>> &img_in_axi_stream,
437 stream<bool> &sMemBurstRx
441 #pragma HLS INLINE off
442 #pragma HLS pipeline II=1
449 static ap_uint<MEMDW_512> v = 0;
450 static unsigned int cnt_wr_stream = 0, cnt_wr_burst = 0;
451 static unsigned int processed_net_bytes_rx = 0;
456 #pragma HLS reset variable=cnt_wr_stream
457 #pragma HLS reset variable=cnt_wr_burst
462 printf(
"DEBUG in pRXPathNetToStream: enqueueRxToStrFSM - WAIT_FOR_META\n");
464 if ( !siNrc_meta.empty() && !sRxtoTx_Meta.full() )
466 meta_tmp = siNrc_meta.read();
468 sRxtoTx_Meta.write(meta_tmp);
474 printf(
"DEBUG in pRXPathNetToStream: enqueueRxToStrFSM - PROCESSING_PACKET, processed_net_bytes_rx=%u\n", processed_net_bytes_rx);
475 if ( !siSHL_This_Data.empty() && !img_in_axi_stream.full())
478 netWord = siSHL_This_Data.read();
479 printf(
"DEBUG in pRXPathNetToStream: Data write = {D=0x%16.16llX, K=0x%2.2X, L=%d} \n",
480 netWord.
tdata.to_long(), netWord.
tkeep.to_int(), netWord.
tlast.to_int());
482 if ((netWord.
tkeep >> cnt_wr_stream) == 0) {
483 printf(
"WARNING: value with tkeep=0 at cnt_wr_stream=%u\n", cnt_wr_stream);
486 v(cnt_wr_stream*64, (cnt_wr_stream+1)*64-1) = netWord.
tdata(0,63);
487 if ((cnt_wr_stream++ == loop_cnt-1) || (netWord.
tlast == 1)) {
489 std::cout <<
"DEBUG in pRXPathNetToStream: Pushing to img_in_axi_stream :" << std::hex << v << std::endl;
490 img_in_axi_stream.write(v);
493 (netWord.
tlast == 1))) {
494 if (!sMemBurstRx.full()) {
495 sMemBurstRx.write(
true);
499 if (netWord.
tlast == 1) {
505 processed_net_bytes_rx = 0;
531 stream<ap_uint<MEMDW_512>> &img_in_axi_stream,
532 stream<bool> &sMemBurstRx,
534 stream<DmCmd> &soMemWrCmdP0,
535 stream<DmSts> &siMemWrStsP0,
538 stream<bool> &sImageLoaded
542 #pragma HLS INLINE off
543 #pragma HLS pipeline II=1
547 static ap_uint<MEMDW_512> v = 0;
550 static unsigned int cur_transfers_per_chunk;
551 static unsigned int cnt_wr_stream, cnt_wr_img_loaded;
555 static unsigned int ddr_addr_in;
562 static DmSts memWrStsP0;
563 static unsigned int processed_bytes_rx;
565 #pragma HLS reset variable=cur_transfers_per_chunk
566 #pragma HLS reset variable=cnt_wr_stream
567 #pragma HLS reset variable=cnt_wr_img_loaded
568 #pragma HLS reset variable=ddr_addr_in
569 #pragma HLS reset variable=patternWriteNum
570 #pragma HLS reset variable=timeoutCnt
571 #pragma HLS reset variable=memP0
572 #pragma HLS reset variable=memWrStsP0
577 printf(
"DEBUG in pRXPathStreamToDDR: enqueueStrToDdrFSM - WAIT_FOR_META, processed_bytes_rx=%u\n",
580 if ( !img_in_axi_stream.empty() )
582 if ((processed_bytes_rx) == 0) {
588 cur_transfers_per_chunk = 0;
603 printf(
"DEBUG in pRXPathStreamToDDR: enqueueStrToDdrFSM - FSM_CHK_PROC_BYTES, processed_bytes_rx=%u\n", processed_bytes_rx);
604 if (processed_bytes_rx <
IMGSIZE-bytes_per_loop) {
605 (processed_bytes_rx) += bytes_per_loop;
608 printf(
"DEBUG in pRXPathStreamToDDR: WARNING - you've reached the max depth of img. Will put processed_bytes_rx = 0.\n");
609 processed_bytes_rx = 0;
615 printf(
"DEBUG in pRXPathStreamToDDR: enqueueStrToDdrFSM - FSM_WR_PAT_CMD\n");
616 if ( !soMemWrCmdP0.full() ) {
618 if (processed_bytes_rx == 0){
633 printf(
"DEBUG in pRXPathStreamToDDR: enqueueStrToDdrFSM - FSM_WR_PAT_LOAD\n");
636 if (!sMemBurstRx.empty()) {
637 if (sMemBurstRx.read() ==
true) {
644 if((processed_bytes_rx) == 0) {
654 printf(
"DEBUG in pRXPathStreamToDDR: enqueueStrToDdrFSM - FSM_WR_PAT_DATA\n");
655 if (!soMemWriteP0.full()) {
657 if (!img_in_axi_stream.empty()) {
658 memP0.
tdata = img_in_axi_stream.read();
659 ap_uint<8> keepVal = 0xFF;
660 memP0.
tkeep = (ap_uint<64>) (keepVal, keepVal, keepVal, keepVal, keepVal, keepVal, keepVal, keepVal);
662 printf(
"DEBUG: (patternWriteNum == cur_transfers_per_chunk -1) \n");
664 cnt_wr_img_loaded = 0;
672 std::cout <<
"DEBUG in pRXPathStreamToDDR: Pushing to soMemWriteP0 :" << std::hex << memP0.
tdata << std::endl;
673 soMemWriteP0.write(memP0);
679 printf(
"DEBUG in pRXPathStreamToDDR: enqueueStrToDdrFSM - FSM_WR_PAT_STS_A\n");
680 if (!siMemWrStsP0.empty()) {
683 siMemWrStsP0.read(memWrStsP0);
699 printf(
"DEBUG in pRXPathStreamToDDR: enqueueStrToDdrFSM - FSM_WR_PAT_STS_B\n");
700 if ((memWrStsP0.
tag == 0x0) && (memWrStsP0.
okay == 1)) {
701 if ((processed_bytes_rx) == 0) {
702 if (!sImageLoaded.full()) {
703 if (cnt_wr_img_loaded++ >= 1) {
704 sImageLoaded.write(
false);
708 sImageLoaded.write(
true);
722 printf(
"DEBUG in pRXPathStreamToDDR: enqueueStrToDdrFSM - FSM_WR_PAT_STS_C\n");
723 if((processed_bytes_rx) == 0) {
752 stream<NetworkWord> &siSHL_This_Data,
753 stream<NetworkMetaStream> &siNrc_meta,
754 stream<NetworkMetaStream> &sRxtoTx_Meta,
755 #ifdef USE_HLSLIB_STREAM
756 Stream<Data_t_in, MIN_RX_LOOPS> &img_in_axi_stream,
759 stream<ap_uint<INPUT_PTR_WIDTH>> &img_in_axi_stream,
762 unsigned int *processed_word_rx,
763 unsigned int *processed_bytes_rx,
764 stream<bool> &sImageLoaded
768 #pragma HLS INLINE off
769 #pragma HLS pipeline II=1
777 printf(
"DEBUG in pRXPath: enqueueFSM - WAIT_FOR_META, *processed_word_rx=%u, *processed_bytes_rx=%u\n",
778 *processed_word_rx, *processed_bytes_rx);
779 if ( !siNrc_meta.empty() && !sRxtoTx_Meta.full() )
781 meta_tmp = siNrc_meta.read();
783 sRxtoTx_Meta.write(meta_tmp);
789 printf(
"DEBUG in pRXPath: enqueueFSM - PROCESSING_PACKET, *processed_word_rx=%u, *processed_bytes_rx=%u\n",
790 *processed_word_rx, *processed_bytes_rx);
791 if ( !siSHL_This_Data.empty() && !img_in_axi_stream.full())
794 netWord = siSHL_This_Data.read();
797 if(netWord.
tlast == 1)
819 stream<NetworkWord> &sRxpToTxp_Data,
825 #ifdef USE_HLSLIB_STREAM
826 Stream<Data_t_in, MIN_RX_LOOPS> &img_in_axi_stream,
827 Stream<Data_t_out, MIN_TX_LOOPS> &img_out_axi_stream,
829 stream<ap_uint<INPUT_PTR_WIDTH>> &img_in_axi_stream,
830 stream<ap_uint<OUTPUT_PTR_WIDTH>> &img_out_axi_stream,
835 stream<bool> &sImageLoaded
839 #pragma HLS INLINE off
840 #pragma HLS pipeline II=1
844 uint16_t Thresh = 442;
846 uint16_t k = K * (1 << 16);
847 static bool accel_called;
848 static unsigned int processed_word_proc;
849 static unsigned int timeoutCntAbs;
850 static unsigned int cnt_i;
852 ap_uint<OUTPUT_PTR_WIDTH> raw64;
857 static unsigned int ddr_addr_out;
858 #pragma HLS reset variable=ddr_addr_out
861 #pragma HLS reset variable=accel_called
862 #pragma HLS reset variable=processed_word_proc
863 #pragma HLS reset variable=timeoutCntAbs
864 #pragma HLS reset variable=cnt_i
865 #pragma HLS reset variable=tmp
866 #pragma HLS reset variable=raw64
867 #pragma HLS reset variable=temp
872 printf(
"DEBUG in pProcPath: WAIT_FOR_META\n");
873 if (!sImageLoaded.empty())
875 if (sImageLoaded.read() ==
true) {
877 accel_called =
false;
878 processed_word_proc = 0;
889 printf(
"DEBUG in pProcPath: PROCESSING_PACKET\n");
891 if ( !img_in_axi_stream.empty() && !img_out_axi_stream.full() )
894 if (accel_called ==
false) {
898 #ifdef FAKE_MedianBlur
914 printf(
"DEBUG in pProcPath: MEDIANBLUR_RETURN_RESULTS, ddr_addr_out=%u\n", ddr_addr_out);
915 if (accel_called ==
true) {
917 printf(
"DEBUG in pProcPath: Accumulated %u net words (%u B) to complete a single DDR word\n",
927 printf(
"DEBUG in pProcPath: MEDIANBLUR_RETURN_RESULTS_ABSORB_DDR_LAT [%u out of %u]\n", timeoutCntAbs,
DDR_LATENCY);
951 printf(
"DEBUG in pProcPath: MEDIANBLUR_RETURN_RESULTS_FWD\n");
966 newWord =
NetworkWord(temp.data, temp.keep, temp.last);
967 sRxpToTxp_Data.write(newWord);
978 printf(
"DEBUG in pProcPath: MEDIANBLUR_RETURN_RESULTS\n");
979 if ( !img_out_axi_stream.empty() && !sRxpToTxp_Data.full() )
982 temp.data = img_out_axi_stream.read();
983 if ( img_out_axi_stream.empty() )
988 accel_called =
false;
996 newWord =
NetworkWord(temp.data, temp.keep, temp.last);
997 sRxpToTxp_Data.write(newWord);
1021 stream<NetworkWord> &soTHIS_Shl_Data,
1022 stream<NetworkMetaStream> &soNrc_meta,
1023 stream<NetworkWord> &sRxpToTxp_Data,
1024 stream<NetworkMetaStream> &sRxtoTx_Meta,
1025 unsigned int *processed_word_tx,
1026 ap_uint<32> *pi_rank,
1027 ap_uint<32> *pi_size
1031 #pragma HLS INLINE off
1032 #pragma HLS pipeline II=1
1042 #pragma HLS reset variable=dst_rank
1043 #pragma HLS reset variable=netWordTx
1049 printf(
"DEBUG in pTXPath: dequeueFSM=%d - WAIT_FOR_META, *processed_word_tx=%u\n",
1053 *processed_word_tx = 0;
1062 if (( !sRxpToTxp_Data.empty() && !sRxtoTx_Meta.empty()
1063 && !soTHIS_Shl_Data.full() && !soNrc_meta.full() ))
1065 netWordTx = sRxpToTxp_Data.read();
1070 netWordTx.
tlast = 1;
1072 soTHIS_Shl_Data.write(netWordTx);
1074 meta_in = sRxtoTx_Meta.read().tdata;
1076 meta_out_stream.
tlast = 1;
1077 meta_out_stream.
tkeep = 0xFF;
1094 soNrc_meta.write(meta_out_stream);
1096 (*processed_word_tx)++;
1097 printf(
"DEBUGGGG: Checking netWordTx.tlast...\n");
1098 if(netWordTx.
tlast != 1)
1106 printf(
"DEBUG in pTXPath: dequeueFSM=%d - PROCESSING_PACKET, *processed_word_tx=%u\n",
1108 if( !sRxpToTxp_Data.empty() && !soTHIS_Shl_Data.full())
1111 netWordTx = sRxpToTxp_Data.read();
1113 (*processed_word_tx)++;
1116 if ((netWordTx.
tlast == 1) || (((*processed_word_tx)*8) %
PACK_SIZE == 0))
1118 netWordTx.
tlast = 1;
1119 printf(
"DEBUGGGG: A netWordTx.tlast=1 ... sRxpToTxp_Data.empty()==%u \n", sRxpToTxp_Data.empty());
1133 soTHIS_Shl_Data.write(netWordTx);
1148 ap_uint<32> *pi_rank,
1149 ap_uint<32> *pi_size,
1153 stream<NetworkWord> &siSHL_This_Data,
1154 stream<NetworkWord> &soTHIS_Shl_Data,
1155 stream<NetworkMetaStream> &siNrc_meta,
1156 stream<NetworkMetaStream> &soNrc_meta,
1157 ap_uint<32> *po_rx_ports
1169 stream<DmCmd> &soMemWrCmdP0,
1170 stream<DmSts> &siMemWrStsP0,
1187 #pragma HLS INTERFACE axis register both port=siSHL_This_Data
1188 #pragma HLS INTERFACE axis register both port=soTHIS_Shl_Data
1190 #pragma HLS INTERFACE axis register both port=siNrc_meta
1191 #pragma HLS INTERFACE axis register both port=soNrc_meta
1193 #pragma HLS INTERFACE ap_ovld register port=po_rx_ports name=poROL_NRC_Rx_ports
1195 #if HLS_VERSION < 20211
1196 #pragma HLS INTERFACE ap_stable register port=pi_rank name=piFMC_ROL_rank
1197 #pragma HLS INTERFACE ap_stable register port=pi_size name=piFMC_ROL_size
1198 #elif HLS_VERSION >= 20211
1199 #pragma HLS stable variable=pi_rank
1200 #pragma HLS stable variable=pi_size
1202 printf(
"ERROR: Invalid HLS_VERSION=%s\n", HLS_VERSION);
1217 #pragma HLS INTERFACE axis register both port=soMemWrCmdP0
1218 #pragma HLS INTERFACE axis register both port=siMemWrStsP0
1219 #pragma HLS INTERFACE axis register both port=soMemWriteP0
1221 #if HLS_VERSION <= 20201
1222 #pragma HLS DATA_PACK variable=soMemWrCmdP0 instance=soMemWrCmdP0
1223 #pragma HLS DATA_PACK variable=siMemWrStsP0 instance=siMemWrStsP0
1224 #elif HLS_VERSION >= 20211
1225 #pragma HLS aggregate variable=soMemWrCmdP0 compact=bit
1226 #pragma HLS aggregate variable=siMemWrStsP0 compact=bit
1228 printf(
"ERROR: Invalid HLS_VERSION=%s\n", HLS_VERSION);
1238 const unsigned int max_axi_rw_burst_length = 64;
1241 #pragma HLS INTERFACE m_axi depth=ddr_mem_depth port=lcl_mem0 bundle=moMEM_Mp1\
1242 max_read_burst_length=max_axi_rw_burst_length max_write_burst_length=max_axi_rw_burst_length offset=direct \
1243 num_read_outstanding=16 num_write_outstanding=16 latency=ddr_latency
1246 #pragma HLS INTERFACE m_axi depth=ddr_mem_depth port=lcl_mem1 bundle=moMEM_Mp1 \
1247 max_read_burst_length=max_axi_rw_burst_length max_write_burst_length=max_axi_rw_burst_length offset=direct \
1248 num_read_outstanding=16 num_write_outstanding=16 latency=ddr_latency
1252 #pragma HLS DATAFLOW
1256 static stream<NetworkWord> sRxpToTxp_Data(
"sRxpToTxP_Data");
1257 static stream<NetworkMetaStream> sRxtoTx_Meta(
"sRxtoTx_Meta");
1258 static unsigned int processed_word_rx;
1259 static unsigned int processed_bytes_rx;
1260 static unsigned int processed_word_tx = 0;
1261 static stream<bool> sImageLoaded(
"sImageLoaded");
1262 static bool skip_read;
1263 static bool write_chunk_to_ddr_pending;
1264 static bool ready_to_accept_new_data;
1265 static bool signal_init;
1268 static stream<ap_uint<MEMDW_512>> img_in_axi_stream (
"img_in_axi_stream");
1270 static stream<bool> sMemBurstRx(
"sMemBurstRx");
1275 #ifdef USE_HLSLIB_DATAFLOW
1276 static hlslib::Stream<Data_t_in, MIN_RX_LOOPS> img_in_axi_stream (
"img_in_axi_stream");
1277 static hlslib::Stream<Data_t_out, MIN_TX_LOOPS> img_out_axi_stream (
"img_out_axi_stream");
1279 static stream<ap_uint<INPUT_PTR_WIDTH>> img_in_axi_stream (
"img_in_axi_stream");
1280 static stream<ap_uint<OUTPUT_PTR_WIDTH>> img_out_axi_stream (
"img_out_axi_stream");
1286 #pragma HLS stream variable=sRxtoTx_Meta depth=tot_transfers
1287 #pragma HLS reset variable=enqueueFSM
1288 #pragma HLS reset variable=dequeueFSM
1289 #pragma HLS reset variable=MedianBlurFSM
1290 #pragma HLS reset variable=processed_word_rx
1291 #pragma HLS reset variable=processed_word_tx
1292 #pragma HLS reset variable=processed_bytes_rx
1294 #pragma HLS stream variable=sImageLoaded depth=1
1295 #pragma HLS reset variable=skip_read
1296 #pragma HLS reset variable=write_chunk_to_ddr_pending
1298 #pragma HLS reset variable=ready_to_accept_new_data
1299 #pragma HLS reset variable=signal_init
1302 #pragma HLS stream variable=img_in_axi_stream depth=img_in_axi_stream_depth
1303 #pragma HLS stream variable=sProcessed_bytes_rx depth=img_in_axi_stream_depth
1305 #pragma HLS stream variable=img_in_axi_stream depth=img_in_axi_stream_depth
1306 #pragma HLS stream variable=img_out_axi_stream depth=img_out_axi_stream_depth
1310 #ifdef USE_HLSLIB_DATAFLOW
1327 HLSLIB_DATAFLOW_INIT();
1329 HLSLIB_DATAFLOW_FUNCTION(
pRXPath,
1336 &processed_bytes_rx,
1353 HLSLIB_DATAFLOW_FUNCTION(
pTXPath,
1362 HLSLIB_DATAFLOW_FINALIZE();
1419 &processed_bytes_rx,
ap_uint< 32 > patternWriteNum
#define TRANSFERS_PER_CHUNK_DIVEND
#define TRANSFERS_PER_CHUNK
#define FSM_CHK_PROC_BYTES
#define BITS_PER_10GBITETHRNET_AXI_PACKET
#define BYTES_PER_10GBITETHRNET_AXI_PACKET
#define CYCLES_UNTIL_TIMEOUT
#define PROCESSING_PACKET