move setStatus into the .cc file
authorNathan Binkert <binkertn@umich.edu>
Mon, 8 Dec 2003 18:15:18 +0000 (13:15 -0500)
committerNathan Binkert <binkertn@umich.edu>
Mon, 8 Dec 2003 18:15:18 +0000 (13:15 -0500)
--HG--
extra : convert_revision : 9ccf885274d72ea3151a0db76b580dd51763edab

cpu/simple_cpu/simple_cpu.cc
cpu/simple_cpu/simple_cpu.hh

index 476f28ea003aea0d207c1ce9f43a959bb7c0e3a5..4b9a7c6bdf49ba93b32d74f61257b9d56a870428 100644 (file)
@@ -212,6 +212,63 @@ SimpleCPU::execCtxStatusChg(int thread_num) {
         setStatus(Idle);
 }
 
+void
+SimpleCPU::setStatus(Status new_status)
+{
+    Status old_status = status();
+
+    // We should never even get here if the CPU has been switched out.
+    assert(old_status != SwitchedOut);
+
+    _status = new_status;
+
+    switch (status()) {
+      case IcacheMissStall:
+        assert(old_status == Running);
+        lastIcacheStall = curTick;
+        if (tickEvent.scheduled())
+            tickEvent.squash();
+        break;
+
+      case IcacheMissComplete:
+        assert(old_status == IcacheMissStall);
+        if (tickEvent.squashed())
+            tickEvent.reschedule(curTick + 1);
+        else if (!tickEvent.scheduled())
+            tickEvent.schedule(curTick + 1);
+        break;
+
+      case DcacheMissStall:
+        assert(old_status == Running);
+        lastDcacheStall = curTick;
+        if (tickEvent.scheduled())
+            tickEvent.squash();
+        break;
+
+      case Idle:
+        assert(old_status == Running);
+        idleFraction++;
+        if (tickEvent.scheduled())
+            tickEvent.squash();
+        break;
+
+      case Running:
+        assert(old_status == Idle ||
+               old_status == DcacheMissStall ||
+               old_status == IcacheMissComplete);
+        if (old_status == Idle && curTick != 0)
+            idleFraction--;
+
+        if (tickEvent.squashed())
+            tickEvent.reschedule(curTick + 1);
+        else if (!tickEvent.scheduled())
+            tickEvent.schedule(curTick + 1);
+        break;
+
+      default:
+        panic("can't get here");
+    }
+}
 
 void
 SimpleCPU::regStats()
index b0189349fdc5309330134ef977825ce637da0eea..e497559ce086b4387928453fc877772d17ad0095 100644 (file)
@@ -174,61 +174,7 @@ class SimpleCPU : public BaseCPU
 
     virtual void execCtxStatusChg(int thread_num);
 
-    void setStatus(Status new_status) {
-        Status old_status = status();
-
-        // We should never even get here if the CPU has been switched out.
-        assert(old_status != SwitchedOut);
-
-        _status = new_status;
-
-        switch (status()) {
-          case IcacheMissStall:
-            assert(old_status == Running);
-            lastIcacheStall = curTick;
-            if (tickEvent.scheduled())
-                tickEvent.squash();
-            break;
-
-          case IcacheMissComplete:
-            assert(old_status == IcacheMissStall);
-            if (tickEvent.squashed())
-                tickEvent.reschedule(curTick + 1);
-            else if (!tickEvent.scheduled())
-                tickEvent.schedule(curTick + 1);
-            break;
-
-          case DcacheMissStall:
-            assert(old_status == Running);
-            lastDcacheStall = curTick;
-            if (tickEvent.scheduled())
-                tickEvent.squash();
-            break;
-
-          case Idle:
-            assert(old_status == Running);
-            idleFraction++;
-            if (tickEvent.scheduled())
-                tickEvent.squash();
-            break;
-
-          case Running:
-            assert(old_status == Idle ||
-                   old_status == DcacheMissStall ||
-                   old_status == IcacheMissComplete);
-            if (old_status == Idle && curTick != 0)
-                idleFraction--;
-
-            if (tickEvent.squashed())
-                tickEvent.reschedule(curTick + 1);
-            else if (!tickEvent.scheduled())
-                tickEvent.schedule(curTick + 1);
-            break;
-
-          default:
-            panic("can't get here");
-        }
-    }
+    void setStatus(Status new_status);
 
     // statistics
     virtual void regStats();