systemc: Use the eq pointer directly less often in the scheduler.
authorGabe Black <gabeblack@google.com>
Thu, 23 Aug 2018 06:51:16 +0000 (23:51 -0700)
committerGabe Black <gabeblack@google.com>
Wed, 26 Sep 2018 00:00:30 +0000 (00:00 +0000)
This takes advantage of the utility functions that exist a little
better, and also avoids accidentally asymetrically using
eventsToSchedule and eq->(de)schedule.

Change-Id: I1eb1c228d47684cccb9deaf6f3409b77cfbad4cd
Reviewed-on: https://gem5-review.googlesource.com/12260
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

src/systemc/core/scheduler.cc

index 58c79562fade97f9d49a92bff12fa53b0ba6418b..2dc3aa74c12c8502587b1aaf90270dac3b905bf8 100644 (file)
@@ -70,21 +70,21 @@ Scheduler::clear()
         TimeSlot *&ts = tsp.second;
         for (auto &e: ts->events)
             e->deschedule();
-        eq->deschedule(ts);
+        deschedule(ts);
     }
     timeSlots.clear();
 
     // gem5 events.
     if (readyEvent.scheduled())
-        eq->deschedule(&readyEvent);
+        deschedule(&readyEvent);
     if (pauseEvent.scheduled())
-        eq->deschedule(&pauseEvent);
+        deschedule(&pauseEvent);
     if (stopEvent.scheduled())
-        eq->deschedule(&stopEvent);
+        deschedule(&stopEvent);
     if (starvationEvent.scheduled())
-        eq->deschedule(&starvationEvent);
+        deschedule(&starvationEvent);
     if (maxTickEvent.scheduled())
-        eq->deschedule(&maxTickEvent);
+        deschedule(&maxTickEvent);
 
     Process *p;
     while ((p = toFinalize.getNext()))
@@ -312,13 +312,13 @@ Scheduler::start(Tick max_tick, bool run_to_time)
     Fiber::primaryFiber()->run();
 
     if (pauseEvent.scheduled())
-        eq->deschedule(&pauseEvent);
+        deschedule(&pauseEvent);
     if (stopEvent.scheduled())
-        eq->deschedule(&stopEvent);
+        deschedule(&stopEvent);
     if (maxTickEvent.scheduled())
-        eq->deschedule(&maxTickEvent);
+        deschedule(&maxTickEvent);
     if (starvationEvent.scheduled())
-        eq->deschedule(&starvationEvent);
+        deschedule(&starvationEvent);
 }
 
 void
@@ -334,7 +334,7 @@ Scheduler::schedulePause()
     if (pauseEvent.scheduled())
         return;
 
-    eq->schedule(&pauseEvent, eq->getCurTick());
+    schedule(&pauseEvent);
 }
 
 void
@@ -348,7 +348,7 @@ Scheduler::scheduleStop(bool finish_delta)
         // pending activity.
         clear();
     }
-    eq->schedule(&stopEvent, eq->getCurTick());
+    schedule(&stopEvent);
 }
 
 Scheduler scheduler;