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