diff --git a/litex/soc/integration/builder.py b/litex/soc/integration/builder.py index 8e3b771fb..829ee14ee 100644 --- a/litex/soc/integration/builder.py +++ b/litex/soc/integration/builder.py @@ -369,7 +369,7 @@ class Builder: "sram" : self.soc.platform.bitstream_ext, "flash" : ".bin" # FIXME. }[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 -------------------------------------------------------------------------------- diff --git a/litex/soc/integration/soc.py b/litex/soc/integration/soc.py index 5132b6059..4deffca7b 100644 --- a/litex/soc/integration/soc.py +++ b/litex/soc/integration/soc.py @@ -1197,6 +1197,9 @@ class SoC(Module): self.logger.info(colorer("-"*80, color="bright")) # SoC build ------------------------------------------------------------------------------------ + def get_build_name(self): + return getattr(self, "build_name", self.platform.name) + def build(self, *args, **kwargs): self.build_name = kwargs.pop("build_name", self.platform.name) if self.build_name[0].isdigit():