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 --- 63 unchanged lines hidden (view full) --- 72 73 for (auto ets: eventsToSchedule) 74 eq->schedule(ets.first, ets.second); 75 eventsToSchedule.clear(); 76 77 if (_started) { 78 if (starved() && !runToTime) 79 scheduleStarvationEvent(); |
80 kernel->status(::sc_core::SC_RUNNING); |
81 } 82 83 initDone = true; 84} 85 86void 87Scheduler::reg(Process *p) 88{ --- 59 unchanged lines hidden (view full) --- 148 149 scheduleReadyEvent(); 150} 151 152void 153Scheduler::requestUpdate(Channel *c) 154{ 155 updateList.pushLast(c); |
156 scheduleReadyEvent(); |
157} 158 159void 160Scheduler::scheduleReadyEvent() 161{ 162 // Schedule the evaluate and update phases. 163 if (!readyEvent.scheduled()) { |
164 schedule(&readyEvent); |
165 if (starvationEvent.scheduled()) |
166 deschedule(&starvationEvent); |
167 } 168} 169 170void 171Scheduler::scheduleStarvationEvent() 172{ 173 if (!starvationEvent.scheduled()) { |
174 schedule(&starvationEvent); |
175 if (readyEvent.scheduled()) |
176 deschedule(&readyEvent); |
177 } 178} 179 180void 181Scheduler::runReady() 182{ 183 bool empty = readyList.empty(); 184 --- 62 unchanged lines hidden (view full) --- 247 runToTime = run_to_time; 248 249 maxTick = max_tick; 250 251 if (initDone) { 252 if (starved() && !runToTime) 253 scheduleStarvationEvent(); 254 kernel->status(::sc_core::SC_RUNNING); |
255 } 256 |
257 schedule(&maxTickEvent, maxTick); 258 |
259 // Return to gem5 to let it run events, etc. 260 Fiber::primaryFiber()->run(); 261 262 if (pauseEvent.scheduled()) 263 eq->deschedule(&pauseEvent); 264 if (stopEvent.scheduled()) 265 eq->deschedule(&stopEvent); 266 if (maxTickEvent.scheduled()) --- 46 unchanged lines hidden --- |