1/* 2 * Copyright (c) 2006 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 37 unchanged lines hidden (view full) --- 46#include "sim/root.hh" 47 48struct Packet; 49typedef Packet *PacketPtr; 50typedef uint8_t* PacketDataPtr; 51typedef std::list<PacketPtr> PacketList; 52 53//Coherence Flags |
54#define NACKED_LINE (1 << 0) 55#define SATISFIED (1 << 1) 56#define SHARED_LINE (1 << 2) 57#define CACHE_LINE_FILL (1 << 3) 58#define COMPRESSED (1 << 4) 59#define NO_ALLOCATE (1 << 5) 60#define SNOOP_COMMIT (1 << 6) |
61 62//for now. @todo fix later |
63#define NUM_MEM_CMDS (1 << 11) |
64/** 65 * A Packet is used to encapsulate a transfer between two objects in 66 * the memory system (e.g., the L1 and L2 cache). (In contrast, a 67 * single Request travels all the way from the requester to the 68 * ultimate destination and back, possibly being conveyed by several 69 * different Packets along the way.) 70 */ 71class Packet --- 95 unchanged lines hidden (view full) --- 167 SenderState *senderState; 168 169 private: 170 /** List of command attributes. */ 171 // If you add a new CommandAttribute, make sure to increase NUM_MEM_CMDS 172 // as well. 173 enum CommandAttribute 174 { |
175 IsRead = 1 << 0, 176 IsWrite = 1 << 1, 177 IsPrefetch = 1 << 2, 178 IsInvalidate = 1 << 3, 179 IsRequest = 1 << 4, 180 IsResponse = 1 << 5, 181 NeedsResponse = 1 << 6, |
182 IsSWPrefetch = 1 << 7, 183 IsHWPrefetch = 1 << 8, 184 IsUpgrade = 1 << 9, |
185 HasData = 1 << 10 |
186 }; 187 188 public: 189 /** List of all commands associated with a packet. */ 190 enum Command 191 { 192 InvalidCmd = 0, |
193 ReadReq = IsRead | IsRequest | NeedsResponse, |
194 WriteReq = IsWrite | IsRequest | NeedsResponse | HasData, |
195 WriteReqNoAck = IsWrite | IsRequest | HasData, |
196 ReadResp = IsRead | IsResponse | NeedsResponse | HasData, |
197 WriteResp = IsWrite | IsResponse | NeedsResponse, |
198 Writeback = IsWrite | IsRequest | HasData, 199 SoftPFReq = IsRead | IsRequest | IsSWPrefetch | NeedsResponse, 200 HardPFReq = IsRead | IsRequest | IsHWPrefetch | NeedsResponse, 201 SoftPFResp = IsRead | IsResponse | IsSWPrefetch |
202 | NeedsResponse | HasData, |
203 HardPFResp = IsRead | IsResponse | IsHWPrefetch |
204 | NeedsResponse | HasData, |
205 InvalidateReq = IsInvalidate | IsRequest, |
206 WriteInvalidateReq = IsWrite | IsInvalidate | IsRequest 207 | HasData | NeedsResponse, 208 WriteInvalidateResp = IsWrite | IsInvalidate | IsRequest 209 | NeedsResponse | IsResponse, |
210 UpgradeReq = IsInvalidate | IsRequest | IsUpgrade, 211 ReadExReq = IsRead | IsInvalidate | IsRequest | NeedsResponse, 212 ReadExResp = IsRead | IsInvalidate | IsResponse |
213 | NeedsResponse | HasData |
214 }; 215 216 /** Return the string name of the cmd field (for debugging and 217 * tracing). */ 218 const std::string &cmdString() const; 219 220 /** Reutrn the string to a cmd given by idx. */ 221 const std::string &cmdIdxToString(Command idx); --- 239 unchanged lines hidden --- |