Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/45863 )

Change subject: mem: Add a ThreadContext helper constructor for PortProxy.
......................................................................

mem: Add a ThreadContext helper constructor for PortProxy.

This creates a sendFunctionalFunc which calls the tc->sendFunctional.

Change-Id: I97ac2fb52d4f61420a09b37d70d4745c779234c1
---
M src/mem/port_proxy.cc
M src/mem/port_proxy.hh
2 files changed, 22 insertions(+), 9 deletions(-)



diff --git a/src/mem/port_proxy.cc b/src/mem/port_proxy.cc
index f12ba8b..34612f0 100644
--- a/src/mem/port_proxy.cc
+++ b/src/mem/port_proxy.cc
@@ -38,6 +38,18 @@
 #include "mem/port_proxy.hh"

 #include "base/chunk_generator.hh"
+#include "cpu/thread_context.hh"
+#include "mem/port.hh"
+
+PortProxy::PortProxy(ThreadContext *tc, unsigned int cache_line_size) :
+    PortProxy([tc](PacketPtr pkt)->void { tc->sendFunctional(pkt); },
+        cache_line_size)
+{}
+
+PortProxy::PortProxy(const RequestPort &port, unsigned int cache_line_size) :
+    PortProxy([&port](PacketPtr pkt)->void { port.sendFunctional(pkt); },
+        cache_line_size)
+{}

 void
 PortProxy::readBlobPhys(Addr addr, Request::Flags flags,
diff --git a/src/mem/port_proxy.hh b/src/mem/port_proxy.hh
index 9f3945b..691f775 100644
--- a/src/mem/port_proxy.hh
+++ b/src/mem/port_proxy.hh
@@ -60,9 +60,12 @@
 #include <functional>
 #include <limits>

-#include "mem/port.hh"
+#include "mem/protocol/functional.hh"
 #include "sim/byteswap.hh"

+class RequestPort;
+class ThreadContext;
+
 /**
  * This object is a proxy for a port or other object which implements the
  * functional response protocol, to be used for debug accesses.
@@ -97,16 +100,14 @@
     }

   public:
-    PortProxy(SendFunctionalFunc func, unsigned int cacheLineSize) :
-        sendFunctional(func), _cacheLineSize(cacheLineSize)
+    PortProxy(SendFunctionalFunc func, unsigned int cache_line_size) :
+        sendFunctional(func), _cacheLineSize(cache_line_size)
     {}
-    PortProxy(const RequestPort &port, unsigned int cacheLineSize) :
-        sendFunctional([&port](PacketPtr pkt)->void {
-                port.sendFunctional(pkt);
-            }), _cacheLineSize(cacheLineSize)
-    {}
-    virtual ~PortProxy() { }

+    PortProxy(ThreadContext *tc, unsigned int cache_line_size);
+    PortProxy(const RequestPort &port, unsigned int cache_line_size);
+
+    virtual ~PortProxy() {}


     /** Fixed functionality for use in base classes. */

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/45863
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: I97ac2fb52d4f61420a09b37d70d4745c779234c1
Gerrit-Change-Number: 45863
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[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