base_set_assoc.cc (12549:d3e5cfe631fc) base_set_assoc.cc (12600:e670dd17c8cf)
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

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

55using namespace std;
56
57BaseSetAssoc::BaseSetAssoc(const Params *p)
58 :BaseTags(p), assoc(p->assoc), allocAssoc(p->assoc),
59 blks(p->size / p->block_size),
60 dataBlks(new uint8_t[p->size]), // Allocate data storage in one big chunk
61 numSets(p->size / (p->block_size * p->assoc)),
62 sequentialAccess(p->sequential_access),
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

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

55using namespace std;
56
57BaseSetAssoc::BaseSetAssoc(const Params *p)
58 :BaseTags(p), assoc(p->assoc), allocAssoc(p->assoc),
59 blks(p->size / p->block_size),
60 dataBlks(new uint8_t[p->size]), // Allocate data storage in one big chunk
61 numSets(p->size / (p->block_size * p->assoc)),
62 sequentialAccess(p->sequential_access),
63 sets(p->size / (p->block_size * p->assoc))
63 sets(p->size / (p->block_size * p->assoc)),
64 replacementPolicy(p->replacement_policy)
64{
65 // Check parameters
66 if (blkSize < 4 || !isPowerOf2(blkSize)) {
67 fatal("Block size must be at least 4 and a power of 2");
68 }
69 if (!isPowerOf2(numSets)) {
70 fatal("# of sets must be non-zero and a power of 2");
71 }

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

179 age_index = 3;
180 } else
181 age_index = 4; // >10ms
182
183 ageTaskId[blks[i].task_id][age_index]++;
184 }
185 }
186}
65{
66 // Check parameters
67 if (blkSize < 4 || !isPowerOf2(blkSize)) {
68 fatal("Block size must be at least 4 and a power of 2");
69 }
70 if (!isPowerOf2(numSets)) {
71 fatal("# of sets must be non-zero and a power of 2");
72 }

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

180 age_index = 3;
181 } else
182 age_index = 4; // >10ms
183
184 ageTaskId[blks[i].task_id][age_index]++;
185 }
186 }
187}
188
189BaseSetAssoc *
190BaseSetAssocParams::create()
191{
192 return new BaseSetAssoc(this);
193}