summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system/Sequencer.cc
diff options
context:
space:
mode:
authorBrad Beckmann <Brad.Beckmann@amd.com>2010-03-21 21:22:21 -0700
committerBrad Beckmann <Brad.Beckmann@amd.com>2010-03-21 21:22:21 -0700
commit6d22db4eaa6cfb73b4a393c9f180867cebe2328f (patch)
tree112697150ab6dc76de3723cd370876c5f5d0fdfd /src/mem/ruby/system/Sequencer.cc
parentf53287f9ad021c2b6b4f63f1cd89b3d07dd19e53 (diff)
downloadgem5-6d22db4eaa6cfb73b4a393c9f180867cebe2328f.tar.xz
ruby: Ruby support for LLSC
Diffstat (limited to 'src/mem/ruby/system/Sequencer.cc')
-rw-r--r--src/mem/ruby/system/Sequencer.cc45
1 files changed, 37 insertions, 8 deletions
diff --git a/src/mem/ruby/system/Sequencer.cc b/src/mem/ruby/system/Sequencer.cc
index b471a4b8b..d6dba08f9 100644
--- a/src/mem/ruby/system/Sequencer.cc
+++ b/src/mem/ruby/system/Sequencer.cc
@@ -334,11 +334,24 @@ void Sequencer::hitCallback(SequencerRequest* srequest, DataBlock& data) {
if (ruby_request.data != NULL) {
if ((type == RubyRequestType_LD) ||
(type == RubyRequestType_IFETCH) ||
- (type == RubyRequestType_RMW_Read)) {
- memcpy(ruby_request.data, data.getData(request_address.getOffset(), ruby_request.len), ruby_request.len);
+ (type == RubyRequestType_RMW_Read) ||
+ (type == RubyRequestType_Locked_Read)) {
+
+ memcpy(ruby_request.data,
+ data.getData(request_address.getOffset(), ruby_request.len),
+ ruby_request.len);
+
} else {
- data.setData(ruby_request.data, request_address.getOffset(), ruby_request.len);
+
+ data.setData(ruby_request.data,
+ request_address.getOffset(),
+ ruby_request.len);
+
}
+ } else {
+ DPRINTF(MemoryAccess,
+ "WARNING. Data not transfered from Ruby to M5 for type %s\n",
+ RubyRequestType_to_string(type));
}
//
@@ -403,11 +416,27 @@ RequestStatus Sequencer::makeRequest(const RubyRequest & request)
bool found = insertRequest(srequest);
if (!found) {
if (request.type == RubyRequestType_Locked_Write) {
- // NOTE: it is OK to check the locked flag here as the mandatory queue will be checked first
- // ensuring that nothing comes between checking the flag and servicing the store
- if (!m_dataCache_ptr->isLocked(line_address(Address(request.paddr)), m_version)) {
- return RequestStatus_LlscFailed;
- }
+ //
+ // NOTE: it is OK to check the locked flag here as the mandatory queue
+ // will be checked first ensuring that nothing comes between checking
+ // the flag and servicing the store.
+ //
+ if (!m_dataCache_ptr->isLocked(line_address(Address(request.paddr)),
+ m_version)) {
+ removeRequest(srequest);
+ if (Debug::getProtocolTrace()) {
+
+ g_system_ptr->getProfiler()->profileTransition("Seq",
+ m_version,
+ Address(request.paddr),
+ "",
+ "SC Fail",
+ "",
+ RubyRequestType_to_string(request.type));
+
+ }
+ return RequestStatus_LlscFailed;
+ }
else {
m_dataCache_ptr->clearLocked(line_address(Address(request.paddr)));
}