[Gems-users] counting number of hits and misses


Date: Sun, 12 Mar 2006 11:52:07 -0800 (PST)
From: Rishi Jain <rjain@xxxxxxxxxxxx>
Subject: [Gems-users] counting number of hits and misses
Hi,
We are trying to modify the GEMS simulator for CMP protocol. We want to
keep track of hits and misses to the L2 cache on a per-processor basis.
We are thinking of adding required methods in ruby/system/CacheMemory.h,
which would be called by ruby/system/Sequencer.C in getRubyMemoryValue and
setRubyMemoryValue methods. We also plan to modify the Sequencer class to
include a member for the processor_id.


/* -------------------------------------------------------------- */
bool Sequencer::getRubyMemoryValue(const Address& addr, char* value, unsigned int size_in_bytes ) {
	...
	...
	if (Protocol::m_CMP && n->L2_CACHE_MEMBER_VARIABLE->tryCacheAccess(lineAddr, CacheRequestType_LD, dataPtr)){
		<do something>
		n->L2_CACHE_MEMBER_VARIABLE->incrementNumHits(m_processor_id); // m_processor_id is a member of Sequencer object
	}
	...
} // end getRubyMemoryValue
/* -------------------------------------------------------------- */

There would be a similar code for tracking number of misses. Also, these
two functions will be called from setRubyMemoryValue as well.


I was wondering if we could get some opinion about this approach. Are we
on the right track? And do we need something else besides this, to
implement the functionality?


thanks
rishi


[← Prev in Thread] Current Thread [Next in Thread→]