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

[Refactor] use is_fpgadataflow_node in CreateStitchedIP

parent c2030bdf
No related branches found
No related tags found
No related merge requests found
...@@ -32,9 +32,9 @@ import subprocess ...@@ -32,9 +32,9 @@ import subprocess
import json import json
from finn.transformation.base import Transformation from finn.transformation.base import Transformation
from finn.util.basic import get_by_name, make_build_dir, is_finn_op from finn.util.basic import make_build_dir, get_num_default_workers
from finn.util.fpgadataflow import is_fpgadataflow_node
from finn.custom_op.registry import getCustomOp from finn.custom_op.registry import getCustomOp
from finn.util.basic import get_num_default_workers
import multiprocessing as mp import multiprocessing as mp
from finn.transformation.fpgadataflow.replace_verilog_relpaths import ( from finn.transformation.fpgadataflow.replace_verilog_relpaths import (
ReplaceVerilogRelPaths, ReplaceVerilogRelPaths,
...@@ -223,14 +223,9 @@ class CreateStitchedIP(Transformation): ...@@ -223,14 +223,9 @@ class CreateStitchedIP(Transformation):
ip_dirs.append("/workspace/finn/finn-rtllib/memstream") ip_dirs.append("/workspace/finn/finn-rtllib/memstream")
# ensure that all nodes are fpgadataflow, and that IPs are generated # ensure that all nodes are fpgadataflow, and that IPs are generated
for node in model.graph.node: for node in model.graph.node:
assert is_finn_op(node.domain), "Found non-FINN node" assert is_fpgadataflow_node(
backend_attribute = get_by_name(node.attribute, "backend") node
assert backend_attribute is not None, "Backend node attribute is not set." ), "All nodes must be FINN fpgadataflow nodes."
backend_value = backend_attribute.s.decode("UTF-8")
assert (
backend_value == "fpgadataflow"
), """Backend node attribute is not
set to "fpgadataflow"."""
node_inst = getCustomOp(node) node_inst = getCustomOp(node)
ip_dir_value = node_inst.get_nodeattr("ip_path") ip_dir_value = node_inst.get_nodeattr("ip_path")
assert os.path.isdir(ip_dir_value), "IP generation directory doesn't exist." assert os.path.isdir(ip_dir_value), "IP generation directory doesn't exist."
......
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