diff --git a/tests/fpgadataflow/test_fpgadataflow_ip_stitch.py b/tests/fpgadataflow/test_fpgadataflow_ip_stitch.py index 0a8e3b0aaceeb7ccc55eead461f13b58736c9a99..32de9b382c0c95d7411a5e17ec78e6c4ea876673 100644 --- a/tests/fpgadataflow/test_fpgadataflow_ip_stitch.py +++ b/tests/fpgadataflow/test_fpgadataflow_ip_stitch.py @@ -1,4 +1,5 @@ -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")