Hi Gem5 users,

Can someone tell which commit point and branch in the riscv-tools repo (
https://github.com/riscv/riscv-tools ) was used for the development of
RISCV in gem5? I was trying to run a simple hello world program compiled
with the latest version of the compiler ( commit point 7b1680 in
riscv-tools trepo ):

  1 #include <iostream>
  2
  3 int main( int argc, char* argv[] )
  4 {
  5   std::cout << "Hello World, RISC-V!" << std::endl;
  6   return 0;
  7 }

and compiling it and running it on gem5 gives error:

% riscv64-unknown-elf-g++ hello.c -o hello
% spike pk hello
Hello World, RISC-V!
% cd gem5
% ./build/RISCV/gem5.opt ./configs/example/se.py -c hello

gives the following error:

warn: DRAM device capacity (8192 Mbytes) does not match the address
range assigned (512 Mbytes)
warn: Unknown operating system; assuming Linux.0:
system.remote_gdb.listener: listening for remote gdb #0 on port 7000
**** REAL SIMULATION ****
info: Entering event queue @ 0.  Starting simulation...*panic: Unknown
instruction 0x41975985 at pc 0x000000000001036e*
Memory Usage: 757624 KBytes
Program aborted at tick 0

Seeing the object-dump for hello at pc 1036e shows:

*000000000001036e <_start>:*
  * 1036e:       000a4197                auipc   gp,0xa4*
   10372:       73a18193                addi    gp,gp,1850 # b4aa8
<__global_pointer$>
   10376:       000a4517                auipc   a0,0xa4
   1037a:       19250513                addi    a0,a0,402 # b4508 <_edata>

Thanks,

Nitish
​
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to