Gabe Black has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/12250 )

Change subject: systemc: If an event is a delta notification, checked if it's timed.
......................................................................

systemc: If an event is a delta notification, checked if it's timed.

If we're descheduling an event which is at the current time, it may
have been scheduled as a delta notification, but it could have also
been scheduled as a timed notification and we just got to that point
in time. If an event is for the current time but isn't in the delta
notifications, this change detects that and then treats it as a timed
notification.

Change-Id: I1d8f4c40325cc7f355b7f2e6f08611483ce11858
Reviewed-on: https://gem5-review.googlesource.com/12250
Reviewed-by: Gabe Black <[email protected]>
Maintainer: Gabe Black <[email protected]>
---
M src/systemc/core/scheduler.hh
1 file changed, 6 insertions(+), 5 deletions(-)

Approvals:
  Gabe Black: Looks good to me, approved; Looks good to me, approved



diff --git a/src/systemc/core/scheduler.hh b/src/systemc/core/scheduler.hh
index 697aa11..3068a0a 100644
--- a/src/systemc/core/scheduler.hh
+++ b/src/systemc/core/scheduler.hh
@@ -238,10 +238,11 @@
     deschedule(ScEvent *event)
     {
         if (event->when() == getCurTick()) {
-            // Remove from delta notifications.
-            deltas.erase(event);
-            event->deschedule();
-            return;
+            // Attempt to remove from delta notifications.
+            if (deltas.erase(event) == 1) {
+                event->deschedule();
+                return;
+            }
         }

         // Timed notification/timeout.
@@ -250,7 +251,7 @@
                 "Descheduling event at time with no events.");
         TimeSlot *ts = tsit->second;
         ScEvents &events = ts->events;
-        events.erase(event);
+        assert(events.erase(event));
         event->deschedule();

// If no more events are happening at this time slot, get rid of it.

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12250
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I1d8f4c40325cc7f355b7f2e6f08611483ce11858
Gerrit-Change-Number: 12250
Gerrit-PatchSet: 9
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Matthias Jung <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to