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 --- 56 unchanged lines hidden (view full) --- 65 e->deschedule(); 66 deltas.clear(); 67 68 // Timed notifications. 69 for (auto &tsp: timeSlots) { 70 TimeSlot *&ts = tsp.second; 71 for (auto &e: ts->events) 72 e->deschedule(); |
73 deschedule(ts); |
74 } 75 timeSlots.clear(); 76 77 // gem5 events. 78 if (readyEvent.scheduled()) |
79 deschedule(&readyEvent); |
80 if (pauseEvent.scheduled()) |
81 deschedule(&pauseEvent); |
82 if (stopEvent.scheduled()) |
83 deschedule(&stopEvent); |
84 if (starvationEvent.scheduled()) |
85 deschedule(&starvationEvent); |
86 if (maxTickEvent.scheduled()) |
87 deschedule(&maxTickEvent); |
88 89 Process *p; 90 while ((p = toFinalize.getNext())) 91 p->popListNode(); 92 while ((p = initList.getNext())) 93 p->popListNode(); 94 while ((p = readyList.getNext())) 95 p->popListNode(); --- 211 unchanged lines hidden (view full) --- 307 } 308 309 schedule(&maxTickEvent, maxTick); 310 311 // Return to gem5 to let it run events, etc. 312 Fiber::primaryFiber()->run(); 313 314 if (pauseEvent.scheduled()) |
315 deschedule(&pauseEvent); |
316 if (stopEvent.scheduled()) |
317 deschedule(&stopEvent); |
318 if (maxTickEvent.scheduled()) |
319 deschedule(&maxTickEvent); |
320 if (starvationEvent.scheduled()) |
321 deschedule(&starvationEvent); |
322} 323 324void 325Scheduler::oneCycle() 326{ 327 runOnce = true; 328 start(::MaxTick, false); 329} 330 331void 332Scheduler::schedulePause() 333{ 334 if (pauseEvent.scheduled()) 335 return; 336 |
337 schedule(&pauseEvent); |
338} 339 340void 341Scheduler::scheduleStop(bool finish_delta) 342{ 343 if (stopEvent.scheduled()) 344 return; 345 346 if (!finish_delta) { 347 // If we're not supposed to finish the delta cycle, flush all 348 // pending activity. 349 clear(); 350 } |
351 schedule(&stopEvent); |
352} 353 354Scheduler scheduler; 355 356} // namespace sc_gem5 |