1/* 2 * Copyright (c) 2013-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 --- 46 unchanged lines hidden (view full) --- 55#include "base/types.hh" 56#include "mem/packet.hh" 57#include "mem/request.hh" 58#include "sim/clocked_object.hh" 59#include "sim/probe/probe.hh" 60 61class BaseCache; 62struct BasePrefetcherParams; |
63 64class BasePrefetcher : public ClockedObject 65{ 66 class PrefetchListener : public ProbeListenerArgBase<PacketPtr> 67 { 68 public: 69 PrefetchListener(BasePrefetcher &_parent, ProbeManager *pm, 70 const std::string &name) --- 13 unchanged lines hidden (view full) --- 84 BaseCache* cache; 85 86 /** The block size of the parent cache. */ 87 unsigned blkSize; 88 89 /** log_2(block size of the parent cache). */ 90 unsigned lBlkSize; 91 |
92 /** Only consult prefetcher on cache misses? */ |
93 const bool onMiss; |
94 95 /** Consult prefetcher on reads? */ |
96 const bool onRead; |
97 98 /** Consult prefetcher on reads? */ |
99 const bool onWrite; |
100 101 /** Consult prefetcher on data accesses? */ |
102 const bool onData; |
103 104 /** Consult prefetcher on instruction accesses? */ |
105 const bool onInst; |
106 107 /** Request id for prefetches */ |
108 const MasterID masterId; |
109 110 const Addr pageBytes; 111 112 /** Prefetch on every access, not just misses */ 113 const bool prefetchOnAccess; 114 115 /** Determine if this access should be observed */ 116 bool observeAccess(const PacketPtr &pkt) const; --- 21 unchanged lines hidden (view full) --- 138 Stats::Scalar pfIssued; 139 140 public: 141 142 BasePrefetcher(const BasePrefetcherParams *p); 143 144 virtual ~BasePrefetcher() {} 145 |
146 void setCache(BaseCache *_cache); |
147 148 /** 149 * Notify prefetcher of cache access (may be any access or just 150 * misses, depending on cache parameters.) 151 */ 152 virtual void notify(const PacketPtr &pkt) = 0; 153 154 virtual PacketPtr getPacket() = 0; 155 156 virtual Tick nextPrefetchReadyTime() const = 0; 157 |
158 /** 159 * Register local statistics. 160 */ 161 void regStats() override; |
162 163 /** 164 * Register probe points for this object. 165 */ 166 void regProbeListeners() override; 167 168 /** 169 * Process a notification event from the ProbeListener. --- 12 unchanged lines hidden --- |