From 4fed1cc7a7872713f51b5cb4ebb06deb779ee3ce Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Thu, 3 Dec 2015 15:16:22 +0100 Subject: [PATCH] soc/integration/builder: move csr_csv generation outside of generate include we mostly use csr_csv for designs without CPU --- litex/soc/integration/builder.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/litex/soc/integration/builder.py b/litex/soc/integration/builder.py index 9b2117fc..08fae492 100644 --- a/litex/soc/integration/builder.py +++ b/litex/soc/integration/builder.py @@ -92,9 +92,13 @@ class Builder: with open(os.path.join(generated_dir, "sdram_phy.h"), "w") as f: f.write(sdram_init.get_sdram_phy_header(sdram_phy_settings)) - if self.csr_csv is not None: - with open(self.csr_csv, "w") as f: - f.write(cpu_interface.get_csr_csv(csr_regions, constants, memory_regions)) + def _generate_csr_csv(self): + memory_regions = self.soc.get_memory_regions() + csr_regions = self.soc.get_csr_regions() + constants = self.soc.get_constants() + + with open(self.csr_csv, "w") as f: + f.write(cpu_interface.get_csr_csv(csr_regions, constants, memory_regions)) def _prepare_software(self): for name, src_dir in self.software_packages: @@ -145,6 +149,9 @@ class Builder: self._generate_software() self._initialize_rom() + if self.csr_csv is not None: + self._generate_csr_csv() + if self.gateware_toolchain_path is not None: toolchain_path = self.gateware_toolchain_path self.soc.build(build_dir=os.path.join(self.output_dir, "gateware"), -- 2.30.2