From aa8932dd4f20499998108c5b7ce93cfa8d3ad6e2 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Thu, 12 May 2022 11:55:54 +0200 Subject: [PATCH] integration/builder/soc: Add get_build_name method (Useful now that builder is no longer called automatically without --build). --- litex/soc/integration/builder.py | 2 +- litex/soc/integration/soc.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) 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():