From ad4b6b8ce4dd60d2aab080c2fe3902b1f130f077 Mon Sep 17 00:00:00 2001
From: Yaman Umuroglu <maltanar@gmail.com>
Date: Thu, 9 Apr 2020 00:46:19 +0100
Subject: [PATCH] [PYNQ] switch to PYNQ shell branch with xml rpt gen

---
 run-docker.sh                                          | 2 +-
 src/finn/transformation/fpgadataflow/make_pynq_proj.py | 4 ++++
 src/finn/transformation/fpgadataflow/templates.py      | 3 +++
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/run-docker.sh b/run-docker.sh
index e01073308..f5c9f64b7 100755
--- a/run-docker.sh
+++ b/run-docker.sh
@@ -89,7 +89,7 @@ git clone $EXAMPLES_REPO $EXAMPLES_LOCAL ||  git -C "$EXAMPLES_LOCAL" checkout f
 git clone $CNPY_REPO $CNPY_LOCAL ||  git -C "$CNPY_LOCAL" pull
 git clone $FINN_HLS_REPO $FINN_HLS_LOCAL ||  git -C "$FINN_HLS_LOCAL" checkout master; git -C "$FINN_HLS_LOCAL" pull
 git clone $PYVERILATOR_REPO $PYVERILATOR_LOCAL ||  git -C "$PYVERILATOR_LOCAL" pull
-git clone $PYNQSHELL_REPO $PYNQSHELL_LOCAL ||  git -C "$PYNQSHELL_LOCAL" pull
+git clone $PYNQSHELL_REPO $PYNQSHELL_LOCAL ||  git -C "$PYNQSHELL_LOCAL" checkout feature/synth_rpt; git -C "$PYNQSHELL_LOCAL" pull
 
 # ensure build dir exists locally
 mkdir -p $BUILD_LOCAL
diff --git a/src/finn/transformation/fpgadataflow/make_pynq_proj.py b/src/finn/transformation/fpgadataflow/make_pynq_proj.py
index c2c380263..2fb56a917 100644
--- a/src/finn/transformation/fpgadataflow/make_pynq_proj.py
+++ b/src/finn/transformation/fpgadataflow/make_pynq_proj.py
@@ -113,11 +113,15 @@ class MakePYNQProject(Transformation):
         # create a temporary folder for the project
         vivado_pynq_proj_dir = make_build_dir(prefix="vivado_pynq_proj_")
         model.set_metadata_prop("vivado_pynq_proj", vivado_pynq_proj_dir)
+        # filename for the synth utilization report
+        synth_report_filename = vivado_pynq_proj_dir + "/synth_report.xml"
+        model.set_metadata_prop("vivado_synth_rpt", vivado_pynq_proj_dir)
 
         ip_config_tcl = templates.ip_config_tcl_template % (
             vivado_pynq_proj_dir,
             ip_dirs_str,
             vivado_pynq_proj_dir,
+            synth_report_filename,
             vivado_stitch_vlnv,
             in_bytes,
             out_bytes,
diff --git a/src/finn/transformation/fpgadataflow/templates.py b/src/finn/transformation/fpgadataflow/templates.py
index edbf28c4e..81cb954bb 100644
--- a/src/finn/transformation/fpgadataflow/templates.py
+++ b/src/finn/transformation/fpgadataflow/templates.py
@@ -38,6 +38,7 @@ variable config_ip_use_axilite
 variable config_ip_project_dir
 variable config_output_products_dir
 variable config_remote_cache
+variable config_util_report_filename
 
 # for arguments involving paths below: use absolute paths or relative to the
 # platform/overlay/bitstream folder
@@ -47,6 +48,8 @@ set config_ip_project_dir %s
 set config_ip_repo %s
 # where the produced bitfile and .hwh file will be placed
 set config_output_products_dir %s
+# where the synth util XML report will be written
+set config_util_report_filename %s
 
 # non-path arguments
 # VLNV of the IP block
-- 
GitLab