Slight fixes, add in commit trace flag.
authorKevin Lim <ktlim@umich.edu>
Tue, 11 Jan 2005 23:52:29 +0000 (18:52 -0500)
committerKevin Lim <ktlim@umich.edu>
Tue, 11 Jan 2005 23:52:29 +0000 (18:52 -0500)
base/traceflags.py:
    Add new commit rate trace flag.
build/SConstruct:
    Add extra option for efence.
cpu/beta_cpu/alpha_full_cpu_impl.hh:
    Use function calls instead of direct indexing (avoids confusion).
cpu/beta_cpu/commit_impl.hh:
    Add commit rate trace output (might not be worthwhile in the future).
cpu/beta_cpu/decode_impl.hh:
    Remove some older hacks.  Fix it so that the isntruction properly sets its next
    PC to the one calculated by the branch.
cpu/beta_cpu/fetch_impl.hh:
    Remove old commented code.
cpu/beta_cpu/iew_impl.hh:
    Add extra check to ensure that the instruction is valid.
cpu/beta_cpu/regfile.hh:
    Include trace file.

--HG--
extra : convert_revision : 4ee1dc88f8a5ed9b65486c6c111a3718a8040e42

base/traceflags.py
build/SConstruct
cpu/beta_cpu/alpha_full_cpu_impl.hh
cpu/beta_cpu/commit_impl.hh
cpu/beta_cpu/decode_impl.hh
cpu/beta_cpu/fetch_impl.hh
cpu/beta_cpu/iew_impl.hh
cpu/beta_cpu/regfile.hh

index a1fb45177591619b4e5ee5755603b662f759724e..eb404fa54f6228d06cbb0b9a25cd4799302eac94 100644 (file)
@@ -136,7 +136,8 @@ baseFlags = [
     'StoreSet',
     'MemDepUnit',
     'DynInst',
-    'FullCPU'
+    'FullCPU',
+    'CommitRate'
     ]
 
 #
index 381b6ecda3490265000f61b93647f04252b9cb35..22f39b72ce9d513c40a15a19c5d94e28129ef075 100644 (file)
@@ -114,11 +114,16 @@ def MySqlOpt(env):
 def NoFastAllocOpt(env):
     env.Append(CPPDEFINES = 'NO_FAST_ALLOC')
 
+# Enable efence
+def EfenceOpt(env):
+    env.Append(LIBS=['efence'])
+
 # Configuration options map.
 options_map = {
     'MEASURE' : MeasureOpt,
     'MYSQL' : MySqlOpt,
-    'NO_FAST_ALLOC' : NoFastAllocOpt
+    'NO_FAST_ALLOC' : NoFastAllocOpt,
+    'EFENCE' : EfenceOpt
     }
 
 # The 'local_configs' file can be used to define additional base
index ee8f9f33b16cee9c1cf0d700cbcae1228747f2e6..611a0d80d0110f7af072bad1f59e8aca4bc175ac 100644 (file)
@@ -127,7 +127,7 @@ AlphaFullCPU<Impl>::copyToXC()
     for (int i = 0; i < AlphaISA::NumIntRegs; ++i)
     {
         renamed_reg = renameMap.lookup(i);
-        xc->regs.intRegFile[i] = regFile.intRegFile[renamed_reg];
+        xc->regs.intRegFile[i] = regFile.readIntReg(renamed_reg);
         DPRINTF(FullCPU, "FullCPU: Copying register %i, has data %lli.\n",
                 renamed_reg, regFile.intRegFile[renamed_reg]);
     }
@@ -136,8 +136,8 @@ AlphaFullCPU<Impl>::copyToXC()
     for (int i = 0; i < AlphaISA::NumFloatRegs; ++i)
     {
         renamed_reg = renameMap.lookup(i + AlphaISA::FP_Base_DepTag);
-        xc->regs.floatRegFile.d[i] = regFile.floatRegFile[renamed_reg].d;
-        xc->regs.floatRegFile.q[i] = regFile.floatRegFile[renamed_reg].q;
+        xc->regs.floatRegFile.d[i] = regFile.readFloatRegDouble(renamed_reg);
+        xc->regs.floatRegFile.q[i] = regFile.readFloatRegInt(renamed_reg);
     }
 
     xc->regs.miscRegs.fpcr = regFile.miscRegs.fpcr;
@@ -169,15 +169,15 @@ AlphaFullCPU<Impl>::copyFromXC()
                 renamed_reg, regFile.intRegFile[renamed_reg],
                 xc->regs.intRegFile[i]);
 
-        regFile.intRegFile[renamed_reg] = xc->regs.intRegFile[i];
+        regFile.setIntReg(renamed_reg, xc->regs.intRegFile[i]);
     }
 
     // Then loop through the floating point registers.
     for (int i = 0; i < AlphaISA::NumFloatRegs; ++i)
     {
         renamed_reg = renameMap.lookup(i + AlphaISA::FP_Base_DepTag);
-        regFile.floatRegFile[renamed_reg].d = xc->regs.floatRegFile.d[i];
-        regFile.floatRegFile[renamed_reg].q = xc->regs.floatRegFile.q[i] ;
+        regFile.setFloatRegDouble(renamed_reg, xc->regs.floatRegFile.d[i]);
+        regFile.setFloatRegInt(renamed_reg, xc->regs.floatRegFile.q[i]);
     }
 
     // Then loop through the misc registers.
index 9a69c92591dea6a51d8f2a716c9838127196fbad..3e97b980ce64c8efd3e94c0aed93b6ac0875eee2 100644 (file)
@@ -323,6 +323,7 @@ SimpleCommit<Impl>::commitInsts()
         head_inst = rob->readHeadInst();
     }
 
+    DPRINTF(CommitRate, "%i\n", num_committed);
     n_committed_dist.sample(num_committed);
 }
 
index 8b20bf8bc872bab55053a85129f5735f0065fcc5..dd51f564d8f3e17378e0545e21e3cc05ec48a958 100644 (file)
@@ -147,7 +147,7 @@ SimpleDecode<Impl>::squash(DynInstPtr &inst)
 {
     DPRINTF(Decode, "Decode: Squashing due to incorrect branch prediction "
                     "detected at decode.\n");
-    Addr new_PC = inst->nextPC;
+    Addr new_PC = inst->readNextPC();
 
     toFetch->decodeInfo.branchMispredict = true;
     toFetch->decodeInfo.doneSeqNum = inst->seqNum;
@@ -355,10 +355,9 @@ SimpleDecode<Impl>::decode()
 
         // Go ahead and compute any PC-relative branches.
 
-        if (inst->isDirectCtrl() && inst->isUncondCtrl() &&
-            inst->numDestRegs() == 0 && inst->numSrcRegs() == 0) {
-            inst->execute();
-            inst->setExecuted();
+        if (inst->isDirectCtrl() && inst->isUncondCtrl()) {
+
+            inst->setNextPC(inst->branchTarget());
 
             if (inst->mispredicted()) {
                 ++decodeBranchMispred;
index 8c9cf9f41f06dd95aa1555b7637f554dfe220d66..90caf9ffec413b8562b375f8b561940fe35e5139 100644 (file)
@@ -195,22 +195,6 @@ SimpleFetch<Impl>::lookupAndUpdateNextPC(DynInstPtr &inst, Addr &next_PC)
 
     predict_taken = branchPred.predict(inst, next_PC);
 
-#if 0
-    predict_taken = branchPred.BPLookup(next_PC)
-
-    DPRINTF(Fetch, "Fetch: Branch predictor predicts taken? %i\n",
-            predict_taken);
-
-    // Only check the BTB if the BP has predicted taken.
-    if (predict_taken && branchPred.BTBValid(next_PC)) {
-        predict_target = branchPred.BTBLookup(next_PC);
-        DPRINTF(Fetch, "Fetch: BTB target is %#x.\n", predict_target);
-    } else {
-        predict_taken = false;
-        DPRINTF(Fetch, "Fetch: BTB does not have a valid entry.\n");
-    }
-
-#endif
     if (predict_taken) {
         ++predictedBranches;
     }
index 2bfd6bae9b0801fcd3410ae5523676e100069fc2..b718e6aa0c91b77c7e3323a250d650c4f0cfd3ba 100644 (file)
@@ -249,7 +249,6 @@ SimpleIEW<Impl, IQ>::squashDueToBranch(DynInstPtr &inst)
     // Prediction was incorrect, so send back inverse.
     toCommit->branchTaken = inst->readCalcTarg() !=
         (inst->readPC() + sizeof(MachInst));
-//    toCommit->globalHist = inst->readGlobalHist();
 }
 
 template<class Impl, class IQ>
@@ -363,10 +362,11 @@ SimpleIEW<Impl, IQ>::dispatchInsts()
 
                 continue;
             } else if (inst->isExecuted()) {
+                assert(0 && "Instruction shouldn't be executed.\n");
                 DPRINTF(IEW, "IEW: Issue: Executed branch encountered, "
                         "skipping.\n");
 
-                assert(inst->isDirectCtrl());
+//                assert(inst->isDirectCtrl());
 
                 inst->setIssued();
                 inst->setCanCommit();
index 148d9408a446cfd0ecabec22df01142a43c6abe4..f6fb917bade2375e9297318f42ab1f0347297231 100644 (file)
@@ -8,6 +8,8 @@ using namespace std;
 #include "arch/alpha/isa_traits.hh"
 #include "cpu/beta_cpu/comm.hh"
 
+#include "base/trace.hh"
+
 // This really only depends on the ISA, and not the Impl.  It might be nicer
 // to see if I can make it depend on nothing...
 // Things that are in the ifdef FULL_SYSTEM are pretty dependent on the ISA,