Many thanks Ali and Amin!

I've tried to implement the call to a prefetcher by myself and came up with the 
following code.
I'm not very fluent in gem5's code yet and this code fragment can be completely 
incorrect.
For example I'm not sure about a snooping part which theoretically should check 
that the L1 doesn't have dirty version of the line requested by a prefetcher.
Could you please point to my mistakes.

It seems that I have them because the effect of 'on-access' prefetcher is 2x 
bigger than the effect of 'on-miss' prefetcher.
I think that the results should be different only with the complex memory 
access pattern but the benchmark I'm using does just streamed reads and writes 
to a different regions.

    if (prefetcher && (missHappened || prefetchOnAccess || (blk && 
blk->wasPrefetched()))) {
        PacketPtr pfPkt;

        if (blk) blk->status &= ~BlkHWPrefetched;
        prefetcher->notify(pkt, clockEdge());
        
        while ((pfPkt = prefetcher->getPacket()))
        {
            if (!tags->findBlock(pfPkt->getAddr()))
            {
                cpuSidePort->sendAtomicSnoop(pfPkt);

                if (pfPkt->memInhibitAsserted()) {
                    delete pfPkt;
                    continue;
                }

                PacketPtr busPfPkt = getBusPacket(pfPkt, NULL, 
pfPkt->needsExclusive());
                memSidePort->sendAtomic(busPfPkt);
                BlkType *pfBlock = handleFill(busPfPkt, NULL, writebacks);
                pfBlock->status |= BlkHWPrefetched;

                delete pfPkt;
                delete busPfPkt;
            }
        }
    }



>When the memory mode is set to atomic, the prefetcher is NOT activated. 
>As Ali mentioned, you can easily modify the cache_impl.hh to call prefetcher.
>You need to modify atomicAccess(). Take a look at timingAccess() and see how 
>prefetcher is notified in that function.
                                          
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to