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

Merge branch 'dev' into feature/alveo_deploy

parents 5abd3dde 98899203
No related branches found
No related tags found
No related merge requests found
......@@ -295,11 +295,12 @@ class ZynqBuild(Transformation):
# Build each kernel individually
sdp_nodes = model.get_nodes_by_op_type("StreamingDataflowPartition")
for sdp_node in sdp_nodes:
prefix = sdp_node.name + "_"
sdp_node = getCustomOp(sdp_node)
dataflow_model_filename = sdp_node.get_nodeattr("model")
kernel_model = ModelWrapper(dataflow_model_filename)
kernel_model = kernel_model.transform(InsertFIFO())
kernel_model = kernel_model.transform(GiveUniqueNodeNames())
kernel_model = kernel_model.transform(GiveUniqueNodeNames(prefix))
kernel_model.save(dataflow_model_filename)
kernel_model = kernel_model.transform(
PrepareIP(self.fpga_part, self.period_ns)
......
......@@ -81,14 +81,19 @@ class RemoveStaticGraphInputs(Transformation):
class GiveUniqueNodeNames(Transformation):
"""Give unique names to each node in the graph using enumeration."""
"""Give unique names to each node in the graph using enumeration, starting
with given prefix (if specified in the constructor)."""
def __init__(self, prefix=""):
super().__init__()
self.prefix = prefix
def apply(self, model):
optype_count = {}
for n in model.graph.node:
if n.op_type not in optype_count.keys():
optype_count[n.op_type] = 0
n.name = "%s_%d" % (n.op_type, optype_count[n.op_type])
n.name = "%s%s_%d" % (self.prefix, n.op_type, optype_count[n.op_type])
optype_count[n.op_type] += 1
# return model_was_changed = False as single iteration is always enough
return (model, False)
......
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