diff options
Diffstat (limited to 'cpu/o3')
-rw-r--r-- | cpu/o3/alpha_cpu_builder.cc | 3 | ||||
-rw-r--r-- | cpu/o3/cpu.cc | 17 | ||||
-rw-r--r-- | cpu/o3/cpu.hh | 7 | ||||
-rw-r--r-- | cpu/o3/tournament_pred.cc | 10 | ||||
-rw-r--r-- | cpu/o3/tournament_pred.hh | 3 |
5 files changed, 30 insertions, 10 deletions
diff --git a/cpu/o3/alpha_cpu_builder.cc b/cpu/o3/alpha_cpu_builder.cc index c563fbef3..fa0e892aa 100644 --- a/cpu/o3/alpha_cpu_builder.cc +++ b/cpu/o3/alpha_cpu_builder.cc @@ -68,6 +68,7 @@ Param<Counter> max_insts_any_thread; Param<Counter> max_insts_all_threads; Param<Counter> max_loads_any_thread; Param<Counter> max_loads_all_threads; +Param<Tick> progress_interval; SimObjectParam<BaseCache *> icache; SimObjectParam<BaseCache *> dcache; @@ -189,6 +190,7 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(DerivAlphaFullCPU) "Terminate when all threads have reached this load" "count", 0), + INIT_PARAM_DFLT(progress_interval, "Progress interval", 0), INIT_PARAM_DFLT(icache, "L1 instruction cache", NULL), INIT_PARAM_DFLT(dcache, "L1 data cache", NULL), @@ -327,6 +329,7 @@ CREATE_SIM_OBJECT(DerivAlphaFullCPU) params->max_insts_all_threads = max_insts_all_threads; params->max_loads_any_thread = max_loads_any_thread; params->max_loads_all_threads = max_loads_all_threads; + params->progress_interval = progress_interval; // // Caches diff --git a/cpu/o3/cpu.cc b/cpu/o3/cpu.cc index f1571e61b..0025d4144 100644 --- a/cpu/o3/cpu.cc +++ b/cpu/o3/cpu.cc @@ -29,6 +29,7 @@ #include "config/full_system.hh" #if FULL_SYSTEM +#include "cpu/quiesce_event.hh" #include "sim/system.hh" #else #include "sim/process.hh" @@ -598,6 +599,9 @@ FullO3CPU<Impl>::activateContext(int tid, int delay) // Be sure to signal that there's some activity so the CPU doesn't // deschedule itself. activityRec.activity(); + if (thread[tid]->quiesceEvent && thread[tid]->quiesceEvent->scheduled()) + thread[tid]->quiesceEvent->deschedule(); + fetch.wakeFromQuiesce(); _status = Running; @@ -759,7 +763,6 @@ FullO3CPU<Impl>::takeOverFrom(BaseCPU *oldCPU) tickEvent.schedule(curTick); } -/* template <class Impl> void FullO3CPU<Impl>::serialize(std::ostream &os) @@ -771,11 +774,11 @@ FullO3CPU<Impl>::serialize(std::ostream &os) // Use SimpleThread's ability to checkpoint to make it easier to // write out the registers. Also make this static so it doesn't // get instantiated multiple times (causes a panic in statistics). - static SimpleThread temp; + static CPUExecContext temp; for (int i = 0; i < thread.size(); i++) { nameOut(os, csprintf("%s.xc.%i", name(), i)); - temp.copyXC(thread[i]->getXC()); + temp.copyXC(thread[i]->getXCProxy()); temp.serialize(os); } } @@ -790,15 +793,15 @@ FullO3CPU<Impl>::unserialize(Checkpoint *cp, const std::string §ion) // Use SimpleThread's ability to checkpoint to make it easier to // read in the registers. Also make this static so it doesn't // get instantiated multiple times (causes a panic in statistics). - static SimpleThread temp; + static CPUExecContext temp; for (int i = 0; i < thread.size(); i++) { - temp.copyXC(thread[i]->getXC()); + temp.copyXC(thread[i]->getXCProxy()); temp.unserialize(cp, csprintf("%s.xc.%i", section, i)); - thread[i]->getXC()->copyArchRegs(temp.getXC()); + thread[i]->getXCProxy()->copyArchRegs(temp.getProxy()); } } -*/ + template <class Impl> uint64_t FullO3CPU<Impl>::readIntReg(int reg_idx) diff --git a/cpu/o3/cpu.hh b/cpu/o3/cpu.hh index ef5c9ae53..4d4adca5a 100644 --- a/cpu/o3/cpu.hh +++ b/cpu/o3/cpu.hh @@ -198,6 +198,13 @@ class FullO3CPU : public BaseFullCPU /** Update The Order In Which We Process Threads. */ void updateThreadPriority(); + /** Serialize state. */ + virtual void serialize(std::ostream &os); + + /** Unserialize from a checkpoint. */ + virtual void unserialize(Checkpoint *cp, const std::string §ion); + + public: /** Executes a syscall on this cycle. * --------------------------------------- * Note: this is a virtual function. CPU-Specific diff --git a/cpu/o3/tournament_pred.cc b/cpu/o3/tournament_pred.cc index f8c95abd8..8b1af6c7c 100644 --- a/cpu/o3/tournament_pred.cc +++ b/cpu/o3/tournament_pred.cc @@ -60,6 +60,8 @@ TournamentBP::TournamentBP(unsigned _localPredictorSize, for (int i = 0; i < localPredictorSize; ++i) localCtrs[i].setBits(localCtrBits); + localPredictorMask = floorPow2(localPredictorSize) - 1; + if (!isPowerOf2(localHistoryTableSize)) { fatal("Invalid local history table size!\n"); } @@ -156,7 +158,7 @@ TournamentBP::lookup(Addr &branch_addr, void * &bp_history) //Lookup in the local predictor to get its branch prediction local_history_idx = calcLocHistIdx(branch_addr); local_predictor_idx = localHistoryTable[local_history_idx] - & localHistoryMask; + & localPredictorMask; local_prediction = localCtrs[local_predictor_idx].read() > threshold; //Lookup in the global predictor to get its branch prediction @@ -174,7 +176,8 @@ TournamentBP::lookup(Addr &branch_addr, void * &bp_history) bp_history = (void *)history; assert(globalHistory < globalPredictorSize && - local_history_idx < localPredictorSize); + local_history_idx < localHistoryTableSize && + local_predictor_idx < localPredictorSize); // Commented code is for doing speculative update of counters and // all histories. @@ -232,7 +235,7 @@ TournamentBP::update(Addr &branch_addr, bool taken, void *bp_history) // Get the local predictor's current prediction local_history_idx = calcLocHistIdx(branch_addr); local_predictor_hist = localHistoryTable[local_history_idx]; - local_predictor_idx = local_predictor_hist & localHistoryMask; + local_predictor_idx = local_predictor_hist & localPredictorMask; // Update the choice predictor to tell it which one was correct if // there was a prediction. @@ -254,6 +257,7 @@ TournamentBP::update(Addr &branch_addr, bool taken, void *bp_history) } assert(globalHistory < globalPredictorSize && + local_history_idx < localHistoryTableSize && local_predictor_idx < localPredictorSize); // Update the counters and local history with the proper diff --git a/cpu/o3/tournament_pred.hh b/cpu/o3/tournament_pred.hh index 6d77999cc..dc0cc55dc 100644 --- a/cpu/o3/tournament_pred.hh +++ b/cpu/o3/tournament_pred.hh @@ -158,6 +158,9 @@ class TournamentBP /** Size of the local predictor. */ unsigned localPredictorSize; + /** Mask to get the proper index bits into the predictor. */ + unsigned localPredictorMask; + /** Number of bits of the local predictor's counters. */ unsigned localCtrBits; |