From 5f551d9ca2b61fc97b9530334e538195a84589b3 Mon Sep 17 00:00:00 2001 From: Polina Dudnik Date: Mon, 13 Jul 2009 17:22:29 -0500 Subject: 1. Got rid of unused functions in DirectoryMemory 2. Reintroduced RMW_Read and RMW_Write 3. Defined -2 in the Sequencer as well as made a note about mandatory queue Did not address the issues in the slicc because remaking the atomics altogether to allow multiple processors to issue atomic requests at once --- src/mem/ruby/system/DMASequencer.cc | 2 ++ src/mem/ruby/system/Sequencer.cc | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'src/mem/ruby/system') diff --git a/src/mem/ruby/system/DMASequencer.cc b/src/mem/ruby/system/DMASequencer.cc index ec5e0b49f..8f7b1c912 100644 --- a/src/mem/ruby/system/DMASequencer.cc +++ b/src/mem/ruby/system/DMASequencer.cc @@ -48,6 +48,8 @@ int64_t DMASequencer::makeRequest(const RubyRequest & request) case RubyRequestType_IFETCH: case RubyRequestType_Locked_Read: case RubyRequestType_Locked_Write: + case RubyRequestType_RMW_Read: + case RubyRequestType_RMW_Write: assert(0); } diff --git a/src/mem/ruby/system/Sequencer.cc b/src/mem/ruby/system/Sequencer.cc index eb694fa13..1587aa5fa 100644 --- a/src/mem/ruby/system/Sequencer.cc +++ b/src/mem/ruby/system/Sequencer.cc @@ -43,6 +43,8 @@ //Sequencer::Sequencer(int core_id, MessageBuffer* mandatory_q) +#define LLSC_FAIL -2 + Sequencer::Sequencer(const string & name) :RubyPort(name) { @@ -201,6 +203,8 @@ bool Sequencer::insertRequest(SequencerRequest* request) { Address line_addr(request->ruby_request.paddr); line_addr.makeLineAddress(); if ((request->ruby_request.type == RubyRequestType_ST) || + (request->ruby_request.type == RubyRequestType_RMW_Read) || + (request->ruby_request.type == RubyRequestType_RMW_Write) || (request->ruby_request.type == RubyRequestType_Locked_Read) || (request->ruby_request.type == RubyRequestType_Locked_Write)) { if (m_writeRequestTable.exist(line_addr)) { @@ -238,6 +242,8 @@ void Sequencer::removeRequest(SequencerRequest* srequest) { Address line_addr(ruby_request.paddr); line_addr.makeLineAddress(); if ((ruby_request.type == RubyRequestType_ST) || + (ruby_request.type == RubyRequestType_RMW_Read) || + (ruby_request.type == RubyRequestType_RMW_Write) || (ruby_request.type == RubyRequestType_Locked_Read) || (ruby_request.type == RubyRequestType_Locked_Write)) { m_writeRequestTable.deallocate(line_addr); @@ -258,6 +264,8 @@ void Sequencer::writeCallback(const Address& address, DataBlock& data) { removeRequest(request); assert((request->ruby_request.type == RubyRequestType_ST) || + (request->ruby_request.type == RubyRequestType_RMW_Read) || + (request->ruby_request.type == RubyRequestType_RMW_Write) || (request->ruby_request.type == RubyRequestType_Locked_Read) || (request->ruby_request.type == RubyRequestType_Locked_Write)); // POLINA: the assumption is that atomics are only on data cache and not instruction cache @@ -355,7 +363,6 @@ bool Sequencer::empty() const { } -// -2 means that the LLSC failed int64_t Sequencer::makeRequest(const RubyRequest & request) { assert(Address(request.paddr).getOffset() + request.len <= RubySystem::getBlockSizeBytes()); @@ -365,8 +372,10 @@ int64_t 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 -2; + return LLSC_FAIL; } else { m_dataCache_ptr->clearLocked(line_address(Address(request.paddr))); @@ -402,6 +411,12 @@ void Sequencer::issueRequest(const RubyRequest& request) { case RubyRequestType_Locked_Write: ctype = CacheRequestType_ST; break; + case RubyRequestType_RMW_Read: + ctype = CacheRequestType_ATOMIC; + break; + case RubyRequestType_RMW_Write: + ctype = CacheRequestType_ATOMIC; + break; default: assert(0); } -- cgit v1.2.3