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 --- 261 unchanged lines hidden (view full) --- 270 deschedule(ts); 271 timeSlots.erase(tsit); 272 } 273 } 274 275 void 276 completeTimeSlot(TimeSlot *ts) 277 { |
278 _changeStamp++; |
279 assert(ts == timeSlots.begin()->second); 280 timeSlots.erase(timeSlots.begin()); 281 if (!runToTime && starved()) 282 scheduleStarvationEvent(); 283 } 284 285 // Pending activity ignores gem5 activity, much like how a systemc 286 // simulation wouldn't know about asynchronous external events (socket IO --- 36 unchanged lines hidden (view full) --- 323 void oneCycle(); 324 325 void schedulePause(); 326 void scheduleStop(bool finish_delta); 327 328 bool paused() { return _paused; } 329 bool stopped() { return _stopped; } 330 |
331 uint64_t changeStamp() { return _changeStamp; } 332 |
333 private: 334 typedef const EventBase::Priority Priority; 335 static Priority DefaultPriority = EventBase::Default_Pri; 336 337 static Priority StopPriority = DefaultPriority - 1; 338 static Priority PausePriority = DefaultPriority + 1; 339 static Priority MaxTickPriority = DefaultPriority + 2; 340 static Priority ReadyPriority = DefaultPriority + 3; --- 45 unchanged lines hidden (view full) --- 386 EventWrapper<Scheduler, &Scheduler::pause> starvationEvent; 387 void scheduleStarvationEvent(); 388 389 bool _started; 390 bool _paused; 391 bool _stopped; 392 393 Tick maxTick; |
394 Tick lastReadyTick; 395 void 396 maxTickFunc() 397 { 398 if (lastReadyTick != getCurTick()) 399 _changeStamp++; 400 pause(); 401 } 402 EventWrapper<Scheduler, &Scheduler::maxTickFunc> maxTickEvent; |
403 404 uint64_t _numCycles; |
405 uint64_t _changeStamp; |
406 407 Process *_current; 408 409 bool initDone; 410 bool runToTime; 411 bool runOnce; 412 413 ProcessList initList; --- 21 unchanged lines hidden --- |