base_set_assoc.cc (12548:285f1792a2da) base_set_assoc.cc (12549:d3e5cfe631fc)
1/*
2 * Copyright (c) 2012-2014 ARM Limited
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 71 unchanged lines hidden (view full) ---

80 unsigned blkIndex = 0; // index into blks array
81 for (unsigned i = 0; i < numSets; ++i) {
82 sets[i].assoc = assoc;
83
84 sets[i].blks.resize(assoc);
85
86 // link in the data blocks
87 for (unsigned j = 0; j < assoc; ++j) {
1/*
2 * Copyright (c) 2012-2014 ARM Limited
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 71 unchanged lines hidden (view full) ---

80 unsigned blkIndex = 0; // index into blks array
81 for (unsigned i = 0; i < numSets; ++i) {
82 sets[i].assoc = assoc;
83
84 sets[i].blks.resize(assoc);
85
86 // link in the data blocks
87 for (unsigned j = 0; j < assoc; ++j) {
88 // locate next cache block
89 BlkType *blk = &blks[blkIndex];
90 blk->data = &dataBlks[blkSize*blkIndex];
91 ++blkIndex;
88 // Select block within the set to be linked
89 BlkType*& blk = sets[i].blks[j];
92
90
93 // invalidate new cache block
94 blk->invalidate();
91 // Locate next cache block
92 blk = &blks[blkIndex];
95
93
96 //EGH Fix Me : do we need to initialize blk?
94 // Associate a data chunk to the block
95 blk->data = &dataBlks[blkSize*blkIndex];
97
96
98 // Setting the tag to j is just to prevent long chains in the hash
99 // table; won't matter because the block is invalid
97 // Setting the tag to j is just to prevent long chains in the
98 // hash table; won't matter because the block is invalid
100 blk->tag = j;
99 blk->tag = j;
101 blk->whenReady = 0;
102 blk->isTouched = false;
103 sets[i].blks[j]=blk;
100
101 // Set its set and way
104 blk->set = i;
105 blk->way = j;
102 blk->set = i;
103 blk->way = j;
104
105 // Update block index
106 ++blkIndex;
106 }
107 }
108}
109
110CacheBlk*
111BaseSetAssoc::findBlock(Addr addr, bool is_secure) const
112{
113 Addr tag = extractTag(addr);

--- 72 unchanged lines hidden ---
107 }
108 }
109}
110
111CacheBlk*
112BaseSetAssoc::findBlock(Addr addr, bool is_secure) const
113{
114 Addr tag = extractTag(addr);

--- 72 unchanged lines hidden ---