diff options
author | Tony Gutierrez <anthony.gutierrez@amd.com> | 2016-01-19 14:05:03 -0500 |
---|---|---|
committer | Tony Gutierrez <anthony.gutierrez@amd.com> | 2016-01-19 14:05:03 -0500 |
commit | 28e353e0403ea379d244a418e8dc8ee0b48187cf (patch) | |
tree | 64bf9dcdf22bf7f60668f790744c11ee8ec2f2bf /src/mem/ruby/common/DataBlock.cc | |
parent | d658b6e1cc22de852fef611e28f448257acc298a (diff) | |
download | gem5-28e353e0403ea379d244a418e8dc8ee0b48187cf.tar.xz |
mem: write combining for ruby protocols
This patch adds support for write-combining in ruby.
Diffstat (limited to 'src/mem/ruby/common/DataBlock.cc')
-rw-r--r-- | src/mem/ruby/common/DataBlock.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mem/ruby/common/DataBlock.cc b/src/mem/ruby/common/DataBlock.cc index fb2e956e0..a4d7f4916 100644 --- a/src/mem/ruby/common/DataBlock.cc +++ b/src/mem/ruby/common/DataBlock.cc @@ -27,6 +27,8 @@ */ #include "mem/ruby/common/DataBlock.hh" + +#include "mem/ruby/common/WriteMask.hh" #include "mem/ruby/system/RubySystem.hh" DataBlock::DataBlock(const DataBlock &cp) @@ -57,6 +59,25 @@ DataBlock::equal(const DataBlock& obj) const } void +DataBlock::copyPartial(const DataBlock &dblk, const WriteMask &mask) +{ + for (int i = 0; i < RubySystem::getBlockSizeBytes(); i++) { + if (mask.getMask(i, 1)) { + m_data[i] = dblk.m_data[i]; + } + } +} + +void +DataBlock::atomicPartial(const DataBlock &dblk, const WriteMask &mask) +{ + for (int i = 0; i < RubySystem::getBlockSizeBytes(); i++) { + m_data[i] = dblk.m_data[i]; + } + mask.performAtomic(m_data); +} + +void DataBlock::print(std::ostream& out) const { using namespace std; @@ -77,6 +98,12 @@ DataBlock::getData(int offset, int len) const return &m_data[offset]; } +uint8_t* +DataBlock::getDataMod(int offset) +{ + return &m_data[offset]; +} + void DataBlock::setData(const uint8_t *data, int offset, int len) { |