From 92f021cbbed84bc1d8ceee80b78fb9be1086819c Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Wed, 10 Feb 2016 04:08:25 -0500 Subject: 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. --- src/mem/dram_ctrl.cc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/mem/dram_ctrl.cc') diff --git a/src/mem/dram_ctrl.cc b/src/mem/dram_ctrl.cc index c7ad3b448..55e1cf805 100644 --- a/src/mem/dram_ctrl.cc +++ b/src/mem/dram_ctrl.cc @@ -273,11 +273,14 @@ DRAMCtrl::recvAtomic(PacketPtr pkt) { DPRINTF(DRAM, "recvAtomic: %s 0x%x\n", pkt->cmdString(), pkt->getAddr()); + panic_if(pkt->cacheResponding(), "Should not see packets where cache " + "is responding"); + // do the actual memory access and turn the packet into a response access(pkt); Tick latency = 0; - if (!pkt->cacheResponding() && pkt->hasData()) { + if (pkt->hasData()) { // this value is not supposed to be accurate, just enough to // keep things going, mimic a closed page latency = tRP + tRCD + tCL; @@ -590,11 +593,11 @@ DRAMCtrl::recvTimingReq(PacketPtr pkt) DPRINTF(DRAM, "recvTimingReq: request %s addr %lld size %d\n", pkt->cmdString(), pkt->getAddr(), pkt->getSize()); - // 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\n"); // Calc avg gap between requests if (prevArrival != 0) { @@ -625,7 +628,8 @@ DRAMCtrl::recvTimingReq(PacketPtr pkt) readReqs++; bytesReadSys += size; } - } else if (pkt->isWrite()) { + } else { + assert(pkt->isWrite()); assert(size != 0); if (writeQueueFull(dram_pkt_count)) { DPRINTF(DRAM, "Write queue full, not accepting\n"); @@ -638,10 +642,6 @@ DRAMCtrl::recvTimingReq(PacketPtr pkt) writeReqs++; bytesWrittenSys += size; } - } else { - DPRINTF(DRAM,"Neither read nor write, ignore timing\n"); - neitherReadNorWrite++; - accessAndRespond(pkt, 1); } return true; -- cgit v1.2.3