Hi,
         I found one misleading stat in gem5. I added one 'Mostly
Exclusive' cache just below 'Data cache', that stores only dirty blocks
coming out of Data Cache. In stats file, i found that dirty writebacks out
of this 'Mostly Exclusive' cache are more than WritebackDirty_hits into
this cache
                WritebackDirty_hits::total < writebacks::total (Which does
not seem correct)
         During debugging, i found following reason for this problem.
         In case of 'Mostly Exclusive' cache data coming from lower level
cache is stored in 'tempblock' rather than actual cache because 'Mostly
Exclusive' caches are not required to store data coming from lower level
caches.
        When any dirty block temporarily stored into 'tempblock' is flushed
back to lower level cache (L2), extra 'writebacks' from 'Mostly Exclusive'
cache are generated.
        I think this is not correct, blocks stored into 'temp' block should
not be written back to lower level cache or atleast they should not
contribute 'writeback' stats in gem5.

          The 'tempblock' writebacks are generated in following code in
"void
Cache::recvTimingResp(PacketPtr pkt)" function in
gem5/src/mem/cache/cache.cc file.

if (blk == tempBlock && tempBlock->isValid()) {
        // We use forwardLatency here because we are copying
        // Writebacks/CleanEvicts to write buffer. It specifies the latency
to
        // allocate an internal buffer and to schedule an event to the
        // queued port.
        if (blk->isDirty() || writebackClean) {
            PacketPtr wbPkt = writebackBlk(blk);
            allocateWriteBuffer(wbPkt, forward_time);
            // Set BLOCK_CACHED flag if cached above.
            if (isCachedAbove(wbPkt))
                wbPkt->setBlockCached();
        } else {
            PacketPtr wcPkt = cleanEvictBlk(blk);
            // Check to see if block is cached above. If not allocate
            // write buffer
            if (isCachedAbove(wcPkt))
                delete wcPkt;
            else
                allocateWriteBuffer(wcPkt, forward_time);
        }
        invalidateBlock(blk);
    }
Can anyone please tell that whether above mentioned code needs some
modification or not?

Thanks
_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to