114185Sgabeblack@google.com/*
214185Sgabeblack@google.com * Copyright (c) 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: Steve Reinhardt
4114185Sgabeblack@google.com *          Andreas Hansson
4214185Sgabeblack@google.com *          William Wang
4314185Sgabeblack@google.com */
4414185Sgabeblack@google.com
4514185Sgabeblack@google.com#include "mem/protocol/timing.hh"
4614185Sgabeblack@google.com
4714185Sgabeblack@google.com/* The request protocol. */
4814185Sgabeblack@google.com
4914185Sgabeblack@google.combool
5014185Sgabeblack@google.comTimingRequestProtocol::sendReq(TimingResponseProtocol *peer, PacketPtr pkt)
5114185Sgabeblack@google.com{
5214185Sgabeblack@google.com    assert(pkt->isRequest());
5314185Sgabeblack@google.com    return peer->recvTimingReq(pkt);
5414185Sgabeblack@google.com}
5514185Sgabeblack@google.com
5614185Sgabeblack@google.combool
5714185Sgabeblack@google.comTimingRequestProtocol::trySend(
5814185Sgabeblack@google.com        TimingResponseProtocol *peer, PacketPtr pkt) const
5914185Sgabeblack@google.com{
6014185Sgabeblack@google.com  assert(pkt->isRequest());
6114185Sgabeblack@google.com  return peer->tryTiming(pkt);
6214185Sgabeblack@google.com}
6314185Sgabeblack@google.com
6414185Sgabeblack@google.combool
6514185Sgabeblack@google.comTimingRequestProtocol::sendSnoopResp(
6614185Sgabeblack@google.com        TimingResponseProtocol *peer, PacketPtr pkt)
6714185Sgabeblack@google.com{
6814185Sgabeblack@google.com    assert(pkt->isResponse());
6914185Sgabeblack@google.com    return peer->recvTimingSnoopResp(pkt);
7014185Sgabeblack@google.com}
7114185Sgabeblack@google.com
7214185Sgabeblack@google.comvoid
7314185Sgabeblack@google.comTimingRequestProtocol::sendRetryResp(TimingResponseProtocol *peer)
7414185Sgabeblack@google.com{
7514185Sgabeblack@google.com    peer->recvRespRetry();
7614185Sgabeblack@google.com}
7714185Sgabeblack@google.com
7814185Sgabeblack@google.com/* The response protocol. */
7914185Sgabeblack@google.com
8014185Sgabeblack@google.combool
8114185Sgabeblack@google.comTimingResponseProtocol::sendResp(TimingRequestProtocol *peer, PacketPtr pkt)
8214185Sgabeblack@google.com{
8314185Sgabeblack@google.com    assert(pkt->isResponse());
8414185Sgabeblack@google.com    return peer->recvTimingResp(pkt);
8514185Sgabeblack@google.com}
8614185Sgabeblack@google.com
8714185Sgabeblack@google.comvoid
8814185Sgabeblack@google.comTimingResponseProtocol::sendSnoopReq(
8914185Sgabeblack@google.com        TimingRequestProtocol *peer, PacketPtr pkt)
9014185Sgabeblack@google.com{
9114185Sgabeblack@google.com    assert(pkt->isRequest());
9214185Sgabeblack@google.com    peer->recvTimingSnoopReq(pkt);
9314185Sgabeblack@google.com}
9414185Sgabeblack@google.com
9514185Sgabeblack@google.comvoid
9614185Sgabeblack@google.comTimingResponseProtocol::sendRetryReq(TimingRequestProtocol *peer)
9714185Sgabeblack@google.com{
9814185Sgabeblack@google.com    peer->recvReqRetry();
9914185Sgabeblack@google.com}
10014185Sgabeblack@google.com
10114185Sgabeblack@google.comvoid
10214185Sgabeblack@google.comTimingResponseProtocol::sendRetrySnoopResp(TimingRequestProtocol *peer)
10314185Sgabeblack@google.com{
10414185Sgabeblack@google.com    peer->recvRetrySnoopResp();
10514185Sgabeblack@google.com}
106