38 #ifndef _ROLE_MEDIANBLUR_H_
39 #define _ROLE_MEDIANBLUR_H_
46 #include <hls_stream.h>
50 #include "memory_utils.hpp"
66 #define ROLE_IS_MEDIANBLUR
68 #define WAIT_FOR_META 0
69 #define PROCESSING_PACKET 1
70 #define LOAD_IN_STREAM 2
71 #define MEDIANBLUR_RETURN_RESULTS 3
72 #define MEDIANBLUR_RETURN_RESULTS_ABSORB_DDR_LAT 4
73 #define MEDIANBLUR_RETURN_RESULTS_UNPACK 5
74 #define MEDIANBLUR_RETURN_RESULTS_FWD 6
77 #define FSM_CHK_SKIP 9
78 #define FSM_CHK_PROC_BYTES 10
79 #define FSM_CHK_WRT_CHNK_TO_DDR_PND 11
80 #define FSM_WR_PAT_CMD 12
81 #define FSM_WR_PAT_LOAD 13
82 #define FSM_WR_PAT_DATA 14
83 #define FSM_WR_PAT_STS_A 15
84 #define FSM_WR_PAT_STS_B 16
85 #define FSM_WR_PAT_STS_C 17
86 #define PacketFsmType uint8_t
89 #define FSM_WRITE_NEW_DATA 0
91 #define PortFsmType uint8_t
93 #define DEFAULT_TX_PORT 2718
94 #define DEFAULT_RX_PORT 2718
99 #define PORTS_OPENED 0x1F
101 #define Data_t_in ap_axiu<INPUT_PTR_WIDTH, 0, 0, 0>
102 #define Data_t_out ap_axiu<OUTPUT_PTR_WIDTH, 0, 0, 0>
105 #define MAX_NB_OF_ELMT_READ 16
108 #define MAX_NB_OF_WORDS_READ (MAX_NB_OF_ELMT_READ*sizeof(mat_elmt_t)/BPERDW)
109 #define MAX_NB_OF_ELMT_PERDW (BPERDW/sizeof(mat_elmt_t))
116 #define MEMDW_512 512
117 #define BPERMDW_512 (MEMDW_512/8)
118 #define KWPERMDW_512 (BPERMDW_512/sizeof(TYPE))
121 #define TOTMEMDW_512 (1 + (IMGSIZE - 1) / BPERMDW_512)
128 #define CHECK_CHUNK_SIZE 0x1000
129 #define BYTE_PER_MEM_WORD BPERMDW_512
130 #define TRANSFERS_PER_CHUNK (CHECK_CHUNK_SIZE/BYTE_PER_MEM_WORD)
131 #define TRANSFERS_PER_CHUNK_DIVEND (TOTMEMDW_512-(TOTMEMDW_512/TRANSFERS_PER_CHUNK)*TRANSFERS_PER_CHUNK)
141 #define fsmStateDDRdef uint8_t
144 #define CYCLES_UNTIL_TIMEOUT 0x0100
145 #define TYPICAL_DDR_LATENCY 4
148 #define DDR_LATENCY (52/4)
149 #define EXTRA_DDR_LATENCY_DUE_II (64 + 8)
156 ap_uint<(D+7)/8> tkeep;
159 Axis(ap_uint<D> single_data) : tdata((ap_uint<D>)single_data), tkeep(1), tlast(1) {}
164 ap_uint<32> *pi_rank,
165 ap_uint<32> *pi_size,
169 stream<NetworkWord> &siSHL_This_Data,
170 stream<NetworkWord> &soTHIS_Shl_Data,
171 stream<NetworkMetaStream> &siNrc_meta,
172 stream<NetworkMetaStream> &soNrc_meta,
173 ap_uint<32> *po_rx_ports
185 stream<DmCmd> &soMemWrCmdP0,
186 stream<DmSts> &siMemWrStsP0,
ap_uint< 512 > membus_512_t
Axis(ap_uint< D > single_data)