packet.hh (10583:d1e1e8588881) packet.hh (10660:87f7b5a07584)
1/*
2 * Copyright (c) 2012-2014 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

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

291
292 /// True if the request targets the secure memory space.
293 bool _isSecure;
294
295 /// The size of the request or transfer.
296 unsigned size;
297
298 /**
1/*
2 * Copyright (c) 2012-2014 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

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

291
292 /// True if the request targets the secure memory space.
293 bool _isSecure;
294
295 /// The size of the request or transfer.
296 unsigned size;
297
298 /**
299 * Source port identifier set on a request packet to enable
300 * appropriate routing of the responses. The source port
301 * identifier is set by any multiplexing component, e.g. a
302 * crossbar, as the timing responses need this information to be
303 * routed back to the appropriate port at a later point in
304 * time. The field can be updated (over-written) as the request
305 * packet passes through additional multiplexing components, and
306 * it is their responsibility to remember the original source port
307 * identifier, for example by using an appropriate sender
308 * state. The latter is done in the cache and bridge.
309 */
310 PortID src;
311
312 /**
313 * Destination port identifier that is present on all response
314 * packets that passed through a multiplexing component as a
315 * request packet. The source port identifier is turned into a
316 * destination port identifier when the packet is turned into a
317 * response, and the destination is used, e.g. by the crossbar, to
318 * select the appropriate path through the interconnect.
319 */
320 PortID dest;
321
322 /**
323 * The original value of the command field. Only valid when the
324 * current command field is an error condition; in that case, the
325 * previous contents of the command field are copied here. This
326 * field is *not* set on non-error responses.
327 */
328 MemCmd origCmd;
329
330 /**

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

542 {
543 assert(isResponse());
544 cmd = MemCmd::BadAddressError;
545 }
546
547 bool hadBadAddress() const { return cmd == MemCmd::BadAddressError; }
548 void copyError(Packet *pkt) { assert(pkt->isError()); cmd = pkt->cmd; }
549
299 * The original value of the command field. Only valid when the
300 * current command field is an error condition; in that case, the
301 * previous contents of the command field are copied here. This
302 * field is *not* set on non-error responses.
303 */
304 MemCmd origCmd;
305
306 /**

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

518 {
519 assert(isResponse());
520 cmd = MemCmd::BadAddressError;
521 }
522
523 bool hadBadAddress() const { return cmd == MemCmd::BadAddressError; }
524 void copyError(Packet *pkt) { assert(pkt->isError()); cmd = pkt->cmd; }
525
550 /// Accessor function to get the source index of the packet.
551 PortID getSrc() const { return src; }
552 /// Accessor function to set the source index of the packet.
553 void setSrc(PortID _src) { src = _src; }
554
555 /// Accessor function for the destination index of the packet.
556 PortID getDest() const { return dest; }
557 /// Accessor function to set the destination index of the packet.
558 void setDest(PortID _dest) { dest = _dest; }
559 /// Reset destination field, e.g. to turn a response into a request again.
560 void clearDest() { dest = InvalidPortID; }
561
562 Addr getAddr() const { assert(flags.isSet(VALID_ADDR)); return addr; }
563 /**
564 * Update the address of this packet mid-transaction. This is used
565 * by the address mapper to change an already set address to a new
566 * one based on the system configuration. It is intended to remap
567 * an existing address, so it asserts that the current address is
568 * valid.
569 */

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

604
605 /**
606 * Constructor. Note that a Request object must be constructed
607 * first, but the Requests's physical address and size fields need
608 * not be valid. The command must be supplied.
609 */
610 Packet(const RequestPtr _req, MemCmd _cmd)
611 : cmd(_cmd), req(_req), data(nullptr), addr(0), _isSecure(false),
526 Addr getAddr() const { assert(flags.isSet(VALID_ADDR)); return addr; }
527 /**
528 * Update the address of this packet mid-transaction. This is used
529 * by the address mapper to change an already set address to a new
530 * one based on the system configuration. It is intended to remap
531 * an existing address, so it asserts that the current address is
532 * valid.
533 */

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

568
569 /**
570 * Constructor. Note that a Request object must be constructed
571 * first, but the Requests's physical address and size fields need
572 * not be valid. The command must be supplied.
573 */
574 Packet(const RequestPtr _req, MemCmd _cmd)
575 : cmd(_cmd), req(_req), data(nullptr), addr(0), _isSecure(false),
612 size(0), src(InvalidPortID), dest(InvalidPortID),
613 bytesValidStart(0), bytesValidEnd(0),
576 size(0), bytesValidStart(0), bytesValidEnd(0),
614 firstWordDelay(0), lastWordDelay(0),
615 senderState(NULL)
616 {
617 if (req->hasPaddr()) {
618 addr = req->getPaddr();
619 flags.set(VALID_ADDR);
620 _isSecure = req->isSecure();
621 }

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

627
628 /**
629 * Alternate constructor if you are trying to create a packet with
630 * a request that is for a whole block, not the address from the
631 * req. this allows for overriding the size/addr of the req.
632 */
633 Packet(const RequestPtr _req, MemCmd _cmd, int _blkSize)
634 : cmd(_cmd), req(_req), data(nullptr), addr(0), _isSecure(false),
577 firstWordDelay(0), lastWordDelay(0),
578 senderState(NULL)
579 {
580 if (req->hasPaddr()) {
581 addr = req->getPaddr();
582 flags.set(VALID_ADDR);
583 _isSecure = req->isSecure();
584 }

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

590
591 /**
592 * Alternate constructor if you are trying to create a packet with
593 * a request that is for a whole block, not the address from the
594 * req. this allows for overriding the size/addr of the req.
595 */
596 Packet(const RequestPtr _req, MemCmd _cmd, int _blkSize)
597 : cmd(_cmd), req(_req), data(nullptr), addr(0), _isSecure(false),
635 src(InvalidPortID), dest(InvalidPortID),
636 bytesValidStart(0), bytesValidEnd(0),
637 firstWordDelay(0), lastWordDelay(0),
638 senderState(NULL)
639 {
640 if (req->hasPaddr()) {
641 addr = req->getPaddr() & ~(_blkSize - 1);
642 flags.set(VALID_ADDR);
643 _isSecure = req->isSecure();

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

652 * that, as we can't guarantee that the new packet's lifetime is
653 * less than that of the original packet. In this case the new
654 * packet should allocate its own data.
655 */
656 Packet(PacketPtr pkt, bool clear_flags, bool alloc_data)
657 : cmd(pkt->cmd), req(pkt->req),
658 data(nullptr),
659 addr(pkt->addr), _isSecure(pkt->_isSecure), size(pkt->size),
598 bytesValidStart(0), bytesValidEnd(0),
599 firstWordDelay(0), lastWordDelay(0),
600 senderState(NULL)
601 {
602 if (req->hasPaddr()) {
603 addr = req->getPaddr() & ~(_blkSize - 1);
604 flags.set(VALID_ADDR);
605 _isSecure = req->isSecure();

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

614 * that, as we can't guarantee that the new packet's lifetime is
615 * less than that of the original packet. In this case the new
616 * packet should allocate its own data.
617 */
618 Packet(PacketPtr pkt, bool clear_flags, bool alloc_data)
619 : cmd(pkt->cmd), req(pkt->req),
620 data(nullptr),
621 addr(pkt->addr), _isSecure(pkt->_isSecure), size(pkt->size),
660 src(pkt->src), dest(pkt->dest),
661 bytesValidStart(pkt->bytesValidStart),
662 bytesValidEnd(pkt->bytesValidEnd),
663 firstWordDelay(pkt->firstWordDelay),
664 lastWordDelay(pkt->lastWordDelay),
665 senderState(pkt->senderState)
666 {
667 if (!clear_flags)
668 flags.set(pkt->flags & COPY_FLAGS);

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

738 // never get the chance.
739 if (req && isRequest() && !needsResponse())
740 delete req;
741 deleteData();
742 }
743
744 /**
745 * Take a request packet and modify it in place to be suitable for
622 bytesValidStart(pkt->bytesValidStart),
623 bytesValidEnd(pkt->bytesValidEnd),
624 firstWordDelay(pkt->firstWordDelay),
625 lastWordDelay(pkt->lastWordDelay),
626 senderState(pkt->senderState)
627 {
628 if (!clear_flags)
629 flags.set(pkt->flags & COPY_FLAGS);

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

699 // never get the chance.
700 if (req && isRequest() && !needsResponse())
701 delete req;
702 deleteData();
703 }
704
705 /**
706 * Take a request packet and modify it in place to be suitable for
746 * returning as a response to that request. The source field is
747 * turned into the destination, and subsequently cleared. Note
748 * that the latter is not necessary for atomic requests, but
749 * causes no harm as neither field is valid.
707 * returning as a response to that request.
750 */
751 void
752 makeResponse()
753 {
754 assert(needsResponse());
755 assert(isRequest());
756 origCmd = cmd;
757 cmd = cmd.responseCommand();
758
759 // responses are never express, even if the snoop that
760 // triggered them was
761 flags.clear(EXPRESS_SNOOP);
708 */
709 void
710 makeResponse()
711 {
712 assert(needsResponse());
713 assert(isRequest());
714 origCmd = cmd;
715 cmd = cmd.responseCommand();
716
717 // responses are never express, even if the snoop that
718 // triggered them was
719 flags.clear(EXPRESS_SNOOP);
762
763 dest = src;
764 src = InvalidPortID;
765 }
766
767 void
768 makeAtomicResponse()
769 {
770 makeResponse();
771 }
772

--- 250 unchanged lines hidden ---
720 }
721
722 void
723 makeAtomicResponse()
724 {
725 makeResponse();
726 }
727

--- 250 unchanged lines hidden ---