mem: Add a Request::Flags parameter to the translating port proxies.
authorGabe Black <gabeblack@google.com>
Thu, 12 Mar 2020 08:41:56 +0000 (01:41 -0700)
committerGabe Black <gabeblack@google.com>
Thu, 19 Mar 2020 07:21:13 +0000 (07:21 +0000)
These flags will be given to the Request object which is used to do the
translation.

Change-Id: I21755f5f9369311e2f2d5be73ebd4f5865f73265
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26623
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>

src/mem/se_translating_port_proxy.cc
src/mem/se_translating_port_proxy.hh
src/mem/translating_port_proxy.cc
src/mem/translating_port_proxy.hh

index 458b2fad51c6bd53fd2b2104e6d872d71820aa89..8af628f3b9cc0f502728947cc36613ed0fda82a6 100644 (file)
@@ -44,8 +44,8 @@
 #include "sim/system.hh"
 
 SETranslatingPortProxy::SETranslatingPortProxy(
-        ThreadContext *tc, AllocType alloc) :
-    TranslatingPortProxy(tc), allocating(alloc)
+        ThreadContext *tc, AllocType alloc, Request::Flags _flags) :
+    TranslatingPortProxy(tc, _flags), allocating(alloc)
 {}
 
 bool
index 1b6be8a25067f6148cf547d07c4e719365fe5475..0fe3212012b8f17ddff10b4433aa5214b99e8fcf 100644 (file)
@@ -60,7 +60,8 @@ class SETranslatingPortProxy : public TranslatingPortProxy
     bool fixupAddr(Addr addr, BaseTLB::Mode mode) const override;
 
   public:
-    SETranslatingPortProxy(ThreadContext *tc, AllocType alloc);
+    SETranslatingPortProxy(ThreadContext *tc, AllocType alloc,
+                           Request::Flags _flags=0);
 };
 
 #endif // __MEM_SE_TRANSLATING_PORT_PROXY_HH__
index c44ff5fca0a3c5c4c8411af494c608518e6c177d..8bb93cc73fbc17b7526ec4e8bcecb4a707528b02 100644 (file)
 #include "cpu/thread_context.hh"
 #include "sim/system.hh"
 
-TranslatingPortProxy::TranslatingPortProxy(ThreadContext *tc) :
+TranslatingPortProxy::TranslatingPortProxy(
+        ThreadContext *tc, Request::Flags _flags) :
     PortProxy(tc->getCpuPtr()->getSendFunctional(),
               tc->getSystemPtr()->cacheLineSize()), _tc(tc),
-              pageBytes(tc->getSystemPtr()->getPageBytes())
+              pageBytes(tc->getSystemPtr()->getPageBytes()),
+              flags(_flags)
 {}
 
 bool
@@ -81,7 +83,7 @@ TranslatingPortProxy::tryReadBlob(Addr addr, void *p, int size) const
          gen.next())
     {
         auto req = std::make_shared<Request>(
-                gen.addr(), gen.size(), 0, Request::funcMasterId, 0,
+                gen.addr(), gen.size(), flags, Request::funcMasterId, 0,
                 _tc->contextId());
 
         if (!tryTLBs(req, BaseTLB::Read))
@@ -103,7 +105,7 @@ TranslatingPortProxy::tryWriteBlob(
          gen.next())
     {
         auto req = std::make_shared<Request>(
-                gen.addr(), gen.size(), 0, Request::funcMasterId, 0,
+                gen.addr(), gen.size(), flags, Request::funcMasterId, 0,
                 _tc->contextId());
 
         if (!tryTLBs(req, BaseTLB::Write))
@@ -123,7 +125,7 @@ TranslatingPortProxy::tryMemsetBlob(Addr address, uint8_t v, int size) const
          gen.next())
     {
         auto req = std::make_shared<Request>(
-                gen.addr(), gen.size(), 0, Request::funcMasterId, 0,
+                gen.addr(), gen.size(), flags, Request::funcMasterId, 0,
                 _tc->contextId());
 
         if (!tryTLBs(req, BaseTLB::Write))
index 1e17c64beea7cbbb53f79f2f5ca847ad17277789..a5dfe7fd175ad5ff3cb4daee8e4640f5a3d0d2b2 100644 (file)
@@ -62,6 +62,8 @@ class TranslatingPortProxy : public PortProxy
     ThreadContext* _tc;
     const Addr pageBytes;
 
+    Request::Flags flags;
+
     virtual bool
     fixupAddr(Addr addr, BaseTLB::Mode mode) const
     {
@@ -70,7 +72,7 @@ class TranslatingPortProxy : public PortProxy
 
   public:
 
-    TranslatingPortProxy(ThreadContext* tc);
+    TranslatingPortProxy(ThreadContext *tc, Request::Flags _flags=0);
 
     /** Version of tryReadblob that translates virt->phys and deals
       * with page boundries. */