From 148324862a5200ed0db0b55056d1a37a2b8e8b4a Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Thu, 17 Mar 2022 09:19:41 +0100 Subject: [PATCH] integration/builder: Add get_bios_filename/get_bitstream_filename methods to simplify targets/projects. --- litex/soc/integration/builder.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/litex/soc/integration/builder.py b/litex/soc/integration/builder.py index d6f04ced3..f394d5d96 100644 --- a/litex/soc/integration/builder.py +++ b/litex/soc/integration/builder.py @@ -359,6 +359,18 @@ class Builder: return vns + def get_bios_filename(self): + return os.path.join(self.software_dir, "bios", "bios.bin") + + def get_bitstream_filename(self, mode="sram", ext=None): + assert mode in ["sram", "flash"] + if ext is None: + ext = { + "sram" : self.soc.platform.bitstream_ext, + "flash" : ".bin" # FIXME. + }[mode] + return os.path.join(self.gateware_dir, self.soc.build_name + ext) + # Builder Arguments -------------------------------------------------------------------------------- def builder_args(parser):