Discussion:
[gem5-users] reset stats counters
Summer Deng
2017-03-14 22:06:29 UTC
Permalink
Hi everyone,

Does anyone know how to reset gem5 stats after the execution has started, say after 1K instructions, ?

Thank you very much!
Best,
Summer
Wei Shu
2017-03-15 01:08:11 UTC
Permalink
Find the global variable of instruction count and make a if condition test in your code.

----- Original Message -----
From: "Summer Deng" <***@gmail.com>
To: gem5-***@gem5.org
Sent: Tuesday, March 14, 2017 5:06:29 PM
Subject: [gem5-users] reset stats counters

Hi everyone,

Does anyone know how to reset gem5 stats after the execution has started, say after 1K instructions, ?

Thank you very much!
Best,
Summer
_______________________________________________
gem5-users mailing list
gem5-***@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
Summer Deng
2017-03-15 15:45:09 UTC
Permalink
Thank you for your answer. My real question is about the stat reset function. What is that function? Can I call that function in the cpu code (src/cpu/o3/cpu.cc)?

Thanks!
Best,
Summer
On Mar 14, 2017, at 8:08 PM, Wei Shu <***@louisiana.edu> wrote:

> Find the global variable of instruction count and make a if condition test in your code.
>
> ----- Original Message -----
> From: "Summer Deng" <***@gmail.com>
> To: gem5-***@gem5.org
> Sent: Tuesday, March 14, 2017 5:06:29 PM
> Subject: [gem5-users] reset stats counters
>
> Hi everyone,
>
> Does anyone know how to reset gem5 stats after the execution has started, say after 1K instructions, ?
>
> Thank you very much!
> Best,
> Summer
> _______________________________________________
> gem5-users mailing list
> gem5-***@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
> _______________________________________________
> gem5-users mailing list
> gem5-***@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
Ferran Olid
2017-03-15 16:14:39 UTC
Permalink
Hi Summer,

There's a library in /src/python/m5 called m5op.h that you can use in
your benchmark to reset stats after N ticks. I am not quite sure if you
can call it from the cpu source code. You can also call it in the
/configs/common/Simulation.py file, although you may need to play a bit
with m5.simulate in order to reset the stats after some ticks or
instructions.

Hope this helped,
Ferran O.


On 15/03/17 16:45, Summer Deng wrote:
> Thank you for your answer. My real question is about the stat reset function. What is that function? Can I call that function in the cpu code (src/cpu/o3/cpu.cc)?
>
> Thanks!
> Best,
> Summer
> On Mar 14, 2017, at 8:08 PM, Wei Shu <***@louisiana.edu> wrote:
>
>> Find the global variable of instruction count and make a if condition test in your code.
>>
>> ----- Original Message -----
>> From: "Summer Deng" <***@gmail.com>
>> To: gem5-***@gem5.org
>> Sent: Tuesday, March 14, 2017 5:06:29 PM
>> Subject: [gem5-users] reset stats counters
>>
>> Hi everyone,
>>
>> Does anyone know how to reset gem5 stats after the execution has started, say after 1K instructions, ?
>>
>> Thank you very much!
>> Best,
>> Summer
>> _______________________________________________
>> gem5-users mailing list
>> gem5-***@gem5.org
>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>> _______________________________________________
>> gem5-users mailing list
>> gem5-***@gem5.org
>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
> _______________________________________________
> gem5-users mailing list
> gem5-***@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
Summer Deng
2017-03-15 16:18:03 UTC
Permalink
Thanks for your answer!

But I am running gem5 in SE mode. I believe the m5op.h libraries can only be used in FS mode. I found some functions(e.g. statdump, statreset) in src/sim/stat_control.hh. Do you know whether these function will do that? How should I call these functions?

Thank you!
Best,
Summer


On Mar 15, 2017, at 11:14 AM, Ferran Olid <***@metempsy.com> wrote:

> Hi Summer,
>
> There's a library in /src/python/m5 called m5op.h that you can use in
> your benchmark to reset stats after N ticks. I am not quite sure if you
> can call it from the cpu source code. You can also call it in the
> /configs/common/Simulation.py file, although you may need to play a bit
> with m5.simulate in order to reset the stats after some ticks or
> instructions.
>
> Hope this helped,
> Ferran O.
>
>
> On 15/03/17 16:45, Summer Deng wrote:
>> Thank you for your answer. My real question is about the stat reset function. What is that function? Can I call that function in the cpu code (src/cpu/o3/cpu.cc)?
>>
>> Thanks!
>> Best,
>> Summer
>> On Mar 14, 2017, at 8:08 PM, Wei Shu <***@louisiana.edu> wrote:
>>
>>> Find the global variable of instruction count and make a if condition test in your code.
>>>
>>> ----- Original Message -----
>>> From: "Summer Deng" <***@gmail.com>
>>> To: gem5-***@gem5.org
>>> Sent: Tuesday, March 14, 2017 5:06:29 PM
>>> Subject: [gem5-users] reset stats counters
>>>
>>> Hi everyone,
>>>
>>> Does anyone know how to reset gem5 stats after the execution has started, say after 1K instructions, ?
>>>
>>> Thank you very much!
>>> Best,
>>> Summer
>>> _______________________________________________
>>> gem5-users mailing list
>>> gem5-***@gem5.org
>>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>>> _______________________________________________
>>> gem5-users mailing list
>>> gem5-***@gem5.org
>>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>> _______________________________________________
>> gem5-users mailing list
>> gem5-***@gem5.org
>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>
>
> _______________________________________________
> gem5-users mailing list
> gem5-***@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
Ferran Olid
2017-03-15 16:32:33 UTC
Permalink
Hmmm true, I have never attempted to use it in SE mode, it makes sense
it would not work there. About the stat_control.hh, I've never dealed
with it before so I'm afraid I can't help you now.

Cheers,
Ferran O.


On 15/03/17 17:18, Summer Deng wrote:
> Thanks for your answer!
>
> But I am running gem5 in SE mode. I believe the m5op.h libraries can only be used in FS mode. I found some functions(e.g. statdump, statreset) in src/sim/stat_control.hh. Do you know whether these function will do that? How should I call these functions?
>
> Thank you!
> Best,
> Summer
>
>
> On Mar 15, 2017, at 11:14 AM, Ferran Olid <***@metempsy.com> wrote:
>
>> Hi Summer,
>>
>> There's a library in /src/python/m5 called m5op.h that you can use in
>> your benchmark to reset stats after N ticks. I am not quite sure if you
>> can call it from the cpu source code. You can also call it in the
>> /configs/common/Simulation.py file, although you may need to play a bit
>> with m5.simulate in order to reset the stats after some ticks or
>> instructions.
>>
>> Hope this helped,
>> Ferran O.
>>
>>
>> On 15/03/17 16:45, Summer Deng wrote:
>>> Thank you for your answer. My real question is about the stat reset function. What is that function? Can I call that function in the cpu code (src/cpu/o3/cpu.cc)?
>>>
>>> Thanks!
>>> Best,
>>> Summer
>>> On Mar 14, 2017, at 8:08 PM, Wei Shu <***@louisiana.edu> wrote:
>>>
>>>> Find the global variable of instruction count and make a if condition test in your code.
>>>>
>>>> ----- Original Message -----
>>>> From: "Summer Deng" <***@gmail.com>
>>>> To: gem5-***@gem5.org
>>>> Sent: Tuesday, March 14, 2017 5:06:29 PM
>>>> Subject: [gem5-users] reset stats counters
>>>>
>>>> Hi everyone,
>>>>
>>>> Does anyone know how to reset gem5 stats after the execution has started, say after 1K instructions, ?
>>>>
>>>> Thank you very much!
>>>> Best,
>>>> Summer
>>>> _______________________________________________
>>>> gem5-users mailing list
>>>> gem5-***@gem5.org
>>>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>>>> _______________________________________________
>>>> gem5-users mailing list
>>>> gem5-***@gem5.org
>>>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>>> _______________________________________________
>>> gem5-users mailing list
>>> gem5-***@gem5.org
>>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>>
>> _______________________________________________
>> gem5-users mailing list
>> gem5-***@gem5.org
>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
> _______________________________________________
> gem5-users mailing list
> gem5-***@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
Serhat Gesoglu
2017-03-15 16:36:18 UTC
Permalink
Hello,
I believe, you can use "m5_reset_stats" in SE mode, in your program. You may want to check util/m5/m5op.h and other related files in util/m5 directory.

Cheers
Serhat

________________________________________
From: gem5-users [gem5-users-***@gem5.org] on behalf of Summer Deng [***@gmail.com]
Sent: 15 March 2017 16:18
To: gem5 users mailing list
Subject: Re: [gem5-users] reset stats counters

Thanks for your answer!

But I am running gem5 in SE mode. I believe the m5op.h libraries can only be used in FS mode. I found some functions(e.g. statdump, statreset) in src/sim/stat_control.hh. Do you know whether these function will do that? How should I call these functions?

Thank you!
Best,
Summer


On Mar 15, 2017, at 11:14 AM, Ferran Olid <***@metempsy.com> wrote:

> Hi Summer,
>
> There's a library in /src/python/m5 called m5op.h that you can use in
> your benchmark to reset stats after N ticks. I am not quite sure if you
> can call it from the cpu source code. You can also call it in the
> /configs/common/Simulation.py file, although you may need to play a bit
> with m5.simulate in order to reset the stats after some ticks or
> instructions.
>
> Hope this helped,
> Ferran O.
>
>
> On 15/03/17 16:45, Summer Deng wrote:
>> Thank you for your answer. My real question is about the stat reset function. What is that function? Can I call that function in the cpu code (src/cpu/o3/cpu.cc)?
>>
>> Thanks!
>> Best,
>> Summer
>> On Mar 14, 2017, at 8:08 PM, Wei Shu <***@louisiana.edu> wrote:
>>
>>> Find the global variable of instruction count and make a if condition test in your code.
>>>
>>> ----- Original Message -----
>>> From: "Summer Deng" <***@gmail.com>
>>> To: gem5-***@gem5.org
>>> Sent: Tuesday, March 14, 2017 5:06:29 PM
>>> Subject: [gem5-users] reset stats counters
>>>
>>> Hi everyone,
>>>
>>> Does anyone know how to reset gem5 stats after the execution has started, say after 1K instructions, ?
>>>
>>> Thank you very much!
>>> Best,
>>> Summer
>>> _______________________________________________
>>> gem5-users mailing list
>>> gem5-***@gem5.org
>>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>>> _______________________________________________
>>> gem5-users mailing list
>>> gem5-***@gem5.org
>>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>> _______________________________________________
>> gem5-users mailing list
>> gem5-***@gem5.org
>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>
>
> _______________________________________________
> gem5-users mailing list
> gem5-***@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

_______________________________________________
gem5-users mailing list
gem5-***@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
Wei Shu
2017-03-16 02:22:03 UTC
Permalink
Hi Summer,

I know that in fs simulation, we can call m5 reset to reset all the stats by some period of ticks. But I am not sure about the se simulation.
Plus, your requirement is to reset stats after some number of instructions. That's what come up in my mind. Let's see if others have better idea.

Thanks,
Wei

----- Original Message -----
From: "Summer Deng" <***@gmail.com>
To: "gem5 users mailing list" <gem5-***@gem5.org>
Sent: Wednesday, March 15, 2017 10:45:09 AM
Subject: Re: [gem5-users] reset stats counters

Thank you for your answer. My real question is about the stat reset function. What is that function? Can I call that function in the cpu code (src/cpu/o3/cpu.cc)?

Thanks!
Best,
Summer
On Mar 14, 2017, at 8:08 PM, Wei Shu <***@louisiana.edu> wrote:

> Find the global variable of instruction count and make a if condition test in your code.
>
> ----- Original Message -----
> From: "Summer Deng" <***@gmail.com>
> To: gem5-***@gem5.org
> Sent: Tuesday, March 14, 2017 5:06:29 PM
> Subject: [gem5-users] reset stats counters
>
> Hi everyone,
>
> Does anyone know how to reset gem5 stats after the execution has started, say after 1K instructions, ?
>
> Thank you very much!
> Best,
> Summer
> _______________________________________________
> gem5-users mailing list
> gem5-***@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
> _______________________________________________
> gem5-users mailing list
> gem5-***@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
Jason Lowe-Power
2017-03-18 19:02:03 UTC
Permalink
Hi all,

You absolutely can reset stats in both SE mode and in FS mode! Resetting
stats can be done via magic instructions (which work in both SE and FS
mode) or via the Python config scripts. You can exit the simulation loop
(e.g., with a magic instruction or by hitting an instruction count limit)
and then call "m5.stats.reset()" to reset the stats.

Jason

On Wed, Mar 15, 2017 at 9:27 PM Wei Shu <***@louisiana.edu> wrote:

> Hi Summer,
>
> I know that in fs simulation, we can call m5 reset to reset all the stats
> by some period of ticks. But I am not sure about the se simulation.
> Plus, your requirement is to reset stats after some number of
> instructions. That's what come up in my mind. Let's see if others have
> better idea.
>
> Thanks,
> Wei
>
> ----- Original Message -----
> From: "Summer Deng" <***@gmail.com>
> To: "gem5 users mailing list" <gem5-***@gem5.org>
> Sent: Wednesday, March 15, 2017 10:45:09 AM
> Subject: Re: [gem5-users] reset stats counters
>
> Thank you for your answer. My real question is about the stat reset
> function. What is that function? Can I call that function in the cpu code
> (src/cpu/o3/cpu.cc)?
>
> Thanks!
> Best,
> Summer
> On Mar 14, 2017, at 8:08 PM, Wei Shu <***@louisiana.edu> wrote:
>
> > Find the global variable of instruction count and make a if condition
> test in your code.
> >
> > ----- Original Message -----
> > From: "Summer Deng" <***@gmail.com>
> > To: gem5-***@gem5.org
> > Sent: Tuesday, March 14, 2017 5:06:29 PM
> > Subject: [gem5-users] reset stats counters
> >
> > Hi everyone,
> >
> > Does anyone know how to reset gem5 stats after the execution has
> started, say after 1K instructions, ?
> >
> > Thank you very much!
> > Best,
> > Summer
> > _______________________________________________
> > gem5-users mailing list
> > gem5-***@gem5.org
> > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
> > _______________________________________________
> > gem5-users mailing list
> > gem5-***@gem5.org
> > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>
> _______________________________________________
> gem5-users mailing list
> gem5-***@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
> _______________________________________________
> gem5-users mailing list
> gem5-***@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
Continue reading on narkive:
Loading...