[gem5-users] Re: Getting tick number from C code

2020-08-06 Thread Muhammad Aamir via gem5-users
Hi Jason,
How would i use the m5.checkpoint() in the c code, as using the m5_rpns()
interferes with the normal run of the code and adds extra cycles.
I would like to do it with minimum interference with the normal running of
the code.

Thanks.


On Thu, 6 Aug 2020, 21:02 Jason Lowe-Power via gem5-users, <
gem5-users@gem5.org> wrote:

> You can also use curTick() from python. For instance:
>
> m5.simulate()
> m5.checkpoint()
> print(f'The current tick value is {m5.curTick()}')
>
> Cheers,
> Jason
>
> On Thu, Aug 6, 2020 at 10:17 AM Daniel Gerzhoy via gem5-users <
> gem5-users@gem5.org> wrote:
>
>> There is the m5_rpns() pseudo instruction that returns the current time
>> in nanoseconds. That is it returns:
>>
>> return curTick() / SimClock::Int::ns;
>>
>> That value is simply 10^3 (unless you've changed the ticks per second it
>> for some reason)
>> So you simply need to multiply the result of rpns() by 10^3
>>
>> For convenience I've made a new pseudo instruction that returns the ticks
>> value directly. (You could just comment out that division in rpns() as well
>> if you don't care to implement your own pseudo instruction.
>>
>> So I guess for your purposes, record the ticks at the beginning and end
>> of your function.
>>
>> Best,
>>
>> Dan
>>
>> On Thu, Aug 6, 2020 at 1:07 PM Muhammad Aamir via gem5-users <
>> gem5-users@gem5.org> wrote:
>>
>>> Hi everyone,
>>>
>>> Is there a way where I can set a checkpoint and print the tick number
>>> when gem5 has reached that checkpoint. What I would like to do is get the
>>> number of ticks a certain function has taken to run. Do m5ops have this
>>> capability or i have to use some other method.
>>>
>>> Any help would be appreciated.
>>>
>>> Thanks,
>>> Muhammad Aamir Saeed
>>> ___
>>> gem5-users mailing list -- gem5-users@gem5.org
>>> To unsubscribe send an email to gem5-users-le...@gem5.org
>>> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
>>
>> ___
>> gem5-users mailing list -- gem5-users@gem5.org
>> To unsubscribe send an email to gem5-users-le...@gem5.org
>> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
>
> ___
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Re: Getting tick number from C code

2020-08-06 Thread Jason Lowe-Power via gem5-users
You can also use curTick() from python. For instance:

m5.simulate()
m5.checkpoint()
print(f'The current tick value is {m5.curTick()}')

Cheers,
Jason

On Thu, Aug 6, 2020 at 10:17 AM Daniel Gerzhoy via gem5-users <
gem5-users@gem5.org> wrote:

> There is the m5_rpns() pseudo instruction that returns the current time in
> nanoseconds. That is it returns:
>
> return curTick() / SimClock::Int::ns;
>
> That value is simply 10^3 (unless you've changed the ticks per second it
> for some reason)
> So you simply need to multiply the result of rpns() by 10^3
>
> For convenience I've made a new pseudo instruction that returns the ticks
> value directly. (You could just comment out that division in rpns() as well
> if you don't care to implement your own pseudo instruction.
>
> So I guess for your purposes, record the ticks at the beginning and end of
> your function.
>
> Best,
>
> Dan
>
> On Thu, Aug 6, 2020 at 1:07 PM Muhammad Aamir via gem5-users <
> gem5-users@gem5.org> wrote:
>
>> Hi everyone,
>>
>> Is there a way where I can set a checkpoint and print the tick number
>> when gem5 has reached that checkpoint. What I would like to do is get the
>> number of ticks a certain function has taken to run. Do m5ops have this
>> capability or i have to use some other method.
>>
>> Any help would be appreciated.
>>
>> Thanks,
>> Muhammad Aamir Saeed
>> ___
>> gem5-users mailing list -- gem5-users@gem5.org
>> To unsubscribe send an email to gem5-users-le...@gem5.org
>> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
>
> ___
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Re: Getting tick number from C code

2020-08-06 Thread Daniel Gerzhoy via gem5-users
There is the m5_rpns() pseudo instruction that returns the current time in
nanoseconds. That is it returns:

return curTick() / SimClock::Int::ns;

That value is simply 10^3 (unless you've changed the ticks per second it
for some reason)
So you simply need to multiply the result of rpns() by 10^3

For convenience I've made a new pseudo instruction that returns the ticks
value directly. (You could just comment out that division in rpns() as well
if you don't care to implement your own pseudo instruction.

So I guess for your purposes, record the ticks at the beginning and end of
your function.

Best,

Dan

On Thu, Aug 6, 2020 at 1:07 PM Muhammad Aamir via gem5-users <
gem5-users@gem5.org> wrote:

> Hi everyone,
>
> Is there a way where I can set a checkpoint and print the tick number when
> gem5 has reached that checkpoint. What I would like to do is get the number
> of ticks a certain function has taken to run. Do m5ops have this capability
> or i have to use some other method.
>
> Any help would be appreciated.
>
> Thanks,
> Muhammad Aamir Saeed
> ___
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s