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; --- 44 unchanged lines hidden (view full) --- 53#define NACKED_LINE 1 << 0 54#define SATISFIED 1 << 1 55#define SHARED_LINE 1 << 2 56#define CACHE_LINE_FILL 1 << 3 57#define COMPRESSED 1 << 4 58#define NO_ALLOCATE 1 << 5 59#define SNOOP_COMMIT 1 << 6 60 |
61/** 62 * A Packet is used to encapsulate a transfer between two objects in 63 * the memory system (e.g., the L1 and L2 cache). (In contrast, a 64 * single Request travels all the way from the requester to the 65 * ultimate destination and back, possibly being conveyed by several 66 * different Packets along the way.) 67 */ 68class Packet --- 16 unchanged lines hidden (view full) --- 85 bool staticData; 86 /** The data pointer points to a value that should be freed when 87 * the packet is destroyed. */ 88 bool dynamicData; 89 /** the data pointer points to an array (thus delete [] ) needs to 90 * be called on it rather than simply delete.*/ 91 bool arrayData; 92 |
93 /** The address of the request. This address could be virtual or 94 * physical, depending on the system configuration. */ 95 Addr addr; 96 97 /** The size of the request or transfer. */ 98 int size; 99 100 /** Device address (e.g., bus ID) of the source of the --- 15 unchanged lines hidden (view full) --- 116 bool srcValid; 117 118 119 public: 120 121 /** Used to calculate latencies for each packet.*/ 122 Tick time; 123 |
124 /** The time at which the packet will be fully transmitted */ 125 Tick finishTime; 126 127 /** The time at which the first chunk of the packet will be transmitted */ 128 Tick firstWordTime; 129 |
130 /** The special destination address indicating that the packet 131 * should be routed based on its address. */ 132 static const short Broadcast = -1; 133 134 /** A pointer to the original request. */ 135 RequestPtr req; 136 137 /** A virtual base opaque structure used to hold coherence-related --- 35 unchanged lines hidden (view full) --- 173 IsWrite = 1 << 1, 174 IsPrefetch = 1 << 2, 175 IsInvalidate = 1 << 3, 176 IsRequest = 1 << 4, 177 IsResponse = 1 << 5, 178 NeedsResponse = 1 << 6, 179 IsSWPrefetch = 1 << 7, 180 IsHWPrefetch = 1 << 8, |
181 HasData = 1 << 9 |
182 }; 183 |
184//For statistics we need max number of commands, hard code it at 185//20 for now. @todo fix later 186#define NUM_MEM_CMDS 1 << 10 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 | HasData, |
207 UpgradeReq = IsInvalidate | IsRequest, |
208 ReadExReq = IsRead | IsInvalidate | IsRequest | NeedsResponse, 209 ReadExResp = IsRead | IsInvalidate | IsResponse 210 | NeedsResponse | HasData 211 }; 212 213 /** Return the string name of the cmd field (for debugging and 214 * tracing). */ 215 const std::string &cmdString() const; --- 110 unchanged lines hidden (view full) --- 326 * modifying the destination fields, so this function 327 * should not be called. */ 328 void makeTimingResponse() { 329 assert(needsResponse()); 330 assert(isRequest()); 331 int icmd = (int)cmd; 332 icmd &= ~(IsRequest); 333 icmd |= IsResponse; |
334 cmd = (Command)icmd; 335 dest = src; 336 srcValid = false; 337 } 338 339 /** Take a request packet and modify it in place to be suitable 340 * for returning as a response to that request. 341 */ --- 57 unchanged lines hidden --- |