changeset a008609e0abc in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=a008609e0abc
description:
        inorder-unified-tlb: use unified TLB instead of old TLB model

diffstat:

8 files changed, 28 insertions(+), 20 deletions(-)
src/arch/alpha/regfile.hh               |    1 +
src/cpu/inorder/cpu.cc                  |    8 ++++----
src/cpu/inorder/cpu.hh                  |    4 ++--
src/cpu/inorder/inorder_dyn_inst.hh     |    9 ++++-----
src/cpu/inorder/pipeline_traits.cc      |    4 ++--
src/cpu/inorder/resources/cache_unit.cc |    6 ++++--
src/cpu/inorder/resources/tlb_unit.cc   |   11 ++++++++---
src/cpu/inorder/resources/tlb_unit.hh   |    5 +++--

diffs (180 lines):

diff -r f51edf04e4a1 -r a008609e0abc src/arch/alpha/regfile.hh
--- a/src/arch/alpha/regfile.hh Tue May 12 15:01:14 2009 -0400
+++ b/src/arch/alpha/regfile.hh Tue May 12 15:01:14 2009 -0400
@@ -36,6 +36,7 @@
 #include "arch/alpha/intregfile.hh"
 #include "arch/alpha/miscregfile.hh"
 #include "arch/alpha/types.hh"
+#include "arch/alpha/mt.hh"
 #include "sim/faults.hh"
 
 #include <string>
diff -r f51edf04e4a1 -r a008609e0abc src/cpu/inorder/cpu.cc
--- a/src/cpu/inorder/cpu.cc    Tue May 12 15:01:14 2009 -0400
+++ b/src/cpu/inorder/cpu.cc    Tue May 12 15:01:14 2009 -0400
@@ -1264,17 +1264,17 @@
     return mem_res->doDataAccess(inst);
 }
 
-TheISA::ITB*
+TheISA::TLB*
 InOrderCPU::getITBPtr()
 {
     TLBUnit *itb_res = dynamic_cast<TLBUnit*>(resPool->getResource(itbIdx));
-    return dynamic_cast<TheISA::ITB*>(itb_res->tlb());
+    return itb_res->tlb();
 }
 
 
-TheISA::DTB*
+TheISA::TLB*
 InOrderCPU::getDTBPtr()
 {
     TLBUnit *dtb_res = dynamic_cast<TLBUnit*>(resPool->getResource(dtbIdx));
-    return dynamic_cast<TheISA::DTB*>(dtb_res->tlb());
+    return dtb_res->tlb();
 }
diff -r f51edf04e4a1 -r a008609e0abc src/cpu/inorder/cpu.hh
--- a/src/cpu/inorder/cpu.hh    Tue May 12 15:01:14 2009 -0400
+++ b/src/cpu/inorder/cpu.hh    Tue May 12 15:01:14 2009 -0400
@@ -266,8 +266,8 @@
     /** Communication structure that sits in between pipeline stages */
     StageQueue *stageQueue[ThePipeline::NumStages-1];
 
-    TheISA::ITB *getITBPtr();
-    TheISA::DTB *getDTBPtr();
+    TheISA::TLB *getITBPtr();
+    TheISA::TLB *getDTBPtr();
 
   public:
 
diff -r f51edf04e4a1 -r a008609e0abc src/cpu/inorder/inorder_dyn_inst.hh
--- a/src/cpu/inorder/inorder_dyn_inst.hh       Tue May 12 15:01:14 2009 -0400
+++ b/src/cpu/inorder/inorder_dyn_inst.hh       Tue May 12 15:01:14 2009 -0400
@@ -419,11 +419,10 @@
 
 
     /** Print Resource Schedule */
+    /** @NOTE: DEBUG ONLY */
     void printSched()
     {
-        using namespace ThePipeline;
-
-        ResSchedule tempSched;
+        ThePipeline::ResSchedule tempSched;
         std::cerr << "\tInst. Res. Schedule: ";
         while (!resSched.empty()) {
             std::cerr << '\t' << resSched.top()->stageNum << "-"
@@ -835,7 +834,7 @@
     IntReg readIntRegOperand(const StaticInst *si, int idx, unsigned tid=0);
     FloatReg readFloatRegOperand(const StaticInst *si, int idx,
                           int width = TheISA::SingleWidth);
-    FloatRegBits readFloatRegOperandBits(const StaticInst *si, int idx,
+    TheISA::FloatRegBits readFloatRegOperandBits(const StaticInst *si, int idx,
                                   int width = TheISA::SingleWidth);
     MiscReg readMiscReg(int misc_reg);
     MiscReg readMiscRegNoEffect(int misc_reg);
@@ -878,7 +877,7 @@
     void setIntRegOperand(const StaticInst *si, int idx, IntReg val);
     void setFloatRegOperand(const StaticInst *si, int idx, FloatReg val,
                      int width = TheISA::SingleWidth);
-    void setFloatRegOperandBits(const StaticInst *si, int idx, FloatRegBits 
val,
+    void setFloatRegOperandBits(const StaticInst *si, int idx, 
TheISA::FloatRegBits val,
                          int width = TheISA::SingleWidth);
     void setMiscReg(int misc_reg, const MiscReg &val);
     void setMiscRegNoEffect(int misc_reg, const MiscReg &val);
diff -r f51edf04e4a1 -r a008609e0abc src/cpu/inorder/pipeline_traits.cc
--- a/src/cpu/inorder/pipeline_traits.cc        Tue May 12 15:01:14 2009 -0400
+++ b/src/cpu/inorder/pipeline_traits.cc        Tue May 12 15:01:14 2009 -0400
@@ -101,7 +101,7 @@
     } else if ( inst->isMemRef() ) {
         if ( inst->isLoad() ) {
             E->needs(AGEN, AGENUnit::GenerateAddr);
-            E->needs(DTLB, TLBUnit::DataLookup);
+            E->needs(DTLB, TLBUnit::DataReadLookup);
             E->needs(DCache, CacheUnit::InitiateReadData);
         }
     } else if (inst->opClass() == IntMultOp || inst->opClass() == IntDivOp) {
@@ -122,7 +122,7 @@
     } else if ( inst->isStore() ) {
         M->needs(RegManager, UseDefUnit::ReadSrcReg, 1);
         M->needs(AGEN, AGENUnit::GenerateAddr);
-        M->needs(DTLB, TLBUnit::DataLookup);
+        M->needs(DTLB, TLBUnit::DataWriteLookup);
         M->needs(DCache, CacheUnit::InitiateWriteData);
     }
 
diff -r f51edf04e4a1 -r a008609e0abc src/cpu/inorder/resources/cache_unit.cc
--- a/src/cpu/inorder/resources/cache_unit.cc   Tue May 12 15:01:14 2009 -0400
+++ b/src/cpu/inorder/resources/cache_unit.cc   Tue May 12 15:01:14 2009 -0400
@@ -451,10 +451,12 @@
 
 
     // Get resource request info
-    // @todo: SMT needs to figure out where to get thread # from.
-    unsigned tid = 0;
     unsigned stage_num = cache_req->getStageNum();
     DynInstPtr inst = cache_req->inst;
+    unsigned tid;
+
+
+    tid = cache_req->inst->readTid();
 
     if (!cache_req->isSquashed()) {
         if (inst->resSched.top()->cmd == CompleteFetch) {
diff -r f51edf04e4a1 -r a008609e0abc src/cpu/inorder/resources/tlb_unit.cc
--- a/src/cpu/inorder/resources/tlb_unit.cc     Tue May 12 15:01:14 2009 -0400
+++ b/src/cpu/inorder/resources/tlb_unit.cc     Tue May 12 15:01:14 2009 -0400
@@ -118,7 +118,7 @@
         {
             tlb_req->fault =
                 _tlb->translateAtomic(tlb_req->memReq,
-                        cpu->thread[tid]->getTC(), false, true);
+                                      cpu->thread[tid]->getTC(), 
TheISA::TLB::Execute);
 
             if (tlb_req->fault != NoFault) {
                 DPRINTF(InOrderTLB, "[tid:%i]: %s encountered while 
translating "
@@ -142,14 +142,19 @@
         }
         break;
 
-      case DataLookup:
+      case DataReadLookup:
+      case DataWriteLookup:
         {
             DPRINTF(InOrderTLB, "[tid:%i]: [sn:%i]: Attempting to translate 
%08p.\n",
                     tid, seq_num, tlb_req->memReq->getVaddr());
 
+
+            TheISA::TLB::Mode tlb_mode = (tlb_req->cmd == DataReadLookup) ?
+                TheISA::TLB::Read : TheISA::TLB::Write;
+
             tlb_req->fault =
                 _tlb->translateAtomic(tlb_req->memReq,
-                        cpu->thread[tid]->getTC());
+                                      cpu->thread[tid]->getTC(), tlb_mode);
 
             if (tlb_req->fault != NoFault) {
                 DPRINTF(InOrderTLB, "[tid:%i]: %s encountered while 
translating "
diff -r f51edf04e4a1 -r a008609e0abc src/cpu/inorder/resources/tlb_unit.hh
--- a/src/cpu/inorder/resources/tlb_unit.hh     Tue May 12 15:01:14 2009 -0400
+++ b/src/cpu/inorder/resources/tlb_unit.hh     Tue May 12 15:01:14 2009 -0400
@@ -47,7 +47,8 @@
 
     enum TLBCommand {
         FetchLookup,
-        DataLookup
+        DataReadLookup,
+        DataWriteLookup
     };
 
   public:
@@ -103,7 +104,7 @@
 
         if (_cmd == TLBUnit::FetchLookup) {
             aligned_addr = inst->getMemAddr();
-            req_size = sizeof(MachInst);
+            req_size = sizeof(TheISA::MachInst);
             flags = 0;
         } else {
             aligned_addr = inst->getMemAddr();;
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to