After sc_start is called, gem5 has run far enough to have an event
queue to schedule the notification events on. Before then, it's still
legal to request a timed notification. The scheduler should keep track
of those requests, and once an event queue is available it should
add them to it.
Change-Id: Ie7445b1f2e616f4bd36044a09dbef9e1d12d7350
Reviewed-on: https://gem5-review.googlesource.com/12036
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
p->ready();
}
+ for (auto ets: eventsToSchedule)
+ eq->schedule(ets.first, ets.second);
+ eventsToSchedule.clear();
+
if (_started)
eq->schedule(&maxTickEvent, maxTick);
schedule(::Event *event, Tick tick)
{
pendingTicks[tick]++;
- eq->schedule(event, tick);
+
+ if (initReady)
+ eq->schedule(event, tick);
+ else
+ eventsToSchedule[event] = tick;
}
// For descheduling delayed/timed notifications/timeouts.
auto it = pendingTicks.find(event->when());
if (--it->second == 0)
pendingTicks.erase(it);
- eq->deschedule(event);
+
+ if (initReady)
+ eq->deschedule(event);
+ else
+ eventsToSchedule.erase(event);
}
// Tell the scheduler than an event fired for bookkeeping purposes.
ProcessList readyList;
ChannelList updateList;
+
+ std::map<::Event *, Tick> eventsToSchedule;
};
extern Scheduler scheduler;