31,32c31
< * Declaration of the Packet Class, a packet is a transaction occuring
< * between a single level of the memory heirarchy (ie L1->L2).
---
> * Declaration of the Packet class.
47,57c46,50
< * A Packet is the structure to handle requests between two levels
< * of the memory system. The Request is a global object that trancends
< * all of the memory heirarchy, but at each levels interface a packet
< * is created to transfer data/requests. For example, a request would
< * be used to initiate a request to go to memory/IOdevices, as the request
< * passes through the memory system several packets will be created. One
< * will be created to go between the L1 and L2 caches and another to go to
< * the next level and so forth.
< *
< * Packets are assumed to be returned in the case of a single response. If
< * the transaction has no response, then the consumer will delete the packet.
---
> * A Packet is used to encapsulate a transfer between two objects in
> * the memory system (e.g., the L1 and L2 cache). (In contrast, a
> * single Request travels all the way from the requester to the
> * ultimate destination and back, possibly being conveyed by several
> * different Packets along the way.)
62,65c55,59
< /** A pointer to the data being transfered. It can be differnt sizes
< at each level of the heirarchy so it belongs in the packet,
< not request. This may or may not be populated when a responder recieves
< the packet. If not populated it memory should be allocated.
---
> /** A pointer to the data being transfered. It can be differnt
> * sizes at each level of the heirarchy so it belongs in the
> * packet, not request. This may or may not be populated when a
> * responder recieves the packet. If not populated it memory
> * should be allocated.
69,70c63,64
< /** Is the data pointer set to a value that shouldn't be freed when the
< * packet is destroyed? */
---
> /** Is the data pointer set to a value that shouldn't be freed
> * when the packet is destroyed? */
72,73c66,67
< /** The data pointer points to a value that should be freed when the packet
< * is destroyed. */
---
> /** The data pointer points to a value that should be freed when
> * the packet is destroyed. */
75,76c69,70
< /** the data pointer points to an array (thus delete [] ) needs to be called
< * on it rather than simply delete.*/
---
> /** the data pointer points to an array (thus delete [] ) needs to
> * be called on it rather than simply delete.*/
80,81c74,75
< /** The address of the request, could be virtual or physical (depending on
< cache configurations). */
---
> /** The address of the request. This address could be virtual or
> * physical, depending on the system configuration. */
84c78
< /** Indicates the size of the request. */
---
> /** The size of the request or transfer. */
87c81,84
< /** A index of the source of the transaction. */
---
> /** Device address (e.g., bus ID) of the source of the
> * transaction. The source is not responsible for setting this
> * field; it is set implicitly by the interconnect when the
> * packet * is first sent. */
90c87,91
< /** A index to the destination of the transaction. */
---
> /** Device address (e.g., bus ID) of the destination of the
> * transaction. The special value Broadcast indicates that the
> * packet should be routed based on its address. This field is
> * initialized in the constructor and is thus always valid
> * (unlike * addr, size, and src). */
92a94
> /** Is the 'addr' field valid? */
93a96
> /** Is the 'size' field valid? */
94a98
> /** Is the 'src' field valid? */
98a103,104
> /** The special destination address indicating that the packet
> * should be routed based on its address. */
101c107
< /** A pointer to the overall request. */
---
> /** A pointer to the original request. */
103a110,112
> /** A virtual base opaque structure used to hold coherence-related
> * state. A specific subclass would be derived from this to
> * carry state specific to a particular coherence protocol. */
109,112c118,121
< /** A virtual base opaque structure used to hold
< coherence status messages. */
< CoherenceState *coherence; // virtual base opaque,
< // assert(dynamic_cast<Foo>) etc.
---
> /** This packet's coherence state. Caches should use
> * dynamic_cast<> to cast to the state appropriate for the
> * system's coherence protocol. */
> CoherenceState *coherence;
113a123,129
> /** A virtual base opaque structure used to hold state associated
> * with the packet but specific to the sending device (e.g., an
> * MSHR). A pointer to this state is returned in the packet's
> * response so that the sender can quickly look up the state
> * needed to process it. A specific subclass would be derived
> * from this to carry state specific to a particular sending
> * device. */
119,121c135,137
< /** A virtual base opaque structure used to hold the senders state. */
< SenderState *senderState; // virtual base opaque,
< // assert(dynamic_cast<Foo>) etc.
---
> /** This packet's sender state. Devices should use dynamic_cast<>
> * to cast to the state appropriate to the sender. */
> SenderState *senderState;
146a163,164
> /** Return the string name of the cmd field (for debugging and
> * tracing). */
149c167
< /** The command of the transaction. */
---
> /** The command field of the packet. */
157,170c175
< void makeTimingResponse() {
< assert(needsResponse());
< int icmd = (int)cmd;
< icmd &= ~(IsRequest | NeedsResponse);
< icmd |= IsResponse;
< cmd = (Command)icmd;
< dest = src;
< srcValid = false;
< }
<
< /** The time this request was responded to. Used to calculate latencies. */
< Tick time;
<
< /** The result of a particular packets request. */
---
> /** Possible results of a packet's request. */
178c183
< /** The result of the packet transaction. */
---
> /** The result of this packet's request. */
196c201,204
<
---
> /** 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. */
203c211
< time(curTick), result(Unknown)
---
> result(Unknown)
206a215
> /** Destructor. */
210,213c219,223
<
< /** Minimally reset a packet so something like simple cpu can reuse it. */
< void reset();
<
---
> /** Reinitialize packet address and size from the associated
> * Request object, and reset other fields that may have been
> * modified by a previous transaction. Typically called when a
> * statically allocated Request/Packet pair is reused for
> * multiple transactions. */
215,216c225,234
< if (req->validPaddr) setAddr(req->paddr);
< if (req->validSize) setSize(req->size);
---
> assert(req->validPaddr);
> setAddr(req->paddr);
> assert(req->validSize);
> setSize(req->size);
> result = Unknown;
> if (dynamicData) {
> deleteData();
> dynamicData = false;
> arrayData = false;
> }
218a237,252
> /** Take a request packet and modify it in place to be suitable
> * for returning as a response to that request. Used for timing
> * accesses only. For atomic and functional accesses, the
> * request packet is always implicitly passed back *without*
> * modifying the command or destination fields, so this function
> * should not be called. */
> void makeTimingResponse() {
> assert(needsResponse());
> int icmd = (int)cmd;
> icmd &= ~(IsRequest | NeedsResponse);
> icmd |= IsResponse;
> cmd = (Command)icmd;
> dest = src;
> srcValid = false;
> }
>