packet.hh (3135:8e008e281579) packet.hh (3156:2e6fc95d9ccf)
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;

--- 160 unchanged lines hidden (view full) ---

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,
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;

--- 160 unchanged lines hidden (view full) ---

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
177 IsHWPrefetch = 1 << 8,
178 HasData = 1 << 9
178 };
179
180 public:
181 /** List of all commands associated with a packet. */
182 enum Command
183 {
184 InvalidCmd = 0,
185 ReadReq = IsRead | IsRequest | NeedsResponse,
179 };
180
181 public:
182 /** List of all commands associated with a packet. */
183 enum Command
184 {
185 InvalidCmd = 0,
186 ReadReq = IsRead | IsRequest | NeedsResponse,
186 WriteReq = IsWrite | IsRequest | NeedsResponse,
187 WriteReqNoAck = IsWrite | IsRequest,
188 ReadResp = IsRead | IsResponse | NeedsResponse,
187 WriteReq = IsWrite | IsRequest | NeedsResponse,// | HasData,
188 WriteReqNoAck = IsWrite | IsRequest,// | HasData,
189 ReadResp = IsRead | IsResponse | NeedsResponse,// | HasData,
189 WriteResp = IsWrite | IsResponse | NeedsResponse,
190 WriteResp = IsWrite | IsResponse | NeedsResponse,
190 Writeback = IsWrite | IsRequest,
191 Writeback = IsWrite | IsRequest,// | HasData,
191 SoftPFReq = IsRead | IsRequest | IsSWPrefetch | NeedsResponse,
192 HardPFReq = IsRead | IsRequest | IsHWPrefetch | NeedsResponse,
192 SoftPFReq = IsRead | IsRequest | IsSWPrefetch | NeedsResponse,
193 HardPFReq = IsRead | IsRequest | IsHWPrefetch | NeedsResponse,
193 SoftPFResp = IsRead | IsResponse | IsSWPrefetch | NeedsResponse,
194 HardPFResp = IsRead | IsResponse | IsHWPrefetch | NeedsResponse,
194 SoftPFResp = IsRead | IsResponse | IsSWPrefetch
195 | NeedsResponse,// | HasData,
196 HardPFResp = IsRead | IsResponse | IsHWPrefetch
197 | NeedsResponse,// | HasData,
195 InvalidateReq = IsInvalidate | IsRequest,
198 InvalidateReq = IsInvalidate | IsRequest,
196 WriteInvalidateReq = IsWrite | IsInvalidate | IsRequest,
199 WriteInvalidateReq = IsWrite | IsInvalidate | IsRequest,// | HasData,
197 UpgradeReq = IsInvalidate | IsRequest | NeedsResponse,
198 UpgradeResp = IsInvalidate | IsResponse | NeedsResponse,
199 ReadExReq = IsRead | IsInvalidate | IsRequest | NeedsResponse,
200 UpgradeReq = IsInvalidate | IsRequest | NeedsResponse,
201 UpgradeResp = IsInvalidate | IsResponse | NeedsResponse,
202 ReadExReq = IsRead | IsInvalidate | IsRequest | NeedsResponse,
200 ReadExResp = IsRead | IsInvalidate | IsResponse | NeedsResponse
203 ReadExResp = IsRead | IsInvalidate | IsResponse
204 | NeedsResponse,// | HasData
201 };
202
203 /** Return the string name of the cmd field (for debugging and
204 * tracing). */
205 const std::string &cmdString() const;
206
207 /** Reutrn the string to a cmd given by idx. */
208 const std::string &cmdIdxToString(Command idx);

--- 5 unchanged lines hidden (view full) ---

214 Command cmd;
215
216 bool isRead() { return (cmd & IsRead) != 0; }
217 bool isWrite() { return (cmd & IsWrite) != 0; }
218 bool isRequest() { return (cmd & IsRequest) != 0; }
219 bool isResponse() { return (cmd & IsResponse) != 0; }
220 bool needsResponse() { return (cmd & NeedsResponse) != 0; }
221 bool isInvalidate() { return (cmd & IsInvalidate) != 0; }
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);

--- 5 unchanged lines hidden (view full) ---

218 Command cmd;
219
220 bool isRead() { return (cmd & IsRead) != 0; }
221 bool isWrite() { return (cmd & IsWrite) != 0; }
222 bool isRequest() { return (cmd & IsRequest) != 0; }
223 bool isResponse() { return (cmd & IsResponse) != 0; }
224 bool needsResponse() { return (cmd & NeedsResponse) != 0; }
225 bool isInvalidate() { return (cmd & IsInvalidate) != 0; }
226 bool hasData() { return (cmd & HasData) != 0; }
222
223 bool isCacheFill() { return (flags & CACHE_LINE_FILL) != 0; }
224 bool isNoAllocate() { return (flags & NO_ALLOCATE) != 0; }
225 bool isCompressed() { return (flags & COMPRESSED) != 0; }
226
227 bool nic_pkt() { assert("Unimplemented\n" && 0); return false; }
228
229 /** Possible results of a packet's request. */

--- 77 unchanged lines hidden (view full) ---

307 arrayData = false;
308 }
309 }
310
311 /** Take a request packet and modify it in place to be suitable
312 * for returning as a response to that request. Used for timing
313 * accesses only. For atomic and functional accesses, the
314 * request packet is always implicitly passed back *without*
227
228 bool isCacheFill() { return (flags & CACHE_LINE_FILL) != 0; }
229 bool isNoAllocate() { return (flags & NO_ALLOCATE) != 0; }
230 bool isCompressed() { return (flags & COMPRESSED) != 0; }
231
232 bool nic_pkt() { assert("Unimplemented\n" && 0); return false; }
233
234 /** Possible results of a packet's request. */

--- 77 unchanged lines hidden (view full) ---

312 arrayData = false;
313 }
314 }
315
316 /** Take a request packet and modify it in place to be suitable
317 * for returning as a response to that request. Used for timing
318 * accesses only. For atomic and functional accesses, the
319 * request packet is always implicitly passed back *without*
315 * modifying the destination fields, so this function
320 * modifying the command or destination fields, so this function
316 * should not be called. */
317 void makeTimingResponse() {
318 assert(needsResponse());
319 assert(isRequest());
320 int icmd = (int)cmd;
321 icmd &= ~(IsRequest);
322 icmd |= IsResponse;
323 cmd = (Command)icmd;
324 dest = src;
325 srcValid = false;
326 }
327
321 * should not be called. */
322 void makeTimingResponse() {
323 assert(needsResponse());
324 assert(isRequest());
325 int icmd = (int)cmd;
326 icmd &= ~(IsRequest);
327 icmd |= IsResponse;
328 cmd = (Command)icmd;
329 dest = src;
330 srcValid = false;
331 }
332
328 /** Take a request packet and modify it in place to be suitable
329 * for returning as a response to that request.
330 */
331 void makeAtomicResponse() {
332 assert(needsResponse());
333 assert(isRequest());
334 int icmd = (int)cmd;
335 icmd &= ~(IsRequest);
336 icmd |= IsResponse;
337 cmd = (Command)icmd;
338 }
339
340 /** Take a request packet that has been returned as NACKED and modify it so
341 * that it can be sent out again. Only packets that need a response can be
342 * NACKED, so verify that that is true. */
343 void reinitNacked() {
344 assert(needsResponse() && result == Nacked);
345 dest = Broadcast;
346 result = Unknown;
347 }

--- 40 unchanged lines hidden ---
333 /** Take a request packet that has been returned as NACKED and modify it so
334 * that it can be sent out again. Only packets that need a response can be
335 * NACKED, so verify that that is true. */
336 void reinitNacked() {
337 assert(needsResponse() && result == Nacked);
338 dest = Broadcast;
339 result = Unknown;
340 }

--- 40 unchanged lines hidden ---