integration/builder/soc: Add get_build_name method (Useful now that builder is no longer called automatically without --build).

This commit is contained in:
Florent Kermarrec 2022-05-12 11:55:54 +02:00
parent e451a87617
commit aa8932dd4f
2 changed files with 4 additions and 1 deletions

View File

@ -369,7 +369,7 @@ class Builder:
"sram" : self.soc.platform.bitstream_ext, "sram" : self.soc.platform.bitstream_ext,
"flash" : ".bin" # FIXME. "flash" : ".bin" # FIXME.
}[mode] }[mode]
return os.path.join(self.gateware_dir, self.soc.build_name + ext) return os.path.join(self.gateware_dir, self.soc.get_build_name() + ext)
# Builder Arguments -------------------------------------------------------------------------------- # Builder Arguments --------------------------------------------------------------------------------

View File

@ -1197,6 +1197,9 @@ class SoC(Module):
self.logger.info(colorer("-"*80, color="bright")) self.logger.info(colorer("-"*80, color="bright"))
# SoC build ------------------------------------------------------------------------------------ # SoC build ------------------------------------------------------------------------------------
def get_build_name(self):
return getattr(self, "build_name", self.platform.name)
def build(self, *args, **kwargs): def build(self, *args, **kwargs):
self.build_name = kwargs.pop("build_name", self.platform.name) self.build_name = kwargs.pop("build_name", self.platform.name)
if self.build_name[0].isdigit(): if self.build_name[0].isdigit():