systemc: Increment the change stamp value before the timing phase.

It appears that events which are triggered during the timing phase
are considered triggered in the following evaluation phase. The
"triggered()" function on events is non-standard and not really
explained anywhere, but this appears to work in practice.

Change-Id: I2574dc4569bf148c55fbe2a4873d458fc507f2a5
Reviewed-on: https://gem5-review.googlesource.com/c/13293
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
diff --git a/src/systemc/core/scheduler.hh b/src/systemc/core/scheduler.hh
index 83585dd..14dee2e 100644
--- a/src/systemc/core/scheduler.hh
+++ b/src/systemc/core/scheduler.hh
@@ -287,7 +287,6 @@
     void
     completeTimeSlot(TimeSlot *ts)
     {
-        _changeStamp++;
         assert(ts == timeSlots.begin()->second);
         timeSlots.erase(timeSlots.begin());
         if (!runToTime && starved())
@@ -364,6 +363,7 @@
     bool inTiming() { return status() == StatusTiming; }
 
     uint64_t changeStamp() { return _changeStamp; }
+    void stepChangeStamp() { _changeStamp++; }
 
     void throwToScMain();
 
@@ -494,6 +494,7 @@
 inline void
 Scheduler::TimeSlot::process()
 {
+    scheduler.stepChangeStamp();
     scheduler.status(StatusTiming);
 
     try {