45 #include "arch/isa_traits.hh" 46 #include "arch/kernel_stats.hh" 47 #include "arch/stacktrace.hh" 48 #include "arch/utility.hh" 53 #include "config/the_isa.hh" 60 #include "params/BaseCPU.hh" 75 isa(dynamic_cast<
TheISA::ISA *>(_isa)),
76 predicate(true), memAccPredicate(true),
77 comInstEventQueue(
"instruction-based event queue"),
87 BaseISA *_isa,
bool use_kernel_stats)
114 if (use_kernel_stats)
124 isa->takeOverFrom(
this, oldContext);
void halt() override
Set the status to Halted.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Struct for holding general thread state that is needed across CPU models.
ProfileNode * profileNode
virtual const Loader::SymbolTable * symtab(ThreadContext *tc)=0
void suspend() override
Set the status to Suspended.
Status status() const override
virtual TheISA::Decoder * getDecoderPtr()=0
FunctionProfile * profile
Tick lastActivate
Last time activate was called on this thread.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
OutputStream * create(const std::string &name, bool binary=false, bool no_gz=false)
Creates a file in this directory (optionally compressed).
virtual ::Kernel::Statistics * getKernelStats()=0
void dumpFuncProfile() override
Tick lastSuspend
Last time suspend was called on this thread.
virtual void regStats(const std::string &name)
virtual void activateContext(ThreadID thread_num)
Notify the CPU that the indicated context is now active.
void clearArchRegs() override
SimpleThread(BaseCPU *_cpu, int _thread_num, System *_system, BaseTLB *_itb, BaseTLB *_dtb, BaseISA *_isa, bool use_kernel_stats=true)
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
Overload hash function for BasicBlockRange type.
void takeOverFrom(ThreadContext *oldContext) override
ThreadContext is the external interface to all thread state for anything outside of the CPU...
Event for timing out quiesce instruction.
EndQuiesceEvent * quiesceEvent
Tick curTick()
The current simulated tick.
std::string csprintf(const char *format, const Args &...args)
void activate() override
Set the status to Active.
void dump(ThreadContext *tc, std::ostream &out) const
virtual Counter readFuncExeInst() const =0
Kernel::Statistics * kernelStats
void close(OutputStream *file)
Closes an output file and free the corresponding OutputFile.
void registerExitCallback(Callback *callback)
Register an exit callback.
void serialize(CheckpointOut &cp) const override
Serialize an object.
Workload * workload
OS kernel.
ThreadContext::Status _status
bool predicate
Did this instruction execute or is it predicated false.
virtual const std::string name() const
bool memAccPredicate
True if the memory access should be skipped for this instruction.
std::ostream CheckpointOut
void copyState(ThreadContext *oldContext)
void regStats(const std::string &name) override
virtual int threadId() const =0
void copyArchRegs(ThreadContext *tc) override
virtual ContextID contextId() const =0
virtual Status status() const =0
unsigned storeCondFailures
void serialize(CheckpointOut &cp) const override
Serialize an object.
virtual void haltContext(ThreadID thread_num)
Notify the CPU that the indicated context is now halted.
Helper template class to turn a simple class member function into a callback.
EventQueue comInstEventQueue
An instruction-based event queue.
void copyRegs(ThreadContext *src, ThreadContext *dest)
const Params * params() const
virtual void suspendContext(ThreadID thread_num)
Notify the CPU that the indicated context is now suspended.