base.hh (13422:4ec52da74cd5) | base.hh (13551:f352df8e2863) |
---|---|
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 --- 64 unchanged lines hidden (view full) --- 73 void notify(const PacketPtr &pkt) override; 74 protected: 75 BasePrefetcher &parent; 76 }; 77 78 std::vector<PrefetchListener *> listeners; 79 protected: 80 | 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 --- 64 unchanged lines hidden (view full) --- 73 void notify(const PacketPtr &pkt) override; 74 protected: 75 BasePrefetcher &parent; 76 }; 77 78 std::vector<PrefetchListener *> listeners; 79 protected: 80 |
81 /** 82 * Class containing the information needed by the prefetch to train and 83 * generate new prefetch requests. 84 */ 85 class PrefetchInfo { 86 /** The address. */ 87 Addr address; 88 /** The program counter that generated this address. */ 89 Addr pc; 90 /** The requestor ID that generated this address. */ 91 MasterID masterId; 92 /** Validity bit for the PC of this address. */ 93 bool validPC; 94 /** Whether this address targets the secure memory space. */ 95 bool secure; 96 97 public: 98 /** 99 * Obtains the address value of this Prefetcher address. 100 * @return the addres value. 101 */ 102 Addr getAddr() const 103 { 104 return address; 105 } 106 107 /** 108 * Returns true if the address targets the secure memory space. 109 * @return true if the address targets the secure memory space. 110 */ 111 bool isSecure() const 112 { 113 return secure; 114 } 115 116 /** 117 * Returns the program counter that generated this request. 118 * @return the pc value 119 */ 120 Addr getPC() const 121 { 122 assert(hasPC()); 123 return pc; 124 } 125 126 /** 127 * Returns true if the associated program counter is valid 128 * @return true if the program counter has a valid value 129 */ 130 bool hasPC() const 131 { 132 return validPC; 133 } 134 135 /** 136 * Gets the requestor ID that generated this address 137 * @return the requestor ID that generated this address 138 */ 139 MasterID getMasterId() const 140 { 141 return masterId; 142 } 143 144 /** 145 * Check for equality 146 * @param pfi PrefetchInfo to compare against 147 * @return True if this object and the provided one are equal 148 */ 149 bool sameAddr(PrefetchInfo const &pfi) const 150 { 151 return this->getAddr() == pfi.getAddr() && 152 this->isSecure() == pfi.isSecure(); 153 } 154 155 /** 156 * Constructs a PrefetchInfo using a PacketPtr. 157 * @param pkt PacketPtr used to generate the PrefetchInfo 158 * @param addr the address value of the new object 159 */ 160 PrefetchInfo(PacketPtr pkt, Addr addr); 161 162 /** 163 * Constructs a PrefetchInfo using a new address value and 164 * another PrefetchInfo as a reference. 165 * @param pfi PrefetchInfo used to generate this new object 166 * @param addr the address value of the new object 167 */ 168 PrefetchInfo(PrefetchInfo const &pfi, Addr addr); 169 }; 170 |
|
81 // PARAMETERS 82 83 /** Pointr to the parent cache. */ 84 BaseCache* cache; 85 86 /** The block size of the parent cache. */ 87 unsigned blkSize; 88 --- 18 unchanged lines hidden (view full) --- 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 | 171 // PARAMETERS 172 173 /** Pointr to the parent cache. */ 174 BaseCache* cache; 175 176 /** The block size of the parent cache. */ 177 unsigned blkSize; 178 --- 18 unchanged lines hidden (view full) --- 197 /** Request id for prefetches */ 198 const MasterID masterId; 199 200 const Addr pageBytes; 201 202 /** Prefetch on every access, not just misses */ 203 const bool prefetchOnAccess; 204 |
205 /** Use Virtual Addresses for prefetching */ 206 const bool useVirtualAddresses; 207 |
|
115 /** Determine if this access should be observed */ 116 bool observeAccess(const PacketPtr &pkt) const; 117 118 /** Determine if address is in cache */ 119 bool inCache(Addr addr, bool is_secure) const; 120 121 /** Determine if address is in cache miss queue */ 122 bool inMissQueue(Addr addr, bool is_secure) const; --- 6 unchanged lines hidden (view full) --- 129 Addr blockIndex(Addr a) const; 130 /** Determine the address of the page in which a lays */ 131 Addr pageAddress(Addr a) const; 132 /** Determine the page-offset of a */ 133 Addr pageOffset(Addr a) const; 134 /** Build the address of the i-th block inside the page */ 135 Addr pageIthBlockAddress(Addr page, uint32_t i) const; 136 | 208 /** Determine if this access should be observed */ 209 bool observeAccess(const PacketPtr &pkt) const; 210 211 /** Determine if address is in cache */ 212 bool inCache(Addr addr, bool is_secure) const; 213 214 /** Determine if address is in cache miss queue */ 215 bool inMissQueue(Addr addr, bool is_secure) const; --- 6 unchanged lines hidden (view full) --- 222 Addr blockIndex(Addr a) const; 223 /** Determine the address of the page in which a lays */ 224 Addr pageAddress(Addr a) const; 225 /** Determine the page-offset of a */ 226 Addr pageOffset(Addr a) const; 227 /** Build the address of the i-th block inside the page */ 228 Addr pageIthBlockAddress(Addr page, uint32_t i) const; 229 |
137 | |
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 */ | 230 Stats::Scalar pfIssued; 231 232 public: 233 234 BasePrefetcher(const BasePrefetcherParams *p); 235 236 virtual ~BasePrefetcher() {} 237 238 void setCache(BaseCache *_cache); 239 240 /** 241 * Notify prefetcher of cache access (may be any access or just 242 * misses, depending on cache parameters.) 243 */ |
152 virtual void notify(const PacketPtr &pkt) = 0; | 244 virtual void notify(const PacketPtr &pkt, const PrefetchInfo &pfi) = 0; |
153 154 virtual PacketPtr getPacket() = 0; 155 156 virtual Tick nextPrefetchReadyTime() const = 0; 157 158 /** 159 * Register local statistics. 160 */ --- 21 unchanged lines hidden --- | 245 246 virtual PacketPtr getPacket() = 0; 247 248 virtual Tick nextPrefetchReadyTime() const = 0; 249 250 /** 251 * Register local statistics. 252 */ --- 21 unchanged lines hidden --- |