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 <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>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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<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))
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user