Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

litex_json2renode.py: add option for elf bios file and correct vexriscv variants #1984

Merged
merged 2 commits into from
Jun 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 25 additions & 11 deletions litex/tools/litex_json2renode.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,23 +219,29 @@ def get_cpu_count(csr):
vexriscv_common_kind = {
'name': 'VexRiscv',
'variants': {
'linux': {
'properties': ['cpuType: "rv32ima"', 'privilegeArchitecture: PrivilegeArchitecture.Priv1_10'],
},
'i': {
'properties': ['cpuType: "rv32i"'],
'minimal': {
'properties': ['cpuType: "rv32i_zicsr_zifencei"'],
},
'im': {
'properties': ['cpuType: "rv32im"'],
'lite': {
'properties': ['cpuType: "rv32im_zicsr_zifencei"'],
},
'ima': {
'properties': ['cpuType: "rv32ima"'],
'standard': {
'properties': ['cpuType: "rv32im_zicsr_zifencei"'],
},
'imac': {
'properties': ['cpuType: "rv32imac"'],
'properties': ['cpuType: "rv32imac_zicsr_zifencei"'],
},
'full': {
'properties': ['cpuType: "rv32im_zicsr_zifencei"'],
},
'linux': {
'properties': ['cpuType: "rv32ima_zicsr_zifencei"'],
},
'secure': {
'properties': ['cpuType: "rv32ima_zicsr_zifencei"'],
},
'others': {
'properties': ['cpuType: "rv32im"'],
'properties': ['cpuType: "rv32im_zicsr_zifencei"'],
}
},
'supports_time_provider': True,
Expand Down Expand Up @@ -900,6 +906,12 @@ def generate_resc(csr, number_of_cores, args, flash_binaries={}, tftp_binaries={
for cpu_id in range(0, number_of_cores):
result += f"cpu{cpu_id} PC {hex(rom_base)}\n"

if args.bios_elf:
# load LiteX BIOS to ROM base
result += """
sysbus LoadELF @{}
""".format(args.bios_elf)

if args.tftp_ip:
result += """

Expand Down Expand Up @@ -1057,6 +1069,8 @@ def parse_args():
bios_group = parser.add_mutually_exclusive_group()
bios_group.add_argument('--bios-binary', action='store',
help='Path to the BIOS binary')
bios_group.add_argument('--bios-elf', action='store',
help='Path to the BIOS ELF file')
bios_group.add_argument('--opensbi-binary', action='store',
help='Path to the OpenSBI binary')

Expand Down
Loading