Hi Andreas,
I have used Invalidate and memWriteBack in cache_impl.hh:recvTimingSnoopReq.
Last line in this function makes a call to handleSnoop. Is this call required for Invalidate and WriteBack cases too or can I "return" right away? (I guess not, in case a line is cached higher up in hierarchy)? With this call, I see a crash in handleSnoop function after a series of function calls. It crashes at :
if (snoopPkt.memInhibitAsserted()) {
// cache-to-cache response from some upper cache
assert(!alreadyResponded);
pkt->assertMemInhibit();
} else {
delete snoopPkt.popSenderState(); --> Line Executed
}
if (snoopPkt.sharedAsserted()) { --> HERE
pkt->assertShared();
}
I dynamically create (new) Request and Packet instances while calling sendTimingSnoopReq (at the beginning of this call stack).
Any clue as what might be going wrong?
-Uday
-----Original Message-----
From: gem5-users-***@gem5.org [mailto:gem5-users-***@gem5.org] On Behalf Of Andreas Sandberg
Sent: Tuesday, July 02, 2013 5:46 PM
To: gem5 users mailing list
Subject: Re: [gem5-users] MemCmd for CleanInvalid
Hi Udaya,
The drain() call is used to make sure that there are no transactions pending. The actual writeback and invalidation is done by memWriteback() and memInvalidate(). The Python world controls draining and decides what needs to be done. In case of a checkpoint, it will first drain the system (calling drain() and simulate until all drain() methods return 0, see drain() in src/m5/simulate.py), and then write back dirty cache lines by calling memWriteback().
In the case of a classic cache, Cache::memWriteback() will call
Cache::writebackVisistor() for each of the blocks in the cache.
Similarly, there is a Cache::invalidateVisitor() that invalidates cache lines.
You will should be able to use the invalidateVisitor right away to invalidate cache lines without writing them to memory. You could use the writeback visitor to write blocks to memory. It will be functionally correct, however you won't get any timing information since it is completely functional (and updates /all/ copies of the block everywhere in the system). You probably need to implement something similar to
writebackVisitor() that sends an atomic or timing request (the request type depends on the current memory mode) to the next level in the memory hierarchy.
//Andreas
On 07/02/2013 01:18 PM, Ranga, L Udaya wrote:
>
> Hi Ali,
>
> Can you please help me identify the code that drains a cache?
>
> At checkpoint function (serialize()) in cache_impl.hh, there is a
> warning message to drain the cache if dirty. I could find drain()
> implementation in base_Cache.cc, but that expects a drainManager.
>
> 1.Is that the correct API to call in order to flush the cache?
>
> 2.How?
>
> Thanks,
>
> Uday
>
> *From:*gem5-users-***@gem5.org
> [mailto:gem5-users-***@gem5.org] *On Behalf Of *Ali Saidi
> *Sent:* Wednesday, June 26, 2013 11:34 AM
> *To:* gem5 users mailing list
> *Subject:* Re: [gem5-users] MemCmd for CleanInvalid
>
> There is some support for doing it for checkpointing, but there isn't
> a way to do it without checkpoint. If you want to do this you'd need
> to add the functionality.
>
> Ali
>
> On Jun 25, 2013, at 11:26 PM, "Ranga, L Udaya" <***@ti.com
> <mailto:***@ti.com>> wrote:
>
>
>
> Hi Ali,
>
> Is there a way to flush and/or invalidate cache line in Classic Memory
> System?
>
> Thanks,
> Uday
>
> ----------------------------------------------------------------------
> --
>
> *From:*gem5-users-***@gem5.org
> <mailto:gem5-users-***@gem5.org>[gem5-users-***@gem5.org
> <mailto:gem5-users-***@gem5.org>] on behalf of Ali Saidi
> [***@umich.edu <mailto:***@umich.edu>] *Sent:*Wednesday, June 26,
> 2013 9:22 AM
> *To:*gem5 users mailing list
> *Subject:*Re: [gem5-users] MemCmd for CleanInvalid
>
> Hi Uday,
>
> You would have to create a new command type to do this. However I
> think the flush requests as they are implemented are only supported in
> Ruby the classic memory system doesn't support them at the moment.
>
> Thanks,
>
> Ali
>
> On Jun 25, 2013, at 4:25 AM, "Ranga, L Udaya" <***@ti.com
> <mailto:***@ti.com>> wrote:
>
>
>
> Hi,
>
> I found MemCmd::FlushReq and MemCmd::InvalidationReq in gem5 MemCmd
> enum. How do I convey CleanInvalid command, whose definition is "cache
> clean and invalidate operation"? is there a way to place multiple
> commands in a single packet?
>
> Thanks,
>
> Uday
>
> _______________________________________________
> gem5-users mailing list
> gem5-***@gem5.org <mailto:gem5-***@gem5.org>
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>
> _______________________________________________
> gem5-users mailing list
> gem5-***@gem5.org <mailto: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