45c45
< * Definitions of a base set associative tag store.
---
> * Definitions of a conventional tag store.
55,57c55
< :BaseTags(p), assoc(p->assoc), allocAssoc(p->assoc),
< blks(p->size / p->block_size),
< numSets(p->size / (p->block_size * p->assoc)),
---
> :BaseTags(p), allocAssoc(p->assoc), blks(p->size / p->block_size),
59d56
< sets(p->size / (p->block_size * p->assoc)),
66,75d62
< if (!isPowerOf2(numSets)) {
< fatal("# of sets must be non-zero and a power of 2");
< }
< if (assoc <= 0) {
< fatal("associativity must be greater than zero");
< }
<
< setShift = floorLog2(blkSize);
< setMask = numSets - 1;
< tagShift = setShift + floorLog2(numSets);
84,87c71,74
< // Initialize blocks
< unsigned blkIndex = 0; // index into blks array
< for (unsigned i = 0; i < numSets; ++i) {
< sets[i].resize(assoc);
---
> // Initialize all blocks
> for (unsigned blk_index = 0; blk_index < numBlocks; blk_index++) {
> // Locate next cache block
> BlkType* blk = &blks[blk_index];
89,92c76,77
< // link in the data blocks
< for (unsigned j = 0; j < assoc; ++j) {
< // Select block within the set to be linked
< BlkType*& blk = sets[i][j];
---
> // Link block to indexing policy
> indexingPolicy->setEntry(blk, blk_index);
94,95c79,80
< // Locate next cache block
< blk = &blks[blkIndex];
---
> // Associate a data chunk to the block
> blk->data = &dataBlks[blkSize*blk_index];
97,112c82,83
< // Associate a data chunk to the block
< blk->data = &dataBlks[blkSize*blkIndex];
<
< // Associate a replacement data entry to the block
< blk->replacementData = replacementPolicy->instantiateEntry();
<
< // 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;
<
< // Set its index
< blk->setPosition(i, j);
<
< // Update block index
< ++blkIndex;
< }
---
> // Associate a replacement data entry to the block
> blk->replacementData = replacementPolicy->instantiateEntry();
128,133d98
< ReplaceableEntry*
< BaseSetAssoc::findBlockBySetAndWay(int set, int way) const
< {
< return sets[set][way];
< }
<
136a102,104
> // There must be a indexing policy
> fatal_if(!indexing_policy, "An indexing policy is required");
>