Skip to content
Snippets Groups Projects
Commit 5de37a43 authored by Tobi-Alonso's avatar Tobi-Alonso
Browse files

[FPGADataFlow] Clean code

parent 57f42b20
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
import os import os
import finn.custom_op.registry as registry import finn.custom_op.registry as registry
from finn.transformation import Transformation
from finn.util.basic import make_build_dir from finn.util.basic import make_build_dir
from finn.util.fpgadataflow import is_fpgadataflow_node from finn.util.fpgadataflow import is_fpgadataflow_node
from finn.transformation import Transformation from finn.transformation import Transformation
...@@ -37,12 +36,13 @@ from finn.util.basic import get_num_default_workers ...@@ -37,12 +36,13 @@ from finn.util.basic import get_num_default_workers
import multiprocessing as mp import multiprocessing as mp
import copy import copy
def _codegen_single_node(node, model): def _codegen_single_node(node, model):
"""Calls C++ code generation for one node. Resulting code can be used """Calls C++ code generation for one node. Resulting code can be used
to simulate node using cppsim.""" to simulate node using cppsim."""
op_type = node.op_type op_type = node.op_type
try: try:
# lookup op_type in registry of CustomOps # lookup op_type in registry of CustomOps
inst = registry.custom_op[op_type](node) inst = registry.custom_op[op_type](node)
# get the path of the code generation directory # get the path of the code generation directory
...@@ -85,7 +85,6 @@ class PrepareCppSim(Transformation): ...@@ -85,7 +85,6 @@ class PrepareCppSim(Transformation):
_codegen_single_node(node, self.model) _codegen_single_node(node, self.model)
return (node, False) return (node, False)
def apply(self, model): def apply(self, model):
# Remove old nodes from the current model # Remove old nodes from the current model
self.model = copy.deepcopy(model) self.model = copy.deepcopy(model)
...@@ -106,4 +105,4 @@ class PrepareCppSim(Transformation): ...@@ -106,4 +105,4 @@ class PrepareCppSim(Transformation):
if run is True: if run is True:
run_again = True run_again = True
return (model, run_again) return (model, run_again)
\ No newline at end of file
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