packet.hh (9044:904ddeecc653) | packet.hh (9165:f9e3dac185ba) |
---|---|
1/* 2 * Copyright (c) 2012 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 --- 106 unchanged lines hidden (view full) --- 115 SwapReq, 116 SwapResp, 117 MessageReq, 118 MessageResp, 119 // Error responses 120 // @TODO these should be classified as responses rather than 121 // requests; coding them as requests initially for backwards 122 // compatibility | 1/* 2 * Copyright (c) 2012 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 --- 106 unchanged lines hidden (view full) --- 115 SwapReq, 116 SwapResp, 117 MessageReq, 118 MessageResp, 119 // Error responses 120 // @TODO these should be classified as responses rather than 121 // requests; coding them as requests initially for backwards 122 // compatibility |
123 NetworkNackError, // nacked at network layer (not by protocol) | |
124 InvalidDestError, // packet dest field invalid 125 BadAddressError, // memory address invalid 126 FunctionalReadError, // unable to fulfill functional read 127 FunctionalWriteError, // unable to fulfill functional write 128 // Fake simulator-only commands 129 PrintReq, // Print state matching address 130 FlushReq, //request for a cache flush 131 InvalidationReq, // request for address to be invalidated from lsq --- 329 unchanged lines hidden (view full) --- 461 bool isSupplyExclusive() { return flags.isSet(SUPPLY_EXCLUSIVE); } 462 void setSuppressFuncError() { flags.set(SUPPRESS_FUNC_ERROR); } 463 bool suppressFuncError() { return flags.isSet(SUPPRESS_FUNC_ERROR); } 464 465 // Network error conditions... encapsulate them as methods since 466 // their encoding keeps changing (from result field to command 467 // field, etc.) 468 void | 123 InvalidDestError, // packet dest field invalid 124 BadAddressError, // memory address invalid 125 FunctionalReadError, // unable to fulfill functional read 126 FunctionalWriteError, // unable to fulfill functional write 127 // Fake simulator-only commands 128 PrintReq, // Print state matching address 129 FlushReq, //request for a cache flush 130 InvalidationReq, // request for address to be invalidated from lsq --- 329 unchanged lines hidden (view full) --- 460 bool isSupplyExclusive() { return flags.isSet(SUPPLY_EXCLUSIVE); } 461 void setSuppressFuncError() { flags.set(SUPPRESS_FUNC_ERROR); } 462 bool suppressFuncError() { return flags.isSet(SUPPRESS_FUNC_ERROR); } 463 464 // Network error conditions... encapsulate them as methods since 465 // their encoding keeps changing (from result field to command 466 // field, etc.) 467 void |
469 setNacked() 470 { 471 assert(isResponse()); 472 cmd = MemCmd::NetworkNackError; 473 } 474 475 void | |
476 setBadAddress() 477 { 478 assert(isResponse()); 479 cmd = MemCmd::BadAddressError; 480 } 481 | 468 setBadAddress() 469 { 470 assert(isResponse()); 471 cmd = MemCmd::BadAddressError; 472 } 473 |
482 bool wasNacked() const { return cmd == MemCmd::NetworkNackError; } | |
483 bool hadBadAddress() const { return cmd == MemCmd::BadAddressError; } 484 void copyError(Packet *pkt) { assert(pkt->isError()); cmd = pkt->cmd; } 485 486 bool isSrcValid() const { return src != InvalidPortID; } 487 /// Accessor function to get the source index of the packet. 488 PortID getSrc() const { assert(isSrcValid()); return src; } 489 /// Accessor function to set the source index of the packet. 490 void setSrc(PortID _src) { src = _src; } --- 173 unchanged lines hidden (view full) --- 664 if (isWrite()) { 665 cmd = MemCmd::FunctionalWriteError; 666 } else { 667 cmd = MemCmd::FunctionalReadError; 668 } 669 } 670 } 671 | 474 bool hadBadAddress() const { return cmd == MemCmd::BadAddressError; } 475 void copyError(Packet *pkt) { assert(pkt->isError()); cmd = pkt->cmd; } 476 477 bool isSrcValid() const { return src != InvalidPortID; } 478 /// Accessor function to get the source index of the packet. 479 PortID getSrc() const { assert(isSrcValid()); return src; } 480 /// Accessor function to set the source index of the packet. 481 void setSrc(PortID _src) { src = _src; } --- 173 unchanged lines hidden (view full) --- 655 if (isWrite()) { 656 cmd = MemCmd::FunctionalWriteError; 657 } else { 658 cmd = MemCmd::FunctionalReadError; 659 } 660 } 661 } 662 |
672 /** 673 * Take a request packet that has been returned as NACKED and 674 * modify it so that it can be sent out again. Only packets that 675 * need a response can be NACKED, so verify that that is true. 676 */ | |
677 void | 663 void |
678 reinitNacked() 679 { 680 assert(wasNacked()); 681 cmd = origCmd; 682 assert(needsResponse()); 683 clearDest(); 684 } 685 686 void | |
687 setSize(unsigned size) 688 { 689 assert(!flags.isSet(VALID_SIZE)); 690 691 this->size = size; 692 flags.set(VALID_SIZE); 693 } 694 --- 178 unchanged lines hidden --- | 664 setSize(unsigned size) 665 { 666 assert(!flags.isSet(VALID_SIZE)); 667 668 this->size = size; 669 flags.set(VALID_SIZE); 670 } 671 --- 178 unchanged lines hidden --- |