scheduler.hh (13701:d84e5d2979a7) | scheduler.hh (13901:b9329102b1d8) |
---|---|
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 --- 18 unchanged lines hidden (view full) --- 27 * Authors: Gabe Black 28 */ 29 30#ifndef __SYSTEMC_CORE_SCHEDULER_HH__ 31#define __SYSTEMC_CORE_SCHEDULER_HH__ 32 33#include <functional> 34#include <map> | 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 --- 18 unchanged lines hidden (view full) --- 27 * Authors: Gabe Black 28 */ 29 30#ifndef __SYSTEMC_CORE_SCHEDULER_HH__ 31#define __SYSTEMC_CORE_SCHEDULER_HH__ 32 33#include <functional> 34#include <map> |
35#include <mutex> |
|
35#include <set> 36#include <vector> 37 38#include "base/logging.hh" 39#include "sim/core.hh" 40#include "sim/eventq.hh" 41#include "systemc/core/channel.hh" 42#include "systemc/core/list.hh" --- 143 unchanged lines hidden (view full) --- 186 void resume(Process *p); 187 188 // Remove a process from the ready/init list if it was on one of them, and 189 // return if it was. 190 bool suspend(Process *p); 191 192 // Schedule an update for a given channel. 193 void requestUpdate(Channel *c); | 36#include <set> 37#include <vector> 38 39#include "base/logging.hh" 40#include "sim/core.hh" 41#include "sim/eventq.hh" 42#include "systemc/core/channel.hh" 43#include "systemc/core/list.hh" --- 143 unchanged lines hidden (view full) --- 187 void resume(Process *p); 188 189 // Remove a process from the ready/init list if it was on one of them, and 190 // return if it was. 191 bool suspend(Process *p); 192 193 // Schedule an update for a given channel. 194 void requestUpdate(Channel *c); |
195 // Same as above, but may be called from a different thread. 196 void asyncRequestUpdate(Channel *c); |
|
194 195 // Run the given process immediately, preempting whatever may be running. 196 void 197 runNow(Process *p) 198 { 199 // This function may put a process on the wrong list, ie a thread 200 // the method list. That's fine since that's just a performance 201 // optimization, and the important thing here is how the processes are --- 274 unchanged lines hidden (view full) --- 476 477 ProcessList initList; 478 479 ProcessList readyListMethods; 480 ProcessList readyListThreads; 481 482 ChannelList updateList; 483 | 197 198 // Run the given process immediately, preempting whatever may be running. 199 void 200 runNow(Process *p) 201 { 202 // This function may put a process on the wrong list, ie a thread 203 // the method list. That's fine since that's just a performance 204 // optimization, and the important thing here is how the processes are --- 274 unchanged lines hidden (view full) --- 479 480 ProcessList initList; 481 482 ProcessList readyListMethods; 483 ProcessList readyListThreads; 484 485 ChannelList updateList; 486 |
487 ChannelList asyncUpdateList; 488 std::mutex asyncListMutex; 489 |
|
484 std::map<::Event *, Tick> eventsToSchedule; 485 486 std::set<TraceFile *> traceFiles; 487 488 void trace(bool delta); 489}; 490 491extern Scheduler scheduler; --- 30 unchanged lines hidden --- | 490 std::map<::Event *, Tick> eventsToSchedule; 491 492 std::set<TraceFile *> traceFiles; 493 494 void trace(bool delta); 495}; 496 497extern Scheduler scheduler; --- 30 unchanged lines hidden --- |