Error in the process of running SPEC CPU2006 Benchmarks in the gem5 Simulator

806 views
Skip to first unread message

Artemis Mohseni

unread,
Jul 19, 2017, 6:54:23 AM7/19/17
to RISC-V SW Dev
Dear Sir/Madam,

As I am beginner and unfortunately I did not found a complete tutorial about running SPEC benchmark in gem5 simulator, I followed the tutorial in (https://markgottscho.wordpress.com/2014/09/20/tutorial-easily-running-spec-cpu2006-benchmarks-in-the-gem5-simulator/comment-page-1/#comment-184) web page. I am using the RISCV version of gem5, but before this, I tested the "./run_gem5_alpha_spec06_benchmark.sh perlbench /home/ubuntu/GEM5_ALPHA/gem5/output_dir" command for ALPHA microprocessor and I had the same error. after running the below command in the terminal,  there is an error related to instruction (panic: Unknown instruction 0xa5378082 at pc 0x0000000000010fa4). 


~/GEM5_RISCV/gem5$ ./run_gem5_riscv_spec06_benchmark.sh perlbench /home/ubuntu/GEM5_RISCV/gem5/output_dir


As follow you can find the result of running the addressed command for RISCV version of gem5. It should be note that the perlbech.out, perlbench.err and the stats.txt which are created after running the command are empty.


I look froward to hearing from you.

Sincerely,
Artemis

~/GEM5_RISCV/gem5$ ./run_gem5_riscv_spec06_benchmark.sh perlbench /home/ubuntu/GEM5_RISCV/gem5/output_dir
Command line:
./run_gem5_riscv_spec06_benchmark.sh perlbench /home/ubuntu/GEM5_RISCV/gem5/output_dir
================= Hardcoded directories ==================
GEM5_DIR:                                     /home/ubuntu/GEM5_RISCV/gem5
SPEC_DIR:                                     /home/ubuntu/cpu2006
==================== Script inputs =======================
BENCHMARK:                                    perlbench
OUTPUT_DIR:                                   /home/ubuntu/GEM5_RISCV/gem5/output_dir
==========================================================

Changing to SPEC benchmark runtime directory: /home/ubuntu/cpu2006/benchspec/CPU2006/400.perlbench/run/run_base_ref_riscv.0000


--------- Here goes nothing! Starting gem5! ------------


warn: DRAM device capacity (8192 Mbytes) does not match the address range assigned (512 Mbytes)
gem5 Simulator System.  http://gem5.org
gem5 is copyrighted software; use the --copyright option for details.

gem5 compiled Jul 17 2017 16:51:43
gem5 started Jul 19 2017 12:00:55
gem5 executing on ubuntu-VirtualBox, pid 7547
command line: /home/ubuntu/GEM5_RISCV/gem5/build/RISCV/gem5.opt --outdir=/home/ubuntu/GEM5_RISCV/gem5/output_dir /home/ubuntu/GEM5_RISCV/gem5/configs/example/spec06_config.py --benchmark=perlbench --benchmark_stdout=/home/ubuntu/GEM5_RISCV/gem5/output_dir/perlbench.out --benchmark_stderr=/home/ubuntu/GEM5_RISCV/gem5/output_dir/perlbench.err

Selected SPEC_CPU2006 benchmark
--> perlbench
Process stdout file: /home/ubuntu/GEM5_RISCV/gem5/output_dir/perlbench.out
Process stderr file: /home/ubuntu/GEM5_RISCV/gem5/output_dir/perlbench.err
['/home/ubuntu/cpu2006/benchspec/CPU2006/400.perlbench/run/run_base_ref_riscv.0000/perlbench_base.riscv', '-I./lib', 'checkspam.pl', '2500', '5', '25', '11', '150', '1', '1', '1', '1']
Global frequency set at 1000000000000 ticks per second
0: system.remote_gdb.listener: listening for remote gdb #0 on port 7000
info: Entering event queue @ 0.  Starting simulation...
**** REAL SIMULATION ****
panic: Unknown instruction 0xa5378082 at pc 0x0000000000010fa4
Memory Usage: 636556 KBytes
Program aborted at tick 1500
--- BEGIN LIBC BACKTRACE ---
/home/ubuntu/GEM5_RISCV/gem5/build/RISCV/gem5.opt(_Z15print_backtracev+0x28)[0x1040588]
/home/ubuntu/GEM5_RISCV/gem5/build/RISCV/gem5.opt(_Z12abortHandleri+0x46)[0x1054586]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f71fe6e3390]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7f71fd0eb428]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7f71fd0ed02a]
/home/ubuntu/GEM5_RISCV/gem5/build/RISCV/gem5.opt(_ZN8RiscvISA16UnknownInstFault9invoke_seEP13ThreadContextRK14RefCountingPtrI10StaticInstE+0x1a8)[0xcaba68]
/home/ubuntu/GEM5_RISCV/gem5/build/RISCV/gem5.opt(_ZN8RiscvISA10RiscvFault6invokeEP13ThreadContextRK14RefCountingPtrI10StaticInstE+0x30)[0xcab7c0]
/home/ubuntu/GEM5_RISCV/gem5/build/RISCV/gem5.opt(_ZN13BaseSimpleCPU9advancePCERKSt10shared_ptrI9FaultBaseE+0xd9)[0xf021d9]
/home/ubuntu/GEM5_RISCV/gem5/build/RISCV/gem5.opt(_ZN15AtomicSimpleCPU4tickEv+0x448)[0xef9a38]
/home/ubuntu/GEM5_RISCV/gem5/build/RISCV/gem5.opt(_ZN10EventQueue10serviceOneEv+0x11d)[0x10471cd]
/home/ubuntu/GEM5_RISCV/gem5/build/RISCV/gem5.opt(_Z9doSimLoopP10EventQueue+0x50)[0x1060b80]
/home/ubuntu/GEM5_RISCV/gem5/build/RISCV/gem5.opt(_Z8simulatem+0x34b)[0x106129b]
/home/ubuntu/GEM5_RISCV/gem5/build/RISCV/gem5.opt(_ZZN8pybind1112cpp_function10initializeIRPFP22GlobalSimLoopExitEventmES3_JmEJNS_4nameENS_5scopeENS_7siblingENS_5arg_vEEEEvOT_PFT0_DpT1_EDpRKT2_ENUlRNS_6detail13function_callEE1_4_FUNESO_+0x4f)[0xdd065f]
/home/ubuntu/GEM5_RISCV/gem5/build/RISCV/gem5.opt(_ZN8pybind1112cpp_function10dispatcherEP7_objectS2_S2_+0xe24)[0xa6afd4]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x7852)[0x7f71fe9ad552]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x85c)[0x7f71fead701c]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x6ffd)[0x7f71fe9accfd]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x7124)[0x7f71fe9ace24]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x7124)[0x7f71fe9ace24]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x85c)[0x7f71fead701c]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCode+0x19)[0x7f71fe9a5b89]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x613b)[0x7f71fe9abe3b]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x85c)[0x7f71fead701c]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x6ffd)[0x7f71fe9accfd]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x85c)[0x7f71fead701c]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCode+0x19)[0x7f71fe9a5b89]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyRun_StringFlags+0x76)[0x7f71fea13166]
/home/ubuntu/GEM5_RISCV/gem5/build/RISCV/gem5.opt(_Z6m5MainiPPc+0x8f)[0x1051b5f]
/home/ubuntu/GEM5_RISCV/gem5/build/RISCV/gem5.opt(main+0x33)[0x83b873]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f71fd0d6830]
/home/ubuntu/GEM5_RISCV/gem5/build/RISCV/gem5.opt(_start+0x29)[0x8571d9]
--- END LIBC BACKTRACE ---

Michael Clark

unread,
Jul 19, 2017, 7:41:12 AM7/19/17
to Artemis Mohseni, RISC-V SW Dev

On 19 Jul 2017, at 10:54 PM, Artemis Mohseni <artemis...@gmail.com> wrote:

0xa5378082

That looks like it starts with a 16-bit RVC compressed instruction from quadrant 2. The low 2 bits are 0b10.

0b00 - RVC quadrant 0
0b01 - RVC quadrant 1
0b10 - RVC quadrant 2
0b11 - 32/48/64-bit

Does gem5 support RVC compression?

Can you compile with -march=rv64imafd.

Note it is not sufficient to just compile your code with -march=rv64imafd, as the newlib libc is likely compressed too. Unless you have a multilib compiler, you will need to configure the gcc toolchain without RVC. e.g.

cd riscv-gnu-toolchain
./configure --with-arch=rv64imafd --prefix=/opt/riscv/toolchain-20170719

Michael

Schuyler Eldridge

unread,
Jul 19, 2017, 11:41:52 PM7/19/17
to Michael Clark, Artemis Mohseni, RISC-V SW Dev
FYI, Alec Roelke (gem5/risc-v maintainer) got this in just recently. He hit the same issue...


A gem5 update that includes this commit may take care of it for you. Alternatively, Michael's suggestion would remove those instructions (from both your binary and the toolchain, with the latter being also required).

Schuyler

--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/A16957B4-F94C-422A-AE34-360778D7AFE6%40mac.com.

Jacob Bachmeyer

unread,
Jul 19, 2017, 11:53:54 PM7/19/17
to Artemis Mohseni, RISC-V SW Dev
Artemis Mohseni wrote:
> panic: Unknown instruction 0xa5378082

I am slightly surprised that no one else has looked it up, but if you
consult the RVC Instruction Set Listings section of the user ISA spec,
0x8082 corresponds to "C.JR x1", which is "C.JR ra", or "return" in
RVC. Your problem is that your program is using RVC and your simulator
does not support RVC.


-- Jacob

Bruce Hoult

unread,
Jul 20, 2017, 6:54:25 AM7/20/17
to Jacob Bachmeyer, Artemis Mohseni, RISC-V SW Dev
??

Michael Clark correctly diagnosed this within an hour of the original post (17 hours before yours), and Schuyler Eldridge later pointed to a patch that adds support for RVC to gem5.

Maybe problems with your mail reception?

--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.

Artemis Mohseni

unread,
Jul 20, 2017, 6:58:44 AM7/20/17
to Bruce Hoult, Jacob Bachmeyer, RISC-V SW Dev
Thank you so much for your useful comments. I am in the process of updating the gem5 with riscv. 

Artemis Mohseni

unread,
Jul 20, 2017, 10:50:12 AM7/20/17
to Bruce Hoult, Jacob Bachmeyer, RISC-V SW Dev
Dear friends,

According to your comment I rebuilt the gem5 with riscv, but the current problem is that after running the spec, there is a waring related to executable file in bzip2 benchmark which you can see as follow.

-----------------------------------------------------------------------------------------------------------------------------------------
~/GEM5_RISCV/gem5$ ./run_gem5_riscv_spec06_benchmark.sh bzip2 /home/ubuntu/GEM5_RISCV/gem5/output_dir
Command line:
./run_gem5_riscv_spec06_benchmark.sh bzip2 /home/ubuntu/GEM5_RISCV/gem5/output_dir

================= Hardcoded directories ==================
GEM5_DIR:                                     /home/ubuntu/GEM5_RISCV/gem5
SPEC_DIR:                                     /home/ubuntu/cpu2006
==================== Script inputs =======================
BENCHMARK:                                    bzip2
OUTPUT_DIR:                                   /home/ubuntu/GEM5_RISCV/gem5/output_dir
==========================================================

Changing to SPEC benchmark runtime directory: /home/ubuntu/cpu2006/benchspec/CPU2006/401.bzip2/run/run_base_ref_riscv.0000



--------- Here goes nothing! Starting gem5! ------------


warn: DRAM device capacity (8192 Mbytes) does not match the address range assigned (512 Mbytes)
gem5 Simulator System.  http://gem5.org
gem5 is copyrighted software; use the --copyright option for details.

gem5 compiled Jul 20 2017 14:41:50
gem5 started Jul 20 2017 16:30:41
gem5 executing on ubuntu-VirtualBox, pid 23226
command line: /home/ubuntu/GEM5_RISCV/gem5/build/RISCV/gem5.opt --outdir=/home/ubuntu/GEM5_RISCV/gem5/output_dir /home/ubuntu/GEM5_RISCV/gem5/configs/example/spec06_config.py --benchmark=bzip2 --benchmark_stdout=/home/ubuntu/GEM5_RISCV/gem5/output_dir/bzip2.out --benchmark_stderr=/home/ubuntu/GEM5_RISCV/gem5/output_dir/bzip2.err

Selected SPEC_CPU2006 benchmark
--> bzip2
Process stdout file: /home/ubuntu/GEM5_RISCV/gem5/output_dir/bzip2.out
Process stderr file: /home/ubuntu/GEM5_RISCV/gem5/output_dir/bzip2.err
['/home/ubuntu/cpu2006/benchspec/CPU2006/401.bzip2/run/run_base_ref_riscv.0000/bzip2_base.riscv', 'input.source', '280']

Global frequency set at 1000000000000 ticks per second
0: system.remote_gdb.listener: listening for remote gdb #0 on port 7000
info: Entering event queue @ 0.  Starting simulation...
**** REAL SIMULATION ****
warn: readlink() called on '/proc/self/exe' may yield unexpected results in various settings.
      Returning '/home/ubuntu/cpu2006/benchspec/CPU2006/401.bzip2/run/run_base_ref_riscv.0000/bzip2_base.riscv'

info: Increasing stack size by one page.
fatal: Out of memory, please increase size of physical memory.
Memory Usage: 640028 KBytes

-----------------------------------------------------------------------------------------------------------------------------------------

As a result, I built the riscv.cfg file in spec for bzip2 benchmark again to be sure about the executable file and it was built successfully.

-----------------------------------------------------------------------------------------------------------------------------------------
~$runspec --config=riscv.cfg --action=build --tune=base bzip2
runspec v6674 - Copyright 1999-2011 Standard Performance Evaluation Corporation
Using 'linux-suse10-amd64' tools
Reading MANIFEST... 22481 files
Loading runspec modules................
Locating benchmarks...found 31 benchmarks in 6 benchsets.
Reading config file '/home/ubuntu/cpu2006/config/riscv.cfg'
Running "specperl /home/ubuntu/cpu2006/Docs/sysinfo" to gather system information.
Loading "http://www.spec.org/auto/cpu2006/current_version" for version check: OK
Benchmarks selected: 401.bzip2
Compiling Binaries
  Building 401.bzip2 base riscv default: (build_base_riscv.0000)

Build successes: 401.bzip2(base)

Build Complete

The log for this run is in /home/ubuntu/cpu2006/result/CPU2006.001.log

runspec finished at Thu Jul 20 15:31:41 2017; 13 total seconds elapsed


-----------------------------------------------------------------------------------------------------------------------------------------

So, in order to create the run_base_ref_riscv.0000 file I ran the below command and as you can see in following part, it was not successful. So, I reckon that my problem is related to creating file or the riscv compiler. What do you think about it?

-----------------------------------------------------------------------------------------------------------------------------------------
~$ runspec --config=riscv.cfg --size=ref --noreportable --tune=base --iterations=1 bzip2
runspec v6674 - Copyright 1999-2011 Standard Performance Evaluation Corporation
Using 'linux-suse10-amd64' tools
Reading MANIFEST... 22481 files
Loading runspec modules................
Locating benchmarks...found 31 benchmarks in 6 benchsets.
Reading config file '/home/ubuntu/cpu2006/config/riscv.cfg'
Running "specperl /home/ubuntu/cpu2006/Docs/sysinfo" to gather system information.
Benchmarks selected: 401.bzip2
Compiling Binaries
  Up to date 401.bzip2 base riscv default


Setting Up Run Directories
  Setting up 401.bzip2 ref base riscv default: created (run_base_ref_riscv.0000)
Running Benchmarks
  Running 401.bzip2 ref base riscv default

401.bzip2: copy 0 non-zero return code (exit code=2, signal=0)


****************************************
Contents of input.source.err
****************************************

../run_base_ref_riscv.0000/bzip2_base.riscv: 2: ../run_base_ref_riscv.0000/bzip2_base.riscv: Syntax error: Unterminated quoted string

****************************************
Error: 1x401.bzip2
Producing Raw Reports

mach: default
  ext: riscv
    size: ref
      set: int
        format: raw -> /home/ubuntu/cpu2006/result/CINT2006.005.ref.rsf
Parsing flags for 401.bzip2 base: done
Doing flag reduction: done
        format: flags -> /home/ubuntu/cpu2006/result/CINT2006.005.ref.flags.html
        format: ASCII -> /home/ubuntu/cpu2006/result/CINT2006.005.ref.txt
        format: CSV -> /home/ubuntu/cpu2006/result/CINT2006.005.ref.csv
        format: HTML -> /home/ubuntu/cpu2006/result/CINT2006.005.ref.html, /home/ubuntu/cpu2006/result/invalid.gif, /home/ubuntu/cpu2006/result/CINT2006.005.ref.gif
      set: fp

The log for this run is in /home/ubuntu/cpu2006/result/CPU2006.005.log
The debug log for this run is in /home/ubuntu/cpu2006/result/CPU2006.005.log.debug

runspec finished at Thu Jul 20 16:25:18 2017; 5 total seconds elapsed

-----------------------------------------------------------------------------------------------------------------------------------------

Sorry for my long email and thank you for the time that you allocate to me.

Sincerely,
Artemis

Alec Roelke

unread,
Jul 20, 2017, 11:06:03 AM7/20/17
to Artemis Mohseni, Bruce Hoult, Jacob Bachmeyer, RISC-V SW Dev
I don't know about the bzip2 unterminated quoted string error, but I can tell you that readlink warning always shows up in gem5 and you can ignore it.  If you want more information about it, you should ask gem5-users.

Reply all
Reply to author
Forward
0 new messages