From: Florent Kermarrec Date: Fri, 8 Nov 2019 22:27:58 +0000 (+0100) Subject: soc_core: add integrated-rom-file parameter to allow initializing rom from command... X-Git-Tag: 24jan2021_ls180~871 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=05e8abfee3dc01895368f8dd60087f2a107a37f8;p=litex.git soc_core: add integrated-rom-file parameter to allow initializing rom from command line --- diff --git a/litex/soc/integration/soc_core.py b/litex/soc/integration/soc_core.py index 6539be8d..7f674b51 100644 --- a/litex/soc/integration/soc_core.py +++ b/litex/soc/integration/soc_core.py @@ -540,6 +540,8 @@ def soc_core_args(parser): # ROM parameters parser.add_argument("--integrated-rom-size", default=None, type=int, help="size/enable the integrated (BIOS) ROM") + parser.add_argument("--integrated-rom-file", default=None, type=str, + help="integrated (BIOS) ROM binary file") # SRAM parameters parser.add_argument("--integrated_sram_size", default=None, help="size/enable the integrated SRAM") @@ -574,6 +576,10 @@ def soc_core_args(parser): def soc_core_argdict(args): r = dict() + rom_file = getattr(args, "integrated_rom_file", None) + if rom_file is not None: + args.integrated_rom_init = get_mem_data(rom_file, "little") # FIXME: endianness + args.integrated_rom_size = len(args.integrated_rom_init)*4 for a in inspect.getargspec(SoCCore.__init__).args: if a not in ["self", "platform"]: arg = getattr(args, a, None)