Skip to content
Snippets Groups Projects
Commit c251fbc5 authored by Yaman Umuroglu's avatar Yaman Umuroglu
Browse files

[Stitch] fix ext interface ordering for multi-I/O

parent 10390bfc
No related branches found
No related tags found
No related merge requests found
...@@ -223,8 +223,8 @@ class CreateStitchedIP(Transformation): ...@@ -223,8 +223,8 @@ class CreateStitchedIP(Transformation):
behavior. It is strongly recommended to insert FIFOs prior to behavior. It is strongly recommended to insert FIFOs prior to
calling CreateStitchedIP.""" calling CreateStitchedIP."""
) )
# ensure that all nodes are fpgadataflow, and that IPs are generated
for node in model.graph.node: for node in model.graph.node:
# ensure that all nodes are fpgadataflow, and that IPs are generated
assert is_fpgadataflow_node( assert is_fpgadataflow_node(
node node
), "All nodes must be FINN fpgadataflow nodes." ), "All nodes must be FINN fpgadataflow nodes."
...@@ -236,9 +236,7 @@ class CreateStitchedIP(Transformation): ...@@ -236,9 +236,7 @@ class CreateStitchedIP(Transformation):
self.connect_clk_rst(node) self.connect_clk_rst(node)
self.connect_axi(node) self.connect_axi(node)
for i in range(len(node.input)): for i in range(len(node.input)):
if is_external_input(model, node, i): if not is_external_input(model, node, i):
self.connect_s_axis_external(node, idx=i)
else:
producer = model.find_producer(node.input[i]) producer = model.find_producer(node.input[i])
if producer is None: if producer is None:
continue continue
...@@ -254,8 +252,25 @@ class CreateStitchedIP(Transformation): ...@@ -254,8 +252,25 @@ class CreateStitchedIP(Transformation):
"[get_bd_intf_pins %s/%s]" "[get_bd_intf_pins %s/%s]"
% (producer.name, src_intf_name, node.name, dst_intf_name) % (producer.name, src_intf_name, node.name, dst_intf_name)
) )
# process external inputs and outputs in top-level graph input order
for input in model.graph.input:
inp_name = input.name
inp_cons = model.find_consumers(inp_name)
assert inp_cons is not None, "No consumer for input " + inp_name
assert len(inp_cons) == 1, "Multiple consumers for input " + inp_name
node = inp_cons[0]
node_inst = getCustomOp(node)
for i in range(len(node.input)):
if node.input[i] == inp_name:
self.connect_s_axis_external(node, idx=i)
for output in model.graph.output:
out_name = output.name
node = model.find_producer(out_name)
assert node is not None, "No producer for output " + out_name
node_inst = getCustomOp(node)
for i in range(len(node.output)): for i in range(len(node.output)):
if is_external_output(model, node, i): if node.output[i] == out_name:
self.connect_m_axis_external(node, idx=i) self.connect_m_axis_external(node, idx=i)
# create a temporary folder for the project # create a temporary folder for the project
......
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