38 #ifndef _ROLE_SOBEL_H_
39 #define _ROLE_SOBEL_H_
46 #include <hls_stream.h>
50 #include "memory_utils.hpp"
68 #define WAIT_FOR_META 0
69 #define WAIT_FOR_STREAM_PAIR 1
70 #define PROCESSING_PACKET 2
71 #define LOAD_IN_STREAM 3
72 #define SOBEL_RETURN_RESULTS 4
73 #define SOBEL_RETURN_RESULTS_ABSORB_DDR_LAT 5
74 #define SOBEL_RETURN_RESULTS_UNPACK 6
75 #define SOBEL_RETURN_RESULTS_FWD 7
78 #define FSM_CHK_SKIP 10
79 #define FSM_CHK_PROC_BYTES 11
80 #define FSM_CHK_WRT_CHNK_TO_DDR_PND 12
81 #define FSM_WR_PAT_CMD 13
82 #define FSM_WR_PAT_LOAD 14
83 #define FSM_WR_PAT_DATA 15
84 #define FSM_WR_PAT_STS_A 16
85 #define FSM_WR_PAT_STS_B 17
86 #define FSM_WR_PAT_STS_C 18
87 #define PacketFsmType uint8_t
90 #define DEFAULT_TX_PORT 2718
91 #define DEFAULT_RX_PORT 2718
93 #define Data_t_in ap_axiu<INPUT_PTR_WIDTH, 0, 0, 0>
94 #define Data_t_out ap_axiu<OUTPUT_PTR_WIDTH, 0, 0, 0>
97 #define MAX_NB_OF_ELMT_READ 16
100 #define MAX_NB_OF_WORDS_READ (MAX_NB_OF_ELMT_READ*sizeof(mat_elmt_t)/BPERDW)
101 #define MAX_NB_OF_ELMT_PERDW (BPERDW/sizeof(mat_elmt_t))
108 #define MEMDW_512 512
109 #define BPERMDW_512 (MEMDW_512/8)
110 #define KWPERMDW_512 (BPERMDW_512/sizeof(TYPE))
113 #define TOTMEMDW_512 (1 + (IMGSIZE - 1) / BPERMDW_512)
120 #define CHECK_CHUNK_SIZE 0x1000
121 #define BYTE_PER_MEM_WORD BPERMDW_512
122 #define TRANSFERS_PER_CHUNK (CHECK_CHUNK_SIZE/BYTE_PER_MEM_WORD)
123 #define TRANSFERS_PER_CHUNK_DIVEND (TOTMEMDW_512-(TOTMEMDW_512/TRANSFERS_PER_CHUNK)*TRANSFERS_PER_CHUNK)
126 #define fsmStateDDRdef uint8_t
129 #define CYCLES_UNTIL_TIMEOUT 0x0100
130 #define TYPICAL_DDR_LATENCY 4
133 #define DDR_LATENCY (52/4)
134 #define EXTRA_DDR_LATENCY_DUE_II (64 + 8)
143 ap_uint<(D+7)/8> tkeep;
146 Axis(ap_uint<D> single_data) : tdata((ap_uint<D>)single_data), tkeep(1), tlast(1) {}
151 ap_uint<32> *pi_rank,
152 ap_uint<32> *pi_size,
156 stream<NetworkWord> &siSHL_This_Data,
157 stream<NetworkWord> &soTHIS_Shl_Data,
158 stream<NetworkMetaStream> &siNrc_meta,
159 stream<NetworkMetaStream> &soNrc_meta,
160 ap_uint<32> *po_rx_ports
172 stream<DmCmd> &soMemWrCmdP0,
173 stream<DmSts> &siMemWrStsP0,
ap_uint< 512 > membus_512_t
ap_uint< 512 > membus_512_t
void sobel(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, stream< DmCmd > &soMemWrCmdP0, stream< DmSts > &siMemWrStsP0, stream< Axis< 512 > > &soMemWriteP0, membus_t *lcl_mem0, membus_t *lcl_mem1)
Main process of the Sobel Application directives.
Axis(ap_uint< D > single_data)