summaryrefslogtreecommitdiff
path: root/src/arch/mips/tlb.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/mips/tlb.cc')
-rw-r--r--src/arch/mips/tlb.cc97
1 files changed, 19 insertions, 78 deletions
diff --git a/src/arch/mips/tlb.cc b/src/arch/mips/tlb.cc
index eac44eba8..9343e35a3 100644
--- a/src/arch/mips/tlb.cc
+++ b/src/arch/mips/tlb.cc
@@ -45,10 +45,7 @@
#include "cpu/thread_context.hh"
#include "sim/process.hh"
#include "mem/page_table.hh"
-#include "params/MipsDTB.hh"
-#include "params/MipsITB.hh"
#include "params/MipsTLB.hh"
-#include "params/MipsUTB.hh"
using namespace std;
@@ -310,7 +307,7 @@ TLB::regStats()
}
Fault
-ITB::translateAtomic(RequestPtr req, ThreadContext *tc)
+TLB::translateInst(RequestPtr req, ThreadContext *tc)
{
#if !FULL_SYSTEM
Process * p = tc->getProcessPtr();
@@ -426,16 +423,8 @@ ITB::translateAtomic(RequestPtr req, ThreadContext *tc)
#endif
}
-void
-ITB::translateTiming(RequestPtr req, ThreadContext *tc,
- Translation *translation)
-{
- assert(translation);
- translation->finish(translateAtomic(req, tc), req, tc, false);
-}
-
Fault
-DTB::translateAtomic(RequestPtr req, ThreadContext *tc, bool write)
+TLB::translateData(RequestPtr req, ThreadContext *tc, bool write)
{
#if !FULL_SYSTEM
Process * p = tc->getProcessPtr();
@@ -572,61 +561,25 @@ DTB::translateAtomic(RequestPtr req, ThreadContext *tc, bool write)
#endif
}
+Fault
+TLB::translateAtomic(RequestPtr req, ThreadContext *tc,
+ bool write, bool execute)
+{
+ if (execute)
+ return translateInst(req, tc);
+ else
+ return translateData(req, tc, write);
+}
+
void
-DTB::translateTiming(RequestPtr req, ThreadContext *tc,
- Translation *translation, bool write)
+TLB::translateTiming(RequestPtr req, ThreadContext *tc,
+ Translation *translation, bool write, bool execute)
{
assert(translation);
- translation->finish(translateAtomic(req, tc, write), req, tc, write);
+ translation->finish(translateAtomic(req, tc, write, execute),
+ req, tc, write, execute);
}
-///////////////////////////////////////////////////////////////////////
-//
-// Mips ITB
-//
-ITB::ITB(const Params *p)
- : TLB(p)
-{}
-
-
-// void
-// ITB::regStats()
-// {
-// /* hits - causes failure for some reason
-// .name(name() + ".hits")
-// .desc("ITB hits");
-// misses
-// .name(name() + ".misses")
-// .desc("ITB misses");
-// acv
-// .name(name() + ".acv")
-// .desc("ITB acv");
-// accesses
-// .name(name() + ".accesses")
-// .desc("ITB accesses");
-
-// accesses = hits + misses + invalids; */
-// }
-
-
-
-///////////////////////////////////////////////////////////////////////
-//
-// Mips DTB
-//
-DTB::DTB(const Params *p)
- : TLB(p)
-{}
-
-///////////////////////////////////////////////////////////////////////
-//
-// Mips UTB
-//
-UTB::UTB(const Params *p)
- : ITB(p), DTB(p)
-{}
-
-
MipsISA::PTE &
TLB::index(bool advance)
@@ -639,20 +592,8 @@ TLB::index(bool advance)
return *pte;
}
-MipsISA::ITB *
-MipsITBParams::create()
-{
- return new MipsISA::ITB(this);
-}
-
-MipsISA::DTB *
-MipsDTBParams::create()
-{
- return new MipsISA::DTB(this);
-}
-
-MipsISA::UTB *
-MipsUTBParams::create()
+MipsISA::TLB *
+MipsTLBParams::create()
{
- return new MipsISA::UTB(this);
+ return new MipsISA::TLB(this);
}