[gem5-users] Supplementing experiment Data///答复: How to make scheduleInstStop() function to stop simulate at an accurate expected instructions counts for one core KVM/ATOMIC/O3 CPU simulation?

2020-08-06 Thread Liyichao via gem5-users


Hi All:


I use the scheduleInstStop() function to let the m5.simulate() stop at a point 
instrutions as my ROI start, for example: 1(100M) instrutions, but when 
the simulate stop, I print the instructions from last start simulation to the 
end, the count always exceed my specified instrutions(100M), like 100423403, 
about 0.4% exceeded. If I set to 137579444 in O3 cpu, when simulation stop, 
totalInsts() print 121264766,about 12% instruction number error.



The more detail the CPU is or the less expected instruction we set to 
scheduleInstStop() , the more error rate the result is.

Can the scheduleInstStop() function to stop simulate at an accurate instrutions 
count?



Below is my experiment data:

SP means each ROI segment number

WT means weight each SP

KVM FF INSTS means expected fastforward instrutions  set to shceduleInstsStop 
in KVM CPU and KVM FF INSTS REAL means actural instructions when simulation 
stopped.

Thes same as DETAIL WARMUP INSTS and DETAIL WARMUP INSTS REAL, ROI START REAL

DETAIL SIM INSTS REAL means actural instructions when simulation stopped.



SP


ROI START INSTS


ROI INSTS


WT


GEM5 CPU time(s)


KVM FF INSTS REAL


KVM FF INSTS


KVM FF ERROR


DETAIL WARMUP INSTS REAL


DETAIL WARMUP INSTS


DETAIL WARMUP ERROR  RATE


ROI START REAL


ROI START ERROR


ROI START ERROR RATE


DETAIL SIM INSTS REAL


ROI ERROR


ROI ERROR RATE


253


10178192697


7961215


0.0831


235.37


10168198363


10168192697


0.56%


11769096


1000


17.69%


10179967459


1774762


0.01744%


9765795


1804580


22.67%


489


14993215251


28956263


0.0807


480.69


14985233613


14983215251


0.013471%


12670891


1000


26.71%


14997904504


4689253


0.03128%


31630388


2674125


9.24%


745


20961513684


7952028


0.0831


366.16


20951519275


20951513684


0.27%


10930605


1000


9.31%


20962449880


936196


0.00447%


9196796


1244768


15.65%


747


20985389544


7913399


0.0831


368.9


20976588014


20975389544


0.005714%


13508368


1000


35.08%


20990096382


4706838


0.02243%


8729639


816240


10.31%


1535


36747557633


71903019


0.0489


852.12


36737563780


36737557633


0.17%


13915280


1000


39.15%


36751479060


3921427


0.01067%


76114831


4211812


5.86%


1576


39801482033


72581100


0.0489


986.37


39791620332


39791482033


0.000348%


13898089


1000


38.98%


39805518421


4036388


0.01014%


76712281


4131181


5.69%


1630


41397216547


7969257


0.0831


576.6


41387222182


41387216547


0.14%


14108619


1000


41.09%


41401330801


4114254


0.00994%


12213236


4243979


53.25%


1678


41875758899


7945777


0.0831


578.1


41871459914


41865758899


0.013617%


14214926


1000


42.15%


41885674840


9915941


0.02368%


12108036


4162259


52.38%


1884


46344067975


28927369


0.0807


845.82


46334073500


46334067975


0.12%


11344254


1000


13.44%


46345417754


1349779


0.00291%


31850077


2922708


10.10%


1919


47342402174


28905117


0.0807


805.16


47332436420


47332402174


0.72%


12802266


1000


28.02%


47345238686


2836512


0.00599%


31773934


2868817


9.92%


1926


47542229035


28886691


0.0807


787.53


47534320414


47532229035


0.004400%


12709174


1000


27.09%


47547029588


4800553


0.01010%


31731786


2845095


9.85%


1940


47914392807


28885810


0.0807


761.57


47904398647


47904392807


0.12%


12542440


1000


25.42%


47916941087


2548280


0.00532%


31799566


2913756


10.09%


2756


62457880622


7895848


0.0831


504.08


62447886490


62447880622


0.09%


13888058


1000


38.88%


62461774548


3893926


0.00623%


11734236


3838388


48.61%




___
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] How to make scheduleInstStop() function to stop simulate at an accurate expected instructions counts for one core KVM/ATOMIC/O3 CPU simulation?

2020-08-06 Thread Liyichao via gem5-users

Hi All:


I use the scheduleInstStop() function to let the m5.simulate() stop at a point 
instrutions as my ROI start, for example: 1(100M) instrutions, but when 
the simulate stop, I print the instructions from last start simulation to the 
end, the count always exceed my specified instrutions(100M), like 100423403, 
about 0.4% exceeded. If I set to 137579444 in O3 cpu, when simulation stop, 
totalInsts() print 121264766,about 12% instruction number error.



The more detail the CPU is or the less expected instruction we set to 
scheduleInstStop() , the more error rate the result is.

Can the scheduleInstStop() function to stop simulate at an accurate instrutions 
count?



___
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: Reading from memory in Gem5

2020-08-06 Thread ABD ALRHMAN ABO ALKHEEL via gem5-users
Hi Jason,

I want to clarify what I want to do; I want to run a program on gem5 (in SE 
mode) for 1M instructions and I want to save the memory addresses that every LD 
instruction loads data from ( I can get those addresses from the pushRequest 
method in the lsq) http://doxygen.gem5.org/release/current/classLSQ.html and 
saving those addresses in a table (map). After a specific time for example 
(every100k instructions), I want to access the memory to read the data from 
those addresses. For instance, let us assume that the address that load 
instruction loads data from it is (0x78226e68), can I read the content of 
this memory address? Also can I read the 256 bytes of this address 
(0x78226e00-0x78226eff)? If so, how?

Thanks



From: Jason Lowe-Power 
Sent: Tuesday, August 4, 2020 4:41 PM
To: ABD ALRHMAN ABO ALKHEEL ; gem5 users mailing list 

Subject: Re: [gem5-users] Re: Reading from memory in Gem5

Hello,

First of all, please reply to the users list, not directly to the person who 
responded. This allows everyone to see answers and/or chime in and help.

Second, the page you linked is out of date. Please use the main gem5 website 
for all of the up to date documentation (e.g., 
http://doxygen.gem5.org/release/current/classLSQUnit.html)

Third, I still don't fully understand what your goals are. However, you can use 
the system port (actually, I think I was wrong before, you should use the 
"getPort" function, not "getSystemPort") to make functional (or debug) accesses 
to the memory. You can create a `Packet` with a `Request` and send a functional 
request across the port (i.e., call sendFunctional(pkt)). You can use either 
virtual (in SE mode) or physical address (in both modes). I am sure there are 
some caveats to using virtual addresses, but I don't know exactly what they are.

If you're trying to make new timing accesses, then you should use the main 
"dcache_port" and "icache_port" that are connected to the CPU. Again, you can 
construct a Packet object with a Request and send it across the port (e.g., 
sendTimingReq(pkt)).

You may want to read up on the details of how gem5's memory objects work: 
http://www.gem5.org/documentation/learning_gem5/part2/memoryobject/

Cheers,
Jason



On Mon, Aug 3, 2020 at 1:15 PM ABD ALRHMAN ABO ALKHEEL 
mailto:abdkeel...@hotmail.com>> wrote:
Hi Jason,

Thanks for your email.

What I want to do is finding the memory address that the LD instruction loads 
data from ( I can get the physical and virtual address from the Read method in 
the lsqunit)http://pages.cs.wisc.edu/~swilson/gem5-docs/classLSQUnit.html and 
saving those addresses. After a specific time, I want to access the memory to 
read the data from those addresses. Can I use getSystemPort function to access 
the memory and read the data from those addresses? If so, should I use the 
virtual address or the physical address?

Thanks



From: Jason Lowe-Power mailto:ja...@lowepower.com>>
Sent: Monday, August 3, 2020 3:26 PM
To: gem5 users mailing list mailto:gem5-users@gem5.org>>
Cc: gem5-users 
mailto:gem5-users-boun...@gem5.org>>; ABD ALRHMAN 
ABO ALKHEEL mailto:abdkeel...@hotmail.com>>
Subject: Re: [gem5-users] Re: Reading from memory in Gem5

Hello,

This sounds like you probably want to use "functional" accesses. These are 
built for introspection and debugging, which is what it sounds like you want to 
do. Using the System object, there is a `getSystemPort` function that will 
return a gem5 port that you can use with functional accesses to "backdoor" into 
the memory. See 
http://doxygen.gem5.org/release/current/classSystem.html#a5ecbd1eaa3e0d19f4640bb71a0b59d64.

Cheers,
Jason

On Sun, Aug 2, 2020 at 7:01 AM ABD ALRHMAN ABO ALKHEEL via gem5-users 
mailto:gem5-users@gem5.org>> wrote:
Hi All, how to read data from memory in Gem5 ? Can I read data from memory in 
Gem5  for a specific addresses? If so, should I use the virtual address or 
physical address? For example, how load instructions read the data from memory? 
Any help would be appreciated. Thanks


From: ABD ALRHMAN ABO ALKHEEL
Sent: Saturday, August 1, 2020 3:19 PM
To: gem5 users mailing list mailto:gem5-users@gem5.org>>; 
gem5-users mailto:gem5-users-boun...@gem5.org>>
Subject: Reading from memory in Gem5

Hi All, how to read data from memory in Gem5 ? Can I read data from memory in 
Gem5  for a specific addresses? If so, should I use the virtual address or 
physical address? For example, how load instructions read the data from memory? 
Any help would be appreciated. Thanks
___
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

[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

[gem5-users] Getting tick number from C code

2020-08-06 Thread Muhammad Aamir via gem5-users
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] Re: gem5 aborted when increase mem-size in FS mode

2020-08-06 Thread Ciro Santilli via gem5-users
Does it crash immediately? If so, provide to us and look at the
backtrace to try and determine which allocation fails. If that doesn't
help, you can also try techniques mentioned at:
https://stackoverflow.com/questions/6261201/how-to-find-memory-leak-in-a-c-code-project/57877190#57877190

On Thu, Aug 6, 2020 at 2:44 AM syf1997--- via gem5-users
 wrote:
>
> Hi Jason,
>
> Thank you for your reply. I am using the latest version 20.3. I have just 
> double-checked the memory usage info of gem5. It showed that memory usage is 
> about 10GB, while I run gem5 on a 128GB memory server. I don't think my 
> system ran out of memory. I am confused about it.
>
> Yifan Song
>
> -原始邮件-
> 发件人:"Jason Lowe-Power via gem5-users" 
> 发送时间:2020-08-06 01:13:59 (星期四)
> 收件人: "gem5 users mailing list" 
> 抄送: syf1...@mail.ustc.edu.cn, "Jason Lowe-Power" 
> 主题: [gem5-users] Re: gem5 aborted when increase mem-size in FS mode
>
> Hi Yifan,
>
> Is it possible that your system is running out of memory? It's possible this 
> is a gem5 bug (what version are you using?), but I haven't heard of this 
> issue before.
>
> Cheers,
> Jason
>
> On Wed, Aug 5, 2020 at 1:34 AM syf1997--- via gem5-users 
>  wrote:
>>
>> Hi all,
>>
>> I am trying to run my own program (training a tiny vgg16 CNN model using 
>> CPU) in FS mode. I have created my own disk image and installed python3 and 
>> pytorch on it. My command line is as bellow:
>>
>> build/X86/gem5.opt configs/example/fs.py --kernel=binary/vmlinux-5.2.4 
>> --disk-image=disk/linux-x86.img -n 2 --caches --l2cache --mem-size=4GB
>>
>> If I set the mem-size small, like 512MB, 1GB, 2GB, my program could run 
>> normally but would fail due to the small memory. On the other hand, if I 
>> increase the mem-size, my program could not run and gem5 aborted (core 
>> dump). Could anyone give me some advice? Thanks.
>>
>> Best regards,
>>
>> Yifan
>>
>> ___
>> 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] Running two programs in parallel

2020-08-06 Thread Yogesh Chhabra via gem5-users
Hi all,

I want to run 2 X86 programs in gem5. These programs are related to spectre
attacks; they analyze memory access times to communicate with each other; *so
they have to be run in parallel in two separate cores, sharing the lowest
level cache*. Is that achievable in SE mode? When I set num-cpu=2 and use a
';' to give 2 programs to gem5, these are relayed one after other.

I thought of doing this using mthreads, but I am having trouble even
compiling mthreads. I couldn't find any detailed instructions about using
mthreads. Can someone please help me?

Thanks,
Yogesh
___
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