diff options
author | Daniel R. Carvalho <odanrc@yahoo.com.br> | 2018-02-27 14:31:59 +0100 |
---|---|---|
committer | Daniel Carvalho <odanrc@yahoo.com.br> | 2018-03-01 09:40:06 +0000 |
commit | 2a714355506200d281175e49f3a5c7886ce3df7d (patch) | |
tree | be090ad90670f3a1eb1f451a12b086c738a8c3fa /src/mem/cache | |
parent | 3c076e4d69b38be9e4ce7ca9cfb7145ae6f27393 (diff) | |
download | gem5-2a714355506200d281175e49f3a5c7886ce3df7d.tar.xz |
mem-cache: Remove extra block init in BaseSetAssoc
Removed extra initialization of cache block just after they have been
created and organized the comments.
Change-Id: I75c1beaf0489e3e530fd8cbff2739dc7593e3e6f
Reviewed-on: https://gem5-review.googlesource.com/8661
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/cache')
-rw-r--r-- | src/mem/cache/tags/base_set_assoc.cc | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/mem/cache/tags/base_set_assoc.cc b/src/mem/cache/tags/base_set_assoc.cc index 728f5a5f9..61764fe91 100644 --- a/src/mem/cache/tags/base_set_assoc.cc +++ b/src/mem/cache/tags/base_set_assoc.cc @@ -85,24 +85,25 @@ BaseSetAssoc::BaseSetAssoc(const Params *p) // link in the data blocks for (unsigned j = 0; j < assoc; ++j) { - // locate next cache block - BlkType *blk = &blks[blkIndex]; - blk->data = &dataBlks[blkSize*blkIndex]; - ++blkIndex; + // Select block within the set to be linked + BlkType*& blk = sets[i].blks[j]; - // invalidate new cache block - blk->invalidate(); + // Locate next cache block + blk = &blks[blkIndex]; - //EGH Fix Me : do we need to initialize blk? + // Associate a data chunk to the block + blk->data = &dataBlks[blkSize*blkIndex]; - // Setting the tag to j is just to prevent long chains in the hash - // table; won't matter because the block is invalid + // Setting the tag to j is just to prevent long chains in the + // hash table; won't matter because the block is invalid blk->tag = j; - blk->whenReady = 0; - blk->isTouched = false; - sets[i].blks[j]=blk; + + // Set its set and way blk->set = i; blk->way = j; + + // Update block index + ++blkIndex; } } } |