From 7c7a114ac59ae607e2301a80577147bdbd7da617 Mon Sep 17 00:00:00 2001
From: Yaman Umuroglu <maltanar@gmail.com>
Date: Tue, 21 Jan 2020 22:54:33 +0000
Subject: [PATCH] [Transform] remove IP stitching proj during cleanup

---
 src/finn/transformation/fpgadataflow/cleanup.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/finn/transformation/fpgadataflow/cleanup.py b/src/finn/transformation/fpgadataflow/cleanup.py
index 941b845df..0f62e568b 100644
--- a/src/finn/transformation/fpgadataflow/cleanup.py
+++ b/src/finn/transformation/fpgadataflow/cleanup.py
@@ -13,6 +13,11 @@ class CleanUp(Transformation):
         super().__init__()
 
     def apply(self, model):
+        # delete IP stitching project, if any
+        ipstitch_path = model.get_metadata_prop("vivado_proj")
+        if ipstitch_path is not None and os.path.isdir(ipstitch_path):
+            shutil.rmtree(ipstitch_path)
+            model.set_metadata_prop("vivado_proj", "")
         for node in model.graph.node:
             op_type = node.op_type
             if node.domain == "finn":
-- 
GitLab