is there a way to configure spike (riscv simulator) for entry PC etc.?

949 views Asked by At

i'm doing verification to a RISCV cpu that supports Machine-Mode only, and i want to run my generated program on spike simulator. i'm struggling to find any documentation about it.

how can i configure the first PC to my DUT first PC? how can i configure other parameters like 'mvendorid' etc. ?

currently i'm working without pk and i'm getting "terminate called after throwing an instance of trap_load_access_fault".

when i'm working with pk, the program enters endless loop and the first PC doesn't look related to the ELF.

any suggestions?

1

There are 1 answers

0
sven On

Spike provides an option "--pc" which override the default entry point, run with '--pc DUT_FIRST_PC' should solve your problem.

When spike start simulation, its first pc is defined by DEFAULT_RSTVEC(0x1000), and spike set a "trampoline program" starts at DEFAULT_RSTVEC. After the "trampoline program" finished, spike jump to your program and go on, the jump pc can be override by '--pc' option.