packet.hh (3018:6130a3c2db41) packet.hh (3039:9cec9533b941)
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;

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

218 bool isResponse() { return (cmd & IsResponse) != 0; }
219 bool needsResponse() { return (cmd & NeedsResponse) != 0; }
220 bool isInvalidate() { return (cmd & IsInvalidate) != 0; }
221
222 bool isCacheFill() { return (flags & CACHE_LINE_FILL) != 0; }
223 bool isNoAllocate() { return (flags & NO_ALLOCATE) != 0; }
224 bool isCompressed() { return (flags & COMPRESSED) != 0; }
225
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;

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

218 bool isResponse() { return (cmd & IsResponse) != 0; }
219 bool needsResponse() { return (cmd & NeedsResponse) != 0; }
220 bool isInvalidate() { return (cmd & IsInvalidate) != 0; }
221
222 bool isCacheFill() { return (flags & CACHE_LINE_FILL) != 0; }
223 bool isNoAllocate() { return (flags & NO_ALLOCATE) != 0; }
224 bool isCompressed() { return (flags & COMPRESSED) != 0; }
225
226 bool nic_pkt() { assert("Unimplemented\n" && 0); }
226 bool nic_pkt() { assert("Unimplemented\n" && 0); return false; }
227
228 /** Possible results of a packet's request. */
229 enum Result
230 {
231 Success,
232 BadAddress,
233 Nacked,
234 Unknown

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

261 : data(NULL), staticData(false), dynamicData(false), arrayData(false),
262 addr(_req->paddr), size(_req->size), dest(_dest),
263 addrSizeValid(_req->validPaddr),
264 srcValid(false),
265 req(_req), coherence(NULL), senderState(NULL), cmd(_cmd),
266 result(Unknown)
267 {
268 flags = 0;
227
228 /** Possible results of a packet's request. */
229 enum Result
230 {
231 Success,
232 BadAddress,
233 Nacked,
234 Unknown

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

261 : data(NULL), staticData(false), dynamicData(false), arrayData(false),
262 addr(_req->paddr), size(_req->size), dest(_dest),
263 addrSizeValid(_req->validPaddr),
264 srcValid(false),
265 req(_req), coherence(NULL), senderState(NULL), cmd(_cmd),
266 result(Unknown)
267 {
268 flags = 0;
269 time = curTick;
270 }
271
272 /** Alternate constructor if you are trying to create a packet with
273 * a request that is for a whole block, not the address from the req.
274 * this allows for overriding the size/addr of the req.*/
275 Packet(Request *_req, Command _cmd, short _dest, int _blkSize)
276 : data(NULL), staticData(false), dynamicData(false), arrayData(false),
277 addr(_req->paddr & ~(_blkSize - 1)), size(_blkSize),
278 dest(_dest),
279 addrSizeValid(_req->validPaddr), srcValid(false),
280 req(_req), coherence(NULL), senderState(NULL), cmd(_cmd),
281 result(Unknown)
282 {
283 flags = 0;
269 }
270
271 /** Alternate constructor if you are trying to create a packet with
272 * a request that is for a whole block, not the address from the req.
273 * this allows for overriding the size/addr of the req.*/
274 Packet(Request *_req, Command _cmd, short _dest, int _blkSize)
275 : data(NULL), staticData(false), dynamicData(false), arrayData(false),
276 addr(_req->paddr & ~(_blkSize - 1)), size(_blkSize),
277 dest(_dest),
278 addrSizeValid(_req->validPaddr), srcValid(false),
279 req(_req), coherence(NULL), senderState(NULL), cmd(_cmd),
280 result(Unknown)
281 {
282 flags = 0;
284 time = curTick;
285 }
286
287 /** Destructor. */
288 ~Packet()
289 { deleteData(); }
290
291 /** Reinitialize packet address and size from the associated
292 * Request object, and reset other fields that may have been
293 * modified by a previous transaction. Typically called when a
294 * statically allocated Request/Packet pair is reused for
295 * multiple transactions. */
296 void reinitFromRequest() {
297 assert(req->validPaddr);
298 addr = req->paddr;
299 size = req->size;
283 }
284
285 /** Destructor. */
286 ~Packet()
287 { deleteData(); }
288
289 /** Reinitialize packet address and size from the associated
290 * Request object, and reset other fields that may have been
291 * modified by a previous transaction. Typically called when a
292 * statically allocated Request/Packet pair is reused for
293 * multiple transactions. */
294 void reinitFromRequest() {
295 assert(req->validPaddr);
296 addr = req->paddr;
297 size = req->size;
300 time = req->time;
301 addrSizeValid = true;
302 result = Unknown;
303 if (dynamicData) {
304 deleteData();
305 dynamicData = false;
306 arrayData = false;
307 }
308 }

--- 66 unchanged lines hidden ---
298 addrSizeValid = true;
299 result = Unknown;
300 if (dynamicData) {
301 deleteData();
302 dynamicData = false;
303 arrayData = false;
304 }
305 }

--- 66 unchanged lines hidden ---