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

[Test] add AnnotateResources to e2e, give hls layer names earlier

parent c34b7289
No related branches found
No related tags found
No related merge requests found
......@@ -133,6 +133,7 @@ def test_end2end_cnv_w1a1_create_dataflow_partition():
def test_end2end_cnv_w1a1_fold_and_tlastmarker():
model = ModelWrapper(build_dir + "/end2end_cnv_w1a1_dataflow_model.onnx")
model = model.transform(GiveUniqueNodeNames())
fc_layers = model.get_nodes_by_op_type("StreamingFCLayer_Batch")
fc0w = getCustomOp(fc_layers[0])
fc1w = getCustomOp(fc_layers[1])
......@@ -169,7 +170,6 @@ def test_end2end_cnv_w1a1_fold_and_tlastmarker():
def test_end2end_cnv_w1a1_gen_hls_ip():
model = ModelWrapper(build_dir + "/end2end_cnv_w1a1_folded.onnx")
model = model.transform(GiveUniqueNodeNames())
model = model.transform(CodeGen_ipgen(test_fpga_part, target_clk_ns))
model = model.transform(HLSSynth_IPGen())
model.save(build_dir + "/end2end_cnv_w1a1_ipgen.onnx")
......
......@@ -70,6 +70,7 @@ from finn.transformation.streamline import Streamline
from finn.transformation.streamline.round_thresholds import RoundAndClipThresholds
from finn.util.basic import pynq_part_map
from finn.util.test import get_test_model_trained
from finn.transformation.fpgadataflow.annotate_resources import AnnotateResources
build_dir = "/tmp/" + os.environ["FINN_INST_NAME"]
test_pynq_board = os.getenv("PYNQ_BOARD", default="Pynq-Z1")
......@@ -126,6 +127,7 @@ def test_end2end_tfc_w1a1_create_dataflow_partition():
def test_end2end_tfc_w1a1_fold_and_tlastmarker():
model = ModelWrapper(build_dir + "/end2end_tfc_w1a1_dataflow_model.onnx")
model = model.transform(GiveUniqueNodeNames())
fc_layers = model.get_nodes_by_op_type("StreamingFCLayer_Batch")
fc0w = getCustomOp(fc_layers[0])
fc1w = getCustomOp(fc_layers[1])
......@@ -146,14 +148,15 @@ def test_end2end_tfc_w1a1_fold_and_tlastmarker():
fc3w.set_nodeattr("outFIFODepth", 50)
model = model.transform(InsertDWC())
model = model.transform(InsertTLastMarker())
model = model.transform(AnnotateResources("estimate"))
model.save(build_dir + "/end2end_tfc_w1a1_folded.onnx")
def test_end2end_tfc_w1a1_gen_hls_ip():
model = ModelWrapper(build_dir + "/end2end_tfc_w1a1_folded.onnx")
model = model.transform(GiveUniqueNodeNames())
model = model.transform(CodeGen_ipgen(test_fpga_part, target_clk_ns))
model = model.transform(HLSSynth_IPGen())
model = model.transform(AnnotateResources("hls"))
model.save(build_dir + "/end2end_tfc_w1a1_ipgen.onnx")
......
......@@ -118,6 +118,7 @@ def test_end2end_tfc_w1a2_create_dataflow_partition():
def test_end2end_tfc_w1a2_fold_and_tlastmarker():
model = ModelWrapper(build_dir + "/end2end_tfc_w1a2_dataflow_model.onnx")
model = model.transform(GiveUniqueNodeNames())
fc_layers = model.get_nodes_by_op_type("StreamingFCLayer_Batch")
fc0w = getCustomOp(fc_layers[0])
fc1w = getCustomOp(fc_layers[1])
......@@ -142,7 +143,6 @@ def test_end2end_tfc_w1a2_fold_and_tlastmarker():
def test_end2end_tfc_w1a2_gen_hls_ip():
model = ModelWrapper(build_dir + "/end2end_tfc_w1a2_folded.onnx")
model = model.transform(GiveUniqueNodeNames())
model = model.transform(CodeGen_ipgen(test_fpga_part, target_clk_ns))
model = model.transform(HLSSynth_IPGen())
model.save(build_dir + "/end2end_tfc_w1a2_ipgen.onnx")
......
......@@ -118,6 +118,7 @@ def test_end2end_tfc_w2a2_create_dataflow_partition():
def test_end2end_tfc_w2a2_fold_and_tlastmarker():
model = ModelWrapper(build_dir + "/end2end_tfc_w2a2_dataflow_model.onnx")
model = model.transform(GiveUniqueNodeNames())
fc_layers = model.get_nodes_by_op_type("StreamingFCLayer_Batch")
fc0w = getCustomOp(fc_layers[0])
fc1w = getCustomOp(fc_layers[1])
......@@ -142,7 +143,6 @@ def test_end2end_tfc_w2a2_fold_and_tlastmarker():
def test_end2end_tfc_w2a2_gen_hls_ip():
model = ModelWrapper(build_dir + "/end2end_tfc_w2a2_folded.onnx")
model = model.transform(GiveUniqueNodeNames())
model = model.transform(CodeGen_ipgen(test_fpga_part, target_clk_ns))
model = model.transform(HLSSynth_IPGen())
model.save(build_dir + "/end2end_tfc_w2a2_ipgen.onnx")
......
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