summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system/Sequencer.cc
diff options
context:
space:
mode:
authorBrad Beckmann <Brad.Beckmann@amd.com>2010-01-29 20:29:23 -0800
committerBrad Beckmann <Brad.Beckmann@amd.com>2010-01-29 20:29:23 -0800
commit45230a4f6b82af61c05fcf93b6e1a9319fcb0a2e (patch)
treebe5514d8ae75df903599758fa2fa86834e9142b1 /src/mem/ruby/system/Sequencer.cc
parent4eb3bfc31b66a6835a398ba2f0a11ea9b78d525d (diff)
downloadgem5-45230a4f6b82af61c05fcf93b6e1a9319fcb0a2e.tar.xz
ruby: added the GEMS ruby tester
Diffstat (limited to 'src/mem/ruby/system/Sequencer.cc')
-rw-r--r--src/mem/ruby/system/Sequencer.cc28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/mem/ruby/system/Sequencer.cc b/src/mem/ruby/system/Sequencer.cc
index 00ae5364c..578dcbf58 100644
--- a/src/mem/ruby/system/Sequencer.cc
+++ b/src/mem/ruby/system/Sequencer.cc
@@ -41,6 +41,7 @@
#include "mem/gems_common/Map.hh"
#include "mem/ruby/buffers/MessageBuffer.hh"
#include "mem/ruby/slicc_interface/AbstractController.hh"
+#include "cpu/rubytest/RubyTester.hh"
#include "params/RubySequencer.hh"
@@ -74,7 +75,8 @@ Sequencer::Sequencer(const Params *p)
m_dataCache_ptr = p->dcache;
m_max_outstanding_requests = p->max_outstanding_requests;
m_deadlock_threshold = p->deadlock_threshold;
-
+ m_usingRubyTester = p->using_ruby_tester;
+
assert(m_max_outstanding_requests > 0);
assert(m_deadlock_threshold > 0);
assert(m_instCache_ptr != NULL);
@@ -344,6 +346,30 @@ void Sequencer::hitCallback(SequencerRequest* srequest, DataBlock& data) {
}
}
+ //
+ // If using the RubyTester, update the RubyTester sender state's subBlock
+ // with the recieved data. The tester will later access this state.
+ // Note: RubyPort will access it's sender state before the RubyTester.
+ //
+ if (m_usingRubyTester) {
+ //
+ // Since the hit callback func only takes a request id, we must iterate
+ // through the requests and update the packet's subBlock here.
+ // All this would be fixed if we could attach a M5 pkt pointer to the
+ // ruby request, however that change will break the libruby interface so
+ // we'll hold off on that for now.
+ //
+ RequestMap::iterator i = pending_cpu_requests.find(srequest->id);
+ if (i == pending_cpu_requests.end())
+ panic("could not find pending request %d\n", srequest->id);
+ RequestCookie *cookie = i->second;
+ Packet *pkt = cookie->pkt;
+
+ RubyTester::SenderState* testerSenderState;
+ testerSenderState = safe_cast<RubyTester::SenderState*>(pkt->senderState);
+ testerSenderState->subBlock->mergeFrom(data);
+ }
+
m_hit_callback(srequest->id);
delete srequest;
}