base_set_assoc.cc (11893:3033b3e6a32a) base_set_assoc.cc (12493:a1cf71a6de73)
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

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

58 :BaseTags(p), assoc(p->assoc), allocAssoc(p->assoc),
59 numSets(p->size / (p->block_size * p->assoc)),
60 sequentialAccess(p->sequential_access)
61{
62 // Check parameters
63 if (blkSize < 4 || !isPowerOf2(blkSize)) {
64 fatal("Block size must be at least 4 and a power of 2");
65 }
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

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

58 :BaseTags(p), assoc(p->assoc), allocAssoc(p->assoc),
59 numSets(p->size / (p->block_size * p->assoc)),
60 sequentialAccess(p->sequential_access)
61{
62 // Check parameters
63 if (blkSize < 4 || !isPowerOf2(blkSize)) {
64 fatal("Block size must be at least 4 and a power of 2");
65 }
66 if (numSets <= 0 || !isPowerOf2(numSets)) {
66 if (!isPowerOf2(numSets)) {
67 fatal("# of sets must be non-zero and a power of 2");
68 }
69 if (assoc <= 0) {
70 fatal("associativity must be greater than zero");
71 }
72
73 setShift = floorLog2(blkSize);
74 setMask = numSets - 1;

--- 123 unchanged lines hidden ---
67 fatal("# of sets must be non-zero and a power of 2");
68 }
69 if (assoc <= 0) {
70 fatal("associativity must be greater than zero");
71 }
72
73 setShift = floorLog2(blkSize);
74 setMask = numSets - 1;

--- 123 unchanged lines hidden ---