summaryrefslogtreecommitdiff
path: root/src/systemc/core/scheduler.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/systemc/core/scheduler.hh')
-rw-r--r--src/systemc/core/scheduler.hh33
1 files changed, 28 insertions, 5 deletions
diff --git a/src/systemc/core/scheduler.hh b/src/systemc/core/scheduler.hh
index dda483f0c..7b6238843 100644
--- a/src/systemc/core/scheduler.hh
+++ b/src/systemc/core/scheduler.hh
@@ -318,7 +318,10 @@ class Scheduler
}
// Run scheduled channel updates.
- void update();
+ void runUpdate();
+
+ // Run delta events.
+ void runDelta();
void setScMainFiber(Fiber *sc_main) { scMain = sc_main; }
@@ -328,13 +331,29 @@ class Scheduler
void schedulePause();
void scheduleStop(bool finish_delta);
- bool paused() { return _paused; }
- bool stopped() { return _stopped; }
+ enum Status
+ {
+ StatusOther = 0,
+ StatusDelta,
+ StatusUpdate,
+ StatusTiming,
+ StatusPaused,
+ StatusStopped
+ };
+
+ bool paused() { return status() == StatusPaused; }
+ bool stopped() { return status() == StatusStopped; }
+ bool inDelta() { return status() == StatusDelta; }
+ bool inUpdate() { return status() == StatusUpdate; }
+ bool inTiming() { return status() == StatusTiming; }
uint64_t changeStamp() { return _changeStamp; }
void throwToScMain(const ::sc_core::sc_report *r=nullptr);
+ Status status() { return _status; }
+ void status(Status s) { _status = s; }
+
private:
typedef const EventBase::Priority Priority;
static Priority DefaultPriority = EventBase::Default_Pri;
@@ -395,10 +414,10 @@ class Scheduler
void scheduleStarvationEvent();
bool _started;
- bool _paused;
- bool _stopped;
bool _stopNow;
+ Status _status;
+
Tick maxTick;
Tick lastReadyTick;
void
@@ -436,8 +455,12 @@ extern Scheduler scheduler;
inline void
Scheduler::TimeSlot::process()
{
+ scheduler.status(StatusTiming);
+
while (!events.empty())
events.front()->run();
+
+ scheduler.status(StatusOther);
scheduler.completeTimeSlot(this);
}