Discussion:
[gem5-users] How to apply fast forwarding on Gem5 with -F flag
Ashkan Asgharzade
2016-10-24 10:10:46 UTC
Permalink
Hi Dear Users,
I am running gem5 in se mode with ARM ISA and i want to apply fast forwarding and also max_instructions on my run to control its accuracy and also simulation_elapsed_time. but when i used -F and -I flag, i encountered assertion failed.
"assert(old_itb_port->isConnected());"

first of all I want to ask what is itb_port and then how should i deal with this problem?
Thanks a lot due to reading my email and appreciate any suggestion for advance.

Ashkan Asgharzadeh
Swapnil Haria
2016-10-25 14:50:06 UTC
Permalink
Hey Ashkan,

The ITB and the DTB are the TLBs for the instruction and data accesses
respectively. The ITB port is the port hooking up the ITB to the CPU.

I am unable to trigger the assertion you saw when I tried this out myself.
What revision of gem5 are you on? I would suggest trying again with the
latest version of gem5.

Have you made any local changes? Having a few more details of your
simulation would also help us understand this.

Cheers,
Swapnil Haria,
Graduate Student,
Dept of Computer Sciences,
University of Wisconsin-Madison
Ashkan Asgharzade
2016-10-26 11:49:41 UTC
Permalink
Hi Swapnil,
Thanks a lot for responding my email.
1) The revision of gem5 that i am using is gem5-stable-629fe6e6c781.2) now i am running my simulation without any -F and -I flags to check whether without these flags my simulation will be done or not? but as you mentioned after this job, i will check the latest version and run in that.
3) yes, I have made some changes in dram_ctrl.cc file. I have implemented a new scheduling algorithm for Mem.Ctrl. to mitigate Timing Channel such that this scheduler isolates different applications in Time domain as different security-classes. by doing this, an attacker couldn't get any time trace to retrieve secret data such as private key.3') Another modification is that I don't use se.py and instead of it, i wrote another configuration file according to the learning_gem5 directory that is located in configs dir.4) for giving more details about my simulation, i can attach my configuration file if its no matter to take a look on it.
My question is that how can I append -F and -I flag into this config file, because i add itb and dtb connections into this config file but again i got the following error:        "assert(stalls[tid].iew); "i run spec-cpu2006 benchmark suite as my workload and when i used "bzip2" and "astar" along with -F and -I, i got the aforementioned error.
Config File also is attached.

appreciate due to responding my email.
Sincerely,Ashkan Asgharzadeh
Swapnil Haria
2016-10-28 14:15:49 UTC
Permalink
Hey Ashkan,

1) The gem5-stable repo will be decommissioned soon and you definitely
shouldn't be using that. You should definitely move to the latest release.

3) I don't think your dram changes are related to the error you are seeing.
Also, I don't see any code for fast forwarding in your config file.
Regarding the itb and the dtb connections, try comparing your script to the
learning_gem5 one -
https://github.com/powerjg/learning_gem5/blob/master/_static/scripts/part3/system.py
Finally, for -F and -I, check how they are implemented in the example gem5
scripts (mostly in configs/common/Simulation.py). You will need to do
something similar in your own config file.


Cheers,
Swapnil Haria,
Graduate Student,
Dept of Computer Sciences,
University of Wisconsin-Madison
Swapnil Haria
2016-11-01 13:51:44 UTC
Permalink
Hey Ashkan,

I looked over your config file briefly, and didn't find anything obviously
wrong with it. I would also add this just before you switch -

print '\n\n Switching because %s' %(exit_event.getCause())


This would ensure that the exit cause is printed, and once you know the
right exit cause, you can add a condition to ensure you are only switching
for that cause. For instance, it can be something like=
if exit_event.getCause() == "a thread reached the max instruction count":

Try passing small instruction counts to both -F and -I (making sure
fast_forward insts < max insts) to see if you are switching and stopping
correctly.

You are correct, after the switch, timing mode is enabled.


Cheers,
Swapnil Haria,
Graduate Student,
Dept of Computer Sciences,
University of Wisconsin-Madison
Post by Swapnil Haria
Hey Ashkan,
1) The gem5-stable repo will be decommissioned soon and you definitely
shouldn't be using that. You should definitely move to the latest release.
3) I don't think your dram changes are related to the error you are
seeing. Also, I don't see any code for fast forwarding in your config file.
Regarding the itb and the dtb connections, try comparing your script to the
learning_gem5 one - https://github.com/powerjg/learning_gem5/blob/master/_
static/scripts/part3/system.py
Finally, for -F and -I, check how they are implemented in the example gem5
scripts (mostly in configs/common/Simulation.py). You will need to do
something similar in your own config file.
Cheers,
Swapnil Haria,
Graduate Student,
Dept of Computer Sciences,
University of Wisconsin-Madison
Ashkan Asgharzade
2016-10-30 13:07:00 UTC
Permalink
Hi Dear Swapnil
according to our discussion about applying fast-forwarding on config-file, I want to let you know that my config file without any simulation-controller flag (such as -I, -F) works well and can run without any problem hopefully.
1) As you recommended, i add some parts from "Simulation.py" to apply the aforementioned flags. I attach this new config_file that if its possible to take look on it.I run it only for few seconds and didn't get any error.
2) at the end of the code i used this statement:(test_sys.mem_mode = 'timing')

do you think by this way my memory_mode is changed for the rest of my simulation?


Thanks a lot due to giving useful suggestions

Sincerely,
Ashkan Asgharzadeh
Ashkan Asgharzade
2016-10-30 13:08:34 UTC
Permalink
Hi Dear Swapnil


according to our discussion about applying fast-forwarding on config-file, I want to let you know that my config file without any simulation-controller flag (such as -I, -F) works well and can run without any problem hopefully.
1) As you recommended, i add some parts from "Simulation.py" to apply the aforementioned flags. I attach this new config_file that if its possible to take look on it.I run it only for few seconds and didn't get any error.
2) at the end of the code i used this statement:(test_sys.mem_mode = 'timing')

do you think by this way my memory_mode is changed for the rest of my simulation?


Thanks a lot due to giving useful suggestions

Sincerely,
Ashkan Asgharzadeh
Swapnil Haria
2016-11-01 14:00:12 UTC
Permalink
Hey Ashkan,

I looked over your config file briefly, and didn't find anything obviously
wrong with it. I would also add this just before you switch -

print '\n\n Switching because %s' %(exit_event.getCause())


This would ensure that the exit cause is printed, and once you know the
right exit cause, you can add a condition to ensure you are only switching
for that cause. For instance, it can be something like=
if exit_event.getCause() == "a thread reached the max instruction count":

Try passing small instruction counts to both -F and -I (making sure
fast_forward insts < max insts) to see if you are switching and stopping
correctly.

You are correct, after the switch, timing mode is enabled.


Cheers,
Swapnil Haria,
Graduate Student,
Dept of Computer Sciences,
University of Wisconsin-Madison

Loading...