base.cc (13219:454ecc63338d) base.cc (13225:8d1621fc586e)
1/*
2 * Copyright (c) 2018 Inria
3 * Copyright (c) 2012-2014,2017 ARM Limited
4 * All rights reserved.
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

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

48 */
49
50#include "mem/cache/tags/indexing_policies/base.hh"
51
52#include <cstdlib>
53
54#include "base/intmath.hh"
55#include "base/logging.hh"
1/*
2 * Copyright (c) 2018 Inria
3 * Copyright (c) 2012-2014,2017 ARM Limited
4 * All rights reserved.
5 *
6 * The license below extends only to copyright in the software and shall
7 * not be construed as granting a license to any other intellectual
8 * property including but not limited to intellectual property relating

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

48 */
49
50#include "mem/cache/tags/indexing_policies/base.hh"
51
52#include <cstdlib>
53
54#include "base/intmath.hh"
55#include "base/logging.hh"
56#include "mem/cache/replacement_policies/base.hh"
56#include "mem/cache/replacement_policies/replaceable_entry.hh"
57
58BaseIndexingPolicy::BaseIndexingPolicy(const Params *p)
59 : SimObject(p), assoc(p->assoc),
60 numSets(p->size / (p->entry_size * assoc)),
61 setShift(floorLog2(p->entry_size)), setMask(numSets - 1), sets(numSets),
62 tagShift(setShift + floorLog2(numSets))
63{
64 fatal_if(!isPowerOf2(numSets), "# of sets must be non-zero and a power " \

--- 38 unchanged lines hidden ---
57
58BaseIndexingPolicy::BaseIndexingPolicy(const Params *p)
59 : SimObject(p), assoc(p->assoc),
60 numSets(p->size / (p->entry_size * assoc)),
61 setShift(floorLog2(p->entry_size)), setMask(numSets - 1), sets(numSets),
62 tagShift(setShift + floorLog2(numSets))
63{
64 fatal_if(!isPowerOf2(numSets), "# of sets must be non-zero and a power " \

--- 38 unchanged lines hidden ---