packet.hh (9543:a373b2e664ff) | packet.hh (9546:ac0c18d738ce) |
---|---|
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 --- 315 unchanged lines hidden (view full) --- 324 /** 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: | 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 --- 315 unchanged lines hidden (view full) --- 324 /** 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 /// Used to calculate latencies for each packet. 333 Tick time; | |
334 335 /// The time at which the packet will be fully transmitted 336 Tick finishTime; 337 338 /// The time at which the first chunk of the packet will be transmitted 339 Tick firstWordTime; 340 341 /** --- 238 unchanged lines hidden (view full) --- 580 * Constructor. Note that a Request object must be constructed 581 * first, but the Requests's physical address and size fields need 582 * not be valid. The command must be supplied. 583 */ 584 Packet(Request *_req, MemCmd _cmd) 585 : cmd(_cmd), req(_req), data(NULL), 586 src(InvalidPortID), dest(InvalidPortID), 587 bytesValidStart(0), bytesValidEnd(0), | 332 333 /// The time at which the packet will be fully transmitted 334 Tick finishTime; 335 336 /// The time at which the first chunk of the packet will be transmitted 337 Tick firstWordTime; 338 339 /** --- 238 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), |
588 time(curTick()), senderState(NULL) | 586 senderState(NULL) |
589 { 590 if (req->hasPaddr()) { 591 addr = req->getPaddr(); 592 flags.set(VALID_ADDR); 593 } 594 if (req->hasSize()) { 595 size = req->getSize(); 596 flags.set(VALID_SIZE); --- 4 unchanged lines hidden (view full) --- 601 * Alternate constructor if you are trying to create a packet with 602 * a request that is for a whole block, not the address from the 603 * req. this allows for overriding the size/addr of the req. 604 */ 605 Packet(Request *_req, MemCmd _cmd, int _blkSize) 606 : cmd(_cmd), req(_req), data(NULL), 607 src(InvalidPortID), dest(InvalidPortID), 608 bytesValidStart(0), bytesValidEnd(0), | 587 { 588 if (req->hasPaddr()) { 589 addr = req->getPaddr(); 590 flags.set(VALID_ADDR); 591 } 592 if (req->hasSize()) { 593 size = req->getSize(); 594 flags.set(VALID_SIZE); --- 4 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), |
609 time(curTick()), senderState(NULL) | 607 senderState(NULL) |
610 { 611 if (req->hasPaddr()) { 612 addr = req->getPaddr() & ~(_blkSize - 1); 613 flags.set(VALID_ADDR); 614 } 615 size = _blkSize; 616 flags.set(VALID_SIZE); 617 } --- 5 unchanged lines hidden (view full) --- 623 * less than that of the original packet. In this case the new 624 * packet should allocate its own data. 625 */ 626 Packet(Packet *pkt, bool clearFlags = false) 627 : cmd(pkt->cmd), req(pkt->req), 628 data(pkt->flags.isSet(STATIC_DATA) ? pkt->data : NULL), 629 addr(pkt->addr), size(pkt->size), src(pkt->src), dest(pkt->dest), 630 bytesValidStart(pkt->bytesValidStart), bytesValidEnd(pkt->bytesValidEnd), | 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); 615 } --- 5 unchanged lines hidden (view full) --- 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), 628 bytesValidStart(pkt->bytesValidStart), bytesValidEnd(pkt->bytesValidEnd), |
631 time(curTick()), senderState(pkt->senderState) | 629 senderState(pkt->senderState) |
632 { 633 if (!clearFlags) 634 flags.set(pkt->flags & COPY_FLAGS); 635 636 flags.set(pkt->flags & (VALID_ADDR|VALID_SIZE)); 637 flags.set(pkt->flags & STATIC_DATA); 638 639 } --- 20 unchanged lines hidden (view full) --- 660 */ 661 void 662 reinitFromRequest() 663 { 664 assert(req->hasPaddr()); 665 flags = 0; 666 addr = req->getPaddr(); 667 size = req->getSize(); | 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 637 } --- 20 unchanged lines hidden (view full) --- 658 */ 659 void 660 reinitFromRequest() 661 { 662 assert(req->hasPaddr()); 663 flags = 0; 664 addr = req->getPaddr(); 665 size = req->getSize(); |
668 time = req->time(); | |
669 670 flags.set(VALID_ADDR|VALID_SIZE); 671 deleteData(); 672 } 673 674 /** 675 * Take a request packet and modify it in place to be suitable for 676 * returning as a response to that request. The source field is --- 231 unchanged lines hidden --- | 666 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 --- 231 unchanged lines hidden --- |