systemc: Increment the change stamp value before the timing phase.
authorGabe Black <gabeblack@google.com>
Thu, 4 Oct 2018 02:02:53 +0000 (19:02 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 16 Oct 2018 00:51:48 +0000 (00:51 +0000)
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>

src/systemc/core/scheduler.hh

index 83585dd2d3d8d9d79509b1941f339beb8b544171..14dee2e6f4b067cfd66f04ea16e0e6f2dcc4bfae 100644 (file)
@@ -287,7 +287,6 @@ class Scheduler
     void
     completeTimeSlot(TimeSlot *ts)
     {
-        _changeStamp++;
         assert(ts == timeSlots.begin()->second);
         timeSlots.erase(timeSlots.begin());
         if (!runToTime && starved())
@@ -364,6 +363,7 @@ class Scheduler
     bool inTiming() { return status() == StatusTiming; }
 
     uint64_t changeStamp() { return _changeStamp; }
+    void stepChangeStamp() { _changeStamp++; }
 
     void throwToScMain();
 
@@ -494,6 +494,7 @@ extern Scheduler scheduler;
 inline void
 Scheduler::TimeSlot::process()
 {
+    scheduler.stepChangeStamp();
     scheduler.status(StatusTiming);
 
     try {