arch,cpu,mem: Replace the mmmapped IPR mechanism with local accesses.
The new local access mechanism installs a callback in the request which implements what the mmapped IPR was doing. That avoids having to have stubs in ISAs that don't have mmapped IPRs, avoids having to encode what to do to communicate from the TLB and the mmapped IPR functions, and gets rid of another global ISA interface function and header files. Jira Issue: https://gem5.atlassian.net/browse/GEM5-187 Change-Id: I772c2ae2ca3830a4486919ce9804560c0f2d596a Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23188 Reviewed-by: Matthew Poremba <matthew.poremba@amd.com> Maintainer: Gabe Black <gabeblack@google.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -42,7 +42,6 @@
|
||||
#include "cpu/simple/atomic.hh"
|
||||
|
||||
#include "arch/locked_mem.hh"
|
||||
#include "arch/mmapped_ipr.hh"
|
||||
#include "arch/utility.hh"
|
||||
#include "base/output.hh"
|
||||
#include "config/the_isa.hh"
|
||||
@@ -406,8 +405,8 @@ AtomicSimpleCPU::readMem(Addr addr, uint8_t * data, unsigned size,
|
||||
Packet pkt(req, Packet::makeReadCmd(req));
|
||||
pkt.dataStatic(data);
|
||||
|
||||
if (req->isMmappedIpr()) {
|
||||
dcache_latency += TheISA::handleIprRead(thread->getTC(), &pkt);
|
||||
if (req->isLocalAccess()) {
|
||||
dcache_latency += req->localAccessor(thread->getTC(), &pkt);
|
||||
} else {
|
||||
dcache_latency += sendPacket(dcachePort, &pkt);
|
||||
}
|
||||
@@ -511,9 +510,9 @@ AtomicSimpleCPU::writeMem(uint8_t *data, unsigned size, Addr addr,
|
||||
Packet pkt(req, Packet::makeWriteCmd(req));
|
||||
pkt.dataStatic(data);
|
||||
|
||||
if (req->isMmappedIpr()) {
|
||||
if (req->isLocalAccess()) {
|
||||
dcache_latency +=
|
||||
TheISA::handleIprWrite(thread->getTC(), &pkt);
|
||||
req->localAccessor(thread->getTC(), &pkt);
|
||||
} else {
|
||||
dcache_latency += sendPacket(dcachePort, &pkt);
|
||||
|
||||
@@ -607,8 +606,8 @@ AtomicSimpleCPU::amoMem(Addr addr, uint8_t* data, unsigned size,
|
||||
Packet pkt(req, Packet::makeWriteCmd(req));
|
||||
pkt.dataStatic(data);
|
||||
|
||||
if (req->isMmappedIpr())
|
||||
dcache_latency += TheISA::handleIprRead(thread->getTC(), &pkt);
|
||||
if (req->isLocalAccess())
|
||||
dcache_latency += req->localAccessor(thread->getTC(), &pkt);
|
||||
else {
|
||||
dcache_latency += sendPacket(dcachePort, &pkt);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
#include "cpu/simple/timing.hh"
|
||||
|
||||
#include "arch/locked_mem.hh"
|
||||
#include "arch/mmapped_ipr.hh"
|
||||
#include "arch/utility.hh"
|
||||
#include "config/the_isa.hh"
|
||||
#include "cpu/exetrace.hh"
|
||||
@@ -266,8 +265,8 @@ TimingSimpleCPU::handleReadPacket(PacketPtr pkt)
|
||||
if (pkt->isRead() && pkt->req->isLLSC()) {
|
||||
TheISA::handleLockedRead(thread, pkt->req);
|
||||
}
|
||||
if (req->isMmappedIpr()) {
|
||||
Cycles delay = TheISA::handleIprRead(thread->getTC(), pkt);
|
||||
if (req->isLocalAccess()) {
|
||||
Cycles delay = req->localAccessor(thread->getTC(), pkt);
|
||||
new IprEvent(pkt, this, clockEdge(delay));
|
||||
_status = DcacheWaitResponse;
|
||||
dcache_pkt = NULL;
|
||||
@@ -388,7 +387,7 @@ TimingSimpleCPU::buildSplitPacket(PacketPtr &pkt1, PacketPtr &pkt2,
|
||||
{
|
||||
pkt1 = pkt2 = NULL;
|
||||
|
||||
assert(!req1->isMmappedIpr() && !req2->isMmappedIpr());
|
||||
assert(!req1->isLocalAccess() && !req2->isLocalAccess());
|
||||
|
||||
if (req->getFlags().isSet(Request::NO_ACCESS)) {
|
||||
pkt1 = buildPacket(req, read);
|
||||
@@ -476,8 +475,8 @@ TimingSimpleCPU::handleWritePacket()
|
||||
SimpleThread* thread = t_info.thread;
|
||||
|
||||
const RequestPtr &req = dcache_pkt->req;
|
||||
if (req->isMmappedIpr()) {
|
||||
Cycles delay = TheISA::handleIprWrite(thread->getTC(), dcache_pkt);
|
||||
if (req->isLocalAccess()) {
|
||||
Cycles delay = req->localAccessor(thread->getTC(), dcache_pkt);
|
||||
new IprEvent(dcache_pkt, this, clockEdge(delay));
|
||||
_status = DcacheWaitResponse;
|
||||
dcache_pkt = NULL;
|
||||
|
||||
Reference in New Issue
Block a user