From 3fea59e1629f5dac55a7d36752e822bee7fd7fa7 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Tue, 1 May 2012 13:40:42 -0400 Subject: MEM: Separate requests and responses for timing accesses This patch moves send/recvTiming and send/recvTimingSnoop from the Port base class to the MasterPort and SlavePort, and also splits them into separate member functions for requests and responses: send/recvTimingReq, send/recvTimingResp, and send/recvTimingSnoopReq, send/recvTimingSnoopResp. A master port sends requests and receives responses, and also receives snoop requests and sends snoop responses. A slave port has the reciprocal behaviour as it receives requests and sends responses, and sends snoop requests and receives snoop responses. For all MemObjects that have only master ports or slave ports (but not both), e.g. a CPU, or a PIO device, this patch merely adds more clarity to what kind of access is taking place. For example, a CPU port used to call sendTiming, and will now call sendTimingReq. Similarly, a response previously came back through recvTiming, which is now recvTimingResp. For the modules that have both master and slave ports, e.g. the bus, the behaviour was previously relying on branches based on pkt->isRequest(), and this is now replaced with a direct call to the apprioriate member function depending on the type of access. Please note that send/recvRetry is still shared by all the timing accessors and remains in the Port base class for now (to maintain the current bus functionality and avoid changing the statistics of all regressions). The packet queue is split into a MasterPort and SlavePort version to facilitate the use of the new timing accessors. All uses of the PacketQueue are updated accordingly. With this patch, the type of packet (request or response) is now well defined for each type of access, and asserts on pkt->isRequest() and pkt->isResponse() are now moved to the appropriate send member functions. It is also worth noting that sendTimingSnoopReq no longer returns a boolean, as the semantics do not alow snoop requests to be rejected or stalled. All these assumptions are now excplicitly part of the port interface itself. --- src/cpu/testers/directedtest/InvalidateGenerator.cc | 2 +- src/cpu/testers/directedtest/RubyDirectedTester.cc | 2 +- src/cpu/testers/directedtest/RubyDirectedTester.hh | 2 +- src/cpu/testers/directedtest/SeriesRequestGenerator.cc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/cpu/testers/directedtest') diff --git a/src/cpu/testers/directedtest/InvalidateGenerator.cc b/src/cpu/testers/directedtest/InvalidateGenerator.cc index a89853061..84a90844f 100644 --- a/src/cpu/testers/directedtest/InvalidateGenerator.cc +++ b/src/cpu/testers/directedtest/InvalidateGenerator.cc @@ -80,7 +80,7 @@ InvalidateGenerator::initiate() *dummyData = 0; pkt->dataDynamic(dummyData); - if (port->sendTiming(pkt)) { + if (port->sendTimingReq(pkt)) { DPRINTF(DirectedTest, "initiating request - successful\n"); if (m_status == InvalidateGeneratorStatus_Load_Waiting) { m_status = InvalidateGeneratorStatus_Load_Pending; diff --git a/src/cpu/testers/directedtest/RubyDirectedTester.cc b/src/cpu/testers/directedtest/RubyDirectedTester.cc index b5fe662af..0aba82dd2 100644 --- a/src/cpu/testers/directedtest/RubyDirectedTester.cc +++ b/src/cpu/testers/directedtest/RubyDirectedTester.cc @@ -91,7 +91,7 @@ RubyDirectedTester::getMasterPort(const std::string &if_name, int idx) } bool -RubyDirectedTester::CpuPort::recvTiming(PacketPtr pkt) +RubyDirectedTester::CpuPort::recvTimingResp(PacketPtr pkt) { tester->hitCallback(id, pkt->getAddr()); diff --git a/src/cpu/testers/directedtest/RubyDirectedTester.hh b/src/cpu/testers/directedtest/RubyDirectedTester.hh index 08b034d3f..75e72edf8 100644 --- a/src/cpu/testers/directedtest/RubyDirectedTester.hh +++ b/src/cpu/testers/directedtest/RubyDirectedTester.hh @@ -59,7 +59,7 @@ class RubyDirectedTester : public MemObject {} protected: - virtual bool recvTiming(PacketPtr pkt); + virtual bool recvTimingResp(PacketPtr pkt); virtual void recvRetry() { panic("%s does not expect a retry\n", name()); } }; diff --git a/src/cpu/testers/directedtest/SeriesRequestGenerator.cc b/src/cpu/testers/directedtest/SeriesRequestGenerator.cc index b8c42b67d..abcb0278f 100644 --- a/src/cpu/testers/directedtest/SeriesRequestGenerator.cc +++ b/src/cpu/testers/directedtest/SeriesRequestGenerator.cc @@ -70,7 +70,7 @@ SeriesRequestGenerator::initiate() *dummyData = 0; pkt->dataDynamic(dummyData); - if (port->sendTiming(pkt)) { + if (port->sendTimingReq(pkt)) { DPRINTF(DirectedTest, "initiating request - successful\n"); m_status = SeriesRequestGeneratorStatus_Request_Pending; return true; -- cgit v1.2.3