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
This commit is contained in:
Polina Dudnik 2009-07-13 17:22:29 -05:00
parent 9a675a0391
commit 5f551d9ca2
6 changed files with 31 additions and 22 deletions

View file

@ -56,9 +56,6 @@ class DataBlock {
uint8 getByte(int whichByte) const;
const uint8* getData(int offset, int len) const;
void setByte(int whichByte, uint8 data);
const uint8* getBlock() const;
uint8* copyData(uint8* dest, int offset, int size) const;
void setBlock(uint8* data) { setData(data, 0, RubySystem::getBlockSizeBytes()); }
void setData(uint8* data, int offset, int len);
void copyPartial(const DataBlock & dblk, int offset, int len);
bool equal(const DataBlock& obj) const;
@ -149,21 +146,6 @@ void DataBlock::copyPartial(const DataBlock & dblk, int offset, int len)
setData(&dblk.m_data[offset], offset, len);
}
inline
const uint8* DataBlock::getBlock() const
{
return m_data;
}
inline
uint8* DataBlock::copyData(uint8* dest, int offset, int size) const
{
assert(offset + size <= RubySystem::getBlockSizeBytes());
memcpy(dest, m_data + offset, size);
return dest;
}
// ******************* Definitions *******************
// Output operator definition

View file

@ -24,6 +24,10 @@ string RubyRequestType_to_string(const RubyRequestType& obj)
return "Locked_Read";
case RubyRequestType_Locked_Write:
return "Locked_Write";
case RubyRequestType_RMW_Read:
return "RMW_Read";
case RubyRequestType_RMW_Write:
return "RMW_Write";
case RubyRequestType_NULL:
default:
assert(0);
@ -43,6 +47,10 @@ RubyRequestType string_to_RubyRequestType(std::string str)
return RubyRequestType_Locked_Read;
else if (str == "Locked_Write")
return RubyRequestType_Locked_Write;
else if (str == "RMW_Read")
return RubyRequestType_RMW_Read;
else if (str == "RMW_Write")
return RubyRequestType_RMW_Write;
else
assert(0);
return RubyRequestType_NULL;

View file

@ -12,7 +12,9 @@ enum RubyRequestType {
RubyRequestType_LD,
RubyRequestType_ST,
RubyRequestType_Locked_Read,
RubyRequestType_Locked_Write
RubyRequestType_Locked_Write,
RubyRequestType_RMW_Read,
RubyRequestType_RMW_Write
};
enum RubyAccessMode {

View file

@ -50,7 +50,7 @@ TraceRecord::TraceRecord(const string & sequencer_name, const Address& data_addr
if (m_type == RubyRequestType_Locked_Read) {
m_type = RubyRequestType_ST;
}
if (m_type == RubyRequestType_Locked_Write) {
else if (m_type == RubyRequestType_Locked_Write) {
m_type = RubyRequestType_ST;
}
}

View file

@ -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);
}

View file

@ -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);
}