Yu-hsin Wang has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/45581 )

Change subject: fastmodel: Use Iris API to access memory
......................................................................

fastmodel: Use Iris API to access memory

Memory space is not always outside of the CPU. For example the tightly
coupled memory (TCM) is inside of the core. To make gdb access those
kind of memory, we should use Iris memory API to read and write memory.
If we access a memory address not inside the CPU with Iris memory API.
The CPU would fire a request via amba transport_dbg. So the change also
covers the original behavior.

Change-Id: Ie223ab12f9a746ebafa21026a8680222f6ebd593
---
M src/arch/arm/fastmodel/iris/thread_context.cc
M src/arch/arm/fastmodel/iris/thread_context.hh
2 files changed, 18 insertions(+), 0 deletions(-)



diff --git a/src/arch/arm/fastmodel/iris/thread_context.cc b/src/arch/arm/fastmodel/iris/thread_context.cc
index 0104ebc..64d8933 100644
--- a/src/arch/arm/fastmodel/iris/thread_context.cc
+++ b/src/arch/arm/fastmodel/iris/thread_context.cc
@@ -494,6 +494,23 @@
     return count;
 }

+PortProxy::SendFunctionalFunc
+ThreadContext::getSendFunctional()
+{
+    return [this](PacketPtr pkt)
+    {
+        auto addr = pkt->getAddr();
+        auto size = pkt->getSize();
+        auto data = pkt->getPtr<unsigned char>();
+
+        pkt->makeResponse();
+        if (pkt->isRead())
+            readMem(addr, data, size);
+        else
+            writeMem(addr, data, size);
+    };
+}
+
 void
 ThreadContext::initMemProxies(::ThreadContext *tc)
 {
diff --git a/src/arch/arm/fastmodel/iris/thread_context.hh b/src/arch/arm/fastmodel/iris/thread_context.hh
index 1d4fcf7..93c3185 100644
--- a/src/arch/arm/fastmodel/iris/thread_context.hh
+++ b/src/arch/arm/fastmodel/iris/thread_context.hh
@@ -216,6 +216,7 @@

     PortProxy &getPhysProxy() override { return *physProxy; }
     PortProxy &getVirtProxy() override { return *virtProxy; }
+    PortProxy::SendFunctionalFunc getSendFunctional() override;
     void initMemProxies(::ThreadContext *tc) override;

     Process *

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/45581
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: Ie223ab12f9a746ebafa21026a8680222f6ebd593
Gerrit-Change-Number: 45581
Gerrit-PatchSet: 1
Gerrit-Owner: Yu-hsin Wang <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to