summaryrefslogtreecommitdiff
path: root/src/cpu/BaseCPU.py
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas@sandberg.pp.se>2013-06-11 09:18:25 +0200
committerAndreas Sandberg <andreas@sandberg.pp.se>2013-06-11 09:18:25 +0200
commit0793d0727bf13f3dc1f41ac24cab04f4ab1f6b2a (patch)
tree60a1e800d9fb1f7462c21708dc2eb096788e56af /src/cpu/BaseCPU.py
parent247e4e9ab41bafcfcbde725bb40e6a7b5628f1de (diff)
downloadgem5-0793d0727bf13f3dc1f41ac24cab04f4ab1f6b2a.tar.xz
cpu: Add support for scheduling multiple inst/load stop events
Currently, the only way to get a CPU to stop after a fixed number of instructions/loads is to set a property on the CPU that causes a SimLoopExitEvent to be scheduled when the CPU is constructed. This is clearly not ideal in cases where the simulation script wants the CPU to stop at multiple instruction counts (e.g., SimPoint generation). This changeset adds the methods scheduleInstStop() and scheduleLoadStop() to the BaseCPU. These methods are exported to Python and are designed to be used from the simulation script. By using these methods instead of the old properties, a simulation script can schedule a stop at any point during simulation or schedule multiple stops. The number of instructions specified when scheduling a stop is relative to the current point of execution.
Diffstat (limited to 'src/cpu/BaseCPU.py')
-rw-r--r--src/cpu/BaseCPU.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cpu/BaseCPU.py b/src/cpu/BaseCPU.py
index b98ddee6e..f52c6b11f 100644
--- a/src/cpu/BaseCPU.py
+++ b/src/cpu/BaseCPU.py
@@ -99,6 +99,8 @@ class BaseCPU(MemObject):
bool switchedOut();
void flushTLBs();
Counter totalInsts();
+ void scheduleInstStop(ThreadID tid, Counter insts, const char *cause);
+ void scheduleLoadStop(ThreadID tid, Counter loads, const char *cause);
''')
@classmethod