packet.hh (7691:358c00c482f7) | packet.hh (7823:dac01f14f20f) |
---|---|
1/* 2 * Copyright (c) 2006 The Regents of The University of Michigan 3 * Copyright (c) 2010 Advanced Micro Devices, Inc. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 482 unchanged lines hidden (view full) --- 491 /** 492 * Constructor. Note that a Request object must be constructed 493 * first, but the Requests's physical address and size fields need 494 * not be valid. The command and destination addresses must be 495 * supplied. 496 */ 497 Packet(Request *_req, MemCmd _cmd, NodeID _dest) 498 : flags(VALID_DST), cmd(_cmd), req(_req), data(NULL), | 1/* 2 * Copyright (c) 2006 The Regents of The University of Michigan 3 * Copyright (c) 2010 Advanced Micro Devices, Inc. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 482 unchanged lines hidden (view full) --- 491 /** 492 * Constructor. Note that a Request object must be constructed 493 * first, but the Requests's physical address and size fields need 494 * not be valid. The command and destination addresses must be 495 * supplied. 496 */ 497 Packet(Request *_req, MemCmd _cmd, NodeID _dest) 498 : flags(VALID_DST), cmd(_cmd), req(_req), data(NULL), |
499 dest(_dest), time(curTick), senderState(NULL) | 499 dest(_dest), time(curTick()), senderState(NULL) |
500 { 501 if (req->hasPaddr()) { 502 addr = req->getPaddr(); 503 flags.set(VALID_ADDR); 504 } 505 if (req->hasSize()) { 506 size = req->getSize(); 507 flags.set(VALID_SIZE); 508 } 509 } 510 511 /** 512 * Alternate constructor if you are trying to create a packet with 513 * a request that is for a whole block, not the address from the 514 * req. this allows for overriding the size/addr of the req. 515 */ 516 Packet(Request *_req, MemCmd _cmd, NodeID _dest, int _blkSize) 517 : flags(VALID_DST), cmd(_cmd), req(_req), data(NULL), | 500 { 501 if (req->hasPaddr()) { 502 addr = req->getPaddr(); 503 flags.set(VALID_ADDR); 504 } 505 if (req->hasSize()) { 506 size = req->getSize(); 507 flags.set(VALID_SIZE); 508 } 509 } 510 511 /** 512 * Alternate constructor if you are trying to create a packet with 513 * a request that is for a whole block, not the address from the 514 * req. this allows for overriding the size/addr of the req. 515 */ 516 Packet(Request *_req, MemCmd _cmd, NodeID _dest, int _blkSize) 517 : flags(VALID_DST), cmd(_cmd), req(_req), data(NULL), |
518 dest(_dest), time(curTick), senderState(NULL) | 518 dest(_dest), time(curTick()), senderState(NULL) |
519 { 520 if (req->hasPaddr()) { 521 addr = req->getPaddr() & ~(_blkSize - 1); 522 flags.set(VALID_ADDR); 523 } 524 size = _blkSize; 525 flags.set(VALID_SIZE); 526 } --- 4 unchanged lines hidden (view full) --- 531 * that, as we can't guarantee that the new packet's lifetime is 532 * less than that of the original packet. In this case the new 533 * packet should allocate its own data. 534 */ 535 Packet(Packet *pkt, bool clearFlags = false) 536 : cmd(pkt->cmd), req(pkt->req), 537 data(pkt->flags.isSet(STATIC_DATA) ? pkt->data : NULL), 538 addr(pkt->addr), size(pkt->size), src(pkt->src), dest(pkt->dest), | 519 { 520 if (req->hasPaddr()) { 521 addr = req->getPaddr() & ~(_blkSize - 1); 522 flags.set(VALID_ADDR); 523 } 524 size = _blkSize; 525 flags.set(VALID_SIZE); 526 } --- 4 unchanged lines hidden (view full) --- 531 * that, as we can't guarantee that the new packet's lifetime is 532 * less than that of the original packet. In this case the new 533 * packet should allocate its own data. 534 */ 535 Packet(Packet *pkt, bool clearFlags = false) 536 : cmd(pkt->cmd), req(pkt->req), 537 data(pkt->flags.isSet(STATIC_DATA) ? pkt->data : NULL), 538 addr(pkt->addr), size(pkt->size), src(pkt->src), dest(pkt->dest), |
539 time(curTick), senderState(pkt->senderState) | 539 time(curTick()), senderState(pkt->senderState) |
540 { 541 if (!clearFlags) 542 flags.set(pkt->flags & COPY_FLAGS); 543 544 flags.set(pkt->flags & (VALID_ADDR|VALID_SIZE|VALID_SRC|VALID_DST)); 545 flags.set(pkt->flags & STATIC_DATA); 546 } 547 --- 270 unchanged lines hidden --- | 540 { 541 if (!clearFlags) 542 flags.set(pkt->flags & COPY_FLAGS); 543 544 flags.set(pkt->flags & (VALID_ADDR|VALID_SIZE|VALID_SRC|VALID_DST)); 545 flags.set(pkt->flags & STATIC_DATA); 546 } 547 --- 270 unchanged lines hidden --- |