summaryrefslogtreecommitdiff
path: root/src/mem/bus.cc
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/bus.cc
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/bus.cc')
-rw-r--r--src/mem/bus.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/mem/bus.cc b/src/mem/bus.cc
index 855f82db4..d94bd6a28 100644
--- a/src/mem/bus.cc
+++ b/src/mem/bus.cc
@@ -189,12 +189,20 @@ template <typename SrcType, typename DstType>
bool
BaseBus::Layer<SrcType,DstType>::tryTiming(SrcType* src_port)
{
- // first we see if the layer is busy, next we check if we are in a
- // retry with a port other than the current one, lastly we check
- // if the destination port is already engaged in a transaction
- // waiting for a retry from the peer
- if (state == BUSY || (state == RETRY && src_port != retryingPort) ||
- waitingForPeer != NULL) {
+ // if we are in the retry state, we will not see anything but the
+ // retrying port (or in the case of the snoop ports the snoop
+ // response port that mirrors the actual slave port) as we leave
+ // this state again in zero time if the peer does not immediately
+ // call the bus when receiving the retry
+
+ // first we see if the layer is busy, next we check if the
+ // destination port is already engaged in a transaction waiting
+ // for a retry from the peer
+ if (state == BUSY || waitingForPeer != NULL) {
+ // the port should not be waiting already
+ assert(std::find(waitingForLayer.begin(), waitingForLayer.end(),
+ src_port) == waitingForLayer.end());
+
// put the port at the end of the retry list waiting for the
// layer to be freed up (and in the case of a busy peer, for
// that transaction to go through, and then the bus to free