114185Sgabeblack@google.com/*
214185Sgabeblack@google.com * Copyright (c) 2011-2012,2015,2017 ARM Limited
314185Sgabeblack@google.com * All rights reserved
414185Sgabeblack@google.com *
514185Sgabeblack@google.com * The license below extends only to copyright in the software and shall
614185Sgabeblack@google.com * not be construed as granting a license to any other intellectual
714185Sgabeblack@google.com * property including but not limited to intellectual property relating
814185Sgabeblack@google.com * to a hardware implementation of the functionality of the software
914185Sgabeblack@google.com * licensed hereunder.  You may use the software subject to the license
1014185Sgabeblack@google.com * terms below provided that you ensure that this notice is replicated
1114185Sgabeblack@google.com * unmodified and in its entirety in all distributions of the software,
1214185Sgabeblack@google.com * modified or unmodified, in source code or in binary form.
1314185Sgabeblack@google.com *
1414185Sgabeblack@google.com * Copyright (c) 2002-2005 The Regents of The University of Michigan
1514185Sgabeblack@google.com * All rights reserved.
1614185Sgabeblack@google.com *
1714185Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without
1814185Sgabeblack@google.com * modification, are permitted provided that the following conditions are
1914185Sgabeblack@google.com * met: redistributions of source code must retain the above copyright
2014185Sgabeblack@google.com * notice, this list of conditions and the following disclaimer;
2114185Sgabeblack@google.com * redistributions in binary form must reproduce the above copyright
2214185Sgabeblack@google.com * notice, this list of conditions and the following disclaimer in the
2314185Sgabeblack@google.com * documentation and/or other materials provided with the distribution;
2414185Sgabeblack@google.com * neither the name of the copyright holders nor the names of its
2514185Sgabeblack@google.com * contributors may be used to endorse or promote products derived from
2614185Sgabeblack@google.com * this software without specific prior written permission.
2714185Sgabeblack@google.com *
2814185Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2914185Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3014185Sgabeblack@google.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3114185Sgabeblack@google.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3214185Sgabeblack@google.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3314185Sgabeblack@google.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3414185Sgabeblack@google.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3514185Sgabeblack@google.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3614185Sgabeblack@google.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3714185Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3814185Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3914185Sgabeblack@google.com *
4014185Sgabeblack@google.com * Authors: Ron Dreslinski
4114185Sgabeblack@google.com *          Andreas Hansson
4214185Sgabeblack@google.com *          William Wang
4314185Sgabeblack@google.com */
4414185Sgabeblack@google.com
4514185Sgabeblack@google.com#ifndef __MEM_GEM5_PROTOCOL_FUNCTIONAL_HH__
4614185Sgabeblack@google.com#define __MEM_GEM5_PROTOCOL_FUNCTIONAL_HH__
4714185Sgabeblack@google.com
4814185Sgabeblack@google.com#include "mem/packet.hh"
4914185Sgabeblack@google.com
5014185Sgabeblack@google.comclass FunctionalResponseProtocol;
5114185Sgabeblack@google.com
5214185Sgabeblack@google.comclass FunctionalRequestProtocol
5314185Sgabeblack@google.com{
5414185Sgabeblack@google.com    friend class FunctionalResponseProtocol;
5514185Sgabeblack@google.com
5614185Sgabeblack@google.com  protected:
5714185Sgabeblack@google.com    /**
5814185Sgabeblack@google.com     * Send a functional request packet, where the data is instantly
5914185Sgabeblack@google.com     * updated everywhere in the memory system, without affecting the
6014185Sgabeblack@google.com     * current state of any block or moving the block.
6114185Sgabeblack@google.com     *
6214185Sgabeblack@google.com     * @param pkt Packet to send.
6314185Sgabeblack@google.com     */
6414185Sgabeblack@google.com    void send(FunctionalResponseProtocol *peer, PacketPtr pkt) const;
6514185Sgabeblack@google.com
6614185Sgabeblack@google.com    /**
6714185Sgabeblack@google.com     * Receive a functional snoop request packet from the peer.
6814185Sgabeblack@google.com     */
6914185Sgabeblack@google.com    virtual void recvFunctionalSnoop(PacketPtr pkt) = 0;
7014185Sgabeblack@google.com};
7114185Sgabeblack@google.com
7214185Sgabeblack@google.comclass FunctionalResponseProtocol
7314185Sgabeblack@google.com{
7414185Sgabeblack@google.com    friend class FunctionalRequestProtocol;
7514185Sgabeblack@google.com
7614185Sgabeblack@google.com  protected:
7714185Sgabeblack@google.com    /**
7814185Sgabeblack@google.com     * Send a functional snoop request packet, where the data is
7914185Sgabeblack@google.com     * instantly updated everywhere in the memory system, without
8014185Sgabeblack@google.com     * affecting the current state of any block or moving the block.
8114185Sgabeblack@google.com     *
8214185Sgabeblack@google.com     * @param pkt Snoop packet to send.
8314185Sgabeblack@google.com     */
8414185Sgabeblack@google.com    void sendSnoop(FunctionalRequestProtocol *peer, PacketPtr pkt) const;
8514185Sgabeblack@google.com
8614185Sgabeblack@google.com    /**
8714185Sgabeblack@google.com     * Receive a functional request packet from the peer.
8814185Sgabeblack@google.com     */
8914185Sgabeblack@google.com    virtual void recvFunctional(PacketPtr pkt) = 0;
9014185Sgabeblack@google.com};
9114185Sgabeblack@google.com
9214185Sgabeblack@google.com#endif //__MEM_GEM5_PROTOCOL_FUNCTIONAL_HH__
93