riscv-isa-sim icon indicating copy to clipboard operation
riscv-isa-sim copied to clipboard

Memory address 0x0 is invalid

Open hyperion009 opened this issue 1 year ago • 11 comments

Hi My riscv core is used in a kind of specific suitation. The program's address linked by ld is to be at 0x0. However, I got following error messages: Access exception occurred while loading payload hmrv_core_arithmetic_basic_test_0.o: Memory address 0x0 is invalid

what else can I do to work around this issue?

thanks in advance.

hyperion009 avatar Jul 06 '23 02:07 hyperion009

The default DRAM_BASE is 0x80000000. You can specify memory layout by "-m" option.

liweiwei90 avatar Jul 07 '23 02:07 liweiwei90

I believe Spike has a debug ROM at 0. You might have to disable the external debug feature, which would require source code changes to Spike.

scottj97 avatar Jul 07 '23 03:07 scottj97

@liweiwei90 thanks, something like -m 0x0:64, right?

hyperion009 avatar Jul 07 '23 08:07 hyperion009

@liweiwei90 I appended -m 0:64 to spike and got a message: Warning: the memory at [0x0, 0x3F] has been realigned to the 4 KiB page size: [0x0, 0xFFF] Access excpetion occurred while loading payload hmrv_core_arithmetic_basic_test_0.o: Memory address 0x0 is invalid

hyperion009 avatar Jul 07 '23 09:07 hyperion009

@scottj97 thanks scott, I am a newbie to spike. Could you provide more details on this, it's better to show me an example.

hyperion009 avatar Jul 07 '23 09:07 hyperion009

I'm afraid I don't know much about the debug hardware that's modeled in Spike, but it might be as simple as removing the debug device here

scottj97 avatar Jul 19 '23 20:07 scottj97

Or changing DEBUG_START to point to somewhere else.

scottj97 avatar Jul 19 '23 20:07 scottj97

Or changing DEBUG_START to point to somewhere else.

A quick test shows that this breaks debugging.

timsifive avatar Jul 19 '23 21:07 timsifive

A quick test shows that this breaks debugging.

Not surprising. I'm assuming since OP has program code residing at address 0, he doesn't care about debugging.

scottj97 avatar Jul 19 '23 21:07 scottj97

@scottj97 @timsifive thanks Scott&Tim. @timsifive what kind of broken debugging issues show up?

hyperion009 avatar Jul 24 '23 05:07 hyperion009