changeset 1b3d165d890d in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=1b3d165d890d
description:
Moved the lock check and clearing the lock into makeRequest
diffstat:
1 file changed, 10 insertions(+), 13 deletions(-)
src/mem/ruby/system/Sequencer.cc | 23 ++++++++++-------------
diffs (47 lines):
diff -r 374e1d9b0660 -r 1b3d165d890d src/mem/ruby/system/Sequencer.cc
--- a/src/mem/ruby/system/Sequencer.cc Mon Jul 13 11:25:23 2009 -0500
+++ b/src/mem/ruby/system/Sequencer.cc Mon Jul 13 11:34:38 2009 -0500
@@ -264,19 +264,6 @@
if (request->ruby_request.type == RubyRequestType_RMW_Read) {
m_dataCache_ptr->setLocked(address, m_version);
}
- else if (request->ruby_request.type == RubyRequestType_RMW_Write) {
- if (m_dataCache_ptr->isLocked(address, m_version)) {
- // if we are holding the lock for this
- request->ruby_request.atomic_success = true;
- m_dataCache_ptr->clearLocked(address);
- }
- else {
- // if we are not holding the lock for this
- request->ruby_request.atomic_success = false;
- }
-
- // can have livelock
- }
hitCallback(request, data);
}
@@ -367,6 +354,8 @@
return (m_writeRequestTable.size() == 0) && (m_readRequestTable.size() == 0);
}
+
+// -2 means that the LLSC failed
int64_t Sequencer::makeRequest(const RubyRequest & request)
{
assert(Address(request.paddr).getOffset() + request.len <=
RubySystem::getBlockSizeBytes());
@@ -375,6 +364,14 @@
SequencerRequest *srequest = new SequencerRequest(request, id,
g_eventQueue_ptr->getTime());
bool found = insertRequest(srequest);
if (!found)
+ if (request.type == RubyRequestType_RMW_Write) {
+ if (!m_dataCache_ptr->isLocked(line_address(Address(request.paddr)),
m_version)) {
+ return -2;
+ }
+ else {
+ m_dataCache_ptr->clearLocked(line_address(Address(request.paddr)));
+ }
+ }
issueRequest(request);
// TODO: issue hardware prefetches here
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev