packet.hh (3156:2e6fc95d9ccf) | packet.hh (3158:e36d37280687) |
---|---|
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 | 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//For statistics we need max number of commands, hard code it at 62//20 for now. @todo fix later 63#define NUM_MEM_CMDS 1 << 9 64 | |
65/** 66 * A Packet is used to encapsulate a transfer between two objects in 67 * the memory system (e.g., the L1 and L2 cache). (In contrast, a 68 * single Request travels all the way from the requester to the 69 * ultimate destination and back, possibly being conveyed by several 70 * different Packets along the way.) 71 */ 72class Packet --- 86 unchanged lines hidden (view full) --- 159 }; 160 161 /** This packet's sender state. Devices should use dynamic_cast<> 162 * to cast to the state appropriate to the sender. */ 163 SenderState *senderState; 164 165 private: 166 /** List of command attributes. */ | 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 --- 86 unchanged lines hidden (view full) --- 155 }; 156 157 /** This packet's sender state. Devices should use dynamic_cast<> 158 * to cast to the state appropriate to the sender. */ 159 SenderState *senderState; 160 161 private: 162 /** List of command attributes. */ |
163 // If you add a new CommandAttribute, make sure to increase NUM_MEM_CMDS 164 // as well. |
|
167 enum CommandAttribute 168 { 169 IsRead = 1 << 0, 170 IsWrite = 1 << 1, 171 IsPrefetch = 1 << 2, 172 IsInvalidate = 1 << 3, 173 IsRequest = 1 << 4, 174 IsResponse = 1 << 5, 175 NeedsResponse = 1 << 6, 176 IsSWPrefetch = 1 << 7, 177 IsHWPrefetch = 1 << 8, 178 HasData = 1 << 9 179 }; 180 | 165 enum CommandAttribute 166 { 167 IsRead = 1 << 0, 168 IsWrite = 1 << 1, 169 IsPrefetch = 1 << 2, 170 IsInvalidate = 1 << 3, 171 IsRequest = 1 << 4, 172 IsResponse = 1 << 5, 173 NeedsResponse = 1 << 6, 174 IsSWPrefetch = 1 << 7, 175 IsHWPrefetch = 1 << 8, 176 HasData = 1 << 9 177 }; 178 |
179//For statistics we need max number of commands, hard code it at 180//20 for now. @todo fix later 181#define NUM_MEM_CMDS 1 << 10 182 |
|
181 public: 182 /** List of all commands associated with a packet. */ 183 enum Command 184 { 185 InvalidCmd = 0, 186 ReadReq = IsRead | IsRequest | NeedsResponse, | 183 public: 184 /** List of all commands associated with a packet. */ 185 enum Command 186 { 187 InvalidCmd = 0, 188 ReadReq = IsRead | IsRequest | NeedsResponse, |
187 WriteReq = IsWrite | IsRequest | NeedsResponse,// | HasData, 188 WriteReqNoAck = IsWrite | IsRequest,// | HasData, 189 ReadResp = IsRead | IsResponse | NeedsResponse,// | HasData, | 189 WriteReq = IsWrite | IsRequest | NeedsResponse | HasData, 190 WriteReqNoAck = IsWrite | IsRequest | HasData, 191 ReadResp = IsRead | IsResponse | NeedsResponse | HasData, |
190 WriteResp = IsWrite | IsResponse | NeedsResponse, | 192 WriteResp = IsWrite | IsResponse | NeedsResponse, |
191 Writeback = IsWrite | IsRequest,// | HasData, | 193 Writeback = IsWrite | IsRequest | HasData, |
192 SoftPFReq = IsRead | IsRequest | IsSWPrefetch | NeedsResponse, 193 HardPFReq = IsRead | IsRequest | IsHWPrefetch | NeedsResponse, 194 SoftPFResp = IsRead | IsResponse | IsSWPrefetch | 194 SoftPFReq = IsRead | IsRequest | IsSWPrefetch | NeedsResponse, 195 HardPFReq = IsRead | IsRequest | IsHWPrefetch | NeedsResponse, 196 SoftPFResp = IsRead | IsResponse | IsSWPrefetch |
195 | NeedsResponse,// | HasData, | 197 | NeedsResponse | HasData, |
196 HardPFResp = IsRead | IsResponse | IsHWPrefetch | 198 HardPFResp = IsRead | IsResponse | IsHWPrefetch |
197 | NeedsResponse,// | HasData, | 199 | NeedsResponse | HasData, |
198 InvalidateReq = IsInvalidate | IsRequest, | 200 InvalidateReq = IsInvalidate | IsRequest, |
199 WriteInvalidateReq = IsWrite | IsInvalidate | IsRequest,// | HasData, | 201 WriteInvalidateReq = IsWrite | IsInvalidate | IsRequest | HasData, |
200 UpgradeReq = IsInvalidate | IsRequest | NeedsResponse, 201 UpgradeResp = IsInvalidate | IsResponse | NeedsResponse, 202 ReadExReq = IsRead | IsInvalidate | IsRequest | NeedsResponse, 203 ReadExResp = IsRead | IsInvalidate | IsResponse | 202 UpgradeReq = IsInvalidate | IsRequest | NeedsResponse, 203 UpgradeResp = IsInvalidate | IsResponse | NeedsResponse, 204 ReadExReq = IsRead | IsInvalidate | IsRequest | NeedsResponse, 205 ReadExResp = IsRead | IsInvalidate | IsResponse |
204 | NeedsResponse,// | HasData | 206 | NeedsResponse | HasData |
205 }; 206 207 /** Return the string name of the cmd field (for debugging and 208 * tracing). */ 209 const std::string &cmdString() const; 210 211 /** Reutrn the string to a cmd given by idx. */ 212 const std::string &cmdIdxToString(Command idx); --- 168 unchanged lines hidden --- | 207 }; 208 209 /** Return the string name of the cmd field (for debugging and 210 * tracing). */ 211 const std::string &cmdString() const; 212 213 /** Reutrn the string to a cmd given by idx. */ 214 const std::string &cmdIdxToString(Command idx); --- 168 unchanged lines hidden --- |