Skip to content
Snippets Groups Projects
Commit 28eecbba authored by auphelia's avatar auphelia
Browse files

[Transformations] Modified trafos to only transform fpgadataflow nodes

parent 9214eed2
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ import tempfile as tmp
import finn.custom_op.registry as registry
from finn.transformation import Transformation
from finn.core.utils import get_by_name
def code_gen_transformation(node, model):
......@@ -64,5 +65,9 @@ class CodeGen(Transformation):
def apply(self, model):
for node in model.graph.node:
code_gen_transformation(node, model)
if node.domain == "finn":
backend_attribute = get_by_name(node.attribute, "backend")
backend_value = backend_attribute.s.decode('UTF-8')
if backend_value == "fpgadataflow":
code_gen_transformation(node, model)
return (model, False)
......@@ -33,13 +33,17 @@ class Compilation(Transformation):
def apply(self, model):
for node in model.graph.node:
self.prepare_bash_command(node)
bash_command = self.compiler_call.compile_script
process_compile = subprocess.Popen(
bash_command.split(), stdout=subprocess.PIPE
)
process_compile.communicate()
model.set_attribute(node, "executable_path", self.compiler_call.executable_path)
if node.domain == "finn":
backend_attribute = util.get_by_name(node.attribute, "backend")
backend_value = backend_attribute.s.decode('UTF-8')
if backend_value == "fpgadataflow":
self.prepare_bash_command(node)
bash_command = self.compiler_call.compile_script
process_compile = subprocess.Popen(
bash_command.split(), stdout=subprocess.PIPE
)
process_compile.communicate()
model.set_attribute(node, "executable_path", self.compiler_call.executable_path)
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