Hi.
I'm trying to run a basic hello world program in The RocketChip.
I have successfully ran the code in the spike simulator but when I run it on the
verilator simulation for the RocketChip nothing seems to happen.
here is the code:
.global _start
.section .text.bios
_start:
addi a0, x0, 0x68
li a1, 0x10000000
sb a0, (a1) # 'h'
addi a0, x0, 0x65
sb a0, (a1) # 'e'
addi a0, x0, 0x6C
sb a0, (a1) # 'l'
addi a0, x0, 0x6C
sb a0, (a1) # 'l'
addi a0, x0, 0x6F
sb a0, (a1) # 'o'
and the .ld file:
MEMORY {
dram_space (rwx) : ORIGIN = 0x80000000, LENGTH = 128
}
SECTIONS {
.text : {
hello.o(.text.bios)
} > dram_space
}
my goal is to be able to run code in machine mode and access the mhpeventX register and mhpcounters to evaluate branch misdirections and cache misses. if you guys have any orientation on how to do that i would appreciate it