diff options
author | Javier Bueno <javier.bueno@metempsy.com> | 2018-11-18 00:50:08 +0100 |
---|---|---|
committer | Javier Bueno Hedo <javier.bueno@metempsy.com> | 2019-01-16 16:01:13 +0000 |
commit | 38f87dab68c809edf4cd95650c833fe82e4b800b (patch) | |
tree | 57cf83df7ee6b5e07dce7e959278cf9e25245a1a /src/mem/cache/prefetch/queued.hh | |
parent | cba75858ab94b525c2daad973b8197e9ebd1f1af (diff) | |
download | gem5-38f87dab68c809edf4cd95650c833fe82e4b800b.tar.xz |
mem-cache: virtual address support for prefetchers
Prefetchers can be configured to operate with virtual or physical addreses.
The option can be configured through the "use_virtual_addresses" parameter
of the Prefetcher object.
Change-Id: I4f8c3687988afecc8a91c3c5b2d44cc0580f72aa
Reviewed-on: https://gem5-review.googlesource.com/c/14416
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/cache/prefetch/queued.hh')
-rw-r--r-- | src/mem/cache/prefetch/queued.hh | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/src/mem/cache/prefetch/queued.hh b/src/mem/cache/prefetch/queued.hh index 774e6ede8..1c63977b4 100644 --- a/src/mem/cache/prefetch/queued.hh +++ b/src/mem/cache/prefetch/queued.hh @@ -55,11 +55,27 @@ class QueuedPrefetcher : public BasePrefetcher { protected: struct DeferredPacket { + /** Prefetch info corresponding to this packet */ + PrefetchInfo pfInfo; + /** Time when this prefetch becomes ready */ Tick tick; + /** The memory packet generated by this prefetch */ PacketPtr pkt; + /** The priority of this prefetch */ int32_t priority; - DeferredPacket(Tick t, PacketPtr p, int32_t pr) : tick(t), pkt(p), - priority(pr) {} + + /** + * Constructor + * @param pfi PrefechInfo object associated to this packet + * @param t Time when this prefetch becomes ready + * @param p PacketPtr with the memory request of the prefetch + * @param prio This prefetch priority + */ + DeferredPacket(PrefetchInfo const &pfi, Tick t, PacketPtr p, + int32_t prio) : pfInfo(pfi), tick(t), pkt(p), + priority(prio) { + } + bool operator>(const DeferredPacket& that) const { return priority > that.priority; @@ -98,9 +114,9 @@ class QueuedPrefetcher : public BasePrefetcher const bool tagPrefetch; using const_iterator = std::list<DeferredPacket>::const_iterator; - const_iterator inPrefetch(Addr address, bool is_secure) const; + const_iterator inPrefetch(const PrefetchInfo &pfi) const; using iterator = std::list<DeferredPacket>::iterator; - iterator inPrefetch(Addr address, bool is_secure); + iterator inPrefetch(const PrefetchInfo &pfi); // STATS Stats::Scalar pfIdentified; @@ -113,11 +129,11 @@ class QueuedPrefetcher : public BasePrefetcher QueuedPrefetcher(const QueuedPrefetcherParams *p); virtual ~QueuedPrefetcher(); - void notify(const PacketPtr &pkt) override; + void notify(const PacketPtr &pkt, const PrefetchInfo &pfi) override; - PacketPtr insert(AddrPriority& info, bool is_secure); + void insert(const PacketPtr &pkt, PrefetchInfo &new_pfi, int32_t priority); - virtual void calculatePrefetch(const PacketPtr &pkt, + virtual void calculatePrefetch(const PrefetchInfo &pfi, std::vector<AddrPriority> &addresses) = 0; PacketPtr getPacket() override; |