From f26a28929583f2ed7fb55521e49c3f9bef557c05 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Mon, 2 Mar 2015 04:00:35 -0500 Subject: mem: Split port retry for all different packet classes This patch fixes a long-standing isue with the port flow control. Before this patch the retry mechanism was shared between all different packet classes. As a result, a snoop response could get stuck behind a request waiting for a retry, even if the send/recv functions were split. This caused message-dependent deadlocks in stress-test scenarios. The patch splits the retry into one per packet (message) class. Thus, sendTimingReq has a corresponding recvReqRetry, sendTimingResp has recvRespRetry etc. Most of the changes to the code involve simply clarifying what type of request a specific object was accepting. The biggest change in functionality is in the cache downstream packet queue, facing the memory. This queue was shared by requests and snoop responses, and it is now split into two queues, each with their own flow control, but the same physical MasterPort. These changes fixes the previously seen deadlocks. --- src/cpu/testers/directedtest/RubyDirectedTester.hh | 2 +- src/cpu/testers/memtest/memtest.cc | 2 +- src/cpu/testers/memtest/memtest.hh | 2 +- src/cpu/testers/networktest/networktest.cc | 2 +- src/cpu/testers/networktest/networktest.hh | 2 +- src/cpu/testers/rubytest/RubyTester.hh | 2 +- src/cpu/testers/traffic_gen/traffic_gen.cc | 2 +- src/cpu/testers/traffic_gen/traffic_gen.hh | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/cpu/testers') diff --git a/src/cpu/testers/directedtest/RubyDirectedTester.hh b/src/cpu/testers/directedtest/RubyDirectedTester.hh index cb58fa63f..0e3b1002a 100644 --- a/src/cpu/testers/directedtest/RubyDirectedTester.hh +++ b/src/cpu/testers/directedtest/RubyDirectedTester.hh @@ -60,7 +60,7 @@ class RubyDirectedTester : public MemObject protected: virtual bool recvTimingResp(PacketPtr pkt); - virtual void recvRetry() + virtual void recvReqRetry() { panic("%s does not expect a retry\n", name()); } }; diff --git a/src/cpu/testers/memtest/memtest.cc b/src/cpu/testers/memtest/memtest.cc index 1d2554852..b0dde6d27 100644 --- a/src/cpu/testers/memtest/memtest.cc +++ b/src/cpu/testers/memtest/memtest.cc @@ -63,7 +63,7 @@ MemTest::CpuPort::recvTimingResp(PacketPtr pkt) } void -MemTest::CpuPort::recvRetry() +MemTest::CpuPort::recvReqRetry() { memtest.recvRetry(); } diff --git a/src/cpu/testers/memtest/memtest.hh b/src/cpu/testers/memtest/memtest.hh index 0648f8c11..daed5e5d2 100644 --- a/src/cpu/testers/memtest/memtest.hh +++ b/src/cpu/testers/memtest/memtest.hh @@ -114,7 +114,7 @@ class MemTest : public MemObject Tick recvAtomicSnoop(PacketPtr pkt) { return 0; } - void recvRetry(); + void recvReqRetry(); }; CpuPort port; diff --git a/src/cpu/testers/networktest/networktest.cc b/src/cpu/testers/networktest/networktest.cc index 4a79d5a17..e3103f6b6 100644 --- a/src/cpu/testers/networktest/networktest.cc +++ b/src/cpu/testers/networktest/networktest.cc @@ -59,7 +59,7 @@ NetworkTest::CpuPort::recvTimingResp(PacketPtr pkt) } void -NetworkTest::CpuPort::recvRetry() +NetworkTest::CpuPort::recvReqRetry() { networktest->doRetry(); } diff --git a/src/cpu/testers/networktest/networktest.hh b/src/cpu/testers/networktest/networktest.hh index 253b48233..572097a09 100644 --- a/src/cpu/testers/networktest/networktest.hh +++ b/src/cpu/testers/networktest/networktest.hh @@ -91,7 +91,7 @@ class NetworkTest : public MemObject virtual bool recvTimingResp(PacketPtr pkt); - virtual void recvRetry(); + virtual void recvReqRetry(); }; CpuPort cachePort; diff --git a/src/cpu/testers/rubytest/RubyTester.hh b/src/cpu/testers/rubytest/RubyTester.hh index e1b829a7d..c0ad554c6 100644 --- a/src/cpu/testers/rubytest/RubyTester.hh +++ b/src/cpu/testers/rubytest/RubyTester.hh @@ -75,7 +75,7 @@ class RubyTester : public MemObject protected: virtual bool recvTimingResp(PacketPtr pkt); - virtual void recvRetry() + virtual void recvReqRetry() { panic("%s does not expect a retry\n", name()); } }; diff --git a/src/cpu/testers/traffic_gen/traffic_gen.cc b/src/cpu/testers/traffic_gen/traffic_gen.cc index 9eee7a119..e4759512d 100644 --- a/src/cpu/testers/traffic_gen/traffic_gen.cc +++ b/src/cpu/testers/traffic_gen/traffic_gen.cc @@ -476,7 +476,7 @@ TrafficGen::enterState(uint32_t newState) } void -TrafficGen::recvRetry() +TrafficGen::recvReqRetry() { assert(retryPkt != NULL); diff --git a/src/cpu/testers/traffic_gen/traffic_gen.hh b/src/cpu/testers/traffic_gen/traffic_gen.hh index b9081b1d4..eb9f6541d 100644 --- a/src/cpu/testers/traffic_gen/traffic_gen.hh +++ b/src/cpu/testers/traffic_gen/traffic_gen.hh @@ -91,7 +91,7 @@ class TrafficGen : public MemObject * Receive a retry from the neighbouring port and attempt to * resend the waiting packet. */ - void recvRetry(); + void recvReqRetry(); /** Struct to represent a probabilistic transition during parsing. */ struct Transition { @@ -148,7 +148,7 @@ class TrafficGen : public MemObject protected: - void recvRetry() { trafficGen.recvRetry(); } + void recvReqRetry() { trafficGen.recvReqRetry(); } bool recvTimingResp(PacketPtr pkt); -- cgit v1.2.3