From a762d29b19e8f9ec38a8085fee56f43ce5eb0a40 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Fri, 1 Nov 2019 09:23:42 +0100 Subject: [PATCH] soc/integration/builder: pass output_dir to platform, make sure gateware/software directory are created before finalizing --- litex/build/generic_platform.py | 1 + litex/soc/integration/builder.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/litex/build/generic_platform.py b/litex/build/generic_platform.py index 0e6a38bc..772f77a1 100644 --- a/litex/build/generic_platform.py +++ b/litex/build/generic_platform.py @@ -268,6 +268,7 @@ class GenericPlatform: self.name = name self.sources = [] self.verilog_include_paths = [] + self.output_dir = None self.finalized = False def request(self, *args, **kwargs): diff --git a/litex/soc/integration/builder.py b/litex/soc/integration/builder.py index b6303a36..4b4eca60 100644 --- a/litex/soc/integration/builder.py +++ b/litex/soc/integration/builder.py @@ -160,9 +160,11 @@ class Builder: self.soc.initialize_rom(bios_data) def build(self, toolchain_path=None, **kwargs): - self.soc.finalize() + self.soc.platform.output_dir = self.output_dir + os.makedirs(os.path.join(self.output_dir, "gateware"), exist_ok=True) + os.makedirs(os.path.join(self.output_dir, "software"), exist_ok=True) - os.makedirs(self.output_dir, exist_ok=True) + self.soc.finalize() self._generate_includes() if self.soc.cpu_type is not None: -- 2.30.2