Error running any script in Full System Simulation(gem5)

Viewed 849

I'm having trouble running scripts in gem5 Full System Simulation.

I'm new to gem5 and I was following this tutorial: http://learning.gem5.org/book/part3/fs_config.html#running-a-full-system-simulation

I was trying to run gem5 in Full System Simulation passing a script in its parameters. The simulation starts normally, and it works if I don't pass any script parameter. However, whenever I pass any script in the parameters, in this case the same runscript that is present in the tutorial(test.rcS), I get the following error:

gem5 Simulator System.  http://gem5.org
gem5 is copyrighted software; use the --copyright option for details.

gem5 compiled Sep 16 2019 12:12:46
gem5 started Oct 10 2019 17:17:06
gem5 executing on verites-desktop, pid 3543
command line: build/X86/gem5.opt configs/learning_gem5/part4/run.py --script test.rcS

Global frequency set at 1000000000000 ticks per second
warn: DRAM device capacity (8192 Mbytes) does not match the address range assigned (4096 Mbytes)
info: kernel located at: /home/taoliveira/Downloads/Gem5/gem5/configs/learning_gem5/part4/x86_64-vmlinux-2.6.22.9
system.pc.com_1.device: Listening for connections on port 3456
      0: rtc: Real-time clock set to Sun Jan  1 00:00:00 2012
0: system.remote_gdb: listening for remote gdb on port 7000
warn: Reading current count from inactive timer.
Running the simulation
info: Entering event queue @ 0.  Starting simulation...
warn: Don't know what interrupt to clear for console.
warn: x86 cpuid: unknown family 0x8086
warn: Tried to clear PCI interrupt 14
warn: Unknown mouse command 0xe1.
warn: instruction 'wbinvd' unimplemented
panic: could not open file test.rcS
Memory Usage: 3640440 KBytes
Program aborted at tick 5106342037509
--- BEGIN LIBC BACKTRACE ---
build/X86/gem5.opt(_Z15print_backtracev+0x2c)[0x558acb71ca8c]
build/X86/gem5.opt(_Z12abortHandleri+0x4a)[0x558acb72eada]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7f1d67f42890]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f1d66750e97]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f1d66752801]
build/X86/gem5.opt(+0x4fe31f)[0x558aca6f031f]
build/X86/gem5.opt(_ZN10PseudoInst8readfileEP13ThreadContextmmm+0x203)[0x558acb769ee3]
build/X86/gem5.opt(_ZNK10X86ISAInst10M5readfile7executeEP11ExecContextPN5Trace10InstRecordE+0x7b)[0x558acad9e4cb]
build/X86/gem5.opt(_ZN15AtomicSimpleCPU4tickEv+0x4da)[0x558acb7abd4a]
build/X86/gem5.opt(_ZN10EventQueue10serviceOneEv+0xd9)[0x558acb724c69]
build/X86/gem5.opt(_Z9doSimLoopP10EventQueue+0x87)[0x558acb745077]
build/X86/gem5.opt(_Z8simulatem+0xcba)[0x558acb7460ca]
build/X86/gem5.opt(+0x78f42e)[0x558aca98142e]
build/X86/gem5.opt(+0x5b177e)[0x558aca7a377e]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5f82)[0x7f1d681fc522]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8)[0x7f1d6832ebf8]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x6364)[0x7f1d681fc904]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8)[0x7f1d6832ebf8]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCode+0x19)[0x7f1d681f6409]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x68a5)[0x7f1d681fce45]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8)[0x7f1d6832ebf8]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x6364)[0x7f1d681fc904]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7d8)[0x7f1d6832ebf8]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyEval_EvalCode+0x19)[0x7f1d681f6409]
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0(PyRun_StringFlags+0x76)[0x7f1d682a66d6]
build/X86/gem5.opt(_Z6m5MainiPPc+0x83)[0x558acb72d6f3]
build/X86/gem5.opt(main+0x38)[0x558aca6ad308]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f1d66733b97]
build/X86/gem5.opt(_start+0x2a)[0x558aca6d7b1a]
--- END LIBC BACKTRACE ---
Aborted (core dumped) 

I've tried to run a simple mergesort C program in the exact same way and got the same problem. What should I do to fix this issue? Don't know if it's relevant, but i'm using Ubuntu 18.04.

1 Answers

I was able to fix my problem with some debug. There were some pieces of the code not working properly, always creating empty paths in SysPaths.py. This line was not in my code, for some reason:

filepath = os.path.join(self._subdir, filename)

Also, the specified path in paths variable was wrong, because I forgot a backslash('/') in the beginning of the path. Thanks for helping, Ciro.

Related