packet.hh (9546:ac0c18d738ce) packet.hh (9547:6d81435f56cb)
1/*
2 * Copyright (c) 2012-2013 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

325 * These values specify the range of bytes found that satisfy a
326 * functional read.
327 */
328 uint16_t bytesValidStart;
329 uint16_t bytesValidEnd;
330
331 public:
332
1/*
2 * Copyright (c) 2012-2013 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

325 * These values specify the range of bytes found that satisfy a
326 * functional read.
327 */
328 uint16_t bytesValidStart;
329 uint16_t bytesValidEnd;
330
331 public:
332
333 /// The time at which the packet will be fully transmitted
334 Tick finishTime;
333 /**
334 * The extra delay from seeing the packet until the first word is
335 * transmitted by the bus that provided it (if any). This delay is
336 * used to communicate the bus waiting time to the neighbouring
337 * object (e.g. a cache) that actually makes the packet wait. As
338 * the delay is relative, a 32-bit unsigned should be sufficient.
339 */
340 uint32_t busFirstWordDelay;
335
341
336 /// The time at which the first chunk of the packet will be transmitted
337 Tick firstWordTime;
342 /**
343 * The extra delay from seeing the packet until the last word is
344 * transmitted by the bus that provided it (if any). Similar to
345 * the first word time, this is used to make up for the fact that
346 * the bus does not make the packet wait. As the delay is relative,
347 * a 32-bit unsigned should be sufficient.
348 */
349 uint32_t busLastWordDelay;
338
339 /**
340 * A virtual base opaque structure used to hold state associated
341 * with the packet (e.g., an MSHR), specific to a MemObject that
342 * sees the packet. A pointer to this state is returned in the
343 * packet's response so that the MemObject in question can quickly
344 * look up the state needed to process it. A specific subclass
345 * would be derived from this to carry state specific to a

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

578 * Constructor. Note that a Request object must be constructed
579 * first, but the Requests's physical address and size fields need
580 * not be valid. The command must be supplied.
581 */
582 Packet(Request *_req, MemCmd _cmd)
583 : cmd(_cmd), req(_req), data(NULL),
584 src(InvalidPortID), dest(InvalidPortID),
585 bytesValidStart(0), bytesValidEnd(0),
350
351 /**
352 * A virtual base opaque structure used to hold state associated
353 * with the packet (e.g., an MSHR), specific to a MemObject that
354 * sees the packet. A pointer to this state is returned in the
355 * packet's response so that the MemObject in question can quickly
356 * look up the state needed to process it. A specific subclass
357 * would be derived from this to carry state specific to a

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

590 * Constructor. Note that a Request object must be constructed
591 * first, but the Requests's physical address and size fields need
592 * not be valid. The command must be supplied.
593 */
594 Packet(Request *_req, MemCmd _cmd)
595 : cmd(_cmd), req(_req), data(NULL),
596 src(InvalidPortID), dest(InvalidPortID),
597 bytesValidStart(0), bytesValidEnd(0),
598 busFirstWordDelay(0), busLastWordDelay(0),
586 senderState(NULL)
587 {
588 if (req->hasPaddr()) {
589 addr = req->getPaddr();
590 flags.set(VALID_ADDR);
591 }
592 if (req->hasSize()) {
593 size = req->getSize();

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

599 * Alternate constructor if you are trying to create a packet with
600 * a request that is for a whole block, not the address from the
601 * req. this allows for overriding the size/addr of the req.
602 */
603 Packet(Request *_req, MemCmd _cmd, int _blkSize)
604 : cmd(_cmd), req(_req), data(NULL),
605 src(InvalidPortID), dest(InvalidPortID),
606 bytesValidStart(0), bytesValidEnd(0),
599 senderState(NULL)
600 {
601 if (req->hasPaddr()) {
602 addr = req->getPaddr();
603 flags.set(VALID_ADDR);
604 }
605 if (req->hasSize()) {
606 size = req->getSize();

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

612 * Alternate constructor if you are trying to create a packet with
613 * a request that is for a whole block, not the address from the
614 * req. this allows for overriding the size/addr of the req.
615 */
616 Packet(Request *_req, MemCmd _cmd, int _blkSize)
617 : cmd(_cmd), req(_req), data(NULL),
618 src(InvalidPortID), dest(InvalidPortID),
619 bytesValidStart(0), bytesValidEnd(0),
620 busFirstWordDelay(0), busLastWordDelay(0),
607 senderState(NULL)
608 {
609 if (req->hasPaddr()) {
610 addr = req->getPaddr() & ~(_blkSize - 1);
611 flags.set(VALID_ADDR);
612 }
613 size = _blkSize;
614 flags.set(VALID_SIZE);

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

620 * that, as we can't guarantee that the new packet's lifetime is
621 * less than that of the original packet. In this case the new
622 * packet should allocate its own data.
623 */
624 Packet(Packet *pkt, bool clearFlags = false)
625 : cmd(pkt->cmd), req(pkt->req),
626 data(pkt->flags.isSet(STATIC_DATA) ? pkt->data : NULL),
627 addr(pkt->addr), size(pkt->size), src(pkt->src), dest(pkt->dest),
621 senderState(NULL)
622 {
623 if (req->hasPaddr()) {
624 addr = req->getPaddr() & ~(_blkSize - 1);
625 flags.set(VALID_ADDR);
626 }
627 size = _blkSize;
628 flags.set(VALID_SIZE);

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

634 * that, as we can't guarantee that the new packet's lifetime is
635 * less than that of the original packet. In this case the new
636 * packet should allocate its own data.
637 */
638 Packet(Packet *pkt, bool clearFlags = false)
639 : cmd(pkt->cmd), req(pkt->req),
640 data(pkt->flags.isSet(STATIC_DATA) ? pkt->data : NULL),
641 addr(pkt->addr), size(pkt->size), src(pkt->src), dest(pkt->dest),
628 bytesValidStart(pkt->bytesValidStart), bytesValidEnd(pkt->bytesValidEnd),
642 bytesValidStart(pkt->bytesValidStart),
643 bytesValidEnd(pkt->bytesValidEnd),
644 busFirstWordDelay(pkt->busFirstWordDelay),
645 busLastWordDelay(pkt->busLastWordDelay),
629 senderState(pkt->senderState)
630 {
631 if (!clearFlags)
632 flags.set(pkt->flags & COPY_FLAGS);
633
634 flags.set(pkt->flags & (VALID_ADDR|VALID_SIZE));
635 flags.set(pkt->flags & STATIC_DATA);
636

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

659 void
660 reinitFromRequest()
661 {
662 assert(req->hasPaddr());
663 flags = 0;
664 addr = req->getPaddr();
665 size = req->getSize();
666
646 senderState(pkt->senderState)
647 {
648 if (!clearFlags)
649 flags.set(pkt->flags & COPY_FLAGS);
650
651 flags.set(pkt->flags & (VALID_ADDR|VALID_SIZE));
652 flags.set(pkt->flags & STATIC_DATA);
653

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

676 void
677 reinitFromRequest()
678 {
679 assert(req->hasPaddr());
680 flags = 0;
681 addr = req->getPaddr();
682 size = req->getSize();
683
684 src = InvalidPortID;
685 dest = InvalidPortID;
686 bytesValidStart = 0;
687 bytesValidEnd = 0;
688 busFirstWordDelay = 0;
689 busLastWordDelay = 0;
690
667 flags.set(VALID_ADDR|VALID_SIZE);
668 deleteData();
669 }
670
671 /**
672 * Take a request packet and modify it in place to be suitable for
673 * returning as a response to that request. The source field is
674 * turned into the destination, and subsequently cleared. Note

--- 230 unchanged lines hidden ---
691 flags.set(VALID_ADDR|VALID_SIZE);
692 deleteData();
693 }
694
695 /**
696 * Take a request packet and modify it in place to be suitable for
697 * returning as a response to that request. The source field is
698 * turned into the destination, and subsequently cleared. Note

--- 230 unchanged lines hidden ---