From e65f0cef3ca70edf37ff74920def4ac899f6c7e3 Mon Sep 17 00:00:00 2001 From: Ron Dreslinski Date: Sun, 8 Oct 2006 19:05:48 -0400 Subject: Only respond if the pkt needs a response. Fix an issue with memory handling writebacks. src/mem/cache/base_cache.hh: src/mem/tport.cc: Only respond if the pkt needs a response. src/mem/physical.cc: Make physical memory respond to writebacks, set satisfied for invalidates/upgrades. --HG-- extra : convert_revision : 7601987a7923e54a6d1a168def4f8133d8de19fd --- src/mem/tport.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/mem/tport.cc') diff --git a/src/mem/tport.cc b/src/mem/tport.cc index 55c301c87..cef7a2a5b 100644 --- a/src/mem/tport.cc +++ b/src/mem/tport.cc @@ -47,9 +47,11 @@ SimpleTimingPort::recvTiming(Packet *pkt) // if we ever added it back. assert(pkt->result != Packet::Nacked); Tick latency = recvAtomic(pkt); - // turn packet around to go back to requester - pkt->makeTimingResponse(); - sendTimingLater(pkt, latency); + // turn packet around to go back to requester if response expected + if (pkt->needsResponse()) { + pkt->makeTimingResponse(); + sendTimingLater(pkt, latency); + } return true; } -- cgit v1.2.3 From 5582e60966822fd33cf1c48abef95e4dab14235c Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Tue, 10 Oct 2006 00:49:27 -0400 Subject: Fixed a bug where a packet was attempted to be sent even though another packet was waiting for the bus. --HG-- extra : convert_revision : 29f7a4f676884330d7b7e93517dea85fc7bbf678 --- src/mem/tport.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/mem/tport.cc') diff --git a/src/mem/tport.cc b/src/mem/tport.cc index cef7a2a5b..66811b820 100644 --- a/src/mem/tport.cc +++ b/src/mem/tport.cc @@ -59,6 +59,8 @@ void SimpleTimingPort::recvRetry() { bool result = true; + + assert(transmitList.size()); while (result && transmitList.size()) { result = sendTiming(transmitList.front()); if (result) @@ -75,8 +77,11 @@ SimpleTimingPort::SendEvent::process() { port->outTiming--; assert(port->outTiming >= 0); - if (port->sendTiming(packet)) { - // send successfule + if (port->transmitList.size()) { + port->transmitList.push_back(packet); + } + else if (port->sendTiming(packet)) { + // send successful if (port->transmitList.size() == 0 && port->drainEvent) { port->drainEvent->process(); port->drainEvent = NULL; -- cgit v1.2.3 From 549412b33361629b03d9d85dac3bb3efa2f07baf Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Tue, 10 Oct 2006 17:24:03 -0400 Subject: Changed the bus to use a bool to keep track of retries rather than a pointer src/mem/tport.cc: minor formatting tweak --HG-- extra : convert_revision : 7391d142815c5876fcc0f991bd053e6a1781c101 --- src/mem/tport.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/mem/tport.cc') diff --git a/src/mem/tport.cc b/src/mem/tport.cc index 66811b820..528067170 100644 --- a/src/mem/tport.cc +++ b/src/mem/tport.cc @@ -79,8 +79,7 @@ SimpleTimingPort::SendEvent::process() assert(port->outTiming >= 0); if (port->transmitList.size()) { port->transmitList.push_back(packet); - } - else if (port->sendTiming(packet)) { + } else if (port->sendTiming(packet)) { // send successful if (port->transmitList.size() == 0 && port->drainEvent) { port->drainEvent->process(); -- cgit v1.2.3 From 3c7e0ec752c1d2c61b9e8c1233bb904d836b4e4e Mon Sep 17 00:00:00 2001 From: Ron Dreslinski Date: Wed, 11 Oct 2006 19:25:48 -0400 Subject: Fix bus in FS mode. src/mem/bus.cc: Add debugging statement src/mem/bus.hh: Fix implementation of bus for subsequent recvTimings while handling a retry request. src/mem/tport.cc: Rework timing port to retry properly --HG-- extra : convert_revision : fbfb5e8b4a625e49c6cd764da1df46a4f336b1b2 --- src/mem/tport.cc | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) (limited to 'src/mem/tport.cc') diff --git a/src/mem/tport.cc b/src/mem/tport.cc index 528067170..456878d0a 100644 --- a/src/mem/tport.cc +++ b/src/mem/tport.cc @@ -58,15 +58,17 @@ SimpleTimingPort::recvTiming(Packet *pkt) void SimpleTimingPort::recvRetry() { - bool result = true; - - assert(transmitList.size()); - while (result && transmitList.size()) { - result = sendTiming(transmitList.front()); - if (result) - transmitList.pop_front(); + assert(outTiming > 0); + assert(!transmitList.empty()); + if (sendTiming(transmitList.front())) { + transmitList.pop_front(); + outTiming--; + DPRINTF(Bus, "No Longer waiting on retry\n"); + if (!transmitList.empty()) + sendTimingLater(transmitList.front(), 1); } - if (transmitList.size() == 0 && drainEvent) { + + if (transmitList.empty() && drainEvent) { drainEvent->process(); drainEvent = NULL; } @@ -75,20 +77,28 @@ SimpleTimingPort::recvRetry() void SimpleTimingPort::SendEvent::process() { - port->outTiming--; - assert(port->outTiming >= 0); - if (port->transmitList.size()) { + assert(port->outTiming > 0); + if (!port->transmitList.empty() && port->transmitList.front() != packet) { + //We are not the head of the list port->transmitList.push_back(packet); } else if (port->sendTiming(packet)) { // send successful - if (port->transmitList.size() == 0 && port->drainEvent) { + if (port->transmitList.size()) { + port->transmitList.pop_front(); + port->outTiming--; + if (!port->transmitList.empty()) + port->sendTimingLater(port->transmitList.front(), 1); + } + if (port->transmitList.empty() && port->drainEvent) { port->drainEvent->process(); port->drainEvent = NULL; } } else { // send unsuccessful (due to flow control). Will get retry - // callback later; save for then. - port->transmitList.push_back(packet); + // callback later; save for then if not already + DPRINTF(Bus, "Waiting on retry\n"); + if (!(port->transmitList.front() == packet)) + port->transmitList.push_back(packet); } } -- cgit v1.2.3