From e1403fc2af61c224c573c47c77a36f9b1b78e7df Mon Sep 17 00:00:00 2001 From: Mitch Hayenga Date: Sat, 20 Sep 2014 17:18:35 -0400 Subject: alpha,arm,mips,power,x86,cpu,sim: Cleanup activate/deactivate activate(), suspend(), and halt() used on thread contexts had an optional delay parameter. However this parameter was often ignored. Also, when used, the delay was seemily arbitrarily set to 0 or 1 cycle (no other delays were ever specified). This patch removes the delay parameter and 'Events' associated with them across all ISAs and cores. Unused activate logic is also removed. --- src/cpu/minor/cpu.cc | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'src/cpu/minor/cpu.cc') diff --git a/src/cpu/minor/cpu.cc b/src/cpu/minor/cpu.cc index f7007f6ff..45817c3a8 100644 --- a/src/cpu/minor/cpu.cc +++ b/src/cpu/minor/cpu.cc @@ -63,7 +63,6 @@ MinorCPU::MinorCPU(MinorCPUParams *params) : } threads.push_back(thread); - threadActivateEvents.push_back(new ThreadActivateEvent(*this, 0)); thread->setStatus(ThreadContext::Halted); @@ -87,7 +86,6 @@ MinorCPU::~MinorCPU() for (ThreadID thread_id = 0; thread_id < threads.size(); thread_id++) { delete threads[thread_id]; - delete threadActivateEvents[thread_id]; } } @@ -192,6 +190,9 @@ MinorCPU::startup() for (auto i = threads.begin(); i != threads.end(); i ++) (*i)->startup(); + + /* CPU state setup, activate initial context */ + activateContext(0); } unsigned int @@ -275,31 +276,20 @@ MinorCPU::takeOverFrom(BaseCPU *old_cpu) } void -MinorCPU::activateContext(ThreadID thread_id, Cycles delay) -{ - DPRINTF(MinorCPU, "ActivateContext thread: %d delay: %d\n", - thread_id, delay); - - if (!threadActivateEvents[thread_id]->scheduled()) { - schedule(threadActivateEvents[thread_id], clockEdge(delay)); - } -} - -void -MinorCPU::ThreadActivateEvent::process() +MinorCPU::activateContext(ThreadID thread_id) { - DPRINTFS(MinorCPU, (&cpu), "Activating thread: %d\n", thread_id); + DPRINTF(MinorCPU, "ActivateContext thread: %d", thread_id); /* Do some cycle accounting. lastStopped is reset to stop the * wakeup call on the pipeline from adding the quiesce period * to BaseCPU::numCycles */ - cpu.stats.quiesceCycles += cpu.pipeline->cyclesSinceLastStopped(); - cpu.pipeline->resetLastStopped(); + stats.quiesceCycles += pipeline->cyclesSinceLastStopped(); + pipeline->resetLastStopped(); /* Wake up the thread, wakeup the pipeline tick */ - cpu.threads[thread_id]->activate(); - cpu.wakeupOnEvent(Minor::Pipeline::CPUStageId); - cpu.pipeline->wakeupFetch(); + threads[thread_id]->activate(); + wakeupOnEvent(Minor::Pipeline::CPUStageId); + pipeline->wakeupFetch(); } void -- cgit v1.2.3