From: Gabe Black Date: Thu, 12 Mar 2020 08:41:56 +0000 (-0700) Subject: mem: Add a Request::Flags parameter to the translating port proxies. X-Git-Tag: v20.0.0.0~305 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9edd7357f61dd1a5ea43320d988124a43f74a9ea;p=gem5.git mem: Add a Request::Flags parameter to the translating port proxies. 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 Reviewed-by: Jason Lowe-Power Reviewed-by: Matthew Poremba Maintainer: Gabe Black --- diff --git a/src/mem/se_translating_port_proxy.cc b/src/mem/se_translating_port_proxy.cc index 458b2fad5..8af628f3b 100644 --- a/src/mem/se_translating_port_proxy.cc +++ b/src/mem/se_translating_port_proxy.cc @@ -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 diff --git a/src/mem/se_translating_port_proxy.hh b/src/mem/se_translating_port_proxy.hh index 1b6be8a25..0fe321201 100644 --- a/src/mem/se_translating_port_proxy.hh +++ b/src/mem/se_translating_port_proxy.hh @@ -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__ diff --git a/src/mem/translating_port_proxy.cc b/src/mem/translating_port_proxy.cc index c44ff5fca..8bb93cc73 100644 --- a/src/mem/translating_port_proxy.cc +++ b/src/mem/translating_port_proxy.cc @@ -50,10 +50,12 @@ #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( - 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( - 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( - gen.addr(), gen.size(), 0, Request::funcMasterId, 0, + gen.addr(), gen.size(), flags, Request::funcMasterId, 0, _tc->contextId()); if (!tryTLBs(req, BaseTLB::Write)) diff --git a/src/mem/translating_port_proxy.hh b/src/mem/translating_port_proxy.hh index 1e17c64be..a5dfe7fd1 100644 --- a/src/mem/translating_port_proxy.hh +++ b/src/mem/translating_port_proxy.hh @@ -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. */