json2renode: Use opensbi->base for bios binary

This commit is contained in:
Mateusz Karlic 2022-09-22 13:25:45 +02:00 committed by Mateusz Karlic
parent ca63d12509
commit 860ca8673e
1 changed files with 4 additions and 4 deletions

View File

@ -774,15 +774,15 @@ showAnalyzer sysbus.uart
showAnalyzer sysbus.uart Antmicro.Renode.Analyzers.LoggingUartAnalyzer showAnalyzer sysbus.uart Antmicro.Renode.Analyzers.LoggingUartAnalyzer
""".format(cpu_type, args.repl) """.format(cpu_type, args.repl)
rom_base = csr['memories']['rom']['base'] if 'rom' in csr['memories'] else None opensbi_base = csr['memories']['opensbi']['base'] if 'opensbi' in csr['memories'] else None
if rom_base is not None and args.bios_binary: if opensbi_base is not None and args.bios_binary:
# load LiteX BIOS to ROM # load LiteX BIOS to ROM
result += """ result += """
sysbus LoadBinary @{} {} sysbus LoadBinary @{} {}
""".format(args.bios_binary, hex(rom_base)) """.format(args.bios_binary, hex(opensbi_base))
for cpu_id in range(0, number_of_cores): for cpu_id in range(0, number_of_cores):
result += f"cpu{cpu_id} PC {hex(rom_base)}\n" result += f"cpu{cpu_id} PC {hex(opensbi_base)}\n"
if args.tftp_ip: if args.tftp_ip:
result += """ result += """