summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system/RubyPort.cc
diff options
context:
space:
mode:
authorBrad Beckmann <Brad.Beckmann@amd.com>2011-02-06 22:14:18 -0800
committerBrad Beckmann <Brad.Beckmann@amd.com>2011-02-06 22:14:18 -0800
commit2da54d1285a506c3ba01ff8cdcaa95fcdfccccdb (patch)
treee6e4a3af3bb67924e1de34adfdf034952552dfe5 /src/mem/ruby/system/RubyPort.cc
parentdedb4fbf058c96597cd48e506e4a3479b192d9aa (diff)
downloadgem5-2da54d1285a506c3ba01ff8cdcaa95fcdfccccdb.tar.xz
ruby: Fix RubyPort to properly handle retrys
Diffstat (limited to 'src/mem/ruby/system/RubyPort.cc')
-rw-r--r--src/mem/ruby/system/RubyPort.cc29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/mem/ruby/system/RubyPort.cc b/src/mem/ruby/system/RubyPort.cc
index 305228a8f..4ecdb02f3 100644
--- a/src/mem/ruby/system/RubyPort.cc
+++ b/src/mem/ruby/system/RubyPort.cc
@@ -49,6 +49,8 @@ RubyPort::RubyPort(const Params *p)
m_request_cnt = 0;
pio_port = NULL;
physMemPort = NULL;
+
+ m_usingRubyTester = p->using_ruby_tester;
}
void
@@ -108,6 +110,7 @@ RubyPort::M5Port::M5Port(const std::string &_name,
{
DPRINTF(Ruby, "creating port from ruby sequcner to cpu %s\n", _name);
ruby_port = _port;
+ _onRetryList = false;
}
Tick
@@ -256,9 +259,18 @@ RubyPort::M5Port::recvTiming(PacketPtr pkt)
// Otherwise, we need to delete the senderStatus we just created and return
// false.
if (requestStatus == RequestStatus_Issued) {
+ DPRINTF(MemoryAccess, "Request %x issued\n", pkt->getAddr());
return true;
}
+ //
+ // Unless one is using the ruby tester, record the stalled M5 port for
+ // later retry when the sequencer becomes free.
+ //
+ if (!ruby_port->m_usingRubyTester) {
+ ruby_port->addToRetryList(this);
+ }
+
DPRINTF(MemoryAccess,
"Request for address %#x did not issue because %s\n",
pkt->getAddr(), RequestStatus_to_string(requestStatus));
@@ -283,6 +295,23 @@ RubyPort::ruby_hit_callback(PacketPtr pkt)
delete senderState;
port->hitCallback(pkt);
+
+ //
+ // If we had to stall the M5Ports, wake them up because the sequencer
+ // likely has free resources now.
+ //
+ if (waitingOnSequencer) {
+ for (std::list<M5Port*>::iterator i = retryList.begin();
+ i != retryList.end(); ++i) {
+ (*i)->sendRetry();
+ (*i)->onRetryList(false);
+ DPRINTF(MemoryAccess,
+ "Sequencer may now be free. SendRetry to port %s\n",
+ (*i)->name());
+ }
+ retryList.clear();
+ waitingOnSequencer = false;
+ }
}
void