summaryrefslogtreecommitdiff
path: root/cpu/base_cpu.hh
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2003-10-23 19:07:52 -0700
committerSteve Reinhardt <stever@eecs.umich.edu>2003-10-23 19:07:52 -0700
commitf5da73b6881991a28844ed59e8dcc1d154ddae7e (patch)
treebc89728af5db24ef0bf1580045c3bcd26a206e85 /cpu/base_cpu.hh
parent73b050a541b1778596f9ebffa8a9f780446365c3 (diff)
downloadgem5-f5da73b6881991a28844ed59e8dcc1d154ddae7e.tar.xz
Initial support for CPU switching. New SamplingCPU object encompasses a set
of CPUs that get switched round-robin (though currently we're only shooting for two CPUs and one switch event, and even that doesn't quite work yet). Registration of ExecContexts with System/Process object factored out so we can create two CPUs but only register one of them at a time. Also worked at making behavior and naming in System and Process objects more consistent. arch/alpha/ev5.cc: Rename ipr_init to initIPRs and get rid of unused mem arg. arch/alpha/fake_syscall.cc: Process:numCpus is now a function (not a data member). base/remote_gdb.hh: Support for ExecContext switching. cpu/base_cpu.cc: cpu/base_cpu.hh: cpu/exec_context.cc: cpu/exec_context.hh: cpu/simple_cpu/simple_cpu.hh: Support for ExecContext switching. Renamed contexts array to execContexts to be consistent with Process. CPU ID now auto-assigned by system object. cpu/simple_cpu/simple_cpu.cc: Support for ExecContext switching. Renamed contexts array to execContexts to be consistent with Process. CPU ID now auto-assigned by system object. Cleaned up MP full-system initialization a bit. dev/alpha_console.cc: Renamed xcvec array to execContexts to be consistent with Process. kern/tru64/tru64_system.cc: kern/tru64/tru64_system.hh: Support for ExecContext switching. CPU ID now auto-assigned by system object. sim/prog.cc: sim/prog.hh: Support for ExecContext switching. Process:numCpus is now a function (not a data member). sim/system.cc: sim/system.hh: Support for ExecContext switching. Renamed xcvec array to execContexts to be consistent with Process. --HG-- extra : convert_revision : 79649cffad5bf3e83de8df44236941907926d791
Diffstat (limited to 'cpu/base_cpu.hh')
-rw-r--r--cpu/base_cpu.hh16
1 files changed, 12 insertions, 4 deletions
diff --git a/cpu/base_cpu.hh b/cpu/base_cpu.hh
index e5d9df6de..5a20aaa54 100644
--- a/cpu/base_cpu.hh
+++ b/cpu/base_cpu.hh
@@ -47,7 +47,6 @@ class BaseCPU : public SimObject
{
#ifdef FULL_SYSTEM
protected:
- int number;
Tick frequency;
uint8_t interrupts[NumInterruptLevels];
uint64_t intstatus;
@@ -71,7 +70,7 @@ class BaseCPU : public SimObject
#endif
protected:
- std::vector<ExecContext *> contexts;
+ std::vector<ExecContext *> execContexts;
public:
virtual void execCtxStatusChg() {}
@@ -82,8 +81,7 @@ class BaseCPU : public SimObject
BaseCPU(const std::string &_name, int _number_of_threads,
Counter max_insts_any_thread, Counter max_insts_all_threads,
Counter max_loads_any_thread, Counter max_loads_all_threads,
- System *_system,
- int num, Tick freq);
+ System *_system, Tick freq);
#else
BaseCPU(const std::string &_name, int _number_of_threads,
Counter max_insts_any_thread = 0,
@@ -96,6 +94,16 @@ class BaseCPU : public SimObject
virtual void regStats();
+ virtual void registerExecContexts();
+
+ /// Prepare for another CPU to take over execution. Called by
+ /// takeOverFrom() on its argument.
+ virtual void switchOut();
+
+ /// Take over execution from the given CPU. Used for warm-up and
+ /// sampling.
+ virtual void takeOverFrom(BaseCPU *);
+
/**
* Number of threads we're actually simulating (<= SMT_MAX_THREADS).
* This is a constant for the duration of the simulation.