Skip to content
Snippets Groups Projects
Unverified Commit fe9cd7db authored by auphelia's avatar auphelia Committed by GitHub
Browse files

Merge pull request #670 from Xilinx/feature/lookup_bounds_irq

WIP: IRQ Signalling for Input Bounds Violation (to be externalized)
parents 162d0f26 e73a0719
No related branches found
No related tags found
No related merge requests found
...@@ -259,8 +259,8 @@ class Lookup(HLSCustomOp): ...@@ -259,8 +259,8 @@ class Lookup(HLSCustomOp):
] ]
elif mem_mode == "external": elif mem_mode == "external":
self.code_gen_dict["$DOCOMPUTE$"] = [ self.code_gen_dict["$DOCOMPUTE$"] = [
"""StreamingLookup_ext<EmbeddingSize> """StreamingLookup_ext<EmbeddingSize>(in0, out, mem, size, oob_count);
(in0, out, mem, size, oob_count);""" oob_irq = oob_count != 0;"""
] ]
def blackboxfunction(self): def blackboxfunction(self):
...@@ -279,7 +279,8 @@ class Lookup(HLSCustomOp): ...@@ -279,7 +279,8 @@ class Lookup(HLSCustomOp):
"void " "void "
+ self.onnx_node.name + self.onnx_node.name
+ "(hls::stream<T_SRC> &in0, hls::stream<T_DST> &out, " + "(hls::stream<T_SRC> &in0, hls::stream<T_DST> &out, "
+ "T_DST const *const mem, unsigned const size, unsigned &oob_count)" + "T_DST const *const mem, unsigned const size, "
+ "unsigned &oob_count, bool &oob_irq)"
] ]
def pragmas(self): def pragmas(self):
...@@ -304,6 +305,7 @@ class Lookup(HLSCustomOp): ...@@ -304,6 +305,7 @@ class Lookup(HLSCustomOp):
my_pragmas.append( my_pragmas.append(
"#pragma HLS INTERFACE s_axilite port=oob_count bundle=control" "#pragma HLS INTERFACE s_axilite port=oob_count bundle=control"
) )
my_pragmas.append("#pragma HLS INTERFACE ap_none port=oob_irq")
else: else:
raise Exception("Unrecognized mem_mode: " + mem_mode) raise Exception("Unrecognized mem_mode: " + mem_mode)
self.code_gen_dict["$PRAGMAS$"] = my_pragmas self.code_gen_dict["$PRAGMAS$"] = my_pragmas
...@@ -474,4 +476,5 @@ class Lookup(HLSCustomOp): ...@@ -474,4 +476,5 @@ class Lookup(HLSCustomOp):
if mem_mode == "external": if mem_mode == "external":
intf_names["axilite"] = ["s_axi_control"] intf_names["axilite"] = ["s_axi_control"]
intf_names["aximm"] = [("m_axi_gmem", self.get_nodeattr("ext_mem_width"))] intf_names["aximm"] = [("m_axi_gmem", self.get_nodeattr("ext_mem_width"))]
intf_names["ap_none"] = ["oob_irq"]
return intf_names return intf_names
...@@ -228,6 +228,22 @@ class CreateStitchedIP(Transformation): ...@@ -228,6 +228,22 @@ class CreateStitchedIP(Transformation):
) )
self.s_axis_idx += 1 self.s_axis_idx += 1
def connect_ap_none_external(self, node):
inst_name = node.name
node_inst = getCustomOp(node)
input_intf_names = node_inst.get_verilog_top_module_intf_names()["ap_none"]
# make external
for i in range(len(input_intf_names)):
input_intf_name = input_intf_names[i]
self.connect_cmds.append(
"make_bd_pins_external [get_bd_pins %s/%s]"
% (inst_name, input_intf_name)
)
self.connect_cmds.append(
"set_property name %s [get_bd_ports %s_0]"
% (input_intf_name, input_intf_name)
)
def insert_signature(self, checksum_count): def insert_signature(self, checksum_count):
signature_vlnv = "AMD:user:axi_info_top:1.0" signature_vlnv = "AMD:user:axi_info_top:1.0"
signature_name = "axi_info_top0" signature_name = "axi_info_top0"
...@@ -305,6 +321,7 @@ class CreateStitchedIP(Transformation): ...@@ -305,6 +321,7 @@ class CreateStitchedIP(Transformation):
ip_dirs += [ip_dir_value] ip_dirs += [ip_dir_value]
self.create_cmds += node_inst.code_generation_ipi() self.create_cmds += node_inst.code_generation_ipi()
self.connect_clk_rst(node) self.connect_clk_rst(node)
self.connect_ap_none_external(node)
self.connect_axi(node) self.connect_axi(node)
for i in range(len(node.input)): for i in range(len(node.input)):
if not is_external_input(model, node, i): if not is_external_input(model, node, i):
......
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