Make the csv directory if it doesn't exist.
authorTim 'mithro' Ansell <mithro@mithis.com>
Thu, 15 Dec 2016 15:33:08 +0000 (16:33 +0100)
committerTim 'mithro' Ansell <mithro@mithis.com>
Thu, 15 Dec 2016 16:19:51 +0000 (17:19 +0100)
litex/soc/integration/builder.py

index 06bdbb581e0f8716c1b01965f57b43c5371469c0..866a4fcdda306fdaad4ee811f5845e3ee5b942af 100644 (file)
@@ -95,6 +95,8 @@ class Builder:
         csr_regions = self.soc.get_csr_regions()
         constants = self.soc.get_constants()
 
+        csr_dir = os.path.dirname(self.csr_csv)
+        os.makedirs(csr_dir, exist_ok=True)
         with open(self.csr_csv, "w") as f:
             f.write(cpu_interface.get_csr_csv(csr_regions, constants, memory_regions))