Hi All,
Is MARSSx86 able to count the cache hit ratio? I am not sure.
And, here is the way I count the L2_CACHE hit ratio in MARSSx86:
*#########################################################*
*bool CacheController::cache_access_cb(void *arg)
*
*{*
* CacheQueueEntry *queueEntry = (CacheQueueEntry*)arg;*
* if(queueEntry->annuled)*
* return true;*
* queueEntry->eventFlags[CACHE_ACCESS_EVENT]--;*
*
*
* if(cacheLines_->get_port(queueEntry->request)) {*
* CacheLine *line = cacheLines_->probe(queueEntry->request);*
* bool hit = (line == NULL) ? false : line->state;*
*
*
*
*
* #ifdef CONFIG_CACHE_HIT_RATIO*
* stringbuf sb;*
* cacheAccessTimes++;*
* if(hit)*
* cacheHitTimes++;*
* else *
* cacheMissTimes++;*
* if(get_cache_type() == L2_CACHE) {*
* sb << "Cache: " << get_name() <<*
* " Access " << cacheAccessTimes <<*
* " Hit " << cacheHitTimes << *
* " Retry " << cacheRetryTimes <<*
* " Miss " << cacheMissTimes << endl;*
* ptl_logfile << sb;*
* }*
* #endif*
* .................*
*#########################################################*
* cacheAccessTimes, cacheHitTimes and cacheMissTimes are the variables I
added in class CacheController and get_cache_type() is to get the type of
cahe.*
While, the data I got in this way seems unresonable..
CoresNum L2_CacheHitRatio 1 0.204246888 2 0.310282203 4 0.268968445 8
0.274661411
*
*
*The above data shows the L2_cache hit ratio of a PARSEC benckmark.*
*
*
*Theoretically, the value of L2_CacheHitRatio should decrease as the
increasement*
*of the number of cores. While, the result I got was not the same as my
expectation...*
*
*
*Is the way I count the L2_CacheHitRatio wrong ?*
*
*
*
*
_______________________________________________
http://www.marss86.org
Marss86-Devel mailing list
[email protected]
https://www.cs.binghamton.edu/mailman/listinfo/marss86-devel