38 #ifndef _ROLE_WARPTRANSFORM_H_
39 #define _ROLE_WARPTRANSFORM_H_
46 #include <hls_stream.h>
50 #include "memory_utils.hpp"
76 #define WARPTRANSFORM_COMMANDS_HIGH_BIT WARPTRANSFORM_COMMANDS_BITWIDTH-1
77 #define WARPTRANSFORM_COMMANDS_LOW_BIT 0
78 #define WARPTRANSFORM_COMMANDS_BITWIDTH 8
80 #define TRANSFORM_MATRIX_DIM 9
82 #define ROLE_IS_WARPTRANSFORM
84 #define WAIT_FOR_META 0
85 #define WAIT_FOR_STREAM_PAIR 1
86 #define PROCESSING_PACKET 2
87 #define LOAD_IN_STREAM 3
88 #define WARPTRANSFORM_RETURN_RESULTS 4
89 #define WARPTRANSFORM_RETURN_RESULTS_ABSORB_DDR_LAT 5
90 #define WARPTRANSFORM_RETURN_RESULTS_UNPACK 6
91 #define WARPTRANSFORM_RETURN_RESULTS_FWD 7
94 #define FSM_CHK_SKIP 10
95 #define FSM_CHK_PROC_BYTES 11
96 #define FSM_CHK_WRT_CHNK_TO_DDR_PND 12
97 #define FSM_WR_PAT_CMD 13
98 #define FSM_WR_PAT_LOAD 14
99 #define FSM_WR_PAT_DATA 15
100 #define FSM_WR_PAT_STS_A 16
101 #define FSM_WR_PAT_STS_B 17
102 #define FSM_WR_PAT_STS_C 18
103 #define PROCESSING_PACKET_TXMAT 19
104 #define PROCESSING_PACKET_IMGMAT 20
105 #define WAIT_FOR_META_IMGMAT 21
106 #define PUSH_REMAINING_META 22
108 #define PacketFsmType uint8_t
111 #define DEFAULT_TX_PORT 2718
112 #define DEFAULT_RX_PORT 2718
116 #define PORTS_OPENED 0x1F
118 #define Data_t_in ap_axiu<INPUT_PTR_WIDTH, 0, 0, 0>
119 #define Data_t_out ap_axiu<OUTPUT_PTR_WIDTH, 0, 0, 0>
122 #define MAX_NB_OF_ELMT_READ 16
125 #define MAX_NB_OF_WORDS_READ (MAX_NB_OF_ELMT_READ*sizeof(mat_elmt_t)/BPERDW)
126 #define MAX_NB_OF_ELMT_PERDW (BPERDW/sizeof(mat_elmt_t))
133 #define MEMDW_512 512
134 #define BPERMDW_512 (MEMDW_512/8)
135 #define KWPERMDW_512 (BPERMDW_512/sizeof(TYPE))
138 #define TOTMEMDW_512 (1 + (IMGSIZE - 1) / BPERMDW_512)
145 #define CHECK_CHUNK_SIZE 0x1000
146 #define BYTE_PER_MEM_WORD BPERMDW_512
147 #define TRANSFERS_PER_CHUNK (CHECK_CHUNK_SIZE/BYTE_PER_MEM_WORD)
148 #define TRANSFERS_PER_CHUNK_DIVEND (TOTMEMDW_512-(TOTMEMDW_512/TRANSFERS_PER_CHUNK)*TRANSFERS_PER_CHUNK)
151 #define fsmStateDDRdef uint8_t
154 #define CYCLES_UNTIL_TIMEOUT 0x0100
155 #define TYPICAL_DDR_LATENCY 4
158 #define DDR_LATENCY (52/4)
159 #define EXTRA_DDR_LATENCY_DUE_II (64 + 8)
168 ap_uint<(D+7)/8> tkeep;
171 Axis(ap_uint<D> single_data) : tdata((ap_uint<D>)single_data), tkeep(1), tlast(1) {}
176 ap_uint<32> *pi_rank,
177 ap_uint<32> *pi_size,
181 stream<NetworkWord> &siSHL_This_Data,
182 stream<NetworkWord> &soTHIS_Shl_Data,
183 stream<NetworkMetaStream> &siNrc_meta,
184 stream<NetworkMetaStream> &soNrc_meta,
185 ap_uint<32> *po_rx_ports
197 stream<DmCmd> &soMemWrCmdP0,
198 stream<DmSts> &siMemWrStsP0,
ap_uint< 512 > membus_512_t
Axis(ap_uint< D > single_data)