mips: Implement translateFunctional.

Change-Id: I32df1b3b12a0adee4457b78c735936c4c73da048
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26548
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
This commit is contained in:
Gabe Black
2020-03-10 18:15:44 -07:00
parent 73fdc2eb57
commit ca83295b6f
2 changed files with 12 additions and 40 deletions

View File

@@ -64,8 +64,7 @@ TLB::TLB(const Params *p)
TLB::~TLB()
{
if (table)
delete [] table;
delete [] table;
}
// look up an entry in the TLB
@@ -275,43 +274,11 @@ TLB::regStats()
accesses = read_accesses + write_accesses;
}
Fault
TLB::translateInst(const RequestPtr &req, ThreadContext *tc)
{
if (FullSystem)
panic("translateInst not implemented in MIPS.\n");
Process * p = tc->getProcessPtr();
Fault fault = p->pTable->translate(req);
if (fault != NoFault)
return fault;
return NoFault;
}
Fault
TLB::translateData(const RequestPtr &req, ThreadContext *tc, bool write)
{
if (FullSystem)
panic("translateData not implemented in MIPS.\n");
Process * p = tc->getProcessPtr();
Fault fault = p->pTable->translate(req);
if (fault != NoFault)
return fault;
return NoFault;
}
Fault
TLB::translateAtomic(const RequestPtr &req, ThreadContext *tc, Mode mode)
{
if (mode == Execute)
return translateInst(req, tc);
else
return translateData(req, tc, mode == Write);
panic_if(FullSystem, "translateAtomic not implemented in full system.");
return tc->getProcessPtr()->pTable->translate(req);
}
void
@@ -322,6 +289,13 @@ TLB::translateTiming(const RequestPtr &req, ThreadContext *tc,
translation->finish(translateAtomic(req, tc, mode), req, tc, mode);
}
Fault
TLB::translateFunctional(const RequestPtr &req, ThreadContext *tc, Mode mode)
{
panic_if(FullSystem, "translateAtomic not implemented in full system.");
return tc->getProcessPtr()->pTable->translate(req);
}
Fault
TLB::finalizePhysical(const RequestPtr &req,
ThreadContext *tc, Mode mode) const

View File

@@ -112,13 +112,11 @@ class TLB : public BaseTLB
void translateTiming(
const RequestPtr &req, ThreadContext *tc,
Translation *translation, Mode mode) override;
Fault translateFunctional(
const RequestPtr &req, ThreadContext *tc, Mode mode) override;
Fault finalizePhysical(
const RequestPtr &req,
ThreadContext *tc, Mode mode) const override;
private:
Fault translateInst(const RequestPtr &req, ThreadContext *tc);
Fault translateData(const RequestPtr &req, ThreadContext *tc, bool write);
};
}