diff --git a/litex/build/generic_platform.py b/litex/build/generic_platform.py index 0e6a38bc5..772f77a1e 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 b6303a365..4b4eca604 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: