diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2016-02-10 04:08:25 -0500 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2016-02-10 04:08:25 -0500 |
commit | 92f021cbbed84bc1d8ceee80b78fb9be1086819c (patch) | |
tree | d65dbb57bc3443e0cd19f30012c43d268f428c63 /src/mem/simple_mem.cc | |
parent | f84ee031ccdb63d016c6f55b578085a2e5af4a4b (diff) | |
download | gem5-92f021cbbed84bc1d8ceee80b78fb9be1086819c.tar.xz |
mem: Move the point of coherency to the coherent crossbar
This patch introduces the ability of making the coherent crossbar the
point of coherency. If so, the crossbar does not forward packets where
a cache with ownership has already committed to responding, and also
does not forward any coherency-related packets that are not intended
for a downstream memory controller. Thus, invalidations and upgrades
are turned around in the crossbar, and the memory controller only sees
normal reads and writes.
In addition this patch moves the express snoop promotion of a packet
to the crossbar, thus allowing the downstream cache to check the
express snoop flag (as it should) for bypassing any blocking, rather
than relying on whether a cache is responding or not.
Diffstat (limited to 'src/mem/simple_mem.cc')
-rw-r--r-- | src/mem/simple_mem.cc | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/mem/simple_mem.cc b/src/mem/simple_mem.cc index 8760c2bef..bb44b8c85 100644 --- a/src/mem/simple_mem.cc +++ b/src/mem/simple_mem.cc @@ -72,8 +72,11 @@ SimpleMemory::init() Tick SimpleMemory::recvAtomic(PacketPtr pkt) { + panic_if(pkt->cacheResponding(), "Should not see packets where cache " + "is responding"); + access(pkt); - return pkt->cacheResponding() ? 0 : getLatency(); + return getLatency(); } void @@ -97,11 +100,12 @@ SimpleMemory::recvFunctional(PacketPtr pkt) bool SimpleMemory::recvTimingReq(PacketPtr pkt) { - // if a cache is responding, sink the packet without further action - if (pkt->cacheResponding()) { - pendingDelete.reset(pkt); - return true; - } + panic_if(pkt->cacheResponding(), "Should not see packets where cache " + "is responding"); + + panic_if(!(pkt->isRead() || pkt->isWrite()), + "Should only see read and writes at memory controller, " + "saw %s to %#llx\n", pkt->cmdString(), pkt->getAddr()); // we should not get a new request after committing to retry the // current one, but unfortunately the CPU violates this rule, so @@ -127,21 +131,16 @@ SimpleMemory::recvTimingReq(PacketPtr pkt) // rather than long term as it is the short term data rate that is // limited for any real memory - // only look at reads and writes when determining if we are busy, - // and for how long, as it is not clear what to regulate for the - // other types of commands - if (pkt->isRead() || pkt->isWrite()) { - // calculate an appropriate tick to release to not exceed - // the bandwidth limit - Tick duration = pkt->getSize() * bandwidth; - - // only consider ourselves busy if there is any need to wait - // to avoid extra events being scheduled for (infinitely) fast - // memories - if (duration != 0) { - schedule(releaseEvent, curTick() + duration); - isBusy = true; - } + // calculate an appropriate tick to release to not exceed + // the bandwidth limit + Tick duration = pkt->getSize() * bandwidth; + + // only consider ourselves busy if there is any need to wait + // to avoid extra events being scheduled for (infinitely) fast + // memories + if (duration != 0) { + schedule(releaseEvent, curTick() + duration); + isBusy = true; } // go ahead and deal with the packet and put the response in the |