Hi Ali,

Since you're doing something that isn't fully supported by the fs.py
script, I would suggest making your own config file. The fs.py script, and
the other supporting scripts in common/, are not very flexible, and when
you want to do something that is a little outside of the norm it becomes
very hard to make changes to those scripts.

To answer your question about the number of instructions, the CPU objects
have a function exposed to python which returns the number of instructions
the CPU has executed. Therefore, you can use this to figure out the number
of instructions from Python. Also, each CPU can cause the simulation to
exit after it has executed some number of instructions. In fact, I have
some scripts that do exactly this on my github page (
https://github.com/powerjg/gem5/tree/devel/simplefs/configs/myconfigs). My
scripts fast-forward with KVM instead of restoring from a checkpoint, but
the skeletons for the code are similar either way.

Let me know if you have more questions.

Jason

On Thu, Feb 2, 2017 at 5:41 AM Alsuwaiyan, Ali Saleh <[email protected]> wrote:

Hi everyone,


I'm relatively new to gem5 and came across a problem where I need to
perform the following:

1. reset the stats and checkpoint, both after 10M instructions

2. restore the checkpoint with detailed CPU type and run for 1B
instructions then stop


The problem is that both resetstats and checkpoint commands take the number
of ticks as input, while what I need is the number of instructions.


I know that this question has been asked previously (e.g.,
https://www.mail-archive.com/[email protected]/msg00489.html, a 2011
thread), however, no accurate answer has been provided.


Currently, I'm using ticks instead of instructions in step 1 above;
however, the number of instructions is different from one workload to
another, when keeping the number of ticks constant. Here is my command line
for step 1:


build/X86/gem5.opt configs/example/fs.py --caches
--disk-image=linux-x86-large.img --kernel=x86_64-vmlinux-3.2.24.smp
--l1d_size=128kB --l1i_size=128kB --l2cache --l2_size=8MB --l2_assoc=8
--cacheline_size=64 -n 4 --script=configs/boot/myworkloads/wd1.rcS -r 1
--rel-max-tick=250000000000


Here, checkpoint 1 is taken by the standard boot script
"hack_back_ckpt.rcS", which hands over control to wd1.rcS script after
restoring. Also, the rel-max-tick is set to stop the execution after the
checkpoint is created. The content of wd1.rcS is as follows:


#!/bin/sh


echo "delayed checkpoint..."

/sbin/m5 checkpoint   200000000

echo "delayed resetstat..."

/sbin/m5 resetstats   200000000


cd /myapps/spec/benchspec/CPU2006/437.leslie3d/data/ref/input


echo "Starting leslie3d..."

taskset 0x1
/myapps/spec/benchspec/CPU2006/437.leslie3d/exe/leslie3d_base.gcc43-64bit <
leslie3d.in > leslie3d.ref.out 2> leslie3d.ref.err &


echo "Starting leslie3d..."

taskset 0x2
/myapps/spec/benchspec/CPU2006/437.leslie3d/exe/leslie3d_base.gcc43-64bit <
leslie3d.in > leslie3d.ref.out2 2> leslie3d.ref.err2 &



cd /myapps/spec/benchspec/CPU2006/429.mcf/data/ref/input

echo "Starting mcf..."

taskset 0x4 /myapps/spec/benchspec/CPU2006/429.mcf/exe/mcf_base.gcc43-64bit
inp.in > mcf.ref.out 2> mcf.ref.err &


echo "Starting mcf..."

taskset 0x8 /myapps/spec/benchspec/CPU2006/429.mcf/exe/mcf_base.gcc43-64bit
inp.in > mcf.ref.out2 2> mcf.ref.err2 &


echo "Waiting ..."

wait

echo "finished!"


/sbin/m5 exit


When the script exists and the second checkpoint is created, I simply carry
on to step #2 using the command below:


build/X86/gem5.opt configs/example/fs.py --caches
--disk-image=linux-x86-large.img --kernel=x86_64-vmlinux-3.2.24.smp
--l1d_size=128kB --l1i_size=128kB --l2cache --l2_size=8MB --l2_assoc=8
--cacheline_size=64 -n 4 -r 2 --cpu-type=detailed -I 1000000000


I know that the "-I" option counts the instructions from the beginning, but
at least it uses instructions as a unit, not ticks.


I'm very sure someone has done something regarding this, i.e., resetstats
and checkpoint at "instruction#"  instead of at "tick#". I have seen this
done by many papers in the literature.


Your feedback is highly appreciated.


BTW, my gem5 revision number is 10791.


Thank you,

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

Reply via email to