diff options
author | Jason Power <power.jg@gmail.com> | 2015-02-26 09:58:26 -0600 |
---|---|---|
committer | Jason Power <power.jg@gmail.com> | 2015-02-26 09:58:26 -0600 |
commit | 670f44e05eb8eb1a56b36c4390cf83807a28d823 (patch) | |
tree | a050dd6f28aebe5221bcf109c2dadb085ad1a67c /src/mem/ruby/system/RubyPort.cc | |
parent | f18d2120fa66803912dcce61fe6c704a6a05a2d1 (diff) | |
download | gem5-670f44e05eb8eb1a56b36c4390cf83807a28d823.tar.xz |
Ruby: Update backing store option to propagate through to all RubyPorts
Previously, the user would have to manually set access_backing_store=True
on all RubyPorts (Sequencers) in the config files.
Now, instead there is one global option that each RubyPort checks on
initialization.
Committed by: Nilay Vaish <nilay@cs.wisc.edu>
Diffstat (limited to 'src/mem/ruby/system/RubyPort.cc')
-rw-r--r-- | src/mem/ruby/system/RubyPort.cc | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/src/mem/ruby/system/RubyPort.cc b/src/mem/ruby/system/RubyPort.cc index 66e59144f..b419c491c 100644 --- a/src/mem/ruby/system/RubyPort.cc +++ b/src/mem/ruby/system/RubyPort.cc @@ -58,7 +58,7 @@ RubyPort::RubyPort(const Params *p) pioSlavePort(csprintf("%s.pio-slave-port", name()), this), memMasterPort(csprintf("%s.mem-master-port", name()), this), memSlavePort(csprintf("%s-mem-slave-port", name()), this, - p->ruby_system, p->access_backing_store, -1), + p->ruby_system, p->ruby_system->getAccessBackingStore(), -1), gotAddrRanges(p->port_master_connection_count), drainManager(NULL) { assert(m_version != -1); @@ -66,7 +66,8 @@ RubyPort::RubyPort(const Params *p) // create the slave ports based on the number of connected ports for (size_t i = 0; i < p->port_slave_connection_count; ++i) { slave_ports.push_back(new MemSlavePort(csprintf("%s.slave%d", name(), - i), this, p->ruby_system, p->access_backing_store, i)); + i), this, p->ruby_system, + p->ruby_system->getAccessBackingStore(), i)); } // create the master ports based on the number of connected ports @@ -297,40 +298,40 @@ RubyPort::MemSlavePort::recvFunctional(PacketPtr pkt) line_address(Address(pkt->getAddr())).getAddress() + RubySystem::getBlockSizeBytes()); - bool accessSucceeded = false; - bool needsResponse = pkt->needsResponse(); - - // Do the functional access on ruby memory - if (pkt->isRead()) { - accessSucceeded = ruby_system->functionalRead(pkt); - } else if (pkt->isWrite()) { - accessSucceeded = ruby_system->functionalWrite(pkt); - } else { - panic("Unsupported functional command %s\n", pkt->cmdString()); - } - - // Unless the requester explicitly said otherwise, generate an error if - // the functional request failed - if (!accessSucceeded && !pkt->suppressFuncError()) { - fatal("Ruby functional %s failed for address %#x\n", - pkt->isWrite() ? "write" : "read", pkt->getAddr()); - } - if (access_backing_store) { // The attached physmem contains the official version of data. // The following command performs the real functional access. // This line should be removed once Ruby supplies the official version // of data. ruby_system->getPhysMem()->functionalAccess(pkt); - } + } else { + bool accessSucceeded = false; + bool needsResponse = pkt->needsResponse(); + + // Do the functional access on ruby memory + if (pkt->isRead()) { + accessSucceeded = ruby_system->functionalRead(pkt); + } else if (pkt->isWrite()) { + accessSucceeded = ruby_system->functionalWrite(pkt); + } else { + panic("Unsupported functional command %s\n", pkt->cmdString()); + } - // turn packet around to go back to requester if response expected - if (needsResponse) { - pkt->setFunctionalResponseStatus(accessSucceeded); - } + // Unless the requester explicitly said otherwise, generate an error if + // the functional request failed + if (!accessSucceeded && !pkt->suppressFuncError()) { + fatal("Ruby functional %s failed for address %#x\n", + pkt->isWrite() ? "write" : "read", pkt->getAddr()); + } - DPRINTF(RubyPort, "Functional access %s!\n", - accessSucceeded ? "successful":"failed"); + // turn packet around to go back to requester if response expected + if (needsResponse) { + pkt->setFunctionalResponseStatus(accessSucceeded); + } + + DPRINTF(RubyPort, "Functional access %s!\n", + accessSucceeded ? "successful":"failed"); + } } void @@ -495,7 +496,7 @@ RubyPort::MemSlavePort::hitCallback(PacketPtr pkt) DPRINTF(RubyPort, "Hit callback needs response %d\n", needsResponse); if (accessPhysMem) { - ruby_system->getPhysMem()->functionalAccess(pkt); + ruby_system->getPhysMem()->access(pkt); } else if (needsResponse) { pkt->makeResponse(); } |