riscv-software-src / riscv-isa-sim

Spike, a RISC-V ISA Simulator
Other
2.34k stars 823 forks source link

How to change/Modify Program Counter starting value in SPIKE. #1470

Open kashifminhas opened 11 months ago

kashifminhas commented 11 months ago

Hello,

I am using the Testbench of SweRV-EH1 Core with integrated SPIKE-ISS.

https://github.com/Lampro-Mellon/LM-RISCV-DV

But now I modified the TB according to my CORE RTL. In my core RTL Program Counter starts from 0x0000... but the SPIKE PC starting address is 0x8000.... . So how would I modify this SPIKE Program counter starting address according to our CORE PC.

widlarizer commented 10 months ago

From the output of spike --help: --pc=<address> Override ELF entry point Maybe this does what you need. Alternatively, change the linker script for the program you compiled to place your startup code at 0x80000000