packet.hh (8436:5648986156db) packet.hh (8668:be72c2a127b2)
1/*
2 * Copyright (c) 2006 The Regents of The University of Michigan
3 * Copyright (c) 2010 Advanced Micro Devices, Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

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

294 /**
295 * The original value of the command field. Only valid when the
296 * current command field is an error condition; in that case, the
297 * previous contents of the command field are copied here. This
298 * field is *not* set on non-error responses.
299 */
300 MemCmd origCmd;
301
1/*
2 * Copyright (c) 2006 The Regents of The University of Michigan
3 * Copyright (c) 2010 Advanced Micro Devices, Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

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

294 /**
295 * The original value of the command field. Only valid when the
296 * current command field is an error condition; in that case, the
297 * previous contents of the command field are copied here. This
298 * field is *not* set on non-error responses.
299 */
300 MemCmd origCmd;
301
302 /**
303 * These values specify the range of bytes found that satisfy a
304 * functional read.
305 */
306 uint16_t bytesValidStart;
307 uint16_t bytesValidEnd;
308
302 public:
303 /// Used to calculate latencies for each packet.
304 Tick time;
305
306 /// The time at which the packet will be fully transmitted
307 Tick finishTime;
308
309 /// The time at which the first chunk of the packet will be transmitted

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

502 /**
503 * Constructor. Note that a Request object must be constructed
504 * first, but the Requests's physical address and size fields need
505 * not be valid. The command and destination addresses must be
506 * supplied.
507 */
508 Packet(Request *_req, MemCmd _cmd, NodeID _dest)
509 : flags(VALID_DST), cmd(_cmd), req(_req), data(NULL),
309 public:
310 /// Used to calculate latencies for each packet.
311 Tick time;
312
313 /// The time at which the packet will be fully transmitted
314 Tick finishTime;
315
316 /// The time at which the first chunk of the packet will be transmitted

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

509 /**
510 * Constructor. Note that a Request object must be constructed
511 * first, but the Requests's physical address and size fields need
512 * not be valid. The command and destination addresses must be
513 * supplied.
514 */
515 Packet(Request *_req, MemCmd _cmd, NodeID _dest)
516 : flags(VALID_DST), cmd(_cmd), req(_req), data(NULL),
510 dest(_dest), time(curTick()), senderState(NULL)
517 dest(_dest), bytesValidStart(0), bytesValidEnd(0),
518 time(curTick()), senderState(NULL)
511 {
512 if (req->hasPaddr()) {
513 addr = req->getPaddr();
514 flags.set(VALID_ADDR);
515 }
516 if (req->hasSize()) {
517 size = req->getSize();
518 flags.set(VALID_SIZE);
519 }
520 }
521
522 /**
523 * Alternate constructor if you are trying to create a packet with
524 * a request that is for a whole block, not the address from the
525 * req. this allows for overriding the size/addr of the req.
526 */
527 Packet(Request *_req, MemCmd _cmd, NodeID _dest, int _blkSize)
528 : flags(VALID_DST), cmd(_cmd), req(_req), data(NULL),
519 {
520 if (req->hasPaddr()) {
521 addr = req->getPaddr();
522 flags.set(VALID_ADDR);
523 }
524 if (req->hasSize()) {
525 size = req->getSize();
526 flags.set(VALID_SIZE);
527 }
528 }
529
530 /**
531 * Alternate constructor if you are trying to create a packet with
532 * a request that is for a whole block, not the address from the
533 * req. this allows for overriding the size/addr of the req.
534 */
535 Packet(Request *_req, MemCmd _cmd, NodeID _dest, int _blkSize)
536 : flags(VALID_DST), cmd(_cmd), req(_req), data(NULL),
529 dest(_dest), time(curTick()), senderState(NULL)
537 dest(_dest), bytesValidStart(0), bytesValidEnd(0),
538 time(curTick()), senderState(NULL)
530 {
531 if (req->hasPaddr()) {
532 addr = req->getPaddr() & ~(_blkSize - 1);
533 flags.set(VALID_ADDR);
534 }
535 size = _blkSize;
536 flags.set(VALID_SIZE);
537 }

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

542 * that, as we can't guarantee that the new packet's lifetime is
543 * less than that of the original packet. In this case the new
544 * packet should allocate its own data.
545 */
546 Packet(Packet *pkt, bool clearFlags = false)
547 : cmd(pkt->cmd), req(pkt->req),
548 data(pkt->flags.isSet(STATIC_DATA) ? pkt->data : NULL),
549 addr(pkt->addr), size(pkt->size), src(pkt->src), dest(pkt->dest),
539 {
540 if (req->hasPaddr()) {
541 addr = req->getPaddr() & ~(_blkSize - 1);
542 flags.set(VALID_ADDR);
543 }
544 size = _blkSize;
545 flags.set(VALID_SIZE);
546 }

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

551 * that, as we can't guarantee that the new packet's lifetime is
552 * less than that of the original packet. In this case the new
553 * packet should allocate its own data.
554 */
555 Packet(Packet *pkt, bool clearFlags = false)
556 : cmd(pkt->cmd), req(pkt->req),
557 data(pkt->flags.isSet(STATIC_DATA) ? pkt->data : NULL),
558 addr(pkt->addr), size(pkt->size), src(pkt->src), dest(pkt->dest),
559 bytesValidStart(pkt->bytesValidStart), bytesValidEnd(pkt->bytesValidEnd),
550 time(curTick()), senderState(pkt->senderState)
551 {
552 if (!clearFlags)
553 flags.set(pkt->flags & COPY_FLAGS);
554
555 flags.set(pkt->flags & (VALID_ADDR|VALID_SIZE|VALID_SRC|VALID_DST));
556 flags.set(pkt->flags & STATIC_DATA);
560 time(curTick()), senderState(pkt->senderState)
561 {
562 if (!clearFlags)
563 flags.set(pkt->flags & COPY_FLAGS);
564
565 flags.set(pkt->flags & (VALID_ADDR|VALID_SIZE|VALID_SRC|VALID_DST));
566 flags.set(pkt->flags & STATIC_DATA);
567
557 }
558
559 /**
560 * clean up packet variables
561 */
562 ~Packet()
563 {
564 // If this is a request packet for which there's no response,

--- 275 unchanged lines hidden ---
568 }
569
570 /**
571 * clean up packet variables
572 */
573 ~Packet()
574 {
575 // If this is a request packet for which there's no response,

--- 275 unchanged lines hidden ---