Hi everyone,

I ran the following program which simply reads the value of MiscReg
(mhartid, mstatus, ...),
https://pastebin.com/t5XBBWEz. (remove line 31-32)

The compilation command I used is, riscv64-unknown-elf-gcc -static hello1.c
-o hello1.
I ran it with SE script, gem5.opt se.py -c hello1

And this is the error I got,
panic: Illegal instruction 0xf14027f3 at pc (0x101b8=>0x101bc).(0=>1):
mhartid is not accessible in 0.

I believe the "0" stands for the value of PrivilegeMode PRV_U right?
So my question is how do I change from PRV_U to PRV_M in order to access
MiscReg?
Also, I have found an element of array MiscRegNames in isa.cc, which
is [MISCREG_PRV]           = "PRV", does this element control which
PrivilegeMode that i'm in?
Any help would be appreciated!
Thanks

Regards,
Jerry
_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org

Reply via email to