On Fri, 7 Jun 2013, Ali Saidi wrote:
On Jun 6, 2013, at 9:24 PM, Nilay Vaish <[email protected]> wrote:
On Thu, 6 Jun 2013, Ali Saidi wrote:
Hi Nilay,
Does a system with multiple o3 cpus correct start up
with this change? Is there something that kicks it from Idle->Running?
Now having looked at more code in fetch_imp.hh, it seems to me that what ever I
am doing would not work either. Actually, while we check for the Idle state at
so many places, we surprisingly do not set fetchStatus to Idle anywhere in the
code. I think this particular state went out of use at some point of time.
I tried to go back through the history and I can't actually find a place where
Idle is assigned to the fetchStatus going all the way back to 2006.
I think we should have the fetchStatus be initialized to Idle state. The
o3 cpu will activate some context at point in future. When it does that,
it calls the function wakeFromQuiesce() on the fetch stage. This function
in turn changes the fetchStatus to Running. As of now, the function only
does this for thread 0. I am proposing that we pass the thread id and do
it for that particular thread.
diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc
--- a/src/cpu/o3/cpu.cc
+++ b/src/cpu/o3/cpu.cc
@@ -773,7 +773,7 @@
// Be sure to signal that there's some activity so the CPU
doesn't
// deschedule itself.
activityRec.activity();
- fetch.wakeFromQuiesce();
+ fetch.wakeFromQuiesce(tid);
Cycles cycles(curCycle() - lastRunningCycle);
// @todo: This is an oddity that is only here to match the stats
diff --git a/src/cpu/o3/fetch.hh b/src/cpu/o3/fetch.hh
--- a/src/cpu/o3/fetch.hh
+++ b/src/cpu/o3/fetch.hh
@@ -249,7 +249,7 @@
void drainStall(ThreadID tid);
/** Tells fetch to wake up from a quiesce instruction. */
- void wakeFromQuiesce();
+ void wakeFromQuiesce(ThreadID tid);
private:
/** Reset this pipeline stage */
diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh
--- a/src/cpu/o3/fetch_impl.hh
+++ b/src/cpu/o3/fetch_impl.hh
@@ -317,7 +317,7 @@
// Setup PC and nextPC with initial state.
for (ThreadID tid = 0; tid < numThreads; tid++) {
- fetchStatus[tid] = Running;
+ fetchStatus[tid] = Idle;
pc[tid] = cpu->pcState(tid);
fetchOffset[tid] = 0;
macroop[tid] = NULL;
@@ -484,12 +484,11 @@
template <class Impl>
void
-DefaultFetch<Impl>::wakeFromQuiesce()
+DefaultFetch<Impl>::wakeFromQuiesce(ThreadID tid)
{
DPRINTF(Fetch, "Waking up from quiesce\n");
// Hopefully this is safe
- // @todo: Allow other threads to wake from quiesce.
- fetchStatus[0] = Running;
+ fetchStatus[tid] = Running;
}
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev