Skip to content
Snippets Groups Projects
Commit 77fce38c authored by auphelia's avatar auphelia
Browse files

[CustomOp] Propagate changes in checksum layer to code generation

parent 0f6af639
No related branches found
No related tags found
No related merge requests found
......@@ -254,10 +254,12 @@ class CheckSum(HLSCustomOp):
'hls::stream<ap_uint<{}>> out ("out");'.format(self.get_outstream_width())
)
self.code_gen_dict["$STREAMDECLARATIONS$"].append("ap_uint<32> chk;")
# set drain = false for cppsim
self.code_gen_dict["$STREAMDECLARATIONS$"].append("ap_uint<1> drain = false;")
def docompute(self):
self.code_gen_dict["$DOCOMPUTE$"] = [
"""checksum<WORDS_PER_FRAME, ITEMS_PER_WORD>(in0, out, chk);"""
"""checksum<WORDS_PER_FRAME, ITEMS_PER_WORD>(in0, out, chk, drain);"""
]
def dataoutstrm(self):
......@@ -298,7 +300,7 @@ class CheckSum(HLSCustomOp):
def blackboxfunction(self):
self.code_gen_dict["$BLACKBOXFUNCTION$"] = [
"""using T = ap_uint<WORD_SIZE>;\n void {}(hls::stream<T> &in0,
hls::stream<T> &out, ap_uint<32> &chk)""".format(
hls::stream<T> &out, ap_uint<32> &chk, ap_uint<1> drain)""".format(
self.onnx_node.name
)
]
......@@ -317,6 +319,7 @@ class CheckSum(HLSCustomOp):
"#pragma HLS interface ap_ctrl_none port=return"
)
self.code_gen_dict["$PRAGMAS$"].append("#pragma HLS dataflow")
self.code_gen_dict["$PRAGMAS$"].append("#pragma HLS dataflow disable_start_propagation")
def get_verilog_top_module_intf_names(self):
intf_names = super().get_verilog_top_module_intf_names()
......
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