Deleted Added
sdiff udiff text old ( 13063:c9905ead0041 ) new ( 13064:e06421881cec )
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

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

191 if (starved() && !runToTime)
192 scheduleStarvationEvent();
193
194 // The delta phase.
195 for (auto &e: deltas)
196 e->run();
197 deltas.clear();
198
199 if (runOnce) {
200 eq->reschedule(&maxTickEvent, eq->getCurTick());
201 runOnce = false;
202 }
203}
204
205void
206Scheduler::update()
207{
208 Channel *channel = updateList.getNext();
209 while (channel) {
210 channel->popListNode();

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

215
216void
217Scheduler::pause()
218{
219 _paused = true;
220 kernel->status(::sc_core::SC_PAUSED);
221 runOnce = false;
222 scMain->run();
223
224 // If the ready event is supposed to run now, run it inline so that it
225 // preempts any delta notifications which were scheduled while we were
226 // paused.
227 if (readyEvent.scheduled()) {
228 eq->deschedule(&readyEvent);
229 runReady();
230 }
231}
232
233void
234Scheduler::stop()
235{
236 _stopped = true;
237 kernel->stop();
238 runOnce = false;

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

293void
294Scheduler::scheduleStop(bool finish_delta)
295{
296 if (stopEvent.scheduled())
297 return;
298
299 if (!finish_delta) {
300 // If we're not supposed to finish the delta cycle, flush the list
301 // of ready processes and scheduled updates.
302 Process *p;
303 while ((p = readyList.getNext()))
304 p->popListNode();
305 Channel *c;
306 while ((c = updateList.getNext()))
307 c->popListNode();
308 }
309 eq->schedule(&stopEvent, eq->getCurTick());
310}
311
312Scheduler scheduler;
313
314} // namespace sc_gem5