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

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

160
161 Scheduler();
162
163 const std::string name() const { return "systemc_scheduler"; }
164
165 uint64_t numCycles() { return _numCycles; }
166 Process *current() { return _current; }
167
168 void initPhase();
169
170 // Register a process with the scheduler.
171 void reg(Process *p);
172
173 // Tell the scheduler not to initialize a process.
174 void dontInitialize(Process *p);
175
176 // Run the next process, if there is one.

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

220 scheduleReadyEvent();
221 return;
222 }
223
224 // Timed notification/timeout.
225 TimeSlot *&ts = timeSlots[tick];
226 if (!ts) {
227 ts = new TimeSlot;
228 if (initDone)
229 eq->schedule(ts, tick);
230 else
231 eventsToSchedule[ts] = tick;
232 }
233 ts->events.insert(event);
234 }
235
236 // For descheduling delayed/timed notifications/timeouts.

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

250 "Descheduling event at time with no events.");
251 TimeSlot *ts = tsit->second;
252 ScEvents &events = ts->events;
253 events.erase(event);
254 event->deschedule();
255
256 // If no more events are happening at this time slot, get rid of it.
257 if (events.empty()) {
258 if (initDone)
259 eq->deschedule(ts);
260 else
261 eventsToSchedule.erase(ts);
262 timeSlots.erase(tsit);
263 }
264 }
265
266 void

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

357
358 Tick maxTick;
359 EventWrapper<Scheduler, &Scheduler::pause> maxTickEvent;
360
361 uint64_t _numCycles;
362
363 Process *_current;
364
365 bool initDone;
366 bool runToTime;
367 bool runOnce;
368
369 ProcessList initList;
370 ProcessList toFinalize;
371 ProcessList readyList;
372
373 ChannelList updateList;

--- 17 unchanged lines hidden ---