Hi, all
I am reading atomic cpu's code and find a piece of code hard to understand.
It's in src/cpu/simple/atomic.cc file:
void
AtomicSimpleCPU::tick()
{
…...
preExecute();
if (curStaticInst) {
fault = curStaticInst->execute(this, traceData);
// keep an instruction count
if (fault == NoFault)
countInst();
else if (traceData && !DTRACE(ExecFaulting)) {
delete traceData;
traceData = NULL;
}
postExecute();
}
……
}
I can't understand this code: " fault = curStaticInst->execute(this,
traceData);". According the context, I know curStaticInst belongs to
StaticInstPtr class whose behaviors are similar to a pointer. It overloads
operator "->" and makes it dereference to a method of another class:
StaticInst. However, I cannot find the execute(AtomicSimpleCPU*,
Trace::InstRecord*) definition or declaration in it and all classes inherited
by it, except that I found a comment in src/cpu/static_inst.hh said "The
execute() signatures are auto-generated by scons based on the set of CPU models
we are compiling in today." My question is how the execute method is found
without declaration of this method.
Thank you very much.
Meng
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev