Skip to content

Commit

Permalink
renode_wrapper: Make CPU type configurable
Browse files Browse the repository at this point in the history
Signed-off-by: Mateusz Karlic <[email protected]>
  • Loading branch information
MateuszKarlic committed Aug 21, 2024
1 parent 15c80f1 commit 7a76cf3
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions scripts/renode_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
memory: Memory.MappedMemory @ sysbus 0x80000000
size: {mem}
cpu: CPU.RiscV32 @ sysbus
cpu: CPU.{cpu_type} @ sysbus
cpuType: "{isa}"
timeProvider: clint
hartId: 0
allowUnalignedAccesses: true
{additional_cpu_parameters}
clint: IRQControllers.CoreLevelInterruptor @ sysbus 0x02000000
[0,1] -> cpu@[3,7]
Expand Down Expand Up @@ -77,6 +77,20 @@ def main():
default="0x100000",
help="Memory size",
)
parser.add_argument(
"--cpu-type",
type=str,
default="Riscv32",
help="Renode CPU type",
)
# Some CPUs might not expose these parameters as configurable
# allow the testing software to ignore/override them if needed
parser.add_argument(
"--additional-cpu-parameters",
type=str,
default="allowUnalignedAccesses: true",
help="Additional CPU parameters",
)

args = parser.parse_args()

Expand All @@ -93,6 +107,8 @@ def main():
"resc": resc,
"log": args.log,
"mem": args.mem_size,
"cpu_type": args.cpu_type,
"additional_cpu_parameters": args.additional_cpu_parameters,
}

# Render REPL template
Expand Down

0 comments on commit 7a76cf3

Please sign in to comment.