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

[PYNQ] better way of getting first/last nodes

parent ddf9b50f
No related branches found
No related tags found
No related merge requests found
......@@ -40,8 +40,8 @@ class MakePYNQDriver(Transformation):
i_tensor_dt = model.get_tensor_datatype(i_tensor_name)
o_tensor_dt = model.get_tensor_datatype(o_tensor_name)
# extract HLSCustomOp instances to get folded i/o shapes
first_node = getCustomOp(model.graph.node[0])
last_node = getCustomOp(model.graph.node[-1])
first_node = getCustomOp(model.find_consumer(i_tensor_name))
last_node = getCustomOp(model.find_producer(o_tensor_name))
i_tensor_shape_folded = first_node.get_folded_input_shape()
o_tensor_shape_folded = last_node.get_folded_output_shape()
# generate dummy folded i/o tensors and their packed versions
......
......@@ -52,8 +52,10 @@ class MakePYNQProject(Transformation):
ip_dirs_str = "[%s]" % (" ".join(ip_dirs))
# extract HLSCustomOp instances to get i/o stream widths
first_node = getCustomOp(model.graph.node[0])
last_node = getCustomOp(model.graph.node[-1])
i_tensor_name = model.graph.input[0].name
o_tensor_name = model.graph.output[0].name
first_node = getCustomOp(model.find_consumer(i_tensor_name))
last_node = getCustomOp(model.find_producer(o_tensor_name))
i_bits_per_cycle = first_node.get_instream_width()
o_bits_per_cycle = last_node.get_outstream_width()
# ensure i/o is padded to bytes
......
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