Skip to content
Snippets Groups Projects
Commit 17e3fba2 authored by auphelia's avatar auphelia
Browse files

[Test] Extended ipstitch test to test functionality of deployment trafo

parent 5979b112
No related branches found
No related tags found
No related merge requests found
import os.path
# import os.path
import os
import pytest
......@@ -10,6 +11,7 @@ from finn.core.modelwrapper import ModelWrapper
from finn.transformation.fpgadataflow.codegen_ipgen import CodeGen_ipgen
from finn.transformation.fpgadataflow.codegen_ipstitch import CodeGen_ipstitch
from finn.transformation.fpgadataflow.hlssynth_ipgen import HLSSynth_IPGen
from finn.transformation.fpgadataflow.make_deployment import DeployToPYNQ
from finn.transformation.fpgadataflow.make_pynq_driver import MakePYNQDriver
from finn.transformation.fpgadataflow.make_pynq_proj import MakePYNQProject
from finn.transformation.fpgadataflow.synth_pynq_proj import SynthPYNQProject
......@@ -22,8 +24,8 @@ from finn.util.basic import (
# TODO control board/part for tests from a global place
# settings for Ultra96
#test_fpga_part = "xczu3eg-sbva484-1-e"
#test_pynq_board = "Ultra96"
# test_fpga_part = "xczu3eg-sbva484-1-e"
# test_pynq_board = "Ultra96"
# settings for PYNQ-Z1
test_fpga_part = "xc7z020clg400-1"
......@@ -260,3 +262,30 @@ def test_fpgadataflow_ipstitch_pynq_driver():
assert driver_dir is not None
assert os.path.isdir(driver_dir)
model.save(ip_stitch_model_dir + "/test_fpgadataflow_ipstitch_pynq_driver.onnx")
@pytest.mark.dependency(depends=["test_fpgadataflow_ipstitch_pynq_driver"])
def test_fpgadataflow_ipstitch_pynq_deployment_folder():
model = ModelWrapper(
ip_stitch_model_dir + "/test_fpgadataflow_ipstitch_pynq_driver.onnx"
)
ip = "172.21.165.113"
username = "xilinx"
password = "xilinx"
target_dir = "/home/xilinx/" + os.environ["FINN_INST_NAME"]
model = model.transform(DeployToPYNQ(ip, username, password, target_dir))
pynq_ip = model.get_metadata_prop("pynq_ip")
pynq_username = model.get_metadata_prop("pynq_username")
pynq_password = model.get_metadata_prop("pynq_password")
pynq_target_dir = model.get_metadata_prop("pynq_target_dir")
assert pynq_ip == ip
assert pynq_username == username
assert pynq_password == password
assert pynq_target_dir == target_dir
deployment_dir = model.get_metadata_prop("pynq_deploy_dir")
assert deployment_dir is not None
assert os.path.isdir(deployment_dir)
model.save(ip_stitch_model_dir + "/test_fpgadataflow_ipstitch_pynq_deployment.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