Deleted Added
sdiff udiff text old ( 12985:ec84697e4e63 ) new ( 12987:97fbdee919d8 )
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

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

210
211 // Tell the scheduler than an event fired for bookkeeping purposes.
212 void
213 eventHappened()
214 {
215 auto it = pendingTicks.begin();
216 if (--it->second == 0)
217 pendingTicks.erase(it);
218 }
219
220 // Pending activity ignores gem5 activity, much like how a systemc
221 // simulation wouldn't know about asynchronous external events (socket IO
222 // for instance) that might happen before time advances in a pure
223 // systemc simulation. Also the spec lists what specific types of pending
224 // activity needs to be counted, which obviously doesn't include gem5
225 // events.

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

272
273 private:
274 typedef const EventBase::Priority Priority;
275 static Priority DefaultPriority = EventBase::Default_Pri;
276
277 static Priority StopPriority = DefaultPriority - 1;
278 static Priority PausePriority = DefaultPriority + 1;
279 static Priority ReadyPriority = DefaultPriority + 2;
280 static Priority MaxTickPriority = DefaultPriority + 3;
281
282 EventQueue *eq;
283 std::map<Tick, int> pendingTicks;
284
285 void runReady();
286 EventWrapper<Scheduler, &Scheduler::runReady> readyEvent;
287 void scheduleReadyEvent();
288
289 void pause();
290 void stop();
291 EventWrapper<Scheduler, &Scheduler::pause> pauseEvent;
292 EventWrapper<Scheduler, &Scheduler::stop> stopEvent;
293 Fiber *scMain;
294
295 bool _started;
296 bool _paused;
297 bool _stopped;
298
299 Tick maxTick;
300 EventWrapper<Scheduler, &Scheduler::pause> maxTickEvent;
301
302 uint64_t _numCycles;
303
304 Process *_current;
305
306 bool initReady;
307
308 ProcessList initList;
309 ProcessList toFinalize;
310 ProcessList readyList;
311
312 ChannelList updateList;
313
314 std::map<::Event *, Tick> eventsToSchedule;
315};
316
317extern Scheduler scheduler;
318
319} // namespace sc_gem5
320
321#endif // __SYSTEMC_CORE_SCHEDULER_H__