diff --git a/src/finn/transformation/fpgadataflow/prepare_ip.py b/src/finn/transformation/fpgadataflow/prepare_ip.py index 7d5da940010896cde3a49bd45a79c69ef455bc72..21f8e0052d5f2d60f11f33846b483d3f556d1188 100644 --- a/src/finn/transformation/fpgadataflow/prepare_ip.py +++ b/src/finn/transformation/fpgadataflow/prepare_ip.py @@ -31,6 +31,7 @@ import finn.custom_op.registry as registry from finn.transformation import Transformation from finn.util.basic import make_build_dir from finn.util.fpgadataflow import is_fpgadataflow_node +import warnings def _codegen_single_node(node, model, fpgapart, clk): @@ -49,8 +50,10 @@ def _codegen_single_node(node, model, fpgapart, clk): prefix="code_gen_ipgen_" + str(node.name) + "_" ) inst.set_nodeattr("code_gen_dir_ipgen", code_gen_dir) - # ensure that there is generated code inside the dir - inst.code_generation_ipgen(model, fpgapart, clk) + # ensure that there is generated code inside the dir + inst.code_generation_ipgen(model, fpgapart, clk) + else: + warnings.warn("Using pre-existing code for %s" % node.name) except KeyError: # exception if op_type is not supported raise Exception("Custom op_type %s is currently not supported." % op_type) @@ -66,6 +69,9 @@ class PrepareIP(Transformation): * clk in ns (int) + Any nodes that already have a code_gen_dir_ipgen attribute pointing to a valid path + will be skipped. + Outcome if succesful: Node attribute "code_gen_dir_ipgen" contains path to folder that contains generated C++ code that can be used to generate a Vivado IP block. The subsequent transformation is HLSSynthIP"""