Skip to content
Snippets Groups Projects
Commit d20837db authored by Thomas B. Preußer's avatar Thomas B. Preußer
Browse files

Generic top-level macro customizable through command-line defines.

parent 232464c7
No related branches found
No related tags found
No related merge requests found
......@@ -33,19 +33,4 @@
*
*******************************************************************************/
#include "checksum.hpp"
using T = ap_uint<32>;
void checksum_top(
hls::stream<T> &src,
hls::stream<T> &dst,
ap_uint<32> &chk
) {
#pragma HLS interface port=src axis
#pragma HLS interface port=dst axis
#pragma HLS interface port=chk ap_ovld
#pragma HLS interface port=return ap_ctrl_none
#pragma HLS dataflow
checksum<60, 4>(src, dst, chk);
}
CHECKSUM_TOP(WORDS_PER_FRAME, WORD_SIZE, ITEMS_PER_WORD)
......@@ -112,3 +112,20 @@ void checksum(
#pragma HLS reset variable=cnt
chk = (cnt++, s);
}
#define CHECKSUM_TOP_(WORDS_PER_FRAME, WORD_SIZE, ITEMS_PER_WORD) \
using T = ap_uint<WORD_SIZE>; \
void checksum_ ## WORDS_PER_FRAME ## _ ## WORD_SIZE ## _ ## ITEMS_PER_WORD ( \
hls::stream<T> &src, \
hls::stream<T> &dst, \
ap_uint<32> &chk \
) { \
_Pragma("HLS interface port=src axis") \
_Pragma("HLS interface port=dst axis") \
_Pragma("HLS interface port=chk s_axilite") \
_Pragma("HLS interface port=return ap_ctrl_none") \
_Pragma("HLS dataflow") \
checksum<WORDS_PER_FRAME, ITEMS_PER_WORD>(src, dst, chk); \
}
#define CHECKSUM_TOP(WORDS_PER_FRAME, WORD_SIZE, ITEMS_PER_WORD) \
CHECKSUM_TOP_(WORDS_PER_FRAME, WORD_SIZE, ITEMS_PER_WORD)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment