Yu-hsin Wang has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/48823 )
Change subject: fastmodel: correct memory access space id
......................................................................
fastmodel: correct memory access space id
Change-Id: Ie513c44c362baddc0690cd97a2657f9ccdd06e96
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48823
Reviewed-by: Gabe Black <[email protected]>
Maintainer: Gabe Black <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/arch/arm/fastmodel/iris/thread_context.cc
M src/arch/arm/fastmodel/iris/thread_context.hh
2 files changed, 16 insertions(+), 8 deletions(-)
Approvals:
Gabe Black: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/arch/arm/fastmodel/iris/thread_context.cc
b/src/arch/arm/fastmodel/iris/thread_context.cc
index 0d2f0b3..11e4f17 100644
--- a/src/arch/arm/fastmodel/iris/thread_context.cc
+++ b/src/arch/arm/fastmodel/iris/thread_context.cc
@@ -437,21 +437,23 @@
}
void
-ThreadContext::readMem(Addr addr, void *p, size_t size)
+ThreadContext::readMem(
+ iris::MemorySpaceId space, Addr addr, void *p, size_t size)
{
iris::r0master::MemoryReadResult r;
- auto err = call().memory_read(_instId, r, 0, addr, 1, size);
+ auto err = call().memory_read(_instId, r, space, addr, 1, size);
panic_if(err != iris::r0master::E_ok, "readMem failed.");
std::memcpy(p, r.data.data(), size);
}
void
-ThreadContext::writeMem(Addr addr, const void *p, size_t size)
+ThreadContext::writeMem(
+ iris::MemorySpaceId space, Addr addr, const void *p, size_t size)
{
std::vector<uint64_t> data((size + 7) / 8);
std::memcpy(data.data(), p, size);
iris::MemoryWriteResult r;
- auto err = call().memory_write(_instId, r, 0, addr, 1, size, data);
+ auto err = call().memory_write(_instId, r, space, addr, 1, size, data);
panic_if(err != iris::r0master::E_ok, "writeMem failed.");
}
@@ -515,15 +517,19 @@
void
ThreadContext::sendFunctional(PacketPtr pkt)
{
+ auto msn = ArmISA::isSecure(this) ?
+ Iris::PhysicalMemorySecureMsn : Iris::PhysicalMemoryNonSecureMsn;
+ auto id = getMemorySpaceId(msn);
+
auto addr = pkt->getAddr();
auto size = pkt->getSize();
auto data = pkt->getPtr<uint8_t>();
pkt->makeResponse();
if (pkt->isRead())
- readMem(addr, data, size);
+ readMem(id, addr, data, size);
else
- writeMem(addr, data, size);
+ writeMem(id, addr, data, size);
}
ThreadContext::Status
diff --git a/src/arch/arm/fastmodel/iris/thread_context.hh
b/src/arch/arm/fastmodel/iris/thread_context.hh
index ddc08eb1..49f2cae 100644
--- a/src/arch/arm/fastmodel/iris/thread_context.hh
+++ b/src/arch/arm/fastmodel/iris/thread_context.hh
@@ -169,8 +169,10 @@
iris::IrisCppAdapter &call() const { return client.irisCall(); }
iris::IrisCppAdapter &noThrow() const { return
client.irisCallNoThrow(); }
- void readMem(Addr addr, void *p, size_t size);
- void writeMem(Addr addr, const void *p, size_t size);
+ void readMem(iris::MemorySpaceId space,
+ Addr addr, void *p, size_t size);
+ void writeMem(iris::MemorySpaceId space,
+ Addr addr, const void *p, size_t size);
bool translateAddress(Addr &paddr, iris::MemorySpaceId p_space,
Addr vaddr, iris::MemorySpaceId v_space);
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/48823
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ie513c44c362baddc0690cd97a2657f9ccdd06e96
Gerrit-Change-Number: 48823
Gerrit-PatchSet: 3
Gerrit-Owner: Yu-hsin Wang <[email protected]>
Gerrit-Reviewer: Earl Ou <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Yu-hsin Wang <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s