[gem5-users] Gem5 not working when executing a python script (fatal: Syscall 318 out of range is the error)

2021-08-11 Thread gogineni kailashnath via gem5-users
Hello,
I'm trying to execute a simple python script and pass command line
parameters to just do simple addition of numbers in gem5
Command:
sudo ./build/X86/gem5.opt configs/example/se.py --cmd /usr/bin/python3
--options "sum.py 3 4"

sum.py source code:
import sys
x=int(sys.argv[1])
y=int(sys.argv[2])
sum=x+y
print("The addition is :",sum)

Error I got:
osboxes@osboxes:~/gem5$ sudo ./build/X86/gem5.opt configs/example/se.py
--cmd /usr/bin/python3 --options "sum.py 3 4"
gem5 Simulator System.  http://gem5.org
gem5 is copyrighted software; use the --copyright option for details.

gem5 version 21.0.0.0
gem5 compiled Aug  5 2021 21:03:24
gem5 started Aug 11 2021 20:44:15
gem5 executing on osboxes, pid 4072
command line: ./build/X86/gem5.opt configs/example/se.py --cmd
/usr/bin/python3 --options 'sum.py 3 4'

warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.master is deprecated. `master` is now called `mem_side_ports`
warn: membus.master is deprecated. `master` is now called `mem_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
Global frequency set at 1 ticks per second
warn: DRAM device capacity (8192 Mbytes) does not match the address range
assigned (512 Mbytes)
warn: Not reserving swap space. May cause SIGSEGV on actual usage
0: system.remote_gdb: listening for remote gdb on port 7000
** REAL SIMULATION **
info: Entering event queue @ 0.  Starting simulation...
warn: ignoring syscall access(...)
warn: ignoring syscall access(...)
warn: ignoring syscall access(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall access(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall access(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall access(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall access(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall access(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall access(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall set_robust_list(...)
warn: ignoring syscall rt_sigaction(...)
  (further warnings will be suppressed)
warn: ignoring syscall rt_sigprocmask(...)
  (further warnings will be suppressed)
fatal: Syscall 318 out of range
Memory Usage: 705664 KBytes

Can anyone let me know where I'm going wrong in executing the python
script. Anyhelp would be appreciated.

Thanks
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Collecting Two Sets of Data Within Same Simulation

2021-08-11 Thread Thomas, Samuel via gem5-users
Hi all,

I'm currently running a full system simulation, and would like to collect
statistics from one particular function as well as overall statistics from
the simulation. Unfortunately, the function gets called many times, so
simply dumping stats at the beginning and end of the function makes the
resulting stats file too large to do any analysis on.

Is there an easy way to get around this issue?

Thank you for your help!

Best,
Sam
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Re: static_inst.cc panic or assertion error when debugging execution of an x86 O3CPU

2021-08-11 Thread Deric Cheung via gem5-users
I implemented that patch (
https://gem5-review.googlesource.com/c/public/gem5/+/49183) and now the
panic in static_inst.cc no longer occurs. Thank you!

However I still encounter a failed assertion (gem5.opt:
build/X86/arch/x86/insts/static_inst.cc:144: static void
gem5::X86ISA::X86StaticInst::printReg(std::ostream&, gem5::RegId, int):
Assertion `size == 1 || size == 2 || size == 4 || size == 8' failed.) when
running this command:

build/X86/gem5.opt --debug-flags=Exec --debug-file=debug.txt
--debug-start=1000 configs/example/se.py --cpu-type=O3CPU --caches -c
tests/test-progs/threads/bin/x86/linux/threads

Log:
$ build/X86/gem5.opt --debug-flags=Exec --debug-file=debug.txt
--debug-start=1000 configs/example/se.py --cpu-type=O3CPU --caches -c
tests/test-progs/threads/bin/x86/linux/threads
gem5 Simulator System.  http://gem5.org
gem5 is copyrighted software; use the --copyright option for details.

gem5 version 21.1.0.0
gem5 compiled Aug 11 2021 08:12:16
gem5 started Aug 11 2021 08:15:32
gem5 executing on uc12, pid 1408288
command line: build/X86/gem5.opt --debug-flags=Exec --debug-file=debug.txt
--debug-start=1000 configs/example/se.py --cpu-type=O3CPU --caches -c
tests/test-progs/threads/bin/x86/linux/threads

warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.master is deprecated. `master` is now called `mem_side_ports`
warn: membus.master is deprecated. `master` is now called `mem_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
Global frequency set at 1 ticks per second
warn: No dot file generated. Please install pydot to generate the dot file
and pdf.
build/X86/mem/mem_interface.cc:791: warn: DRAM device capacity (8192
Mbytes) does not match the address range assigned (512 Mbytes)
0: system.remote_gdb: listening for remote gdb on port 7000
 REAL SIMULATION 
build/X86/sim/simulate.cc:107: info: Entering event queue @ 0.  Starting
simulation...
build/X86/arch/x86/cpuid.cc:180: warn: x86 cpuid family 0x:
unimplemented function 13
gem5.opt: build/X86/arch/x86/insts/static_inst.cc:144: static void
gem5::X86ISA::X86StaticInst::printReg(std::ostream&, gem5::RegId, int):
Assertion `size == 1 || size == 2 || size == 4 || size == 8' failed.
Program aborted at tick 10277500
--- BEGIN LIBC BACKTRACE ---
build/X86/gem5.opt(+0x1074340)[0x55744c0c4340]
build/X86/gem5.opt(+0x109393e)[0x55744c0e393e]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7f3f7d2353c0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7f3f7c7d818b]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7f3f7c7b7859]
/lib/x86_64-linux-gnu/libc.so.6(+0x25729)[0x7f3f7c7b7729]
/lib/x86_64-linux-gnu/libc.so.6(+0x36f36)[0x7f3f7c7c8f36]
build/X86/gem5.opt(+0x7a680a)[0x55744b7f680a]
build/X86/gem5.opt(+0xb1e459)[0x55744bb6e459]
build/X86/gem5.opt(+0xe913fd)[0x55744bee13fd]
build/X86/gem5.opt(+0xe83859)[0x55744bed3859]
build/X86/gem5.opt(+0xfa9893)[0x55744bff9893]
build/X86/gem5.opt(+0xfaad51)[0x55744bffad51]
build/X86/gem5.opt(+0xfac650)[0x55744bffc650]
build/X86/gem5.opt(+0xfaca08)[0x55744bffca08]
build/X86/gem5.opt(+0xfbd469)[0x55744c00d469]
build/X86/gem5.opt(+0x10815f6)[0x55744c0d15f6]
build/X86/gem5.opt(+0x10af334)[0x55744c0ff334]
build/X86/gem5.opt(+0x10afb82)[0x55744c0ffb82]
build/X86/gem5.opt(+0xc7d2f2)[0x55744bccd2f2]
build/X86/gem5.opt(+0x6804b3)[0x55744b6d04b3]
/lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x2a8738)[0x7f3f7d4eb738]
/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x8dd8)[0x7f3f7d2c0f48]
/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalCodeWithName+0x8fb)[0x7f3f7d40de3b]
/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyFunction_Vectorcall+0x94)[0x7f3f7d4eb114]
/lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x74d6d)[0x7f3f7d2b7d6d]
/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x7d86)[0x7f3f7d2bfef6]
/lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x8006b)[0x7f3f7d2c306b]
/lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x74d6d)[0x7f3f7d2b7d6d]
/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x12fd)[0x7f3f7d2b946d]
/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalCodeWithName+0x8fb)[0x7f3f7d40de3b]
/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyFunction_Vectorcall+0x94)[0x7f3f7d4eb114]
--- END LIBC BACKTRACE ---
Aborted

On Wed, Aug 11, 2021 at 12:41 AM Gabe Black via gem5-users <
gem5-users@gem5.org> wrote:

> Please give this a try:
>
> https://gem5-review.googlesource.com/c/public/gem5/+/49183
>
> On Tue, Aug 10, 2021 at 9:37 PM Deric Cheung via gem5-users <
> gem5-users@gem5.org> wrote:
>
>> Host OS: Ubuntu 12.04 LTS
>> Host CPU: Intel i7-2600 3.40 GHz
>>
>> I'm trying to debug an x86 

[gem5-users] Re: static_inst.cc panic or assertion error when debugging execution of an x86 O3CPU

2021-08-11 Thread Gabe Black via gem5-users
Please give this a try:

https://gem5-review.googlesource.com/c/public/gem5/+/49183

On Tue, Aug 10, 2021 at 9:37 PM Deric Cheung via gem5-users <
gem5-users@gem5.org> wrote:

> Host OS: Ubuntu 12.04 LTS
> Host CPU: Intel i7-2600 3.40 GHz
>
> I'm trying to debug an x86 application on an O3CPU using syscall
> emulation, but static_inst.cc panics or runs into an assertion error. Ideas
> for how I can debug or solve this issue?
>
> Example command 1 (causing panic): build/X86/gem5.opt --debug-flags=Exec
> --debug-file=debug.txt configs/example/se.py --cpu-type=O3CPU --caches -c
> tests/test-progs/hello/bin/x86/linux/hello
>
> Terminal output:
>
>> $build/X86/gem5.opt --debug-flags=Exec --debug-file=debug.txt
>>> configs/example/se.py --cpu-type=O3CPU --caches -c
>>> tests/test-progs/hello/bin/x86/linux/hello
>>
>> gem5 Simulator System.  http://gem5.org
>>
>> gem5 is copyrighted software; use the --copyright option for details.
>>
>>
>>> gem5 version 21.1.0.0
>>
>> gem5 compiled Aug 10 2021 19:50:47
>>
>> gem5 started Aug 10 2021 22:07:52
>>
>> gem5 executing on uc12, pid 1240379
>>
>> command line: build/X86/gem5.opt --debug-flags=Exec
>>> --debug-file=debug.txt configs/example/se.py --cpu-type=O3CPU --caches -c
>>> tests/test-progs/hello/bin/x86/linux/hello
>>
>>
>>> warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
>>
>> warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
>>
>> warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
>>
>> warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
>>
>> warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
>>
>> warn: membus.master is deprecated. `master` is now called `mem_side_ports`
>>
>> warn: membus.master is deprecated. `master` is now called `mem_side_ports`
>>
>> warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
>>
>> Global frequency set at 1 ticks per second
>>
>> warn: No dot file generated. Please install pydot to generate the dot
>>> file and pdf.
>>
>> build/X86/mem/mem_interface.cc:791: warn: DRAM device capacity (8192
>>> Mbytes) does not match the address range assigned (512 Mbytes)
>>
>> 0: system.remote_gdb: listening for remote gdb on port 7000
>>
>>  REAL SIMULATION 
>>
>> build/X86/sim/simulate.cc:107: info: Entering event queue @ 0.  Starting
>>> simulation...
>>
>> build/X86/arch/x86/insts/static_inst.cc:252: panic: Unrecognized register
>>> class.
>>
>> Memory Usage: 630156 KBytes
>>
>> Program aborted at tick 1281000
>>
>> --- BEGIN LIBC BACKTRACE ---
>>
>> build/X86/gem5.opt(+0x10743b0)[0x5647381dc3b0]
>>
>> build/X86/gem5.opt(+0x10939ae)[0x5647381fb9ae]
>>
>> /lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7fa5889d33c0]
>>
>> /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7fa587f7618b]
>>
>> /lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7fa587f55859]
>>
>> build/X86/gem5.opt(+0x30e015)[0x564737476015]
>>
>> build/X86/gem5.opt(+0x7a6964)[0x56473790e964]
>>
>> build/X86/gem5.opt(+0x85464b)[0x5647379bc64b]
>>
>> build/X86/gem5.opt(+0xe9146d)[0x564737ff946d]
>>
>> build/X86/gem5.opt(+0xe838c9)[0x564737feb8c9]
>>
>> build/X86/gem5.opt(+0xfa9fcd)[0x564738111fcd]
>>
>> build/X86/gem5.opt(+0xfaadc1)[0x564738112dc1]
>>
>> build/X86/gem5.opt(+0xfac6c0)[0x5647381146c0]
>>
>> build/X86/gem5.opt(+0xfaca78)[0x564738114a78]
>>
>> build/X86/gem5.opt(+0xfbd4d9)[0x5647381254d9]
>>
>> build/X86/gem5.opt(+0x1081666)[0x5647381e9666]
>>
>> build/X86/gem5.opt(+0x10af3a4)[0x5647382173a4]
>>
>> build/X86/gem5.opt(+0x10afbf2)[0x564738217bf2]
>>
>> build/X86/gem5.opt(+0xc7d362)[0x564737de5362]
>>
>> build/X86/gem5.opt(+0x680583)[0x5647377e8583]
>>
>> /lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x2a8738)[0x7fa588c89738]
>>
>>
>>> /lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x8dd8)[0x7fa588a5ef48]
>>
>>
>>> /lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalCodeWithName+0x8fb)[0x7fa588babe3b]
>>
>>
>>> /lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyFunction_Vectorcall+0x94)[0x7fa588c89114]
>>
>> /lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x74d6d)[0x7fa588a55d6d]
>>
>>
>>> /lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x7d86)[0x7fa588a5def6]
>>
>> /lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x8006b)[0x7fa588a6106b]
>>
>> /lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x74d6d)[0x7fa588a55d6d]
>>
>>
>>> /lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x12fd)[0x7fa588a5746d]
>>
>>
>>> /lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalCodeWithName+0x8fb)[0x7fa588babe3b]
>>
>>
>>> /lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyFunction_Vectorcall+0x94)[0x7fa588c89114]
>>
>> /lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x74d6d)[0x7fa588a55d6d]
>>
>> --- END LIBC BACKTRACE ---
>>
>> Aborted
>>
>>
> Example command 2 (causing assertion error): build/X86/gem5.opt
> --debug-flags=Exec --debug-file=debug.txt --debug-start=1000
> configs/example/se.py --cpu-type=O3CPU 

[gem5-users] static_inst.cc panic or assertion error when debugging execution of an x86 O3CPU

2021-08-11 Thread Deric Cheung via gem5-users
Correction:
The host Operating System is Ubuntu 20.04.2 LTS
The host CPU is Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz

I built gem5 using `scons build/X86/gem5.opt`, from the latest stable
branch (v21.1.0.0)
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s