gem5-users@gem5.org

The gem5 Users mailing list

View all threads

how clflush is simulated in classic cache ( not ruby ) ?

KS
Khan Shaikhul Hadi
Tue, Aug 1, 2023 9:15 PM

As far as I understand, gem5 simulates functionality of clflush instruction
for classic cache. Can anyone explain how it do that ?

I traced Clflushopt::initiateAcc() function call which eventually
calls LSQ::pushRequest() function in lsq.cc. But after completion of
translation, it checks request->isMemAccessRequired() and isLoad both of
which returns falls. As a result it does not call write() function which
should put the instruction in store queue, instead just return
inst->getFault().

Without placing this request in the store queue, how does this request
reach the cache to invalid the block ?
Where gem5 get's timing for this clflush instruction  ?

Best
Shaikhul

As far as I understand, gem5 simulates functionality of clflush instruction for classic cache. Can anyone explain how it do that ? I traced Clflushopt::initiateAcc() function call which eventually calls LSQ::pushRequest() function in lsq.cc. But after completion of translation, it checks request->isMemAccessRequired() and isLoad both of which returns falls. As a result it does not call write() function which should put the instruction in store queue, instead just return inst->getFault(). Without placing this request in the store queue, how does this request reach the cache to invalid the block ? Where gem5 get's timing for this clflush instruction ? Best Shaikhul
EM
Eliot Moss
Tue, Aug 1, 2023 9:52 PM

On 8/1/2023 5:15 PM, Khan Shaikhul Hadi via gem5-users wrote:

As far as I understand, gem5 simulates functionality of clflush instruction for classic cache. Can
anyone explain how it do that ?

I traced Clflushopt::initiateAcc() function call which eventually calls LSQ::pushRequest() function
in lsq.cc. But after completion of translation, it checks request->isMemAccessRequired() and isLoad
both of which returns falls. As a result it does not call write() function which should put the
instruction in store queue, instead just return inst->getFault().

Without placing this request in the store queue, how does this request reach the cache to invalid
the block ?
Where gem5 get's timing for this clflush instruction  ?

My reading of the code suggests that request->isMemAccessRequired() will return true, since
this is a request.  Things will then move on to do the write.  Eventually a suitable packet
will be sent to memory (interestingly, it carries no data).

HTH

Eliot Moss

On 8/1/2023 5:15 PM, Khan Shaikhul Hadi via gem5-users wrote: > As far as I understand, gem5 simulates functionality of clflush instruction for classic cache. Can > anyone explain how it do that ? > > I traced Clflushopt::initiateAcc() function call which eventually calls LSQ::pushRequest() function > in lsq.cc. But after completion of translation, it checks request->isMemAccessRequired() and isLoad > both of which returns falls. As a result it does not call write() function which should put the > instruction in store queue, instead just return inst->getFault(). > > Without placing this request in the store queue, how does this request reach the cache to invalid > the block ? > Where gem5 get's timing for this clflush instruction  ? My reading of the code suggests that request->isMemAccessRequired() will return true, since this is a request. Things will then move on to do the write. Eventually a suitable packet will be sent to memory (interestingly, it carries no data). HTH Eliot Moss
KS
Khan Shaikhul Hadi
Wed, Aug 2, 2023 7:20 PM

But my gdb traces showing that request->isMemAccessRequired() is returning
false. That's where I'm confused. I'm running this simulation in SE mode.

Shaikhul

[image: ismemAccessRequired.png]

On Tue, Aug 1, 2023 at 5:52 PM Eliot Moss moss@cs.umass.edu wrote:

On 8/1/2023 5:15 PM, Khan Shaikhul Hadi via gem5-users wrote:

As far as I understand, gem5 simulates functionality of clflush

instruction for classic cache. Can

anyone explain how it do that ?

I traced Clflushopt::initiateAcc() function call which eventually

calls LSQ::pushRequest() function

in lsq.cc. But after completion of translation, it checks

request->isMemAccessRequired() and isLoad

both of which returns falls. As a result it does not call write()

function which should put the

instruction in store queue, instead just return inst->getFault().

Without placing this request in the store queue, how does this request

reach the cache to invalid

the block ?
Where gem5 get's timing for this clflush instruction  ?

My reading of the code suggests that request->isMemAccessRequired() will
return true, since
this is a request.  Things will then move on to do the write.  Eventually
a suitable packet
will be sent to memory (interestingly, it carries no data).

HTH

Eliot Moss

But my gdb traces showing that request->isMemAccessRequired() is returning false. That's where I'm confused. I'm running this simulation in SE mode. Shaikhul [image: ismemAccessRequired.png] On Tue, Aug 1, 2023 at 5:52 PM Eliot Moss <moss@cs.umass.edu> wrote: > On 8/1/2023 5:15 PM, Khan Shaikhul Hadi via gem5-users wrote: > > As far as I understand, gem5 simulates functionality of clflush > instruction for classic cache. Can > > anyone explain how it do that ? > > > > I traced Clflushopt::initiateAcc() function call which eventually > calls LSQ::pushRequest() function > > in lsq.cc. But after completion of translation, it checks > request->isMemAccessRequired() and isLoad > > both of which returns falls. As a result it does not call write() > function which should put the > > instruction in store queue, instead just return inst->getFault(). > > > > Without placing this request in the store queue, how does this request > reach the cache to invalid > > the block ? > > Where gem5 get's timing for this clflush instruction ? > > My reading of the code suggests that request->isMemAccessRequired() will > return true, since > this is a request. Things will then move on to do the write. Eventually > a suitable packet > will be sent to memory (interestingly, it carries no data). > > HTH > > Eliot Moss >
EM
Eliot Moss
Thu, Aug 3, 2023 1:38 AM

On 8/2/2023 3:20 PM, Khan Shaikhul Hadi via gem5-users wrote:

But my gdb traces showing that request->isMemAccessRequired() is returning false. That's where I'm
confused. I'm running this simulation in SE mode.

I always deal with FS mode, but I don't think that matters.

I wonder if the particular access in question is one to a page not currently
mapped.  That should result in silent suppression of the flush (no page fault),
I believe.

EM

On 8/2/2023 3:20 PM, Khan Shaikhul Hadi via gem5-users wrote: > > But my gdb traces showing that request->isMemAccessRequired() is returning false. That's where I'm > confused. I'm running this simulation in SE mode. I always deal with FS mode, but I don't think that matters. I wonder if the particular access in question is one to a page not currently mapped. That should result in silent suppression of the flush (no page fault), I believe. EM