mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
json2renode: cpu: Extract minor common logic
This commit is contained in:
parent
97772eb4bd
commit
eccb26874e
1 changed files with 2 additions and 8 deletions
|
@ -241,10 +241,6 @@ CPU.VexRiscv @ sysbus
|
||||||
cpu_string += """
|
cpu_string += """
|
||||||
cpuType: "rv32im"
|
cpuType: "rv32im"
|
||||||
"""
|
"""
|
||||||
if time_provider:
|
|
||||||
cpu_string += """
|
|
||||||
timeProvider: {}
|
|
||||||
""".format(time_provider)
|
|
||||||
|
|
||||||
elif kind == 'picorv32':
|
elif kind == 'picorv32':
|
||||||
cpu_string = """
|
cpu_string = """
|
||||||
|
@ -271,10 +267,6 @@ CPU.CV32E40P @ sysbus
|
||||||
cpu_string += """
|
cpu_string += """
|
||||||
cpuType: "rv32imc"
|
cpuType: "rv32imc"
|
||||||
"""
|
"""
|
||||||
if time_provider:
|
|
||||||
cpu_string += """
|
|
||||||
timeProvider: {}
|
|
||||||
""".format(time_provider)
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise Exception('Unsupported cpu type: {}'.format(kind))
|
raise Exception('Unsupported cpu type: {}'.format(kind))
|
||||||
|
@ -285,6 +277,8 @@ CPU.CV32E40P @ sysbus
|
||||||
cpu{cpu_id}: {cpu_string.strip()}
|
cpu{cpu_id}: {cpu_string.strip()}
|
||||||
hartId: {cpu_id}
|
hartId: {cpu_id}
|
||||||
"""
|
"""
|
||||||
|
if time_provider:
|
||||||
|
result += f' timeProvider: {time_provider}\n'
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue