From 10c69bb1684c515d683a084b40ab19e5e7ee8c11 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Thu, 22 Jan 2015 05:01:31 -0500 Subject: [PATCH] mem: Remove unused Packet src and dest fields This patch takes the final step in removing the src and dest fields in the packet. These fields were rather confusing in that they only remember a single multiplexing component, and pushed the responsibility to the bridge and caches to store the fields in a senderstate, thus effectively creating a stack. With the recent changes to the crossbar response routing the crossbar is now responsible without relying on the packet fields. Thus, these variables are now unused and can be removed. --- src/arch/x86/pagetable_walker.cc | 1 - src/mem/packet.hh | 49 ++------------------------------ 2 files changed, 2 insertions(+), 48 deletions(-) diff --git a/src/arch/x86/pagetable_walker.cc b/src/arch/x86/pagetable_walker.cc index 81c4ccdb5..f6f8da968 100644 --- a/src/arch/x86/pagetable_walker.cc +++ b/src/arch/x86/pagetable_walker.cc @@ -523,7 +523,6 @@ Walker::WalkerState::stepWalk(PacketPtr &write) write = oldRead; write->set(pte); write->cmd = MemCmd::WriteReq; - write->clearDest(); } else { write = NULL; delete oldRead->req; diff --git a/src/mem/packet.hh b/src/mem/packet.hh index 8e3bcdd37..2917262c3 100644 --- a/src/mem/packet.hh +++ b/src/mem/packet.hh @@ -295,30 +295,6 @@ class Packet : public Printable /// The size of the request or transfer. unsigned size; - /** - * Source port identifier set on a request packet to enable - * appropriate routing of the responses. The source port - * identifier is set by any multiplexing component, e.g. a - * crossbar, as the timing responses need this information to be - * routed back to the appropriate port at a later point in - * time. The field can be updated (over-written) as the request - * packet passes through additional multiplexing components, and - * it is their responsibility to remember the original source port - * identifier, for example by using an appropriate sender - * state. The latter is done in the cache and bridge. - */ - PortID src; - - /** - * Destination port identifier that is present on all response - * packets that passed through a multiplexing component as a - * request packet. The source port identifier is turned into a - * destination port identifier when the packet is turned into a - * response, and the destination is used, e.g. by the crossbar, to - * select the appropriate path through the interconnect. - */ - PortID dest; - /** * The original value of the command field. Only valid when the * current command field is an error condition; in that case, the @@ -547,18 +523,6 @@ class Packet : public Printable bool hadBadAddress() const { return cmd == MemCmd::BadAddressError; } void copyError(Packet *pkt) { assert(pkt->isError()); cmd = pkt->cmd; } - /// Accessor function to get the source index of the packet. - PortID getSrc() const { return src; } - /// Accessor function to set the source index of the packet. - void setSrc(PortID _src) { src = _src; } - - /// Accessor function for the destination index of the packet. - PortID getDest() const { 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 @@ -609,8 +573,7 @@ class Packet : public Printable */ Packet(const RequestPtr _req, MemCmd _cmd) : cmd(_cmd), req(_req), data(nullptr), addr(0), _isSecure(false), - size(0), src(InvalidPortID), dest(InvalidPortID), - bytesValidStart(0), bytesValidEnd(0), + size(0), bytesValidStart(0), bytesValidEnd(0), firstWordDelay(0), lastWordDelay(0), senderState(NULL) { @@ -632,7 +595,6 @@ class Packet : public Printable */ Packet(const RequestPtr _req, MemCmd _cmd, int _blkSize) : cmd(_cmd), req(_req), data(nullptr), addr(0), _isSecure(false), - src(InvalidPortID), dest(InvalidPortID), bytesValidStart(0), bytesValidEnd(0), firstWordDelay(0), lastWordDelay(0), senderState(NULL) @@ -657,7 +619,6 @@ class Packet : public Printable : cmd(pkt->cmd), req(pkt->req), data(nullptr), addr(pkt->addr), _isSecure(pkt->_isSecure), size(pkt->size), - src(pkt->src), dest(pkt->dest), bytesValidStart(pkt->bytesValidStart), bytesValidEnd(pkt->bytesValidEnd), firstWordDelay(pkt->firstWordDelay), @@ -743,10 +704,7 @@ class Packet : public Printable /** * Take a request packet and modify it in place to be suitable for - * returning as a response to that request. The source field is - * turned into the destination, and subsequently cleared. Note - * that the latter is not necessary for atomic requests, but - * causes no harm as neither field is valid. + * returning as a response to that request. */ void makeResponse() @@ -759,9 +717,6 @@ class Packet : public Printable // responses are never express, even if the snoop that // triggered them was flags.clear(EXPRESS_SNOOP); - - dest = src; - src = InvalidPortID; } void -- 2.30.2