12381SN/A/*
212342Snikos.nikoleris@arm.com * Copyright (c) 2011-2012,2015,2017 ARM Limited
38711Sandreas.hansson@arm.com * All rights reserved
48711Sandreas.hansson@arm.com *
58711Sandreas.hansson@arm.com * The license below extends only to copyright in the software and shall
68711Sandreas.hansson@arm.com * not be construed as granting a license to any other intellectual
78711Sandreas.hansson@arm.com * property including but not limited to intellectual property relating
88711Sandreas.hansson@arm.com * to a hardware implementation of the functionality of the software
98711Sandreas.hansson@arm.com * licensed hereunder.  You may use the software subject to the license
108711Sandreas.hansson@arm.com * terms below provided that you ensure that this notice is replicated
118711Sandreas.hansson@arm.com * unmodified and in its entirety in all distributions of the software,
128711Sandreas.hansson@arm.com * modified or unmodified, in source code or in binary form.
138711Sandreas.hansson@arm.com *
142381SN/A * Copyright (c) 2002-2005 The Regents of The University of Michigan
152381SN/A * All rights reserved.
162381SN/A *
172381SN/A * Redistribution and use in source and binary forms, with or without
182381SN/A * modification, are permitted provided that the following conditions are
192381SN/A * met: redistributions of source code must retain the above copyright
202381SN/A * notice, this list of conditions and the following disclaimer;
212381SN/A * redistributions in binary form must reproduce the above copyright
222381SN/A * notice, this list of conditions and the following disclaimer in the
232381SN/A * documentation and/or other materials provided with the distribution;
242381SN/A * neither the name of the copyright holders nor the names of its
252381SN/A * contributors may be used to endorse or promote products derived from
262381SN/A * this software without specific prior written permission.
272381SN/A *
282381SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
292381SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
302381SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
312381SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
322381SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
332381SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
342381SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
352381SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
362381SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
372381SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
382381SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
392665Ssaidi@eecs.umich.edu *
402665Ssaidi@eecs.umich.edu * Authors: Ron Dreslinski
418853Sandreas.hansson@arm.com *          Andreas Hansson
428922Swilliam.wang@arm.com *          William Wang
432381SN/A */
442381SN/A
452381SN/A/**
462381SN/A * @file
478922Swilliam.wang@arm.com * Port Object Declaration.
482381SN/A */
492381SN/A
502381SN/A#ifndef __MEM_PORT_HH__
512381SN/A#define __MEM_PORT_HH__
522381SN/A
539235Sandreas.hansson@arm.com#include "base/addr_range.hh"
542381SN/A#include "mem/packet.hh"
5514185Sgabeblack@google.com#include "mem/protocol/atomic.hh"
5614185Sgabeblack@google.com#include "mem/protocol/functional.hh"
5714185Sgabeblack@google.com#include "mem/protocol/timing.hh"
5813771Sgabeblack@google.com#include "sim/port.hh"
592381SN/A
6013892Sgabeblack@google.comclass SimObject;
613401Sktlim@umich.edu
628922Swilliam.wang@arm.com/** Forward declaration */
638922Swilliam.wang@arm.comclass SlavePort;
648922Swilliam.wang@arm.com
658922Swilliam.wang@arm.com/**
669294Sandreas.hansson@arm.com * A MasterPort is a specialisation of a BaseMasterPort, which
679294Sandreas.hansson@arm.com * implements the default protocol for the three different level of
689294Sandreas.hansson@arm.com * transport functions. In addition to the basic functionality of
699294Sandreas.hansson@arm.com * sending packets, it also has functions to receive range changes or
709294Sandreas.hansson@arm.com * determine if the port is snooping or not.
7114183Sgabeblack@google.com *
7214183Sgabeblack@google.com * The three protocols are atomic, timing, and functional, each with its own
7314183Sgabeblack@google.com * header file.
748922Swilliam.wang@arm.com */
7514193Sgabeblack@google.comclass MasterPort : public Port, public AtomicRequestProtocol,
7614183Sgabeblack@google.com    public TimingRequestProtocol, public FunctionalRequestProtocol
778922Swilliam.wang@arm.com{
788975Sandreas.hansson@arm.com    friend class SlavePort;
798975Sandreas.hansson@arm.com
808922Swilliam.wang@arm.com  private:
8114183Sgabeblack@google.com    SlavePort *_slavePort;
828922Swilliam.wang@arm.com
8313769Sgabeblack@google.com  protected:
8414183Sgabeblack@google.com    SimObject &owner;
8513769Sgabeblack@google.com
868922Swilliam.wang@arm.com  public:
8713892Sgabeblack@google.com    MasterPort(const std::string& name, SimObject* _owner,
8813769Sgabeblack@google.com               PortID id=InvalidPortID);
898922Swilliam.wang@arm.com    virtual ~MasterPort();
908922Swilliam.wang@arm.com
919178Sandreas.hansson@arm.com    /**
929178Sandreas.hansson@arm.com     * Bind this master port to a slave port. This also does the
939178Sandreas.hansson@arm.com     * mirror action and binds the slave port to the master port.
949178Sandreas.hansson@arm.com     */
9513782Sgabeblack@google.com    void bind(Port &peer) override;
969178Sandreas.hansson@arm.com
979178Sandreas.hansson@arm.com    /**
989178Sandreas.hansson@arm.com     * Unbind this master port and the associated slave port.
999178Sandreas.hansson@arm.com     */
10013782Sgabeblack@google.com    void unbind() override;
1019178Sandreas.hansson@arm.com
1028922Swilliam.wang@arm.com    /**
10314183Sgabeblack@google.com     * Determine if this master port is snooping or not. The default
10414183Sgabeblack@google.com     * implementation returns false and thus tells the neighbour we
10514183Sgabeblack@google.com     * are not snooping. Any master port that wants to receive snoop
10614183Sgabeblack@google.com     * requests (e.g. a cache connected to a bus) has to override this
10714183Sgabeblack@google.com     * function.
10814183Sgabeblack@google.com     *
10914183Sgabeblack@google.com     * @return true if the port should be considered a snooper
11014183Sgabeblack@google.com     */
11114183Sgabeblack@google.com    virtual bool isSnooping() const { return false; }
11214183Sgabeblack@google.com
11314183Sgabeblack@google.com    /**
11414183Sgabeblack@google.com     * Get the address ranges of the connected slave port.
11514183Sgabeblack@google.com     */
11614183Sgabeblack@google.com    AddrRangeList getAddrRanges() const;
11714183Sgabeblack@google.com
11814183Sgabeblack@google.com    /**
11914183Sgabeblack@google.com     * Inject a PrintReq for the given address to print the state of
12014183Sgabeblack@google.com     * that address throughout the memory system.  For debugging.
12114183Sgabeblack@google.com     */
12214183Sgabeblack@google.com    void printAddr(Addr a);
12314183Sgabeblack@google.com
12414183Sgabeblack@google.com  public:
12514183Sgabeblack@google.com    /* The atomic protocol. */
12614183Sgabeblack@google.com
12714183Sgabeblack@google.com    /**
1288948Sandreas.hansson@arm.com     * Send an atomic request packet, where the data is moved and the
1298948Sandreas.hansson@arm.com     * state is updated in zero time, without interleaving with other
1308948Sandreas.hansson@arm.com     * memory accesses.
1318948Sandreas.hansson@arm.com     *
1328948Sandreas.hansson@arm.com     * @param pkt Packet to send.
1338948Sandreas.hansson@arm.com     *
1348948Sandreas.hansson@arm.com     * @return Estimated latency of access.
1358948Sandreas.hansson@arm.com     */
1368948Sandreas.hansson@arm.com    Tick sendAtomic(PacketPtr pkt);
1378948Sandreas.hansson@arm.com
1388948Sandreas.hansson@arm.com    /**
13913845Sgabeblack@google.com     * Send an atomic request packet like above, but also request a backdoor
14013845Sgabeblack@google.com     * to the data being accessed.
14113845Sgabeblack@google.com     *
14213845Sgabeblack@google.com     * @param pkt Packet to send.
14313845Sgabeblack@google.com     * @param backdoor Can be set to a back door pointer by the target to let
14413845Sgabeblack@google.com     *        caller have direct access to the requested data.
14513845Sgabeblack@google.com     *
14613845Sgabeblack@google.com     * @return Estimated latency of access.
14713845Sgabeblack@google.com     */
14813845Sgabeblack@google.com    Tick sendAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &backdoor);
14913845Sgabeblack@google.com
15014183Sgabeblack@google.com  public:
15114183Sgabeblack@google.com    /* The functional protocol. */
15214183Sgabeblack@google.com
15313845Sgabeblack@google.com    /**
1548948Sandreas.hansson@arm.com     * Send a functional request packet, where the data is instantly
1558948Sandreas.hansson@arm.com     * updated everywhere in the memory system, without affecting the
1568948Sandreas.hansson@arm.com     * current state of any block or moving the block.
1578948Sandreas.hansson@arm.com     *
1588948Sandreas.hansson@arm.com     * @param pkt Packet to send.
1598948Sandreas.hansson@arm.com     */
16014183Sgabeblack@google.com    void sendFunctional(PacketPtr pkt) const;
16114183Sgabeblack@google.com
16214183Sgabeblack@google.com  public:
16314183Sgabeblack@google.com    /* The timing protocol. */
1648948Sandreas.hansson@arm.com
1658948Sandreas.hansson@arm.com    /**
1668975Sandreas.hansson@arm.com     * Attempt to send a timing request to the slave port by calling
1678975Sandreas.hansson@arm.com     * its corresponding receive function. If the send does not
1688975Sandreas.hansson@arm.com     * succeed, as indicated by the return value, then the sender must
16910713Sandreas.hansson@arm.com     * wait for a recvReqRetry at which point it can re-issue a
1708975Sandreas.hansson@arm.com     * sendTimingReq.
1718975Sandreas.hansson@arm.com     *
1728975Sandreas.hansson@arm.com     * @param pkt Packet to send.
1738975Sandreas.hansson@arm.com     *
1748975Sandreas.hansson@arm.com     * @return If the send was succesful or not.
1758975Sandreas.hansson@arm.com    */
1768975Sandreas.hansson@arm.com    bool sendTimingReq(PacketPtr pkt);
1778948Sandreas.hansson@arm.com
1788948Sandreas.hansson@arm.com    /**
17912342Snikos.nikoleris@arm.com     * Check if the slave can handle a timing request.
18012342Snikos.nikoleris@arm.com     *
18112342Snikos.nikoleris@arm.com     * If the send cannot be handled at the moment, as indicated by
18212342Snikos.nikoleris@arm.com     * the return value, then the sender will receive a recvReqRetry
18312342Snikos.nikoleris@arm.com     * at which point it can re-issue a sendTimingReq.
18412342Snikos.nikoleris@arm.com     *
18512342Snikos.nikoleris@arm.com     * @param pkt Packet to send.
18612342Snikos.nikoleris@arm.com     *
18712342Snikos.nikoleris@arm.com     * @return If the send was succesful or not.
18812342Snikos.nikoleris@arm.com     */
18912342Snikos.nikoleris@arm.com    bool tryTiming(PacketPtr pkt) const;
19012342Snikos.nikoleris@arm.com
19112342Snikos.nikoleris@arm.com    /**
1928975Sandreas.hansson@arm.com     * Attempt to send a timing snoop response packet to the slave
1938975Sandreas.hansson@arm.com     * port by calling its corresponding receive function. If the send
1948975Sandreas.hansson@arm.com     * does not succeed, as indicated by the return value, then the
19510713Sandreas.hansson@arm.com     * sender must wait for a recvRetrySnoop at which point it can
19610713Sandreas.hansson@arm.com     * re-issue a sendTimingSnoopResp.
1978975Sandreas.hansson@arm.com     *
1988975Sandreas.hansson@arm.com     * @param pkt Packet to send.
1998948Sandreas.hansson@arm.com     */
2008975Sandreas.hansson@arm.com    bool sendTimingSnoopResp(PacketPtr pkt);
2018922Swilliam.wang@arm.com
2028922Swilliam.wang@arm.com    /**
2039087Sandreas.hansson@arm.com     * Send a retry to the slave port that previously attempted a
20410713Sandreas.hansson@arm.com     * sendTimingResp to this master port and failed. Note that this
20510713Sandreas.hansson@arm.com     * is virtual so that the "fake" snoop response port in the
20610713Sandreas.hansson@arm.com     * coherent crossbar can override the behaviour.
2079087Sandreas.hansson@arm.com     */
20810713Sandreas.hansson@arm.com    virtual void sendRetryResp();
2099087Sandreas.hansson@arm.com
2108975Sandreas.hansson@arm.com  protected:
2119087Sandreas.hansson@arm.com    /**
2128975Sandreas.hansson@arm.com     * Called to receive an address range change from the peer slave
2139325Sandreas.hansson@arm.com     * port. The default implementation ignores the change and does
2148975Sandreas.hansson@arm.com     * nothing. Override this function in a derived class if the owner
2159325Sandreas.hansson@arm.com     * needs to be aware of the address ranges, e.g. in an
2168975Sandreas.hansson@arm.com     * interconnect component like a bus.
2178975Sandreas.hansson@arm.com     */
2188975Sandreas.hansson@arm.com    virtual void recvRangeChange() { }
21914183Sgabeblack@google.com
22014183Sgabeblack@google.com    /**
22114183Sgabeblack@google.com     * Default implementations.
22214183Sgabeblack@google.com     */
22314183Sgabeblack@google.com    Tick
22414183Sgabeblack@google.com    recvAtomicSnoop(PacketPtr pkt) override
22514183Sgabeblack@google.com    {
22614183Sgabeblack@google.com        panic("%s was not expecting an atomic snoop request\n", name());
22714183Sgabeblack@google.com        return 0;
22814183Sgabeblack@google.com    }
22914183Sgabeblack@google.com
23014183Sgabeblack@google.com    void
23114183Sgabeblack@google.com    recvFunctionalSnoop(PacketPtr pkt) override
23214183Sgabeblack@google.com    {
23314183Sgabeblack@google.com        panic("%s was not expecting a functional snoop request\n", name());
23414183Sgabeblack@google.com    }
23514183Sgabeblack@google.com
23614183Sgabeblack@google.com    void
23714183Sgabeblack@google.com    recvTimingSnoopReq(PacketPtr pkt) override
23814183Sgabeblack@google.com    {
23914183Sgabeblack@google.com        panic("%s was not expecting a timing snoop request.\n", name());
24014183Sgabeblack@google.com    }
24114183Sgabeblack@google.com
24214183Sgabeblack@google.com    void
24314183Sgabeblack@google.com    recvRetrySnoopResp() override
24414183Sgabeblack@google.com    {
24514183Sgabeblack@google.com        panic("%s was not expecting a snoop retry.\n", name());
24614183Sgabeblack@google.com    }
2472381SN/A};
2482381SN/A
2498922Swilliam.wang@arm.com/**
2508922Swilliam.wang@arm.com * A SlavePort is a specialisation of a port. In addition to the
2518922Swilliam.wang@arm.com * basic functionality of sending packets to its master peer, it also
2528922Swilliam.wang@arm.com * has functions specific to a slave, e.g. to send range changes
2538922Swilliam.wang@arm.com * and get the address ranges that the port responds to.
25414183Sgabeblack@google.com *
25514183Sgabeblack@google.com * The three protocols are atomic, timing, and functional, each with its own
25614183Sgabeblack@google.com * header file.
2578922Swilliam.wang@arm.com */
25814193Sgabeblack@google.comclass SlavePort : public Port, public AtomicResponseProtocol,
25914183Sgabeblack@google.com    public TimingResponseProtocol, public FunctionalResponseProtocol
2608922Swilliam.wang@arm.com{
2618975Sandreas.hansson@arm.com    friend class MasterPort;
2628975Sandreas.hansson@arm.com
2638922Swilliam.wang@arm.com  private:
2648922Swilliam.wang@arm.com    MasterPort* _masterPort;
26513845Sgabeblack@google.com    bool defaultBackdoorWarned;
2668922Swilliam.wang@arm.com
26713769Sgabeblack@google.com  protected:
26813892Sgabeblack@google.com    SimObject& owner;
26913769Sgabeblack@google.com
2708922Swilliam.wang@arm.com  public:
27113892Sgabeblack@google.com    SlavePort(const std::string& name, SimObject* _owner,
27213769Sgabeblack@google.com              PortID id=InvalidPortID);
2738922Swilliam.wang@arm.com    virtual ~SlavePort();
2748922Swilliam.wang@arm.com
2758922Swilliam.wang@arm.com    /**
2769088Sandreas.hansson@arm.com     * Find out if the peer master port is snooping or not.
2779088Sandreas.hansson@arm.com     *
2789088Sandreas.hansson@arm.com     * @return true if the peer master port is snooping
2799088Sandreas.hansson@arm.com     */
2809088Sandreas.hansson@arm.com    bool isSnooping() const { return _masterPort->isSnooping(); }
2819088Sandreas.hansson@arm.com
2829088Sandreas.hansson@arm.com    /**
2838922Swilliam.wang@arm.com     * Called by the owner to send a range change
2848922Swilliam.wang@arm.com     */
28514183Sgabeblack@google.com    void
28614183Sgabeblack@google.com    sendRangeChange() const
28714183Sgabeblack@google.com    {
28814183Sgabeblack@google.com        fatal_if(!_masterPort,
28914183Sgabeblack@google.com                "%s cannot sendRangeChange() without master port.", name());
29010413SCurtis.Dunham@arm.com        _masterPort->recvRangeChange();
29110413SCurtis.Dunham@arm.com    }
2928922Swilliam.wang@arm.com
2938922Swilliam.wang@arm.com    /**
2948922Swilliam.wang@arm.com     * Get a list of the non-overlapping address ranges the owner is
2958922Swilliam.wang@arm.com     * responsible for. All slave ports must override this function
2968922Swilliam.wang@arm.com     * and return a populated list with at least one item.
2978922Swilliam.wang@arm.com     *
2988922Swilliam.wang@arm.com     * @return a list of ranges responded to
2998922Swilliam.wang@arm.com     */
3009090Sandreas.hansson@arm.com    virtual AddrRangeList getAddrRanges() const = 0;
3018975Sandreas.hansson@arm.com
30213782Sgabeblack@google.com    /**
30313782Sgabeblack@google.com     * We let the master port do the work, so these don't do anything.
30413782Sgabeblack@google.com     */
30513782Sgabeblack@google.com    void unbind() override {}
30613782Sgabeblack@google.com    void bind(Port &peer) override {}
30713782Sgabeblack@google.com
30814183Sgabeblack@google.com  public:
30914183Sgabeblack@google.com    /* The atomic protocol. */
31014183Sgabeblack@google.com
31114183Sgabeblack@google.com    /**
31214183Sgabeblack@google.com     * Send an atomic snoop request packet, where the data is moved
31314183Sgabeblack@google.com     * and the state is updated in zero time, without interleaving
31414183Sgabeblack@google.com     * with other memory accesses.
31514183Sgabeblack@google.com     *
31614183Sgabeblack@google.com     * @param pkt Snoop packet to send.
31714183Sgabeblack@google.com     *
31814183Sgabeblack@google.com     * @return Estimated latency of access.
31914183Sgabeblack@google.com     */
32014183Sgabeblack@google.com    Tick
32114183Sgabeblack@google.com    sendAtomicSnoop(PacketPtr pkt)
32214183Sgabeblack@google.com    {
32314183Sgabeblack@google.com        return AtomicResponseProtocol::sendSnoop(_masterPort, pkt);
32414183Sgabeblack@google.com    }
32514183Sgabeblack@google.com
32614183Sgabeblack@google.com  public:
32714183Sgabeblack@google.com    /* The functional protocol. */
32814183Sgabeblack@google.com
32914183Sgabeblack@google.com    /**
33014183Sgabeblack@google.com     * Send a functional snoop request packet, where the data is
33114183Sgabeblack@google.com     * instantly updated everywhere in the memory system, without
33214183Sgabeblack@google.com     * affecting the current state of any block or moving the block.
33314183Sgabeblack@google.com     *
33414183Sgabeblack@google.com     * @param pkt Snoop packet to send.
33514183Sgabeblack@google.com     */
33614183Sgabeblack@google.com    void
33714183Sgabeblack@google.com    sendFunctionalSnoop(PacketPtr pkt) const
33814183Sgabeblack@google.com    {
33914183Sgabeblack@google.com        FunctionalResponseProtocol::sendSnoop(_masterPort, pkt);
34014183Sgabeblack@google.com    }
34114183Sgabeblack@google.com
34214183Sgabeblack@google.com  public:
34314183Sgabeblack@google.com    /* The timing protocol. */
34414183Sgabeblack@google.com
34514183Sgabeblack@google.com    /**
34614183Sgabeblack@google.com     * Attempt to send a timing response to the master port by calling
34714183Sgabeblack@google.com     * its corresponding receive function. If the send does not
34814183Sgabeblack@google.com     * succeed, as indicated by the return value, then the sender must
34914183Sgabeblack@google.com     * wait for a recvRespRetry at which point it can re-issue a
35014183Sgabeblack@google.com     * sendTimingResp.
35114183Sgabeblack@google.com     *
35214183Sgabeblack@google.com     * @param pkt Packet to send.
35314183Sgabeblack@google.com     *
35414183Sgabeblack@google.com     * @return If the send was succesful or not.
35514183Sgabeblack@google.com    */
35614183Sgabeblack@google.com    bool
35714183Sgabeblack@google.com    sendTimingResp(PacketPtr pkt)
35814183Sgabeblack@google.com    {
35914183Sgabeblack@google.com        return TimingResponseProtocol::sendResp(_masterPort, pkt);
36014183Sgabeblack@google.com    }
36114183Sgabeblack@google.com
36214183Sgabeblack@google.com    /**
36314183Sgabeblack@google.com     * Attempt to send a timing snoop request packet to the master port
36414183Sgabeblack@google.com     * by calling its corresponding receive function. Snoop requests
36514183Sgabeblack@google.com     * always succeed and hence no return value is needed.
36614183Sgabeblack@google.com     *
36714183Sgabeblack@google.com     * @param pkt Packet to send.
36814183Sgabeblack@google.com     */
36914183Sgabeblack@google.com    void
37014183Sgabeblack@google.com    sendTimingSnoopReq(PacketPtr pkt)
37114183Sgabeblack@google.com    {
37214183Sgabeblack@google.com        TimingResponseProtocol::sendSnoopReq(_masterPort, pkt);
37314183Sgabeblack@google.com    }
37414183Sgabeblack@google.com
37514183Sgabeblack@google.com    /**
37614183Sgabeblack@google.com     * Send a retry to the master port that previously attempted a
37714183Sgabeblack@google.com     * sendTimingReq to this slave port and failed.
37814183Sgabeblack@google.com     */
37914183Sgabeblack@google.com    void
38014183Sgabeblack@google.com    sendRetryReq()
38114183Sgabeblack@google.com    {
38214183Sgabeblack@google.com        TimingResponseProtocol::sendRetryReq(_masterPort);
38314183Sgabeblack@google.com    }
38414183Sgabeblack@google.com
38514183Sgabeblack@google.com    /**
38614183Sgabeblack@google.com     * Send a retry to the master port that previously attempted a
38714183Sgabeblack@google.com     * sendTimingSnoopResp to this slave port and failed.
38814183Sgabeblack@google.com     */
38914183Sgabeblack@google.com    void
39014183Sgabeblack@google.com    sendRetrySnoopResp()
39114183Sgabeblack@google.com    {
39214183Sgabeblack@google.com        TimingResponseProtocol::sendRetrySnoopResp(_masterPort);
39314183Sgabeblack@google.com    }
39414183Sgabeblack@google.com
3958975Sandreas.hansson@arm.com  protected:
3968975Sandreas.hansson@arm.com    /**
3979178Sandreas.hansson@arm.com     * Called by the master port to unbind. Should never be called
3989178Sandreas.hansson@arm.com     * directly.
3999178Sandreas.hansson@arm.com     */
40013782Sgabeblack@google.com    void slaveUnbind();
4019178Sandreas.hansson@arm.com
4029178Sandreas.hansson@arm.com    /**
4039178Sandreas.hansson@arm.com     * Called by the master port to bind. Should never be called
4049178Sandreas.hansson@arm.com     * directly.
4059178Sandreas.hansson@arm.com     */
40613782Sgabeblack@google.com    void slaveBind(MasterPort& master_port);
4079178Sandreas.hansson@arm.com
4089178Sandreas.hansson@arm.com    /**
40914183Sgabeblack@google.com     * Default implementations.
4108975Sandreas.hansson@arm.com     */
41114183Sgabeblack@google.com    Tick recvAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &backdoor) override;
4128975Sandreas.hansson@arm.com
41314183Sgabeblack@google.com    bool
41414183Sgabeblack@google.com    tryTiming(PacketPtr pkt) override
41514183Sgabeblack@google.com    {
41612342Snikos.nikoleris@arm.com        panic("%s was not expecting a %s\n", name(), __func__);
41712342Snikos.nikoleris@arm.com    }
41812342Snikos.nikoleris@arm.com
41914183Sgabeblack@google.com    bool
42014183Sgabeblack@google.com    recvTimingSnoopResp(PacketPtr pkt) override
4218975Sandreas.hansson@arm.com    {
4228975Sandreas.hansson@arm.com        panic("%s was not expecting a timing snoop response\n", name());
4238975Sandreas.hansson@arm.com    }
4248922Swilliam.wang@arm.com};
4258922Swilliam.wang@arm.com
42614183Sgabeblack@google.cominline Tick
42714183Sgabeblack@google.comMasterPort::sendAtomic(PacketPtr pkt)
42814183Sgabeblack@google.com{
42914183Sgabeblack@google.com    return AtomicRequestProtocol::send(_slavePort, pkt);
43014183Sgabeblack@google.com}
43114183Sgabeblack@google.com
43214183Sgabeblack@google.cominline Tick
43314183Sgabeblack@google.comMasterPort::sendAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &backdoor)
43414183Sgabeblack@google.com{
43514183Sgabeblack@google.com    return AtomicRequestProtocol::sendBackdoor(_slavePort, pkt, backdoor);
43614183Sgabeblack@google.com}
43714183Sgabeblack@google.com
43814183Sgabeblack@google.cominline void
43914183Sgabeblack@google.comMasterPort::sendFunctional(PacketPtr pkt) const
44014183Sgabeblack@google.com{
44114183Sgabeblack@google.com    return FunctionalRequestProtocol::send(_slavePort, pkt);
44214183Sgabeblack@google.com}
44314183Sgabeblack@google.com
44414183Sgabeblack@google.cominline bool
44514183Sgabeblack@google.comMasterPort::sendTimingReq(PacketPtr pkt)
44614183Sgabeblack@google.com{
44714183Sgabeblack@google.com    return TimingRequestProtocol::sendReq(_slavePort, pkt);
44814183Sgabeblack@google.com}
44914183Sgabeblack@google.com
45014183Sgabeblack@google.cominline bool
45114183Sgabeblack@google.comMasterPort::tryTiming(PacketPtr pkt) const
45214183Sgabeblack@google.com{
45314183Sgabeblack@google.com    return TimingRequestProtocol::trySend(_slavePort, pkt);
45414183Sgabeblack@google.com}
45514183Sgabeblack@google.com
45614183Sgabeblack@google.cominline bool
45714183Sgabeblack@google.comMasterPort::sendTimingSnoopResp(PacketPtr pkt)
45814183Sgabeblack@google.com{
45914183Sgabeblack@google.com    return TimingRequestProtocol::sendSnoopResp(_slavePort, pkt);
46014183Sgabeblack@google.com}
46114183Sgabeblack@google.com
46214183Sgabeblack@google.cominline void
46314183Sgabeblack@google.comMasterPort::sendRetryResp()
46414183Sgabeblack@google.com{
46514183Sgabeblack@google.com    TimingRequestProtocol::sendRetryResp(_slavePort);
46614183Sgabeblack@google.com}
46714183Sgabeblack@google.com
4682381SN/A#endif //__MEM_PORT_HH__
469