diff options
Diffstat (limited to 'cpu')
-rw-r--r-- | cpu/base.cc | 12 | ||||
-rw-r--r-- | cpu/base.hh | 1 | ||||
-rw-r--r-- | cpu/o3/alpha_cpu_builder.cc | 8 | ||||
-rw-r--r-- | cpu/simple/cpu.cc | 10 |
4 files changed, 13 insertions, 18 deletions
diff --git a/cpu/base.cc b/cpu/base.cc index 9e66d934f..50c777b0d 100644 --- a/cpu/base.cc +++ b/cpu/base.cc @@ -189,15 +189,15 @@ BaseCPU::registerExecContexts() { for (int i = 0; i < execContexts.size(); ++i) { ExecContext *xc = execContexts[i]; - int cpu_id; - #ifdef FULL_SYSTEM - cpu_id = system->registerExecContext(xc); + int id = params->cpu_id; + if (id != -1) + id += i; + + xc->cpu_id = system->registerExecContext(xc, id); #else - cpu_id = xc->process->registerExecContext(xc); + xc->cpu_id = xc->process->registerExecContext(xc); #endif - - xc->cpu_id = cpu_id; } } diff --git a/cpu/base.hh b/cpu/base.hh index cafe70b75..e28f15884 100644 --- a/cpu/base.hh +++ b/cpu/base.hh @@ -111,6 +111,7 @@ class BaseCPU : public SimObject Tick functionTraceStart; #ifdef FULL_SYSTEM System *system; + int cpu_id; #endif }; diff --git a/cpu/o3/alpha_cpu_builder.cc b/cpu/o3/alpha_cpu_builder.cc index 57061c052..57c567471 100644 --- a/cpu/o3/alpha_cpu_builder.cc +++ b/cpu/o3/alpha_cpu_builder.cc @@ -71,9 +71,9 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(DerivAlphaFullCPU) #ifdef FULL_SYSTEM SimObjectParam<System *> system; +Param<int> cpu_id; SimObjectParam<AlphaITB *> itb; SimObjectParam<AlphaDTB *> dtb; -Param<int> mult; #else SimObjectVectorParam<Process *> workload; #endif // FULL_SYSTEM @@ -164,9 +164,9 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(DerivAlphaFullCPU) #ifdef FULL_SYSTEM INIT_PARAM(system, "System object"), + INIT_PARAM(cpu_id, "processor ID"), INIT_PARAM(itb, "Instruction translation buffer"), INIT_PARAM(dtb, "Data translation buffer"), - INIT_PARAM(mult, "System clock multiplier"), #else INIT_PARAM(workload, "Processes to run"), #endif // FULL_SYSTEM @@ -274,9 +274,6 @@ CREATE_SIM_OBJECT(DerivAlphaFullCPU) DerivAlphaFullCPU *cpu; #ifdef FULL_SYSTEM - if (mult != 1) - panic("Processor clock multiplier must be 1?\n"); - // Full-system only supports a single thread for the moment. int actual_num_threads = 1; #else @@ -300,6 +297,7 @@ CREATE_SIM_OBJECT(DerivAlphaFullCPU) #ifdef FULL_SYSTEM params.system = system; + params.cpu_id = cpu_id; params.itb = itb; params.dtb = dtb; #else diff --git a/cpu/simple/cpu.cc b/cpu/simple/cpu.cc index de28913e4..1164e35a4 100644 --- a/cpu/simple/cpu.cc +++ b/cpu/simple/cpu.cc @@ -823,7 +823,7 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(SimpleCPU) SimObjectParam<AlphaDTB *> dtb; SimObjectParam<FunctionalMemory *> mem; SimObjectParam<System *> system; - Param<int> mult; + Param<int> cpu_id; #else SimObjectParam<Process *> workload; #endif // FULL_SYSTEM @@ -855,7 +855,7 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(SimpleCPU) INIT_PARAM(dtb, "Data TLB"), INIT_PARAM(mem, "memory"), INIT_PARAM(system, "system object"), - INIT_PARAM(mult, "system clock multiplier"), + INIT_PARAM(cpu_id, "processor ID"), #else INIT_PARAM(workload, "processes to run"), #endif // FULL_SYSTEM @@ -873,11 +873,6 @@ END_INIT_SIM_OBJECT_PARAMS(SimpleCPU) CREATE_SIM_OBJECT(SimpleCPU) { -#ifdef FULL_SYSTEM - if (mult != 1) - panic("processor clock multiplier must be 1\n"); -#endif - SimpleCPU::Params *params = new SimpleCPU::Params(); params->name = getInstanceName(); params->numberOfThreads = 1; @@ -898,6 +893,7 @@ CREATE_SIM_OBJECT(SimpleCPU) params->dtb = dtb; params->mem = mem; params->system = system; + params->cpu_id = cpu_id; #else params->process = workload; #endif |