diff options
author | Steve Reinhardt <stever@eecs.umich.edu> | 2003-12-10 17:47:28 -0800 |
---|---|---|
committer | Steve Reinhardt <stever@eecs.umich.edu> | 2003-12-10 17:47:28 -0800 |
commit | 4ce6118fdac16cfdc0d945e8793ace3379779288 (patch) | |
tree | 73d1b9ca10a321d4b022177396262a9386a36f42 /cpu/simple_cpu/simple_cpu.hh | |
parent | db6038937d126ec11e7745a1182c69f79b92f41f (diff) | |
download | gem5-4ce6118fdac16cfdc0d945e8793ace3379779288.tar.xz |
Factor ExecContext::setStatus(), BaseCPU::execCtxStatusChange(),
and SimpleCPU::setStatus() into separate functions. For example,
setStatus(Active) is now activate().
--HG--
extra : convert_revision : 4392e07caf6c918db0b535f613175109681686fe
Diffstat (limited to 'cpu/simple_cpu/simple_cpu.hh')
-rw-r--r-- | cpu/simple_cpu/simple_cpu.hh | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/cpu/simple_cpu/simple_cpu.hh b/cpu/simple_cpu/simple_cpu.hh index 666fe490b..7c9d4ea75 100644 --- a/cpu/simple_cpu/simple_cpu.hh +++ b/cpu/simple_cpu/simple_cpu.hh @@ -75,6 +75,22 @@ class SimpleCPU : public BaseCPU TickEvent tickEvent; + /// Schedule tick event, regardless of its current state. + void scheduleTickEvent(int delay) + { + if (tickEvent.squashed()) + tickEvent.reschedule(curTick + delay); + else if (!tickEvent.scheduled()) + tickEvent.schedule(curTick + delay); + } + + /// Unschedule tick event, regardless of its current state. + void unscheduleTickEvent() + { + if (tickEvent.scheduled()) + tickEvent.squash(); + } + private: Trace::InstRecord *traceData; template<typename T> @@ -172,9 +188,10 @@ class SimpleCPU : public BaseCPU Status status() const { return _status; } - virtual void execCtxStatusChg(int thread_num); - - void setStatus(Status new_status); + virtual void activateContext(int thread_num, int delay); + virtual void suspendContext(int thread_num); + virtual void deallocateContext(int thread_num); + virtual void haltContext(int thread_num); // statistics virtual void regStats(); |