#include "base/cast.hh"
#include "base/compiler.hh"
-#include "base/fast_alloc.hh"
#include "base/flags.hh"
#include "base/misc.hh"
#include "base/printable.hh"
// @TODO these should be classified as responses rather than
// requests; coding them as requests initially for backwards
// compatibility
- NetworkNackError, // nacked at network layer (not by protocol)
InvalidDestError, // packet dest field invalid
BadAddressError, // memory address invalid
FunctionalReadError, // unable to fulfill functional read
* ultimate destination and back, possibly being conveyed by several
* different Packets along the way.)
*/
-class Packet : public FastAlloc, public Printable
+class Packet : public Printable
{
public:
typedef uint32_t FlagsType;
* Object used to maintain state of a PrintReq. The senderState
* field of a PrintReq should always be of this type.
*/
- class PrintReqState : public SenderState, public FastAlloc
+ class PrintReqState : public SenderState
{
private:
/**
// Network error conditions... encapsulate them as methods since
// their encoding keeps changing (from result field to command
// field, etc.)
- void
- setNacked()
- {
- assert(isResponse());
- cmd = MemCmd::NetworkNackError;
- }
-
void
setBadAddress()
{
cmd = MemCmd::BadAddressError;
}
- bool wasNacked() const { return cmd == MemCmd::NetworkNackError; }
bool hadBadAddress() const { return cmd == MemCmd::BadAddressError; }
void copyError(Packet *pkt) { assert(pkt->isError()); cmd = pkt->cmd; }
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); }
}
}
- /**
- * Take a request packet that has been returned as NACKED and
- * modify it so that it can be sent out again. Only packets that
- * need a response can be NACKED, so verify that that is true.
- */
- void
- reinitNacked()
- {
- assert(wasNacked());
- cmd = origCmd;
- assert(needsResponse());
- clearDest();
- }
-
void
setSize(unsigned size)
{