12810SN/A/*
210623Smitch.hayenga@arm.com * Copyright (c) 2013-2014 ARM Limited
39546Sandreas.hansson@arm.com * All rights reserved.
49546Sandreas.hansson@arm.com *
59546Sandreas.hansson@arm.com * The license below extends only to copyright in the software and shall
69546Sandreas.hansson@arm.com * not be construed as granting a license to any other intellectual
79546Sandreas.hansson@arm.com * property including but not limited to intellectual property relating
89546Sandreas.hansson@arm.com * to a hardware implementation of the functionality of the software
99546Sandreas.hansson@arm.com * licensed hereunder.  You may use the software subject to the license
109546Sandreas.hansson@arm.com * terms below provided that you ensure that this notice is replicated
119546Sandreas.hansson@arm.com * unmodified and in its entirety in all distributions of the software,
129546Sandreas.hansson@arm.com * modified or unmodified, in source code or in binary form.
139546Sandreas.hansson@arm.com *
142810SN/A * Copyright (c) 2005 The Regents of The University of Michigan
152810SN/A * All rights reserved.
162810SN/A *
172810SN/A * Redistribution and use in source and binary forms, with or without
182810SN/A * modification, are permitted provided that the following conditions are
192810SN/A * met: redistributions of source code must retain the above copyright
202810SN/A * notice, this list of conditions and the following disclaimer;
212810SN/A * redistributions in binary form must reproduce the above copyright
222810SN/A * notice, this list of conditions and the following disclaimer in the
232810SN/A * documentation and/or other materials provided with the distribution;
242810SN/A * neither the name of the copyright holders nor the names of its
252810SN/A * contributors may be used to endorse or promote products derived from
262810SN/A * this software without specific prior written permission.
272810SN/A *
282810SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
292810SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
302810SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
312810SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
322810SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
332810SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
342810SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
352810SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
362810SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
372810SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
382810SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
392810SN/A *
402810SN/A * Authors: Ron Dreslinski
4110623Smitch.hayenga@arm.com *          Mitch Hayenga
422810SN/A */
432810SN/A
442810SN/A/**
452810SN/A * @file
462810SN/A * Miss and writeback queue declarations.
472810SN/A */
482810SN/A
4910623Smitch.hayenga@arm.com#ifndef __MEM_CACHE_PREFETCH_BASE_HH__
5010623Smitch.hayenga@arm.com#define __MEM_CACHE_PREFETCH_BASE_HH__
512810SN/A
5212727Snikos.nikoleris@arm.com#include <cstdint>
5312727Snikos.nikoleris@arm.com
5413751Sjavier.bueno@metempsy.com#include "arch/isa_traits.hh"
5514013Sjavier.bueno@metempsy.com#include "arch/generic/tlb.hh"
563861SN/A#include "base/statistics.hh"
5712727Snikos.nikoleris@arm.com#include "base/types.hh"
583861SN/A#include "mem/packet.hh"
5912727Snikos.nikoleris@arm.com#include "mem/request.hh"
6013751Sjavier.bueno@metempsy.com#include "sim/byteswap.hh"
619288Sandreas.hansson@arm.com#include "sim/clocked_object.hh"
6213416Sjavier.bueno@metempsy.com#include "sim/probe/probe.hh"
633861SN/A
642810SN/Aclass BaseCache;
6512727Snikos.nikoleris@arm.comstruct BasePrefetcherParams;
663861SN/A
679288Sandreas.hansson@arm.comclass BasePrefetcher : public ClockedObject
682810SN/A{
6913416Sjavier.bueno@metempsy.com    class PrefetchListener : public ProbeListenerArgBase<PacketPtr>
7013416Sjavier.bueno@metempsy.com    {
7113416Sjavier.bueno@metempsy.com      public:
7213416Sjavier.bueno@metempsy.com        PrefetchListener(BasePrefetcher &_parent, ProbeManager *pm,
7313751Sjavier.bueno@metempsy.com                         const std::string &name, bool _isFill = false,
7413751Sjavier.bueno@metempsy.com                         bool _miss = false)
7513416Sjavier.bueno@metempsy.com            : ProbeListenerArgBase(pm, name),
7613751Sjavier.bueno@metempsy.com              parent(_parent), isFill(_isFill), miss(_miss) {}
7713416Sjavier.bueno@metempsy.com        void notify(const PacketPtr &pkt) override;
7813416Sjavier.bueno@metempsy.com      protected:
7913416Sjavier.bueno@metempsy.com        BasePrefetcher &parent;
8013751Sjavier.bueno@metempsy.com        const bool isFill;
8113751Sjavier.bueno@metempsy.com        const bool miss;
8213416Sjavier.bueno@metempsy.com    };
8313416Sjavier.bueno@metempsy.com
8413416Sjavier.bueno@metempsy.com    std::vector<PrefetchListener *> listeners;
8513667Sjavier.bueno@metempsy.com
8613667Sjavier.bueno@metempsy.com  public:
872810SN/A
8813551Sjavier.bueno@metempsy.com    /**
8913551Sjavier.bueno@metempsy.com     * Class containing the information needed by the prefetch to train and
9013551Sjavier.bueno@metempsy.com     * generate new prefetch requests.
9113551Sjavier.bueno@metempsy.com     */
9213551Sjavier.bueno@metempsy.com    class PrefetchInfo {
9313751Sjavier.bueno@metempsy.com        /** The address used to train and generate prefetches */
9413551Sjavier.bueno@metempsy.com        Addr address;
9513551Sjavier.bueno@metempsy.com        /** The program counter that generated this address. */
9613551Sjavier.bueno@metempsy.com        Addr pc;
9713551Sjavier.bueno@metempsy.com        /** The requestor ID that generated this address. */
9813551Sjavier.bueno@metempsy.com        MasterID masterId;
9913551Sjavier.bueno@metempsy.com        /** Validity bit for the PC of this address. */
10013551Sjavier.bueno@metempsy.com        bool validPC;
10113551Sjavier.bueno@metempsy.com        /** Whether this address targets the secure memory space. */
10213551Sjavier.bueno@metempsy.com        bool secure;
10313751Sjavier.bueno@metempsy.com        /** Size in bytes of the request triggering this event */
10413751Sjavier.bueno@metempsy.com        unsigned int size;
10513751Sjavier.bueno@metempsy.com        /** Whether this event comes from a write request */
10613751Sjavier.bueno@metempsy.com        bool write;
10713751Sjavier.bueno@metempsy.com        /** Physical address, needed because address can be virtual */
10813751Sjavier.bueno@metempsy.com        Addr paddress;
10913751Sjavier.bueno@metempsy.com        /** Whether this event comes from a cache miss */
11013751Sjavier.bueno@metempsy.com        bool cacheMiss;
11113751Sjavier.bueno@metempsy.com        /** Pointer to the associated request data */
11213751Sjavier.bueno@metempsy.com        uint8_t *data;
11313551Sjavier.bueno@metempsy.com
11413551Sjavier.bueno@metempsy.com      public:
11513551Sjavier.bueno@metempsy.com        /**
11613551Sjavier.bueno@metempsy.com         * Obtains the address value of this Prefetcher address.
11713551Sjavier.bueno@metempsy.com         * @return the addres value.
11813551Sjavier.bueno@metempsy.com         */
11913551Sjavier.bueno@metempsy.com        Addr getAddr() const
12013551Sjavier.bueno@metempsy.com        {
12113551Sjavier.bueno@metempsy.com            return address;
12213551Sjavier.bueno@metempsy.com        }
12313551Sjavier.bueno@metempsy.com
12413551Sjavier.bueno@metempsy.com        /**
12513551Sjavier.bueno@metempsy.com         * Returns true if the address targets the secure memory space.
12613551Sjavier.bueno@metempsy.com         * @return true if the address targets the secure memory space.
12713551Sjavier.bueno@metempsy.com         */
12813551Sjavier.bueno@metempsy.com        bool isSecure() const
12913551Sjavier.bueno@metempsy.com        {
13013551Sjavier.bueno@metempsy.com            return secure;
13113551Sjavier.bueno@metempsy.com        }
13213551Sjavier.bueno@metempsy.com
13313551Sjavier.bueno@metempsy.com        /**
13413551Sjavier.bueno@metempsy.com         * Returns the program counter that generated this request.
13513551Sjavier.bueno@metempsy.com         * @return the pc value
13613551Sjavier.bueno@metempsy.com         */
13713551Sjavier.bueno@metempsy.com        Addr getPC() const
13813551Sjavier.bueno@metempsy.com        {
13913551Sjavier.bueno@metempsy.com            assert(hasPC());
14013551Sjavier.bueno@metempsy.com            return pc;
14113551Sjavier.bueno@metempsy.com        }
14213551Sjavier.bueno@metempsy.com
14313551Sjavier.bueno@metempsy.com        /**
14413551Sjavier.bueno@metempsy.com         * Returns true if the associated program counter is valid
14513551Sjavier.bueno@metempsy.com         * @return true if the program counter has a valid value
14613551Sjavier.bueno@metempsy.com         */
14713551Sjavier.bueno@metempsy.com        bool hasPC() const
14813551Sjavier.bueno@metempsy.com        {
14913551Sjavier.bueno@metempsy.com            return validPC;
15013551Sjavier.bueno@metempsy.com        }
15113551Sjavier.bueno@metempsy.com
15213551Sjavier.bueno@metempsy.com        /**
15313551Sjavier.bueno@metempsy.com         * Gets the requestor ID that generated this address
15413551Sjavier.bueno@metempsy.com         * @return the requestor ID that generated this address
15513551Sjavier.bueno@metempsy.com         */
15613551Sjavier.bueno@metempsy.com        MasterID getMasterId() const
15713551Sjavier.bueno@metempsy.com        {
15813551Sjavier.bueno@metempsy.com            return masterId;
15913551Sjavier.bueno@metempsy.com        }
16013551Sjavier.bueno@metempsy.com
16113551Sjavier.bueno@metempsy.com        /**
16213751Sjavier.bueno@metempsy.com         * Gets the size of the request triggering this event
16313751Sjavier.bueno@metempsy.com         * @return the size in bytes of the request triggering this event
16413751Sjavier.bueno@metempsy.com         */
16513751Sjavier.bueno@metempsy.com        unsigned int getSize() const
16613751Sjavier.bueno@metempsy.com        {
16713751Sjavier.bueno@metempsy.com            return size;
16813751Sjavier.bueno@metempsy.com        }
16913751Sjavier.bueno@metempsy.com
17013751Sjavier.bueno@metempsy.com        /**
17113751Sjavier.bueno@metempsy.com         * Checks if the request that caused this prefetch event was a write
17213751Sjavier.bueno@metempsy.com         * request
17313751Sjavier.bueno@metempsy.com         * @return true if the request causing this event is a write request
17413751Sjavier.bueno@metempsy.com         */
17513751Sjavier.bueno@metempsy.com        bool isWrite() const
17613751Sjavier.bueno@metempsy.com        {
17713751Sjavier.bueno@metempsy.com            return write;
17813751Sjavier.bueno@metempsy.com        }
17913751Sjavier.bueno@metempsy.com
18013751Sjavier.bueno@metempsy.com        /**
18113751Sjavier.bueno@metempsy.com         * Gets the physical address of the request
18213751Sjavier.bueno@metempsy.com         * @return physical address of the request
18313751Sjavier.bueno@metempsy.com         */
18413751Sjavier.bueno@metempsy.com        Addr getPaddr() const
18513751Sjavier.bueno@metempsy.com        {
18613751Sjavier.bueno@metempsy.com            return paddress;
18713751Sjavier.bueno@metempsy.com        }
18813751Sjavier.bueno@metempsy.com
18913751Sjavier.bueno@metempsy.com        /**
19013751Sjavier.bueno@metempsy.com         * Check if this event comes from a cache miss
19113751Sjavier.bueno@metempsy.com         * @result true if this event comes from a cache miss
19213751Sjavier.bueno@metempsy.com         */
19313751Sjavier.bueno@metempsy.com        bool isCacheMiss() const
19413751Sjavier.bueno@metempsy.com        {
19513751Sjavier.bueno@metempsy.com            return cacheMiss;
19613751Sjavier.bueno@metempsy.com        }
19713751Sjavier.bueno@metempsy.com
19813751Sjavier.bueno@metempsy.com        /**
19913751Sjavier.bueno@metempsy.com         * Gets the associated data of the request triggering the event
20013751Sjavier.bueno@metempsy.com         * @param Byte ordering of the stored data
20113751Sjavier.bueno@metempsy.com         * @return the data
20213751Sjavier.bueno@metempsy.com         */
20313751Sjavier.bueno@metempsy.com        template <typename T>
20413751Sjavier.bueno@metempsy.com        inline T
20513755Sgambordr@oregonstate.edu        get(ByteOrder endian) const
20613751Sjavier.bueno@metempsy.com        {
20713751Sjavier.bueno@metempsy.com            if (data == nullptr) {
20813751Sjavier.bueno@metempsy.com                panic("PrefetchInfo::get called with a request with no data.");
20913751Sjavier.bueno@metempsy.com            }
21013751Sjavier.bueno@metempsy.com            switch (endian) {
21113751Sjavier.bueno@metempsy.com                case BigEndianByteOrder:
21213751Sjavier.bueno@metempsy.com                    return betoh(*(T*)data);
21313751Sjavier.bueno@metempsy.com
21413751Sjavier.bueno@metempsy.com                case LittleEndianByteOrder:
21513751Sjavier.bueno@metempsy.com                    return letoh(*(T*)data);
21613751Sjavier.bueno@metempsy.com
21713751Sjavier.bueno@metempsy.com                default:
21813751Sjavier.bueno@metempsy.com                    panic("Illegal byte order in PrefetchInfo::get()\n");
21913751Sjavier.bueno@metempsy.com            };
22013751Sjavier.bueno@metempsy.com        }
22113751Sjavier.bueno@metempsy.com
22213751Sjavier.bueno@metempsy.com        /**
22313551Sjavier.bueno@metempsy.com         * Check for equality
22413551Sjavier.bueno@metempsy.com         * @param pfi PrefetchInfo to compare against
22513551Sjavier.bueno@metempsy.com         * @return True if this object and the provided one are equal
22613551Sjavier.bueno@metempsy.com         */
22713551Sjavier.bueno@metempsy.com        bool sameAddr(PrefetchInfo const &pfi) const
22813551Sjavier.bueno@metempsy.com        {
22913551Sjavier.bueno@metempsy.com            return this->getAddr() == pfi.getAddr() &&
23013551Sjavier.bueno@metempsy.com                this->isSecure() == pfi.isSecure();
23113551Sjavier.bueno@metempsy.com        }
23213551Sjavier.bueno@metempsy.com
23313551Sjavier.bueno@metempsy.com        /**
23413551Sjavier.bueno@metempsy.com         * Constructs a PrefetchInfo using a PacketPtr.
23513551Sjavier.bueno@metempsy.com         * @param pkt PacketPtr used to generate the PrefetchInfo
23613751Sjavier.bueno@metempsy.com         * @param addr the address value of the new object, this address is
23713751Sjavier.bueno@metempsy.com         *        used to train the prefetcher
23813751Sjavier.bueno@metempsy.com         * @param miss whether this event comes from a cache miss
23913551Sjavier.bueno@metempsy.com         */
24013751Sjavier.bueno@metempsy.com        PrefetchInfo(PacketPtr pkt, Addr addr, bool miss);
24113551Sjavier.bueno@metempsy.com
24213551Sjavier.bueno@metempsy.com        /**
24313551Sjavier.bueno@metempsy.com         * Constructs a PrefetchInfo using a new address value and
24413551Sjavier.bueno@metempsy.com         * another PrefetchInfo as a reference.
24513551Sjavier.bueno@metempsy.com         * @param pfi PrefetchInfo used to generate this new object
24613551Sjavier.bueno@metempsy.com         * @param addr the address value of the new object
24713551Sjavier.bueno@metempsy.com         */
24813551Sjavier.bueno@metempsy.com        PrefetchInfo(PrefetchInfo const &pfi, Addr addr);
24913751Sjavier.bueno@metempsy.com
25013751Sjavier.bueno@metempsy.com        ~PrefetchInfo()
25113751Sjavier.bueno@metempsy.com        {
25213751Sjavier.bueno@metempsy.com            delete data;
25313751Sjavier.bueno@metempsy.com        }
25413551Sjavier.bueno@metempsy.com    };
25513551Sjavier.bueno@metempsy.com
25613667Sjavier.bueno@metempsy.com  protected:
25713667Sjavier.bueno@metempsy.com
2582810SN/A    // PARAMETERS
2592810SN/A
2602810SN/A    /** Pointr to the parent cache. */
2612810SN/A    BaseCache* cache;
2622810SN/A
2632810SN/A    /** The block size of the parent cache. */
26410360Sandreas.hansson@arm.com    unsigned blkSize;
2652810SN/A
26611438SRekai.GonzalezAlberquilla@arm.com    /** log_2(block size of the parent cache). */
26711438SRekai.GonzalezAlberquilla@arm.com    unsigned lBlkSize;
26811438SRekai.GonzalezAlberquilla@arm.com
26910623Smitch.hayenga@arm.com    /** Only consult prefetcher on cache misses? */
27013422Sodanrc@yahoo.com.br    const bool onMiss;
27110623Smitch.hayenga@arm.com
27210623Smitch.hayenga@arm.com    /** Consult prefetcher on reads? */
27313422Sodanrc@yahoo.com.br    const bool onRead;
27410623Smitch.hayenga@arm.com
27510623Smitch.hayenga@arm.com    /** Consult prefetcher on reads? */
27613422Sodanrc@yahoo.com.br    const bool onWrite;
27710623Smitch.hayenga@arm.com
27810623Smitch.hayenga@arm.com    /** Consult prefetcher on data accesses? */
27913422Sodanrc@yahoo.com.br    const bool onData;
28010623Smitch.hayenga@arm.com
28110623Smitch.hayenga@arm.com    /** Consult prefetcher on instruction accesses? */
28213422Sodanrc@yahoo.com.br    const bool onInst;
28310623Smitch.hayenga@arm.com
2848832SAli.Saidi@ARM.com    /** Request id for prefetches */
28513422Sodanrc@yahoo.com.br    const MasterID masterId;
2868832SAli.Saidi@ARM.com
28710466Sandreas.hansson@arm.com    const Addr pageBytes;
28810466Sandreas.hansson@arm.com
28913416Sjavier.bueno@metempsy.com    /** Prefetch on every access, not just misses */
29013416Sjavier.bueno@metempsy.com    const bool prefetchOnAccess;
29113416Sjavier.bueno@metempsy.com
29213551Sjavier.bueno@metempsy.com    /** Use Virtual Addresses for prefetching */
29313551Sjavier.bueno@metempsy.com    const bool useVirtualAddresses;
29413551Sjavier.bueno@metempsy.com
29513751Sjavier.bueno@metempsy.com    /**
29613751Sjavier.bueno@metempsy.com     * Determine if this access should be observed
29713751Sjavier.bueno@metempsy.com     * @param pkt The memory request causing the event
29813751Sjavier.bueno@metempsy.com     * @param miss whether this event comes from a cache miss
29913751Sjavier.bueno@metempsy.com     */
30013751Sjavier.bueno@metempsy.com    bool observeAccess(const PacketPtr &pkt, bool miss) const;
30110623Smitch.hayenga@arm.com
30210623Smitch.hayenga@arm.com    /** Determine if address is in cache */
30310623Smitch.hayenga@arm.com    bool inCache(Addr addr, bool is_secure) const;
30410623Smitch.hayenga@arm.com
30510623Smitch.hayenga@arm.com    /** Determine if address is in cache miss queue */
30610623Smitch.hayenga@arm.com    bool inMissQueue(Addr addr, bool is_secure) const;
30710623Smitch.hayenga@arm.com
30813624Sjavier.bueno@metempsy.com    bool hasBeenPrefetched(Addr addr, bool is_secure) const;
30913624Sjavier.bueno@metempsy.com
31010623Smitch.hayenga@arm.com    /** Determine if addresses are on the same page */
31110623Smitch.hayenga@arm.com    bool samePage(Addr a, Addr b) const;
31211438SRekai.GonzalezAlberquilla@arm.com    /** Determine the address of the block in which a lays */
31311438SRekai.GonzalezAlberquilla@arm.com    Addr blockAddress(Addr a) const;
31411438SRekai.GonzalezAlberquilla@arm.com    /** Determine the address of a at block granularity */
31511438SRekai.GonzalezAlberquilla@arm.com    Addr blockIndex(Addr a) const;
31611438SRekai.GonzalezAlberquilla@arm.com    /** Determine the address of the page in which a lays */
31711438SRekai.GonzalezAlberquilla@arm.com    Addr pageAddress(Addr a) const;
31811438SRekai.GonzalezAlberquilla@arm.com    /** Determine the page-offset of a  */
31911438SRekai.GonzalezAlberquilla@arm.com    Addr pageOffset(Addr a) const;
32011438SRekai.GonzalezAlberquilla@arm.com    /** Build the address of the i-th block inside the page */
32111438SRekai.GonzalezAlberquilla@arm.com    Addr pageIthBlockAddress(Addr page, uint32_t i) const;
32211438SRekai.GonzalezAlberquilla@arm.com
32310623Smitch.hayenga@arm.com    Stats::Scalar pfIssued;
32410623Smitch.hayenga@arm.com
32513624Sjavier.bueno@metempsy.com    /** Total prefetches issued */
32613624Sjavier.bueno@metempsy.com    uint64_t issuedPrefetches;
32713624Sjavier.bueno@metempsy.com    /** Total prefetches that has been useful */
32813624Sjavier.bueno@metempsy.com    uint64_t usefulPrefetches;
32913624Sjavier.bueno@metempsy.com
33014013Sjavier.bueno@metempsy.com    /** Registered tlb for address translations */
33114013Sjavier.bueno@metempsy.com    BaseTLB * tlb;
33214013Sjavier.bueno@metempsy.com
3332810SN/A  public:
3342810SN/A
33510623Smitch.hayenga@arm.com    BasePrefetcher(const BasePrefetcherParams *p);
3362810SN/A
3372810SN/A    virtual ~BasePrefetcher() {}
3382810SN/A
33913991Sandreas.sandberg@arm.com    virtual void setCache(BaseCache *_cache);
3402810SN/A
3415875Ssteve.reinhardt@amd.com    /**
3425875Ssteve.reinhardt@amd.com     * Notify prefetcher of cache access (may be any access or just
3435875Ssteve.reinhardt@amd.com     * misses, depending on cache parameters.)
3445875Ssteve.reinhardt@amd.com     */
34513551Sjavier.bueno@metempsy.com    virtual void notify(const PacketPtr &pkt, const PrefetchInfo &pfi) = 0;
3462810SN/A
34713717Sivan.pizarro@metempsy.com    /** Notify prefetcher of cache fill */
34813717Sivan.pizarro@metempsy.com    virtual void notifyFill(const PacketPtr &pkt)
34913717Sivan.pizarro@metempsy.com    {}
35013717Sivan.pizarro@metempsy.com
35110623Smitch.hayenga@arm.com    virtual PacketPtr getPacket() = 0;
3523861SN/A
35310623Smitch.hayenga@arm.com    virtual Tick nextPrefetchReadyTime() const = 0;
3543861SN/A
35513422Sodanrc@yahoo.com.br    /**
35613422Sodanrc@yahoo.com.br     * Register local statistics.
35713422Sodanrc@yahoo.com.br     */
35813422Sodanrc@yahoo.com.br    void regStats() override;
35913416Sjavier.bueno@metempsy.com
36013416Sjavier.bueno@metempsy.com    /**
36113416Sjavier.bueno@metempsy.com     * Register probe points for this object.
36213416Sjavier.bueno@metempsy.com     */
36313416Sjavier.bueno@metempsy.com    void regProbeListeners() override;
36413416Sjavier.bueno@metempsy.com
36513416Sjavier.bueno@metempsy.com    /**
36613416Sjavier.bueno@metempsy.com     * Process a notification event from the ProbeListener.
36713416Sjavier.bueno@metempsy.com     * @param pkt The memory request causing the event
36813751Sjavier.bueno@metempsy.com     * @param miss whether this event comes from a cache miss
36913416Sjavier.bueno@metempsy.com     */
37013751Sjavier.bueno@metempsy.com    void probeNotify(const PacketPtr &pkt, bool miss);
37113416Sjavier.bueno@metempsy.com
37213416Sjavier.bueno@metempsy.com    /**
37313416Sjavier.bueno@metempsy.com     * Add a SimObject and a probe name to listen events from
37413416Sjavier.bueno@metempsy.com     * @param obj The SimObject pointer to listen from
37513416Sjavier.bueno@metempsy.com     * @param name The probe name
37613416Sjavier.bueno@metempsy.com     */
37713416Sjavier.bueno@metempsy.com    void addEventProbe(SimObject *obj, const char *name);
37814013Sjavier.bueno@metempsy.com
37914013Sjavier.bueno@metempsy.com    /**
38014013Sjavier.bueno@metempsy.com     * Add a BaseTLB object to be used whenever a translation is needed.
38114013Sjavier.bueno@metempsy.com     * This is generally required when the prefetcher is allowed to generate
38214013Sjavier.bueno@metempsy.com     * page crossing references and/or uses virtual addresses for training.
38314013Sjavier.bueno@metempsy.com     * @param tlb pointer to the BaseTLB object to add
38414013Sjavier.bueno@metempsy.com     */
38514013Sjavier.bueno@metempsy.com    void addTLB(BaseTLB *tlb);
3862810SN/A};
38710623Smitch.hayenga@arm.com#endif //__MEM_CACHE_PREFETCH_BASE_HH__
388