projects
/
gem5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
forgot tid
[gem5.git]
/
src
/
cpu
/
base.cc
diff --git
a/src/cpu/base.cc
b/src/cpu/base.cc
index e48edb2a84ca10d9773df6ea152f7b8808f66e75..ce440aeffc2eaf9ba316ea5e8a7abb13e093224f 100644
(file)
--- a/
src/cpu/base.cc
+++ b/
src/cpu/base.cc
@@
-39,9
+39,8
@@
#include "base/output.hh"
#include "cpu/base.hh"
#include "cpu/cpuevent.hh"
#include "base/output.hh"
#include "cpu/base.hh"
#include "cpu/cpuevent.hh"
-#include "cpu/
exec
_context.hh"
+#include "cpu/
thread
_context.hh"
#include "cpu/profile.hh"
#include "cpu/profile.hh"
-#include "cpu/sampler/sampler.hh"
#include "sim/param.hh"
#include "sim/process.hh"
#include "sim/sim_events.hh"
#include "sim/param.hh"
#include "sim/process.hh"
#include "sim/sim_events.hh"
@@
-60,11
+59,11
@@
int maxThreadsPerCPU = 1;
#if FULL_SYSTEM
BaseCPU::BaseCPU(Params *p)
#if FULL_SYSTEM
BaseCPU::BaseCPU(Params *p)
- :
Si
mObject(p->name), clock(p->clock), checkInterrupts(true),
+ :
Me
mObject(p->name), clock(p->clock), checkInterrupts(true),
params(p), number_of_threads(p->numberOfThreads), system(p->system)
#else
BaseCPU::BaseCPU(Params *p)
params(p), number_of_threads(p->numberOfThreads), system(p->system)
#else
BaseCPU::BaseCPU(Params *p)
- :
Si
mObject(p->name), clock(p->clock), params(p),
+ :
Me
mObject(p->name), clock(p->clock), params(p),
number_of_threads(p->numberOfThreads), system(p->system)
#endif
{
number_of_threads(p->numberOfThreads), system(p->system)
#endif
{
@@
-89,8
+88,8
@@
BaseCPU::BaseCPU(Params *p)
//
if (p->max_insts_any_thread != 0)
for (int i = 0; i < number_of_threads; ++i)
//
if (p->max_insts_any_thread != 0)
for (int i = 0; i < number_of_threads; ++i)
- new SimExitEvent(comInstEventQueue[i], p->max_insts_any_thread,
- "a thread reached the max instruction count");
+ new Sim
Loop
ExitEvent(comInstEventQueue[i], p->max_insts_any_thread,
+
"a thread reached the max instruction count");
if (p->max_insts_all_threads != 0) {
// allocate & initialize shared downcounter: each event will
if (p->max_insts_all_threads != 0) {
// allocate & initialize shared downcounter: each event will
@@
-114,8
+113,8
@@
BaseCPU::BaseCPU(Params *p)
//
if (p->max_loads_any_thread != 0)
for (int i = 0; i < number_of_threads; ++i)
//
if (p->max_loads_any_thread != 0)
for (int i = 0; i < number_of_threads; ++i)
- new SimExitEvent(comLoadEventQueue[i], p->max_loads_any_thread,
- "a thread reached the max load count");
+ new Sim
Loop
ExitEvent(comLoadEventQueue[i], p->max_loads_any_thread,
+
"a thread reached the max load count");
if (p->max_loads_all_threads != 0) {
// allocate & initialize shared downcounter: each event will
if (p->max_loads_all_threads != 0) {
// allocate & initialize shared downcounter: each event will
@@
-179,7
+178,7
@@
void
BaseCPU::init()
{
if (!params->deferRegistration)
BaseCPU::init()
{
if (!params->deferRegistration)
- register
Exec
Contexts();
+ register
Thread
Contexts();
}
void
}
void
@@
-202,15
+201,15
@@
BaseCPU::regStats()
.desc("number of cpu cycles simulated")
;
.desc("number of cpu cycles simulated")
;
- int size =
exec
Contexts.size();
+ int size =
thread
Contexts.size();
if (size > 1) {
for (int i = 0; i < size; ++i) {
stringstream namestr;
ccprintf(namestr, "%s.ctx%d", name(), i);
if (size > 1) {
for (int i = 0; i < size; ++i) {
stringstream namestr;
ccprintf(namestr, "%s.ctx%d", name(), i);
-
exec
Contexts[i]->regStats(namestr.str());
+
thread
Contexts[i]->regStats(namestr.str());
}
} else if (size == 1)
}
} else if (size == 1)
-
exec
Contexts[0]->regStats(name());
+
thread
Contexts[0]->regStats(name());
#if FULL_SYSTEM
#endif
#if FULL_SYSTEM
#endif
@@
-218,26
+217,26
@@
BaseCPU::regStats()
void
void
-BaseCPU::register
Exec
Contexts()
+BaseCPU::register
Thread
Contexts()
{
{
- for (int i = 0; i <
exec
Contexts.size(); ++i) {
-
ExecContext *xc = exec
Contexts[i];
+ for (int i = 0; i <
thread
Contexts.size(); ++i) {
+
ThreadContext *tc = thread
Contexts[i];
#if FULL_SYSTEM
int id = params->cpu_id;
if (id != -1)
id += i;
#if FULL_SYSTEM
int id = params->cpu_id;
if (id != -1)
id += i;
-
xc->setCpuId(system->registerExecContext(x
c, id));
+
tc->setCpuId(system->registerThreadContext(t
c, id));
#else
#else
-
xc->setCpuId(xc->getProcessPtr()->registerExecContext(x
c));
+
tc->setCpuId(tc->getProcessPtr()->registerThreadContext(t
c));
#endif
}
}
void
#endif
}
}
void
-BaseCPU::switchOut(
Sampler *sampler
)
+BaseCPU::switchOut()
{
panic("This CPU doesn't support sampling!");
}
{
panic("This CPU doesn't support sampling!");
}
@@
-245,22
+244,22
@@
BaseCPU::switchOut(Sampler *sampler)
void
BaseCPU::takeOverFrom(BaseCPU *oldCPU)
{
void
BaseCPU::takeOverFrom(BaseCPU *oldCPU)
{
- assert(
execContexts.size() == oldCPU->exec
Contexts.size());
+ assert(
threadContexts.size() == oldCPU->thread
Contexts.size());
- for (int i = 0; i <
exec
Contexts.size(); ++i) {
-
ExecContext *newXC = exec
Contexts[i];
-
ExecContext *oldXC = oldCPU->exec
Contexts[i];
+ for (int i = 0; i <
thread
Contexts.size(); ++i) {
+
ThreadContext *newTC = thread
Contexts[i];
+
ThreadContext *oldTC = oldCPU->thread
Contexts[i];
- new
XC->takeOverFrom(oldX
C);
+ new
TC->takeOverFrom(oldT
C);
- CpuEvent::replace
ExecContext(oldXC, newX
C);
+ CpuEvent::replace
ThreadContext(oldTC, newT
C);
- assert(new
XC->readCpuId() == oldX
C->readCpuId());
+ assert(new
TC->readCpuId() == oldT
C->readCpuId());
#if FULL_SYSTEM
#if FULL_SYSTEM
- system->replace
ExecContext(newXC, newX
C->readCpuId());
+ system->replace
ThreadContext(newTC, newT
C->readCpuId());
#else
#else
- assert(new
XC->getProcessPtr() == oldX
C->getProcessPtr());
- new
XC->getProcessPtr()->replaceExecContext(newXC, newX
C->readCpuId());
+ assert(new
TC->getProcessPtr() == oldT
C->getProcessPtr());
+ new
TC->getProcessPtr()->replaceThreadContext(newTC, newT
C->readCpuId());
#endif
}
#endif
}
@@
-269,8
+268,8
@@
BaseCPU::takeOverFrom(BaseCPU *oldCPU)
interrupts[i] = oldCPU->interrupts[i];
intstatus = oldCPU->intstatus;
interrupts[i] = oldCPU->interrupts[i];
intstatus = oldCPU->intstatus;
- for (int i = 0; i <
exec
Contexts.size(); ++i)
-
exec
Contexts[i]->profileClear();
+ for (int i = 0; i <
thread
Contexts.size(); ++i)
+
thread
Contexts[i]->profileClear();
if (profileEvent)
profileEvent->schedule(curTick);
if (profileEvent)
profileEvent->schedule(curTick);
@@
-286,9
+285,9
@@
BaseCPU::ProfileEvent::ProfileEvent(BaseCPU *_cpu, int _interval)
void
BaseCPU::ProfileEvent::process()
{
void
BaseCPU::ProfileEvent::process()
{
- for (int i = 0, size = cpu->
exec
Contexts.size(); i < size; ++i) {
-
ExecContext *xc = cpu->exec
Contexts[i];
-
x
c->profileSample();
+ for (int i = 0, size = cpu->
thread
Contexts.size(); i < size; ++i) {
+
ThreadContext *tc = cpu->thread
Contexts[i];
+
t
c->profileSample();
}
schedule(curTick + interval);
}
schedule(curTick + interval);