changeset ee56bb539212 in /z/repo/m5 details: http://repo.m5sim.org/m5?cmd=changeset;node=ee56bb539212 description: Change the findBlock(addr, lat) to accessBlock, which I think has better connotations for what is really happening and how it should be used.
diffstat: 3 files changed, 11 insertions(+), 6 deletions(-) src/mem/cache/tags/fa_lru.hh | 6 ++++-- src/mem/cache/tags/iic.hh | 6 ++++-- src/mem/cache/tags/lru.hh | 5 +++-- diffs (121 lines): diff -r e8c1d4e669a7 -r ee56bb539212 src/mem/cache/cache_impl.hh --- a/src/mem/cache/cache_impl.hh Tue Nov 04 11:35:42 2008 -0500 +++ b/src/mem/cache/cache_impl.hh Tue Nov 04 11:35:57 2008 -0500 @@ -269,7 +269,7 @@ return false; } - blk = tags->findBlock(pkt->getAddr(), lat); + blk = tags->accessBlock(pkt->getAddr(), lat); if (prefetchAccess) { //We are determining prefetches on access stream, call prefetcher diff -r e8c1d4e669a7 -r ee56bb539212 src/mem/cache/tags/fa_lru.cc --- a/src/mem/cache/tags/fa_lru.cc Tue Nov 04 11:35:42 2008 -0500 +++ b/src/mem/cache/tags/fa_lru.cc Tue Nov 04 11:35:57 2008 -0500 @@ -155,7 +155,7 @@ } FALRUBlk* -FALRU::findBlock(Addr addr, int &lat, int *inCache) +FALRU::accessBlock(Addr addr, int &lat, int *inCache) { accesses++; int tmp_in_cache = 0; diff -r e8c1d4e669a7 -r ee56bb539212 src/mem/cache/tags/fa_lru.hh --- a/src/mem/cache/tags/fa_lru.hh Tue Nov 04 11:35:42 2008 -0500 +++ b/src/mem/cache/tags/fa_lru.hh Tue Nov 04 11:35:57 2008 -0500 @@ -171,15 +171,17 @@ void invalidateBlk(BlkType *blk); /** - * Find the block in the cache and update the replacement data. Returns - * the access latency and the in cache flags as a side effect + * Access block and update replacement data. May not succeed, in which case + * NULL pointer is returned. This has all the implications of a cache + * access and should only be used as such. + * Returns the access latency and inCache flags as a side effect. * @param addr The address to look for. * @param asid The address space ID. * @param lat The latency of the access. * @param inCache The FALRUBlk::inCache flags. * @return Pointer to the cache block. */ - FALRUBlk* findBlock(Addr addr, int &lat, int *inCache = 0); + FALRUBlk* accessBlock(Addr addr, int &lat, int *inCache = 0); /** * Find the block in the cache, do not update the replacement data. diff -r e8c1d4e669a7 -r ee56bb539212 src/mem/cache/tags/iic.cc --- a/src/mem/cache/tags/iic.cc Tue Nov 04 11:35:42 2008 -0500 +++ b/src/mem/cache/tags/iic.cc Tue Nov 04 11:35:57 2008 -0500 @@ -221,7 +221,7 @@ IICTag* -IIC::findBlock(Addr addr, int &lat) +IIC::accessBlock(Addr addr, int &lat) { Addr tag = extractTag(addr); unsigned set = hash(addr); diff -r e8c1d4e669a7 -r ee56bb539212 src/mem/cache/tags/iic.hh --- a/src/mem/cache/tags/iic.hh Tue Nov 04 11:35:42 2008 -0500 +++ b/src/mem/cache/tags/iic.hh Tue Nov 04 11:35:57 2008 -0500 @@ -410,14 +410,16 @@ void invalidateBlk(BlkType *blk); /** - * Find the block and update the replacement data. This call also returns - * the access latency as a side effect. + * Access block and update replacement data. May not succeed, in which case + * NULL pointer is returned. This has all the implications of a cache + * access and should only be used as such. + * Returns the access latency and inCache flags as a side effect. * @param addr The address to find. * @param asid The address space ID. * @param lat The access latency. * @return A pointer to the block found, if any. */ - IICTag* findBlock(Addr addr, int &lat); + IICTag* accessBlock(Addr addr, int &lat); /** * Find the block, do not update the replacement data. diff -r e8c1d4e669a7 -r ee56bb539212 src/mem/cache/tags/lru.cc --- a/src/mem/cache/tags/lru.cc Tue Nov 04 11:35:42 2008 -0500 +++ b/src/mem/cache/tags/lru.cc Tue Nov 04 11:35:57 2008 -0500 @@ -151,7 +151,7 @@ } LRUBlk* -LRU::findBlock(Addr addr, int &lat) +LRU::accessBlock(Addr addr, int &lat) { Addr tag = extractTag(addr); unsigned set = extractSet(addr); diff -r e8c1d4e669a7 -r ee56bb539212 src/mem/cache/tags/lru.hh --- a/src/mem/cache/tags/lru.hh Tue Nov 04 11:35:42 2008 -0500 +++ b/src/mem/cache/tags/lru.hh Tue Nov 04 11:35:57 2008 -0500 @@ -160,17 +160,19 @@ void invalidateBlk(BlkType *blk); /** - * Finds the given address in the cache and update replacement data. - * Returns the access latency as a side effect. + * Access block and update replacement data. May not succeed, in which case + * NULL pointer is returned. This has all the implications of a cache + * access and should only be used as such. Returns the access latency as a side effect. * @param addr The address to find. * @param asid The address space ID. * @param lat The access latency. * @return Pointer to the cache block if found. */ - LRUBlk* findBlock(Addr addr, int &lat); + LRUBlk* accessBlock(Addr addr, int &lat); /** * Finds the given address in the cache, do not update replacement data. + * i.e. This is a no-side-effect find of a block. * @param addr The address to find. * @param asid The address space ID. * @return Pointer to the cache block if found. _______________________________________________ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev