Deleted Added
sdiff udiff text old ( 13182:9e030f636a8c ) new ( 13186:1ebc6c729311 )
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

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

313 if (pendingCurr())
314 return 0;
315 if (pendingFuture())
316 return timeSlots.begin()->first - getCurTick();
317 return MaxTick - getCurTick();
318 }
319
320 // Run scheduled channel updates.
321 void update();
322
323 void setScMainFiber(Fiber *sc_main) { scMain = sc_main; }
324
325 void start(Tick max_tick, bool run_to_time);
326 void oneCycle();
327
328 void schedulePause();
329 void scheduleStop(bool finish_delta);
330
331 bool paused() { return _paused; }
332 bool stopped() { return _stopped; }
333
334 uint64_t changeStamp() { return _changeStamp; }
335
336 void throwToScMain(const ::sc_core::sc_report *r=nullptr);
337
338 private:
339 typedef const EventBase::Priority Priority;
340 static Priority DefaultPriority = EventBase::Default_Pri;
341
342 static Priority StopPriority = DefaultPriority - 1;
343 static Priority PausePriority = DefaultPriority + 1;
344 static Priority MaxTickPriority = DefaultPriority + 2;
345 static Priority ReadyPriority = DefaultPriority + 3;

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

390 updateList.empty() && deltas.empty() &&
391 (timeSlots.empty() || timeSlots.begin()->first > maxTick) &&
392 initList.empty());
393 }
394 EventWrapper<Scheduler, &Scheduler::pause> starvationEvent;
395 void scheduleStarvationEvent();
396
397 bool _started;
398 bool _paused;
399 bool _stopped;
400 bool _stopNow;
401
402 Tick maxTick;
403 Tick lastReadyTick;
404 void
405 maxTickFunc()
406 {
407 if (lastReadyTick != getCurTick())
408 _changeStamp++;
409 pause();

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

431 std::map<::Event *, Tick> eventsToSchedule;
432};
433
434extern Scheduler scheduler;
435
436inline void
437Scheduler::TimeSlot::process()
438{
439 while (!events.empty())
440 events.front()->run();
441 scheduler.completeTimeSlot(this);
442}
443
444const ::sc_core::sc_report *reportifyException();
445
446} // namespace sc_gem5
447
448#endif // __SYSTEMC_CORE_SCHEDULER_H__