From: Florent Kermarrec Date: Fri, 1 Nov 2019 08:23:42 +0000 (+0100) Subject: soc/integration/builder: pass output_dir to platform, make sure gateware/software... X-Git-Tag: 24jan2021_ls180~886 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a762d29b19e8f9ec38a8085fee56f43ce5eb0a40;p=litex.git soc/integration/builder: pass output_dir to platform, make sure gateware/software directory are created before finalizing --- 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: