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 --- 36 unchanged lines hidden (view full) --- 45 * Declaration of a base set associative tag store. 46 */ 47 48#ifndef __MEM_CACHE_TAGS_BASE_SET_ASSOC_HH__ 49#define __MEM_CACHE_TAGS_BASE_SET_ASSOC_HH__ 50 51#include <cassert> 52#include <cstring> |
53#include <memory> 54#include <vector> |
55 56#include "mem/cache/base.hh" 57#include "mem/cache/blk.hh" 58#include "mem/cache/tags/base.hh" 59#include "mem/cache/tags/cacheset.hh" 60#include "mem/packet.hh" 61#include "params/BaseSetAssoc.hh" 62 --- 20 unchanged lines hidden (view full) --- 83 typedef CacheSet<CacheBlk> SetType; 84 85 86 protected: 87 /** The associativity of the cache. */ 88 const unsigned assoc; 89 /** The allocatable associativity of the cache (alloc mask). */ 90 unsigned allocAssoc; |
91 92 /** The cache blocks. */ 93 std::vector<BlkType> blks; 94 /** The data blocks, 1 per cache block. */ 95 std::unique_ptr<uint8_t[]> dataBlks; 96 |
97 /** The number of sets in the cache. */ 98 const unsigned numSets; |
99 |
100 /** Whether tags and data are accessed sequentially. */ 101 const bool sequentialAccess; 102 103 /** The cache sets. */ |
104 std::vector<SetType> sets; |
105 |
106 /** The amount to shift the address to get the set. */ 107 int setShift; 108 /** The amount to shift the address to get the tag. */ 109 int tagShift; 110 /** Mask out all bits that aren't part of the set index. */ 111 unsigned setMask; 112 113public: --- 4 unchanged lines hidden (view full) --- 118 /** 119 * Construct and initialize this tag store. 120 */ 121 BaseSetAssoc(const Params *p); 122 123 /** 124 * Destructor 125 */ |
126 virtual ~BaseSetAssoc() {}; |
127 128 /** 129 * Find the cache block given set and way 130 * @param set The set of the block. 131 * @param way The way of the block. 132 * @return The cache block. 133 */ 134 CacheBlk *findBlockBySetAndWay(int set, int way) const override; --- 237 unchanged lines hidden --- |