soc/integration/builder: move csr_csv generation outside of generate include

we mostly use csr_csv for designs without CPU
This commit is contained in:
Florent Kermarrec 2015-12-03 15:16:22 +01:00
parent 90f03133ef
commit 4fed1cc7a7
1 changed files with 10 additions and 3 deletions

View File

@ -92,7 +92,11 @@ 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:
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))
@ -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"),