summaryrefslogtreecommitdiff
path: root/src/mem/coherent_bus.hh
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2013-05-30 12:54:02 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2013-05-30 12:54:02 -0400
commit7e13c4d046ea8335fa5681e8c035c3839f0749f9 (patch)
tree1a6102adf5c6167deed7e8fa21ce5da06f98fcc2 /src/mem/coherent_bus.hh
parent2308f812ef848d027b99dd52c0900aed11260d87 (diff)
downloadgem5-7e13c4d046ea8335fa5681e8c035c3839f0749f9.tar.xz
mem: Make returning snoop responses occupy response layer
This patch introduces a mirrored internal snoop port to facilitate easy addition of flow control for the snoop responses that are turned into normal responses on their return. To perform this, the slave ports of the coherent bus are wrapped in internal master ports that are passed as the source ports to the response layer in question. As a result of this patch, there is more contention for the response resources, and as such system performance will decrease slightly. A consequence of the mirrored internal port is that the port the bus tells to retry (the internal one) and the port actually retrying (the mirrored) one are not the same. Thus, the existing check in tryTiming is not longer correct. In fact, the test is redundant as the layer is only in the retry state while calling sendRetry on the waiting port, and if the latter does not immediately call the bus then the retry state is left. Consequently the check is removed.
Diffstat (limited to 'src/mem/coherent_bus.hh')
-rw-r--r--src/mem/coherent_bus.hh51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/mem/coherent_bus.hh b/src/mem/coherent_bus.hh
index d8ddd507c..49f7ae698 100644
--- a/src/mem/coherent_bus.hh
+++ b/src/mem/coherent_bus.hh
@@ -219,6 +219,57 @@ class CoherentBus : public BaseBus
};
+ /**
+ * Internal class to bridge between an incoming snoop response
+ * from a slave port and forwarding it through an outgoing slave
+ * port. It is effectively a dangling master port.
+ */
+ class SnoopRespPort : public MasterPort
+ {
+
+ private:
+
+ /** The port which we mirror internally. */
+ SlavePort& slavePort;
+
+ /** The bus to which this port belongs. */
+ CoherentBus &bus;
+
+ public:
+
+ /**
+ * Create a snoop response port that mirrors a given slave port.
+ */
+ SnoopRespPort(SlavePort& slave_port, CoherentBus& _bus) :
+ MasterPort(slave_port.name() + ".snoopRespPort", &_bus),
+ slavePort(slave_port), bus(_bus) { }
+
+ /**
+ * Override the sending of retries and pass them on through
+ * the mirrored slave port.
+ */
+ void sendRetry() {
+ slavePort.sendRetry();
+ }
+
+ /**
+ * Provided as necessary.
+ */
+ void recvRetry() { panic("SnoopRespPort should never see retry\n"); }
+
+ /**
+ * Provided as necessary.
+ */
+ bool recvTimingResp(PacketPtr pkt)
+ {
+ panic("SnoopRespPort should never see timing response\n");
+ return false;
+ }
+
+ };
+
+ std::vector<SnoopRespPort*> snoopRespPorts;
+
std::vector<SlavePort*> snoopPorts;
/**