Deleted Added
sdiff udiff text old ( 12987:97fbdee919d8 ) new ( 13058:da3ffd935b29 )
full compact
1/*
2 * Copyright 2018 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

--- 115 unchanged lines hidden (view full) ---

124 * delta notifications have happened, but after the evaluate and update phases.
125 * For that, a stop event with slightly higher than normal priority will be
126 * scheduled so that it happens before any of the delta notification events
127 * which are at normal priority.
128 *
129 * MAX RUN TIME
130 *
131 * When sc_start is called, it's possible to pass in a maximum time the
132 * simulation should run to, at which point sc_pause is implicitly called.
133 * That's implemented by scheduling an event at the max time with a priority
134 * which is lower than all the others so that it happens only if time would
135 * advance. When that event triggers, it calls the same function as the pause
136 * event.
137 */
138
139class Scheduler
140{
141 public:
142 Scheduler();
143
144 const std::string name() const { return "systemc_scheduler"; }

--- 129 unchanged lines hidden (view full) ---

274 bool stopped() { return _stopped; }
275
276 private:
277 typedef const EventBase::Priority Priority;
278 static Priority DefaultPriority = EventBase::Default_Pri;
279
280 static Priority StopPriority = DefaultPriority - 1;
281 static Priority PausePriority = DefaultPriority + 1;
282 static Priority ReadyPriority = DefaultPriority + 2;
283 static Priority StarvationPriority = ReadyPriority;
284 static Priority MaxTickPriority = DefaultPriority + 3;
285
286 EventQueue *eq;
287 std::map<Tick, int> pendingTicks;
288
289 void runReady();
290 EventWrapper<Scheduler, &Scheduler::runReady> readyEvent;
291 void scheduleReadyEvent();
292

--- 45 unchanged lines hidden ---