114184Sgabeblack@google.com/*
214184Sgabeblack@google.com * Copyright (c) 1999-2005 Mark D. Hill and David A. Wood
314184Sgabeblack@google.com * All rights reserved.
414184Sgabeblack@google.com *
514184Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without
614184Sgabeblack@google.com * modification, are permitted provided that the following conditions are
714184Sgabeblack@google.com * met: redistributions of source code must retain the above copyright
814184Sgabeblack@google.com * notice, this list of conditions and the following disclaimer;
914184Sgabeblack@google.com * redistributions in binary form must reproduce the above copyright
1014184Sgabeblack@google.com * notice, this list of conditions and the following disclaimer in the
1114184Sgabeblack@google.com * documentation and/or other materials provided with the distribution;
1214184Sgabeblack@google.com * neither the name of the copyright holders nor the names of its
1314184Sgabeblack@google.com * contributors may be used to endorse or promote products derived from
1414184Sgabeblack@google.com * this software without specific prior written permission.
1514184Sgabeblack@google.com *
1614184Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1714184Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1814184Sgabeblack@google.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1914184Sgabeblack@google.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2014184Sgabeblack@google.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2114184Sgabeblack@google.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2214184Sgabeblack@google.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2314184Sgabeblack@google.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2414184Sgabeblack@google.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2514184Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2614184Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2714184Sgabeblack@google.com */
2814184Sgabeblack@google.com
2914184Sgabeblack@google.com/*
3014184Sgabeblack@google.com * $Id$
3114184Sgabeblack@google.com *
3214184Sgabeblack@google.com */
3314184Sgabeblack@google.com
3414184Sgabeblack@google.com// CoherenceRequestType
3514184Sgabeblack@google.comenumeration(CoherenceRequestType, desc="...") {
3614184Sgabeblack@google.com  GETX,      desc="Get eXclusive";
3714184Sgabeblack@google.com  GETS,      desc="Get Shared";
3814184Sgabeblack@google.com}
3914184Sgabeblack@google.com
4014184Sgabeblack@google.com// PersistentType
4114184Sgabeblack@google.comenumeration(PersistentRequestType, desc="...") {
4214184Sgabeblack@google.com  GETX_PERSISTENT,  desc="...";
4314184Sgabeblack@google.com  GETS_PERSISTENT,  desc="...";
4414184Sgabeblack@google.com  DEACTIVATE_PERSISTENT,desc="...";
4514184Sgabeblack@google.com}
4614184Sgabeblack@google.com
4714184Sgabeblack@google.com// CoherenceResponseType
4814184Sgabeblack@google.comenumeration(CoherenceResponseType, desc="...") {
4914184Sgabeblack@google.com  DATA_OWNER,  desc="Data";
5014184Sgabeblack@google.com  ACK_OWNER,  desc="data-less owner token";
5114184Sgabeblack@google.com  DATA_SHARED, desc="Data";
5214184Sgabeblack@google.com  ACK,         desc="ACKnowledgment";
5314184Sgabeblack@google.com  WB_TOKENS,   desc="L1 to L2 writeback";
5414184Sgabeblack@google.com  WB_SHARED_DATA,   desc="L1 to L2 writeback with data";
5514184Sgabeblack@google.com  WB_OWNED,    desc="L1 to L2 writeback with data";
5614184Sgabeblack@google.com  INV,         desc="L1 informing L2 of loss of all tokens";
5714184Sgabeblack@google.com}
5814184Sgabeblack@google.com
5914184Sgabeblack@google.com// PersistentMsg
6014184Sgabeblack@google.comstructure(PersistentMsg, desc="...", interface="Message") {
6114184Sgabeblack@google.com  Addr addr,             desc="Physical address for this request";
6214184Sgabeblack@google.com  PersistentRequestType Type,  desc="Type of starvation request";
6314184Sgabeblack@google.com  MachineID Requestor,            desc="Node who initiated the request";
6414184Sgabeblack@google.com  NetDest Destination,             desc="Destination set";
6514184Sgabeblack@google.com  MessageSizeType MessageSize, desc="size category of the message";
6614184Sgabeblack@google.com  RubyAccessMode AccessMode,    desc="user/supervisor access type";
6714184Sgabeblack@google.com  PrefetchBit Prefetch,         desc="Is this a prefetch request";
6814184Sgabeblack@google.com
6914184Sgabeblack@google.com  bool functionalRead(Packet *pkt) {
7014184Sgabeblack@google.com    // No data in persistent messages
7114184Sgabeblack@google.com    return false;
7214184Sgabeblack@google.com  }
7314184Sgabeblack@google.com
7414184Sgabeblack@google.com  bool functionalWrite(Packet *pkt) {
7514184Sgabeblack@google.com    // No data in persistent messages
7614184Sgabeblack@google.com    return false;
7714184Sgabeblack@google.com  }
7814184Sgabeblack@google.com}
7914184Sgabeblack@google.com
8014184Sgabeblack@google.com// RequestMsg
8114184Sgabeblack@google.comstructure(RequestMsg, desc="...", interface="Message") {
8214184Sgabeblack@google.com  Addr addr,             desc="Physical address for this request";
8314184Sgabeblack@google.com  CoherenceRequestType Type,   desc="Type of request (GetS, GetX, PutX, etc)";
8414184Sgabeblack@google.com  MachineID Requestor,            desc="Node who initiated the request";
8514184Sgabeblack@google.com  NetDest Destination,             desc="Multicast destination mask";
8614184Sgabeblack@google.com  bool isLocal,                    desc="Is this request from a local L1";
8714184Sgabeblack@google.com  int RetryNum,                    desc="retry sequence number";
8814184Sgabeblack@google.com  MessageSizeType MessageSize, desc="size category of the message";
8914184Sgabeblack@google.com  RubyAccessMode AccessMode,    desc="user/supervisor access type";
9014184Sgabeblack@google.com  PrefetchBit Prefetch,         desc="Is this a prefetch request";
9114184Sgabeblack@google.com
9214184Sgabeblack@google.com  bool functionalRead(Packet *pkt) {
9314184Sgabeblack@google.com    // No data in request messages
9414184Sgabeblack@google.com    return false;
9514184Sgabeblack@google.com  }
9614184Sgabeblack@google.com
9714184Sgabeblack@google.com  bool functionalWrite(Packet *pkt) {
9814184Sgabeblack@google.com    // No data in request messages
9914184Sgabeblack@google.com    return false;
10014184Sgabeblack@google.com  }
10114184Sgabeblack@google.com}
10214184Sgabeblack@google.com
10314184Sgabeblack@google.com// ResponseMsg
10414184Sgabeblack@google.comstructure(ResponseMsg, desc="...", interface="Message") {
10514184Sgabeblack@google.com  Addr addr,             desc="Physical address for this request";
10614184Sgabeblack@google.com  CoherenceResponseType Type,  desc="Type of response (Ack, Data, etc)";
10714184Sgabeblack@google.com  MachineID Sender,               desc="Node who sent the data";
10814184Sgabeblack@google.com  NetDest Destination,             desc="Node to whom the data is sent";
10914184Sgabeblack@google.com  int Tokens,                  desc="Number of tokens being transfered for this line";
11014184Sgabeblack@google.com  DataBlock DataBlk,           desc="data for the cache line";
11114184Sgabeblack@google.com  bool Dirty,                  desc="Is the data dirty (different than memory)?";
11214184Sgabeblack@google.com  MessageSizeType MessageSize, desc="size category of the message";
11314184Sgabeblack@google.com
11414184Sgabeblack@google.com  bool functionalRead(Packet *pkt) {
11514184Sgabeblack@google.com    // No check being carried out on the message type. Would be added later.
11614184Sgabeblack@google.com    return testAndRead(addr, DataBlk, pkt);
11714184Sgabeblack@google.com  }
11814184Sgabeblack@google.com
11914184Sgabeblack@google.com  bool functionalWrite(Packet *pkt) {
12014184Sgabeblack@google.com    // No check required since all messages are written.
12114184Sgabeblack@google.com    return testAndWrite(addr, DataBlk, pkt);
12214184Sgabeblack@google.com  }
12314184Sgabeblack@google.com}
12414184Sgabeblack@google.com
12514184Sgabeblack@google.comenumeration(DMARequestType, desc="...", default="DMARequestType_NULL") {
12614184Sgabeblack@google.com  READ,          desc="Memory Read";
12714184Sgabeblack@google.com  WRITE,         desc="Memory Write";
12814184Sgabeblack@google.com  NULL,          desc="Invalid";
12914184Sgabeblack@google.com}
13014184Sgabeblack@google.com
13114184Sgabeblack@google.comenumeration(DMAResponseType, desc="...", default="DMAResponseType_NULL") {
13214184Sgabeblack@google.com  DATA,          desc="DATA read";
13314184Sgabeblack@google.com  ACK,           desc="ACK write";
13414184Sgabeblack@google.com  NULL,          desc="Invalid";
13514184Sgabeblack@google.com}
13614184Sgabeblack@google.com
13714184Sgabeblack@google.comstructure(DMARequestMsg, desc="...", interface="Message") {
13814184Sgabeblack@google.com  DMARequestType Type,       desc="Request type (read/write)";
13914184Sgabeblack@google.com  Addr PhysicalAddress,   desc="Physical address for this request";
14014184Sgabeblack@google.com  Addr LineAddress,       desc="Line address for this request";
14114184Sgabeblack@google.com  MachineID Requestor,            desc="Node who initiated the request";
14214184Sgabeblack@google.com  NetDest Destination,       desc="Destination";
14314184Sgabeblack@google.com  DataBlock DataBlk,         desc="DataBlk attached to this request";
14414184Sgabeblack@google.com  int Len,                   desc="The length of the request";
14514184Sgabeblack@google.com  MessageSizeType MessageSize, desc="size category of the message";
14614184Sgabeblack@google.com
14714184Sgabeblack@google.com  bool functionalRead(Packet *pkt) {
14814184Sgabeblack@google.com    return false;
14914184Sgabeblack@google.com  }
15014184Sgabeblack@google.com
15114184Sgabeblack@google.com  bool functionalWrite(Packet *pkt) {
15214184Sgabeblack@google.com    return testAndWrite(LineAddress, DataBlk, pkt);
15314184Sgabeblack@google.com  }
15414184Sgabeblack@google.com}
15514184Sgabeblack@google.com
15614184Sgabeblack@google.comstructure(DMAResponseMsg, desc="...", interface="Message") {
15714184Sgabeblack@google.com  DMAResponseType Type,      desc="Response type (DATA/ACK)";
15814184Sgabeblack@google.com  Addr PhysicalAddress,   desc="Physical address for this request";
15914184Sgabeblack@google.com  Addr LineAddress,       desc="Line address for this request";
16014184Sgabeblack@google.com  NetDest Destination,       desc="Destination";
16114184Sgabeblack@google.com  DataBlock DataBlk,         desc="DataBlk attached to this request";
16214184Sgabeblack@google.com  MessageSizeType MessageSize, desc="size category of the message";
16314184Sgabeblack@google.com
16414184Sgabeblack@google.com  bool functionalRead(Packet *pkt) {
16514184Sgabeblack@google.com    return false;
16614184Sgabeblack@google.com  }
16714184Sgabeblack@google.com
16814184Sgabeblack@google.com  bool functionalWrite(Packet *pkt) {
16914184Sgabeblack@google.com    return testAndWrite(LineAddress, DataBlk, pkt);
17014184Sgabeblack@google.com  }
17114184Sgabeblack@google.com}
172