base.hh (13418:08101e89101e) | base.hh (13419:aaadcfae091a) |
---|---|
1/* 2 * Copyright (c) 2012-2014,2016-2018 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 --- 47 unchanged lines hidden (view full) --- 56#include "base/callback.hh" 57#include "base/logging.hh" 58#include "base/statistics.hh" 59#include "base/types.hh" 60#include "mem/cache/cache_blk.hh" 61#include "params/BaseTags.hh" 62#include "sim/clocked_object.hh" 63 | 1/* 2 * Copyright (c) 2012-2014,2016-2018 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 --- 47 unchanged lines hidden (view full) --- 56#include "base/callback.hh" 57#include "base/logging.hh" 58#include "base/statistics.hh" 59#include "base/types.hh" 60#include "mem/cache/cache_blk.hh" 61#include "params/BaseTags.hh" 62#include "sim/clocked_object.hh" 63 |
64class BaseCache; | 64class System; |
65class IndexingPolicy; 66class ReplaceableEntry; 67 68/** 69 * A common base class of Cache tagstore objects. 70 */ 71class BaseTags : public ClockedObject 72{ 73 protected: 74 /** The block size of the cache. */ 75 const unsigned blkSize; 76 /** Mask out all bits that aren't part of the block offset. */ 77 const Addr blkMask; 78 /** The size of the cache. */ 79 const unsigned size; 80 /** The tag lookup latency of the cache. */ 81 const Cycles lookupLatency; 82 | 65class IndexingPolicy; 66class ReplaceableEntry; 67 68/** 69 * A common base class of Cache tagstore objects. 70 */ 71class BaseTags : public ClockedObject 72{ 73 protected: 74 /** The block size of the cache. */ 75 const unsigned blkSize; 76 /** Mask out all bits that aren't part of the block offset. */ 77 const Addr blkMask; 78 /** The size of the cache. */ 79 const unsigned size; 80 /** The tag lookup latency of the cache. */ 81 const Cycles lookupLatency; 82 |
83 /** Pointer to the parent cache. */ 84 BaseCache *cache; | 83 /** System we are currently operating in. */ 84 System *system; |
85 86 /** Indexing policy */ 87 BaseIndexingPolicy *indexingPolicy; 88 89 /** 90 * The number of tags that need to be touched to meet the warmup 91 * percentage. 92 */ --- 55 unchanged lines hidden (view full) --- 148 Stats::Scalar tagAccesses; 149 /** Number of data blocks consulted over all accesses. */ 150 Stats::Scalar dataAccesses; 151 152 /** 153 * @} 154 */ 155 | 85 86 /** Indexing policy */ 87 BaseIndexingPolicy *indexingPolicy; 88 89 /** 90 * The number of tags that need to be touched to meet the warmup 91 * percentage. 92 */ --- 55 unchanged lines hidden (view full) --- 148 Stats::Scalar tagAccesses; 149 /** Number of data blocks consulted over all accesses. */ 150 Stats::Scalar dataAccesses; 151 152 /** 153 * @} 154 */ 155 |
156 /** 157 * Set the parent cache back pointer. 158 * 159 * @param _cache Pointer to parent cache. 160 */ 161 void setCache(BaseCache *_cache); 162 | |
163 public: 164 typedef BaseTagsParams Params; 165 BaseTags(const Params *p); 166 167 /** 168 * Destructor. 169 */ 170 virtual ~BaseTags() {} 171 172 /** | 156 public: 157 typedef BaseTagsParams Params; 158 BaseTags(const Params *p); 159 160 /** 161 * Destructor. 162 */ 163 virtual ~BaseTags() {} 164 165 /** |
173 * Initialize blocks and set the parent cache back pointer. 174 * 175 * @param _cache Pointer to parent cache. | 166 * Initialize blocks. Must be overriden by every subclass that uses 167 * a block type different from its parent's, as the current Python 168 * code generation does not allow templates. |
176 */ | 169 */ |
177 virtual void tagsInit(BaseCache *_cache) = 0; | 170 virtual void tagsInit() = 0; |
178 179 /** 180 * Register local statistics. 181 */ 182 void regStats(); 183 184 /** 185 * Average in the reference count for valid blocks when the simulation --- 201 unchanged lines hidden --- | 171 172 /** 173 * Register local statistics. 174 */ 175 void regStats(); 176 177 /** 178 * Average in the reference count for valid blocks when the simulation --- 201 unchanged lines hidden --- |