114184Sgabeblack@google.com
214184Sgabeblack@google.com/*
314184Sgabeblack@google.com * Copyright (c) 1999-2005 Mark D. Hill and David A. Wood
414184Sgabeblack@google.com * All rights reserved.
514184Sgabeblack@google.com *
614184Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without
714184Sgabeblack@google.com * modification, are permitted provided that the following conditions are
814184Sgabeblack@google.com * met: redistributions of source code must retain the above copyright
914184Sgabeblack@google.com * notice, this list of conditions and the following disclaimer;
1014184Sgabeblack@google.com * redistributions in binary form must reproduce the above copyright
1114184Sgabeblack@google.com * notice, this list of conditions and the following disclaimer in the
1214184Sgabeblack@google.com * documentation and/or other materials provided with the distribution;
1314184Sgabeblack@google.com * neither the name of the copyright holders nor the names of its
1414184Sgabeblack@google.com * contributors may be used to endorse or promote products derived from
1514184Sgabeblack@google.com * this software without specific prior written permission.
1614184Sgabeblack@google.com *
1714184Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1814184Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1914184Sgabeblack@google.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2014184Sgabeblack@google.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2114184Sgabeblack@google.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2214184Sgabeblack@google.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2314184Sgabeblack@google.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2414184Sgabeblack@google.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2514184Sgabeblack@google.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2614184Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2714184Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2814184Sgabeblack@google.com */
2914184Sgabeblack@google.com
3014184Sgabeblack@google.com/*
3114184Sgabeblack@google.com * $Id$
3214184Sgabeblack@google.com *
3314184Sgabeblack@google.com */
3414184Sgabeblack@google.com
3514184Sgabeblack@google.com// MemoryRequestType used in MemoryMsg
3614184Sgabeblack@google.com
3714184Sgabeblack@google.comenumeration(MemoryRequestType, desc="...") {
3814184Sgabeblack@google.com
3914184Sgabeblack@google.com  // Southbound request: from directory to memory cache
4014184Sgabeblack@google.com  // or directory to memory or memory cache to memory
4114184Sgabeblack@google.com  MEMORY_READ,     desc="Read request to memory";
4214184Sgabeblack@google.com  MEMORY_WB,       desc="Write back data to memory";
4314184Sgabeblack@google.com
4414184Sgabeblack@google.com  // response from memory to directory
4514184Sgabeblack@google.com  // (These are currently unused!)
4614184Sgabeblack@google.com  MEMORY_DATA, desc="Data read from memory";
4714184Sgabeblack@google.com  MEMORY_ACK,  desc="Write to memory acknowledgement";
4814184Sgabeblack@google.com}
4914184Sgabeblack@google.com
5014184Sgabeblack@google.com
5114184Sgabeblack@google.com// Message to and from Memory Control
5214184Sgabeblack@google.com
5314184Sgabeblack@google.comstructure(MemoryMsg, desc="...", interface="Message") {
5414184Sgabeblack@google.com  Addr addr,              desc="Physical address for this request";
5514184Sgabeblack@google.com  MemoryRequestType Type,       desc="Type of memory request (MEMORY_READ or MEMORY_WB)";
5614184Sgabeblack@google.com  MachineID Sender,             desc="What component sent the data";
5714184Sgabeblack@google.com  MachineID OriginalRequestorMachId, desc="What component originally requested";
5814184Sgabeblack@google.com  DataBlock DataBlk,            desc="Data to writeback";
5914184Sgabeblack@google.com  MessageSizeType MessageSize,  desc="size category of the message";
6014184Sgabeblack@google.com  // Not all fields used by all protocols:
6114184Sgabeblack@google.com  PrefetchBit Prefetch,         desc="Is this a prefetch request";
6214184Sgabeblack@google.com  bool ReadX,                   desc="Exclusive";
6314184Sgabeblack@google.com  int Acks,                     desc="How many acks to expect";
6414184Sgabeblack@google.com
6514184Sgabeblack@google.com  bool functionalRead(Packet *pkt) {
6614184Sgabeblack@google.com    return testAndRead(addr, DataBlk, pkt);
6714184Sgabeblack@google.com  }
6814184Sgabeblack@google.com
6914184Sgabeblack@google.com  bool functionalWrite(Packet *pkt) {
7014184Sgabeblack@google.com    return testAndWrite(addr, DataBlk, pkt);
7114184Sgabeblack@google.com  }
7214184Sgabeblack@google.com}
73