Hi Shervin,
Sorry about the late reply, I just came back after a few weeks of holiday.
When dumping statistics for multiple cores, there are at least three
different points in instruction time that you might want to use:
* A point where /all/ cores have executed N instructions.
* A point when /at least/ one core has executed N instructions.
* A point when the sum of all executed instructions is M.
The first two can be implemented in you configuration script by
scheduling breakpoints from python using the cpu.schedulInstStop API.
Just schedule one instruction stop per CPU and dump statistics when the
first event is returned or after all events have been returned.
The third is a bit more tricky. There is currently no support for
scheduling such exit events, but there is already an instruction queue
in the System object that can be used to implement this. In order to
implement that, you need to implement an scheduleInstStop() method on
the System object that schedules an exit in the instEventQueue. Events
in this queue are triggered based on the total number of instructions
executed in the system. Support for this exists, at least, in the Simple
CPUs, but the code isn't used anywhere so your mileage may vary.
I'd argue that the using the total number of instructions probably makes
most sense when profiling multicore applications, but it really depends
on what you're doing.
//Andreas
On 07/24/2013 04:00 AM, shervin hajiamini wrote:
Hi Andreas,
Thank you very much for your help. Using link #2 which you suggested
in your reply, I can dump the stats ever fixed number of instructions!
I want to dump the statistics with more than one core and I am
wondering how I should use/call scheduleInstStop function in the
simulation loop when gem5 simulates multiple cores. I would appreciate
if you could clarify this for me. Please let me know if I need to
consider anything else for dumping the statistics with multiple cores.
Thank you very much,
Shervin
------------------------------------------------------------------------
**Message: 3
Date: Tue, 21 May 2013 16:26:16 +0200
From: Andreas Sandberg <[email protected]
<mailto:[email protected]>>
To: gem5 users mailing list <[email protected]
<mailto:[email protected]>>
Subject: Re: [gem5-users] Dumping stats every period of fixed number
of instructions
Message-ID: <[email protected]
<mailto:[email protected]>>
Content-Type: text/plain; charset=windows-1252; format=flowed
Hi Shervin,
Negar is right in that there is currently no good way of stopping the
simulator every N instructions to dump statistics. I needed to do the
same thing some time ago and added support for it in my local 'fixes'
branch of gem5 [1]. The changeset you want is [2]. I haven't pushed the
patch for review yet, but I intend to do so sometime soon.
When you have that changeset applied, you simply do something like the
following in your simulation loop:
your_cpu_object.scheduleInstStop(0, no_instructions_into_the_future,
"dump statistics")
event = m5.simulate()
if event.getCause() == "dump statistics":
m5.stats.dump()
else:
# Handle other exit events here
pass
There are two gotchas here:
* The exit event scheduled by scheduleInstStop is removed when it is
triggered. You have to schedule a new one if you want another exit after
it triggers.
* If m5.simulate() exits with a different cause than 'dump statistics',
you might have to continue simulating. The instruction stop event will
still be in the event queue, so you shouldn't reschedule it in that
case. That's not handled correctly in the example above.
//Andreas
[1] https://github.com/andysan/gem5/
[2]
https://github.com/andysan/gem5/commit/d649b66f944c9465ee80fbdb10a2766a36798e3e
On 05/21/2013 12:29 PM, Negar Miralaei wrote:
> Hi Shervin,
>
> you can dump stats in the Simulation.py file by calling
> "m5.stats.dump()". I'm not sure how you can dump stats for fixed
> number of instructions (it's easier to do that based on time
> intervals), but you can create checkpoints at specific instruction
> numbers with the option "--at-instruction". Then, restore it from the
> checkpoint to execute for your interval length. However, it should be
> some easier ways to dump stats based on the number of instructions,
> maybe someone else knows!
>
> Cheers
> Negar
>
> On 19/05/2013 00:43, shervin hajiamini wrote:
>>
>> Hi all,
>>
>>
>> I want to dump stats.txt every fixed interval of instructions. There
>> are already some posted messages in the mailing list about using
>> ?testsys.cpu[i].max_insts_any_thread = options.maxinsts? in
>> Simulation.py. I have tested those suggestions but they don?t seem to
>> work.
>>
>>
>> Can anybody please tell me how I should modify Simulation.py so that
>> stats.txt is dumped periodically based on a fixed number of
>> instructions? I want to dump stats just in the ROI of a benchmark.
>>
>>
>> Thanks,
>>
>> Shervin
>>
>>
>>
>> _______________________________________________
>> gem5-users mailing list
>> [email protected] <mailto:[email protected]>
>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>
>
>
> _______________________________________________
> gem5-users mailing list
> [email protected] <mailto:[email protected]>
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
------------------------------
_______________________________________________
gem5-users mailing list
[email protected] <mailto:[email protected]>
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
End of gem5-users Digest, Vol 82, Issue 42
******************************************
_______________________________________________
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