[gem5-users] Build gem5 on macOS

2019-10-23 Thread Tom Ray
   I have downloaded the gem5-master from the github, and want to build the 
gem5 on macos.


   However, it's not successfully built. The error is as follows:


#+BEGIN_SRC error_log


$ scons build/ARM/gem5.opt -j2
scons: Reading SConscript files ...
Warning: Protocol buffer compiler (protoc) not found.
 Please install protobuf-compiler for tracing support.
Info: Using Python config: /usr/bin/python2.7-config
Checking for C header file Python.h... (cached) yes
Checking for C library python2.7... (cached) yes
Checking for C library dl... (cached) yes
Checking for accept(0,0,0) in C++ library None... (cached) yes
Checking for zlibVersion() in C++ library z... (cached) yes
Checking for C header file valgrind/valgrind.h... (cached) no
Checking for clock_nanosleep(0,0,NULL,NULL) in C library None... (cached) no
Checking for clock_nanosleep(0,0,NULL,NULL) in C library rt... (cached) no
Checking for timer_create(CLOCK_MONOTONIC, NULL, NULL) in C library None... 
(cached) no
Checking for timer_create(CLOCK_MONOTONIC, NULL, NULL) in C library rt... 
(cached) no
Checking for C library tcmalloc... (cached) no
Checking for C library tcmalloc_minimal... (cached) no
You can get a 12% performance improvement by installing tcmalloc 
(libgoogle-perftools-dev package on Ubuntu or RedHat).
Checking for char temp; backtrace_symbols_fd((void*), 0, 0) in C library 
None... (cached) yes
Can't find library for POSIX clocks.
Checking for C header file fenv.h... (cached) yes
Checking for C header file png.h... (cached) yes
Checking for C header file linux/kvm.h... (cached) no
Info: Compatible header file  not found, disabling KVM support.
Checking for C header file linux/if_tun.h... (cached) no
Info: Compatible header file  not found.
Checking size of struct kvm_xsave ... (cached) no
Checking for member exclude_host in struct perf_event_attr...(cached) no
Package hdf5-serial was not found in the pkg-config search path.
Perhaps you should add the directory containing `hdf5-serial.pc'
to the PKG_CONFIG_PATH environment variable
No package 'hdf5-serial' found
Checking for hdf5-serial using pkg-config... no
Package hdf5 was not found in the pkg-config search path.
Perhaps you should add the directory containing `hdf5.pc'
to the PKG_CONFIG_PATH environment variable
No package 'hdf5' found
Checking for hdf5 using pkg-config... no
Checking for H5Fcreate("", 0, 0, 0) in C library hdf5... (cached) no
Warning: Couldn't find any HDF5 C++ libraries. Disabling
 HDF5 support.
Checking whether __i386__ is declared... (cached) no
Checking whether __x86_64__ is declared... (cached) yes
Building in /Users/cinsy/git/gem5-master/build/ARM
Using saved variables file /Users/cinsy/git/gem5-master/build/variables/ARM
scons: done reading SConscript files.
scons: Building targets ...
 [ CXX] ARM/arch/arm/generated/generic_cpu_exec_1.cc -> .o
 [ CXX] ARM/arch/arm/generated/generic_cpu_exec_2.cc -> .o
In file included from build/ARM/arch/arm/generated/generic_cpu_exec_1.cc:10:
build/ARM/arch/arm/generated/exec-ns.cc.inc:115:13: error: variable 'Mem' is 
used uninitialized whenever 'if' condition is false
  [-Werror,-Wsometimes-uninitialized]
if (fault == NoFault) {
^~~~
build/ARM/arch/arm/generated/exec-ns.cc.inc:120:73: note: uninitialized use 
occurs here
TypedAtomicOpFunctor *amo_op = new AtomicGeneric3Op(Mem, 
valRs, [](uint64_t* b, uint64_t a, uint64_t c){ if (a == *b){*b = c;} });
^~~
build/ARM/arch/arm/generated/exec-ns.cc.inc:115:9: note: remove the 'if' if its 
condition is always true
if (fault == NoFault) {
^~
build/ARM/arch/arm/generated/exec-ns.cc.inc:90:13: note: initialize the 
variable 'Mem' to silence this warning
uint64_t Mem;
^
 = 0
build/ARM/arch/arm/generated/exec-ns.cc.inc:183:13: error: variable 'Mem' is 
used uninitialized whenever 'if' condition is false
  [-Werror,-Wsometimes-uninitialized]
if (fault == NoFault) {
^~~~
build/ARM/arch/arm/generated/exec-ns.cc.inc:188:73: note: uninitialized use 
occurs here
TypedAtomicOpFunctor *amo_op = new AtomicGeneric3Op(Mem, 
valRs, [](uint64_t* b, uint64_t a, uint64_t c){ if (a == *b){*b = c;} });
^~~
build/ARM/arch/arm/generated/exec-ns.cc.inc:183:9: note: remove the 'if' if its 
condition is always true
if (fault == NoFault) {
^~
build/ARM/arch/arm/generated/exec-ns.cc.inc:160:13: note: initialize the 
variable 'Mem' to silence this warning
uint64_t Mem;
^
 = 0
build/ARM/arch/arm/generated/exec-ns.cc.inc:275:13: error: variable 'Mem' is 
used uninitialized whenever 'if' condition is false
  [-Werror,-Wsometimes-uninitialized]
if (fault == NoFault) {
^~~~

Re: [gem5-users] Printing stats in ROI

2019-10-23 Thread Prathap Kolakkampadath
Why don't you use existing m5_ pseudo instructions around ROI of the
benchmark. Note to compile your benchmark with the m5 library.

If you are looking for more data, you may also add them in respective
mem/cache file and compile the gem.

Regards,
Prathap

On Wed, Oct 23, 2019 at 4:41 PM Victor Kariofillis 
wrote:

> Hi,
>
> I have implemented pseudo instructions for recognizing the Region of
> Interest of the benchmarks that I am running. What I want to do is to start
> printing some information (cache data) to a file as soon as the ROI begins.
> This printing will be done through the base.cc file in mem/cache. I tried
> having a boolean "roi" variable in system.hh, so that it will globally
> available, but I'm getting compiler errors of multiple definitions. How can
> I have knowledge of whether the execution of the program is in the ROI in
> the base.cc file?
>
> I have another question also. Is it possible to delay this printing until
> the ROI ends? The problem I have with that is that when the "roiend" pseudo
> instruction is encountered, I dump the stats and exit the simulation. Is it
> possible to print these data from base.cc just as it is done with regstats
> before exiting the simulation?
>
> Thanks,
> Victor
> ___
> gem5-users mailing list
> gem5-users@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
___
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

[gem5-users] Printing stats in ROI

2019-10-23 Thread Victor Kariofillis
Hi,

I have implemented pseudo instructions for recognizing the Region of
Interest of the benchmarks that I am running. What I want to do is to start
printing some information (cache data) to a file as soon as the ROI begins.
This printing will be done through the base.cc file in mem/cache. I tried
having a boolean "roi" variable in system.hh, so that it will globally
available, but I'm getting compiler errors of multiple definitions. How can
I have knowledge of whether the execution of the program is in the ROI in
the base.cc file?

I have another question also. Is it possible to delay this printing until
the ROI ends? The problem I have with that is that when the "roiend" pseudo
instruction is encountered, I dump the stats and exit the simulation. Is it
possible to print these data from base.cc just as it is done with regstats
before exiting the simulation?

Thanks,
Victor
___
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Re: [gem5-users] How to collect stats from my benchmark on FS mode

2019-10-23 Thread Iago .
Also I forgot to ask on the last message but could you specify which init 
script youre talking about and where i would put m5 checkpoint; m5 readfile | 
sh . The reason I worry is because testing from checkpoints made with 
hack_back_ckpt the results were very insconsistent running my control 
precompiled binary.I tried a couple of times and the results varied from 0.01 
to 0.0025 simulated seconds with different checkpoints of course, where as with 
the manual checkpoints the results were more simillar(still different of course 
since i was manually executing the script through m5 readfile |sh) only 
changing from 0.0025 to around 0.0026. I do agree that making these tests 
reproducible is  very important.
Thanks for the help again

De: Ciro Santilli 
Enviado: quarta-feira, 23 de outubro de 2019 17:32
Para: Iago . 
Cc: gem5 users mailing list 
Assunto: Re: [gem5-users] How to collect stats from my benchmark on FS mode

On Wed, Oct 23, 2019 at 7:37 PM Iago .  wrote:
>
> Sorry to ask but is there any reason to do it in the init script, isnt the 
> results of the control algorithm performance benchmark going to be affected 
> by the system still booting up?

You'd have to study your system to understand if the init starting
separate threads or not, and if you need that initialization or not.

To be able to better make sense of the benchmark, I would craft an
init that does not launch any userland processes, or else the stats
will be split across programs.

The Buildroot system I linked to, does not launch any processes,
Ubuntu likely spaws something, but we can just make it use our own
minimal init which does minimal initialization like mounting /proc
etc. and runs the benchmark witihout spawning anything else.

Running automatically without manual intervention is preferred to make
things reproducible.

> Also, i have sucessfully created a checkpoint on the simulation right after 
> the terminal shows root@genericarmv8:~# and am restoring to it and executing 
> the script through the command m5 readfile | sh , but when i check the 
> stats.txt there are two sets of simulation statistics, am I correct to assume 
> that the first one is from whenever I commanded the dumpstats and the last 
> one from whenever the simulation actually ends?

Correct.

> Thanks for the help anyway
> 
> De: Ciro Santilli 
> Enviado: quarta-feira, 23 de outubro de 2019 09:35
> Para: gem5 users mailing list ; 
> iagosilvestr...@hotmail.com 
> Assunto: Re: [gem5-users] How to collect stats from my benchmark on FS mode
>
> In summary:
>
> - run your benchmark from the init executable
> - to run a single benchmark with different parameters without
> rebooting, do in your init script: "m5 checkpoint; m5 readfile | sh".
> This is what the "configs/boot/hack_back_ckpt.rcS" but I think that
> script is overly complicated.
> - to modify the executable without having to reboot, attach a second
> disk image: 
> https://stackoverflow.com/questions/50862906/how-to-attach-multiple-disk-images-in-a-simulation-with-gem5-fs-py
> - to only count only benchmark instructions, do "m5 resetstats &&
> ./run-benchmark && m5 dumpstats". If that is not precise enough,
> modify the source of your benchmark with m5ops instructions that do
> resetstats and dumpstats
>
> Here's a fully automated Buildroot setup that helps with most of that:
> https://github.com/cirosantilli/linux-kernel-module-cheat/tree/d1f16390d0cd53a337e0014ce627803b1d6282de#gem5-run-benchmark
>
> On Tue, Oct 22, 2019 at 11:52 PM Iago .  wrote:
> >
> > I have been trying to use gem5 to analyze the performance of different 
> > control algorithms of an UAV. Using the full system mode simulation for 
> > that with an ARM image I would like to know if theres a way to write a 
> > script where I run my cross-compiled binary already moved to the system 
> > image and collect the stats only from the time it took to run the control 
> > binary.
> > ___
> > gem5-users mailing list
> > gem5-users@gem5.org
> > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
___
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Re: [gem5-users] How to collect stats from my benchmark on FS mode

2019-10-23 Thread Ciro Santilli
On Wed, Oct 23, 2019 at 7:37 PM Iago .  wrote:
>
> Sorry to ask but is there any reason to do it in the init script, isnt the 
> results of the control algorithm performance benchmark going to be affected 
> by the system still booting up?

You'd have to study your system to understand if the init starting
separate threads or not, and if you need that initialization or not.

To be able to better make sense of the benchmark, I would craft an
init that does not launch any userland processes, or else the stats
will be split across programs.

The Buildroot system I linked to, does not launch any processes,
Ubuntu likely spaws something, but we can just make it use our own
minimal init which does minimal initialization like mounting /proc
etc. and runs the benchmark witihout spawning anything else.

Running automatically without manual intervention is preferred to make
things reproducible.

> Also, i have sucessfully created a checkpoint on the simulation right after 
> the terminal shows root@genericarmv8:~# and am restoring to it and executing 
> the script through the command m5 readfile | sh , but when i check the 
> stats.txt there are two sets of simulation statistics, am I correct to assume 
> that the first one is from whenever I commanded the dumpstats and the last 
> one from whenever the simulation actually ends?

Correct.

> Thanks for the help anyway
> 
> De: Ciro Santilli 
> Enviado: quarta-feira, 23 de outubro de 2019 09:35
> Para: gem5 users mailing list ; 
> iagosilvestr...@hotmail.com 
> Assunto: Re: [gem5-users] How to collect stats from my benchmark on FS mode
>
> In summary:
>
> - run your benchmark from the init executable
> - to run a single benchmark with different parameters without
> rebooting, do in your init script: "m5 checkpoint; m5 readfile | sh".
> This is what the "configs/boot/hack_back_ckpt.rcS" but I think that
> script is overly complicated.
> - to modify the executable without having to reboot, attach a second
> disk image: 
> https://stackoverflow.com/questions/50862906/how-to-attach-multiple-disk-images-in-a-simulation-with-gem5-fs-py
> - to only count only benchmark instructions, do "m5 resetstats &&
> ./run-benchmark && m5 dumpstats". If that is not precise enough,
> modify the source of your benchmark with m5ops instructions that do
> resetstats and dumpstats
>
> Here's a fully automated Buildroot setup that helps with most of that:
> https://github.com/cirosantilli/linux-kernel-module-cheat/tree/d1f16390d0cd53a337e0014ce627803b1d6282de#gem5-run-benchmark
>
> On Tue, Oct 22, 2019 at 11:52 PM Iago .  wrote:
> >
> > I have been trying to use gem5 to analyze the performance of different 
> > control algorithms of an UAV. Using the full system mode simulation for 
> > that with an ARM image I would like to know if theres a way to write a 
> > script where I run my cross-compiled binary already moved to the system 
> > image and collect the stats only from the time it took to run the control 
> > binary.
> > ___
> > gem5-users mailing list
> > gem5-users@gem5.org
> > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
___
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

[gem5-users] Difference in results using hack_back_ckpt.rcS or manual checkpoint

2019-10-23 Thread Iago .
I am trying to determine control algorithms for an UAV performances using gem5 
and have a question regarding the scripts.
I have tried running my pre cross-compiled control binary in two different ways:
1º:
-Launching the gem5 simulation and waiting for terminal input
-creating a manual checkpoint
-restoring from that checkpoint passing a simple script as parameter and 
executing it through m5 readfile |sh:

m5 resetstats &&./controlS && m5 dumpstats
/sbin/m5 exit

2º:
-Launching gem5 simulation passing the hack_back_ckpt.rcS
-Restoring from the hack_back checkpoint with the above script as parameter

And the results vary so much I would like to understand why.For example at the 
temporal aspect the hack back test took 0.010121 seconds while the manual 
checkpoint usually is around 0.002541.
___
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Re: [gem5-users] How to collect stats from my benchmark on FS mode

2019-10-23 Thread Iago .
Sorry to ask but is there any reason to do it in the init script, isnt the 
results of the control algorithm performance benchmark going to be affected by 
the system still booting up?
Also, i have sucessfully created a checkpoint on the simulation right after the 
terminal shows root@genericarmv8:~# and am restoring to it and executing the 
script through the command m5 readfile | sh , but when i check the stats.txt 
there are two sets of simulation statistics, am I correct to assume that the 
first one is from whenever I commanded the dumpstats and the last one from 
whenever the simulation actually ends?
Thanks for the help anyway

De: Ciro Santilli 
Enviado: quarta-feira, 23 de outubro de 2019 09:35
Para: gem5 users mailing list ; 
iagosilvestr...@hotmail.com 
Assunto: Re: [gem5-users] How to collect stats from my benchmark on FS mode

In summary:

- run your benchmark from the init executable
- to run a single benchmark with different parameters without
rebooting, do in your init script: "m5 checkpoint; m5 readfile | sh".
This is what the "configs/boot/hack_back_ckpt.rcS" but I think that
script is overly complicated.
- to modify the executable without having to reboot, attach a second
disk image: 
https://stackoverflow.com/questions/50862906/how-to-attach-multiple-disk-images-in-a-simulation-with-gem5-fs-py
- to only count only benchmark instructions, do "m5 resetstats &&
./run-benchmark && m5 dumpstats". If that is not precise enough,
modify the source of your benchmark with m5ops instructions that do
resetstats and dumpstats

Here's a fully automated Buildroot setup that helps with most of that:
https://github.com/cirosantilli/linux-kernel-module-cheat/tree/d1f16390d0cd53a337e0014ce627803b1d6282de#gem5-run-benchmark

On Tue, Oct 22, 2019 at 11:52 PM Iago .  wrote:
>
> I have been trying to use gem5 to analyze the performance of different 
> control algorithms of an UAV. Using the full system mode simulation for that 
> with an ARM image I would like to know if theres a way to write a script 
> where I run my cross-compiled binary already moved to the system image and 
> collect the stats only from the time it took to run the control binary.
> ___
> gem5-users mailing list
> gem5-users@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
___
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Re: [gem5-users] How to collect stats from my benchmark on FS mode

2019-10-23 Thread Ciro Santilli
In summary:

- run your benchmark from the init executable
- to run a single benchmark with different parameters without
rebooting, do in your init script: "m5 checkpoint; m5 readfile | sh".
This is what the "configs/boot/hack_back_ckpt.rcS" but I think that
script is overly complicated.
- to modify the executable without having to reboot, attach a second
disk image: 
https://stackoverflow.com/questions/50862906/how-to-attach-multiple-disk-images-in-a-simulation-with-gem5-fs-py
- to only count only benchmark instructions, do "m5 resetstats &&
./run-benchmark && m5 dumpstats". If that is not precise enough,
modify the source of your benchmark with m5ops instructions that do
resetstats and dumpstats

Here's a fully automated Buildroot setup that helps with most of that:
https://github.com/cirosantilli/linux-kernel-module-cheat/tree/d1f16390d0cd53a337e0014ce627803b1d6282de#gem5-run-benchmark

On Tue, Oct 22, 2019 at 11:52 PM Iago .  wrote:
>
> I have been trying to use gem5 to analyze the performance of different 
> control algorithms of an UAV. Using the full system mode simulation for that 
> with an ARM image I would like to know if theres a way to write a script 
> where I run my cross-compiled binary already moved to the system image and 
> collect the stats only from the time it took to run the control binary.
> ___
> gem5-users mailing list
> gem5-users@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
___
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users