packet.hh (9951:2f5eec8c1010) | packet.hh (10028:fb8c44de891a) |
---|---|
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 --- 272 unchanged lines hidden (view full) --- 281 * be allocated. 282 */ 283 PacketDataPtr data; 284 285 /// The address of the request. This address could be virtual or 286 /// physical, depending on the system configuration. 287 Addr addr; 288 | 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 --- 272 unchanged lines hidden (view full) --- 281 * be allocated. 282 */ 283 PacketDataPtr data; 284 285 /// The address of the request. This address could be virtual or 286 /// physical, depending on the system configuration. 287 Addr addr; 288 |
289 /// True if the request targets the secure memory space. 290 bool _isSecure; 291 |
|
289 /// The size of the request or transfer. 290 unsigned size; 291 292 /** 293 * Source port identifier set on a request packet to enable 294 * appropriate routing of the responses. The source port 295 * identifier is set by any multiplexing component, e.g. a bus, as 296 * the timing responses need this information to be routed back to --- 260 unchanged lines hidden (view full) --- 557 * an existing address, so it asserts that the current address is 558 * valid. 559 */ 560 void setAddr(Addr _addr) { assert(flags.isSet(VALID_ADDR)); addr = _addr; } 561 562 unsigned getSize() const { assert(flags.isSet(VALID_SIZE)); return size; } 563 Addr getOffset(int blkSize) const { return getAddr() & (Addr)(blkSize - 1); } 564 | 292 /// The size of the request or transfer. 293 unsigned size; 294 295 /** 296 * Source port identifier set on a request packet to enable 297 * appropriate routing of the responses. The source port 298 * identifier is set by any multiplexing component, e.g. a bus, as 299 * the timing responses need this information to be routed back to --- 260 unchanged lines hidden (view full) --- 560 * an existing address, so it asserts that the current address is 561 * valid. 562 */ 563 void setAddr(Addr _addr) { assert(flags.isSet(VALID_ADDR)); addr = _addr; } 564 565 unsigned getSize() const { assert(flags.isSet(VALID_SIZE)); return size; } 566 Addr getOffset(int blkSize) const { return getAddr() & (Addr)(blkSize - 1); } 567 |
568 bool isSecure() const 569 { 570 assert(flags.isSet(VALID_ADDR)); 571 return _isSecure; 572 } 573 |
|
565 /** 566 * It has been determined that the SC packet should successfully update 567 * memory. Therefore, convert this SC packet to a normal write. 568 */ 569 void 570 convertScToWrite() 571 { 572 assert(isLLSC()); --- 23 unchanged lines hidden (view full) --- 596 src(InvalidPortID), dest(InvalidPortID), 597 bytesValidStart(0), bytesValidEnd(0), 598 busFirstWordDelay(0), busLastWordDelay(0), 599 senderState(NULL) 600 { 601 if (req->hasPaddr()) { 602 addr = req->getPaddr(); 603 flags.set(VALID_ADDR); | 574 /** 575 * It has been determined that the SC packet should successfully update 576 * memory. Therefore, convert this SC packet to a normal write. 577 */ 578 void 579 convertScToWrite() 580 { 581 assert(isLLSC()); --- 23 unchanged lines hidden (view full) --- 605 src(InvalidPortID), dest(InvalidPortID), 606 bytesValidStart(0), bytesValidEnd(0), 607 busFirstWordDelay(0), busLastWordDelay(0), 608 senderState(NULL) 609 { 610 if (req->hasPaddr()) { 611 addr = req->getPaddr(); 612 flags.set(VALID_ADDR); |
613 _isSecure = req->isSecure(); |
|
604 } 605 if (req->hasSize()) { 606 size = req->getSize(); 607 flags.set(VALID_SIZE); 608 } 609 } 610 611 /** --- 6 unchanged lines hidden (view full) --- 618 src(InvalidPortID), dest(InvalidPortID), 619 bytesValidStart(0), bytesValidEnd(0), 620 busFirstWordDelay(0), busLastWordDelay(0), 621 senderState(NULL) 622 { 623 if (req->hasPaddr()) { 624 addr = req->getPaddr() & ~(_blkSize - 1); 625 flags.set(VALID_ADDR); | 614 } 615 if (req->hasSize()) { 616 size = req->getSize(); 617 flags.set(VALID_SIZE); 618 } 619 } 620 621 /** --- 6 unchanged lines hidden (view full) --- 628 src(InvalidPortID), dest(InvalidPortID), 629 bytesValidStart(0), bytesValidEnd(0), 630 busFirstWordDelay(0), busLastWordDelay(0), 631 senderState(NULL) 632 { 633 if (req->hasPaddr()) { 634 addr = req->getPaddr() & ~(_blkSize - 1); 635 flags.set(VALID_ADDR); |
636 _isSecure = req->isSecure(); |
|
626 } 627 size = _blkSize; 628 flags.set(VALID_SIZE); 629 } 630 631 /** 632 * Alternate constructor for copying a packet. Copy all fields 633 * *except* if the original packet's data was dynamic, don't copy 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), | 637 } 638 size = _blkSize; 639 flags.set(VALID_SIZE); 640 } 641 642 /** 643 * Alternate constructor for copying a packet. Copy all fields 644 * *except* if the original packet's data was dynamic, don't copy 645 * that, as we can't guarantee that the new packet's lifetime is 646 * less than that of the original packet. In this case the new 647 * packet should allocate its own data. 648 */ 649 Packet(Packet *pkt, bool clearFlags = false) 650 : cmd(pkt->cmd), req(pkt->req), 651 data(pkt->flags.isSet(STATIC_DATA) ? pkt->data : NULL), |
641 addr(pkt->addr), size(pkt->size), src(pkt->src), dest(pkt->dest), | 652 addr(pkt->addr), _isSecure(pkt->_isSecure), size(pkt->size), 653 src(pkt->src), dest(pkt->dest), |
642 bytesValidStart(pkt->bytesValidStart), 643 bytesValidEnd(pkt->bytesValidEnd), 644 busFirstWordDelay(pkt->busFirstWordDelay), 645 busLastWordDelay(pkt->busLastWordDelay), 646 senderState(pkt->senderState) 647 { 648 if (!clearFlags) 649 flags.set(pkt->flags & COPY_FLAGS); --- 24 unchanged lines hidden (view full) --- 674 * transactions. 675 */ 676 void 677 reinitFromRequest() 678 { 679 assert(req->hasPaddr()); 680 flags = 0; 681 addr = req->getPaddr(); | 654 bytesValidStart(pkt->bytesValidStart), 655 bytesValidEnd(pkt->bytesValidEnd), 656 busFirstWordDelay(pkt->busFirstWordDelay), 657 busLastWordDelay(pkt->busLastWordDelay), 658 senderState(pkt->senderState) 659 { 660 if (!clearFlags) 661 flags.set(pkt->flags & COPY_FLAGS); --- 24 unchanged lines hidden (view full) --- 686 * transactions. 687 */ 688 void 689 reinitFromRequest() 690 { 691 assert(req->hasPaddr()); 692 flags = 0; 693 addr = req->getPaddr(); |
694 _isSecure = req->isSecure(); |
|
682 size = req->getSize(); 683 684 src = InvalidPortID; 685 dest = InvalidPortID; 686 bytesValidStart = 0; 687 bytesValidEnd = 0; 688 busFirstWordDelay = 0; 689 busLastWordDelay = 0; --- 192 unchanged lines hidden (view full) --- 882 883 /** 884 * Check a functional request against a memory value represented 885 * by a base/size pair and an associated data array. If the 886 * functional request is a read, it may be satisfied by the memory 887 * value. If the functional request is a write, it may update the 888 * memory value. 889 */ | 695 size = req->getSize(); 696 697 src = InvalidPortID; 698 dest = InvalidPortID; 699 bytesValidStart = 0; 700 bytesValidEnd = 0; 701 busFirstWordDelay = 0; 702 busLastWordDelay = 0; --- 192 unchanged lines hidden (view full) --- 895 896 /** 897 * Check a functional request against a memory value represented 898 * by a base/size pair and an associated data array. If the 899 * functional request is a read, it may be satisfied by the memory 900 * value. If the functional request is a write, it may update the 901 * memory value. 902 */ |
890 bool checkFunctional(Printable *obj, Addr base, int size, uint8_t *data); | 903 bool checkFunctional(Printable *obj, Addr base, bool is_secure, int size, 904 uint8_t *data); |
891 892 /** 893 * Check a functional request against a memory value stored in 894 * another packet (i.e. an in-transit request or response). 895 */ 896 bool 897 checkFunctional(PacketPtr other) 898 { 899 uint8_t *data = other->hasData() ? other->getPtr<uint8_t>() : NULL; | 905 906 /** 907 * Check a functional request against a memory value stored in 908 * another packet (i.e. an in-transit request or response). 909 */ 910 bool 911 checkFunctional(PacketPtr other) 912 { 913 uint8_t *data = other->hasData() ? other->getPtr<uint8_t>() : NULL; |
900 return checkFunctional(other, other->getAddr(), other->getSize(), 901 data); | 914 return checkFunctional(other, other->getAddr(), other->isSecure(), 915 other->getSize(), data); |
902 } 903 904 /** 905 * Push label for PrintReq (safe to call unconditionally). 906 */ 907 void 908 pushLabel(const std::string &lbl) 909 { --- 27 unchanged lines hidden --- | 916 } 917 918 /** 919 * Push label for PrintReq (safe to call unconditionally). 920 */ 921 void 922 pushLabel(const std::string &lbl) 923 { --- 27 unchanged lines hidden --- |