- bool nic_pkt() { panic("Unimplemented"); M5_DUMMY_RETURN }
-
- /** Accessor function that returns the source index of the packet. */
- short getSrc() const { assert(srcValid); return src; }
- void setSrc(short _src) { src = _src; srcValid = true; }
- /** Reset source field, e.g. to retransmit packet on different bus. */
- void clearSrc() { srcValid = false; }
-
- /** Accessor function that returns the destination index of
- the packet. */
- short getDest() const { assert(destValid); return dest; }
- void setDest(short _dest) { dest = _dest; destValid = true; }
-
- Addr getAddr() const { assert(addrSizeValid); return addr; }
- int getSize() const { assert(addrSizeValid); return size; }
- Addr getOffset(int blkSize) const { return addr & (Addr)(blkSize - 1); }
-
- /** Constructor. Note that a Request object must be constructed
- * first, but the Requests's physical address and size fields
- * need not be valid. The command and destination addresses
- * must be supplied. */
- Packet(Request *_req, MemCmd _cmd, short _dest)
- : cmd(_cmd), req(_req),
- data(NULL), staticData(false), dynamicData(false), arrayData(false),
- addr(_req->paddr), size(_req->size), dest(_dest),
- addrSizeValid(_req->validPaddr), srcValid(false), destValid(true),
- flags(0), time(curTick), senderState(NULL)
+ bool isSrcValid() const { return src != InvalidPortID; }
+ /// Accessor function to get the source index of the packet.
+ PortID getSrc() const { assert(isSrcValid()); return src; }
+ /// Accessor function to set the source index of the packet.
+ void setSrc(PortID _src) { src = _src; }
+ /// Reset source field, e.g. to retransmit packet on different bus.
+ void clearSrc() { src = InvalidPortID; }
+
+ bool isDestValid() const { return dest != InvalidPortID; }
+ /// Accessor function for the destination index of the packet.
+ PortID getDest() const { assert(isDestValid()); return dest; }
+ /// Accessor function to set the destination index of the packet.
+ void setDest(PortID _dest) { dest = _dest; }
+ /// Reset destination field, e.g. to turn a response into a request again.
+ void clearDest() { dest = InvalidPortID; }
+
+ Addr getAddr() const { assert(flags.isSet(VALID_ADDR)); return addr; }
+ /**
+ * Update the address of this packet mid-transaction. This is used
+ * by the address mapper to change an already set address to a new
+ * one based on the system configuration. It is intended to remap
+ * an existing address, so it asserts that the current address is
+ * valid.
+ */
+ void setAddr(Addr _addr) { assert(flags.isSet(VALID_ADDR)); addr = _addr; }
+
+ unsigned getSize() const { assert(flags.isSet(VALID_SIZE)); return size; }
+ Addr getOffset(int blkSize) const { return getAddr() & (Addr)(blkSize - 1); }
+
+ /**
+ * It has been determined that the SC packet should successfully update
+ * memory. Therefore, convert this SC packet to a normal write.
+ */
+ void
+ convertScToWrite()