Source('interrupts.cc')
Source('ipr.cc')
Source('isa.cc')
+ Source('kernel_stats.cc')
+ Source('osfpal.cc')
Source('pagetable.cc')
Source('regredir.cc')
Source('remote_gdb.cc')
+ Source('stacktrace.cc')
Source('tlb.cc')
Source('utility.cc')
Source('vtophys.cc')
SimObject('AlphaSystem.py')
Source('idle_event.cc')
- Source('kernel_stats.cc')
- Source('osfpal.cc')
- Source('stacktrace.cc')
Source('system.cc')
Source('freebsd/system.cc')
Source('nativetrace.cc')
Source('predecoder.cc')
Source('remote_gdb.cc')
+ Source('stacktrace.cc')
Source('table_walker.cc')
Source('tlb.cc')
Source('utility.cc')
DebugFlag('Faults', "Trace Exceptions, interrupts, svc/swi")
DebugFlag('Predecoder', "Instructions returned by the predecoder")
if env['FULL_SYSTEM']:
- Source('stacktrace.cc')
Source('system.cc')
Source('linux/system.cc')
Source('intr_control.cc')
Source('nativetrace.cc')
Source('pc_event.cc')
+Source('profile.cc')
Source('quiesce_event.cc')
Source('static_inst.cc')
Source('simple_thread.cc')
Source('thread_state.cc')
if env['FULL_SYSTEM']:
- Source('profile.cc')
-
if env['TARGET_ISA'] == 'sparc':
SimObject('LegionTrace.py')
Source('legiontrace.cc')
#include "cpu/activity.hh"
#include "cpu/base.hh"
#include "cpu/exetrace.hh"
+#include "cpu/quiesce_event.hh"
#include "cpu/simple_thread.hh"
#include "cpu/thread_context.hh"
#include "debug/Activity.hh"
#include "params/InOrderCPU.hh"
#include "sim/process.hh"
#include "sim/stat_control.hh"
-
-#if FULL_SYSTEM
-#include "cpu/quiesce_event.hh"
#include "sim/system.hh"
-#endif
#if THE_ISA == ALPHA_ISA
#include "arch/alpha/osfpal.hh"
return resPool->getPort(if_name, idx);
}
-#if FULL_SYSTEM
Fault
InOrderCPU::hwrei(ThreadID tid)
{
trap(interrupt, threadContexts[0]->contextId(), dummyBufferInst);
}
-
void
InOrderCPU::updateMemPorts()
{
for (ThreadID i = 0; i < size; ++i)
thread[i]->connectMemPorts(thread[i]->getTC());
}
-#endif
void
InOrderCPU::trapContext(Fault fault, ThreadID tid, DynInstPtr inst, int delay)
}
#endif
-#if !FULL_SYSTEM
void
InOrderCPU::syscallContext(Fault fault, ThreadID tid, DynInstPtr inst, int delay)
{
// Clear Non-Speculative Block Variable
nonSpecInstActive[tid] = false;
}
-#endif
TheISA::TLB*
InOrderCPU::getITBPtr()
/** Get a Memory Port */
Port* getPort(const std::string &if_name, int idx = 0);
-#if FULL_SYSTEM
/** HW return from error interrupt. */
Fault hwrei(ThreadID tid);
/** Check if this address is a valid data address. */
bool validDataAddr(Addr addr) { return true; }
-#else
+
/** Schedule a syscall on the CPU */
void syscallContext(Fault fault, ThreadID tid, DynInstPtr inst,
int delay = 0);
/** Executes a syscall.*/
void syscall(int64_t callnum, ThreadID tid);
-#endif
/** Schedule a trap on the CPU */
void trapContext(Fault fault, ThreadID tid, DynInstPtr inst, int delay = 0);
return thread->getVirtPort();
}
-#if FULL_SYSTEM
-
void
InOrderThreadContext::dumpFuncProfile()
{
{
thread->profileSample();
}
-#endif
void
InOrderThreadContext::takeOverFrom(ThreadContext *old_context)
/** Returns a pointer to physical memory. */
PhysicalMemory *getPhysMemPtr()
{ assert(0); return 0; /*return cpu->physmem;*/ }
+#endif
/** Returns a pointer to this thread's kernel statistics. */
TheISA::Kernel::Statistics *getKernelStats()
{
return this->thread->quiesceEvent;
}
-#endif
+
/** Returns a pointer to this thread's process. */
Process *getProcessPtr() { return thread->getProcessPtr(); }
* misspeculating, this is set as false. */
bool misspeculating() { return false; }
-#if !FULL_SYSTEM
/** Executes a syscall in SE mode. */
void syscall(int64_t callnum)
{ return cpu->syscall(callnum, thread->threadId()); }
-#endif
/** Reads the funcExeInst counter. */
Counter readFuncExeInst() { return thread->funcExeInst; }
using namespace TheISA;
-#if FULL_SYSTEM
void
InOrderThreadState::dumpFuncProfile()
{
std::ostream *os = simout.create(csprintf("profile.%s.dat", cpu->name()));
profile->dump(tc, *os);
}
-#endif
-
/** Handles the syscall. */
void syscall(int64_t callnum) { process->syscall(callnum, tc); }
-#if FULL_SYSTEM
void dumpFuncProfile();
-#endif
/** Pointer to the ThreadContext of this thread. */
ThreadContext *tc;
fault->invoke(this->threadContexts[tid], inst);
}
-#if !FULL_SYSTEM
-
template <class Impl>
void
FullO3CPU<Impl>::syscall(int64_t callnum, ThreadID tid)
--(this->thread[tid]->funcExeInst);
}
-#endif
-
template <class Impl>
void
FullO3CPU<Impl>::serialize(std::ostream &os)
virtual void unserialize(Checkpoint *cp, const std::string §ion);
public:
-#if !FULL_SYSTEM
/** Executes a syscall.
* @todo: Determine if this needs to be virtual.
*/
void syscall(int64_t callnum, ThreadID tid);
-#endif
/** Starts draining the CPU's pipeline of all instructions in
* order to stop all memory accesses. */
/** Returns a pointer to the system. */
virtual System *getSystemPtr() { return cpu->system; }
-#if FULL_SYSTEM
/** Returns a pointer to this thread's kernel statistics. */
virtual TheISA::Kernel::Statistics *getKernelStats()
{ return thread->kernelStats; }
- virtual void connectMemPorts(ThreadContext *tc) { thread->connectMemPorts(tc); }
-#endif
+ virtual void connectMemPorts(ThreadContext *tc)
+ { thread->connectMemPorts(tc); }
+
/** Returns a pointer to this thread's process. */
virtual Process *getProcessPtr() { return thread->getProcessPtr(); }
/** Set the status to Halted. */
virtual void halt(int delay = 0);
-#if FULL_SYSTEM
/** Dumps the function profiling information.
* @todo: Implement.
*/
virtual void dumpFuncProfile();
-#endif
+
/** Takes over execution of a thread from another CPU. */
virtual void takeOverFrom(ThreadContext *old_context);
/** Unserializes state. */
virtual void unserialize(Checkpoint *cp, const std::string §ion);
-#if FULL_SYSTEM
/** Reads the last tick that this thread was activated on. */
virtual Tick readLastActivate();
/** Reads the last tick that this thread was suspended on. */
virtual void profileClear();
/** Samples the function profiling information. */
virtual void profileSample();
-#endif
/** Copies the architectural registers from another TC into this TC. */
virtual void copyArchRegs(ThreadContext *tc);
* misspeculating, this is set as false. */
virtual bool misspeculating() { return false; }
-#if !FULL_SYSTEM
/** Executes a syscall in SE mode. */
virtual void syscall(int64_t callnum)
{ return cpu->syscall(callnum, thread->threadId()); }
/** Reads the funcExeInst counter. */
virtual Counter readFuncExeInst() { return thread->funcExeInst; }
-#else
+
/** Returns pointer to the quiesce event. */
virtual EndQuiesceEvent *getQuiesceEvent()
{
return this->thread->quiesceEvent;
}
-#endif
};
return thread->getVirtPort();
}
-#if FULL_SYSTEM
template <class Impl>
void
O3ThreadContext<Impl>::dumpFuncProfile()
{
thread->dumpFuncProfile();
}
-#endif
template <class Impl>
void
}
-#if FULL_SYSTEM
template <class Impl>
Tick
O3ThreadContext<Impl>::readLastActivate()
{
thread->profileSample();
}
-#endif
template <class Impl>
void
#include "cpu/thread_state.hh"
#include "sim/sim_exit.hh"
-class Event;
-class Process;
-
-#if FULL_SYSTEM
class EndQuiesceEvent;
-class FunctionProfile;
-class ProfileNode;
-#else
+class Event;
class FunctionalMemory;
+class FunctionProfile;
class Process;
-#endif
+class ProfileNode;
/**
* Class that has various thread state, such as the status, the
/** Returns a pointer to the TC of this thread. */
ThreadContext *getTC() { return tc; }
-#if !FULL_SYSTEM
/** Handles the syscall. */
void syscall(int64_t callnum) { process->syscall(callnum, tc); }
-#endif
-#if FULL_SYSTEM
void dumpFuncProfile()
{
std::ostream *os = simout.create(csprintf("profile.%s.dat", cpu->name()));
profile->dump(tc, *os);
}
-#endif
};
#endif // __CPU_O3_THREAD_STATE_HH__
#include <string>
#include "arch/isa_traits.hh"
-#include "arch/utility.hh"
-#include "config/the_isa.hh"
-#include "cpu/base.hh"
-#include "cpu/simple_thread.hh"
-#include "cpu/thread_context.hh"
-#include "mem/vport.hh"
-#include "params/BaseCPU.hh"
-#include "sim/process.hh"
-
-#if FULL_SYSTEM
#include "arch/kernel_stats.hh"
#include "arch/stacktrace.hh"
+#include "arch/utility.hh"
#include "base/callback.hh"
#include "base/cprintf.hh"
#include "base/output.hh"
#include "base/trace.hh"
+#include "config/the_isa.hh"
+#include "cpu/base.hh"
#include "cpu/profile.hh"
#include "cpu/quiesce_event.hh"
+#include "cpu/simple_thread.hh"
+#include "cpu/thread_context.hh"
+#include "mem/translating_port.hh"
+#include "mem/vport.hh"
+#include "params/BaseCPU.hh"
+#include "sim/process.hh"
#include "sim/serialize.hh"
#include "sim/sim_exit.hh"
-#else
-#include "mem/translating_port.hh"
#include "sim/system.hh"
-#endif
using namespace std;
isa.unserialize(cpu, cp, section);
}
-#if FULL_SYSTEM
void
SimpleThread::dumpFuncProfile()
{
std::ostream *os = simout.create(csprintf("profile.%s.dat", cpu->name()));
profile->dump(tc, *os);
}
-#endif
void
SimpleThread::activate(int delay)
#include "cpu/thread_state.hh"
#include "debug/FloatRegs.hh"
#include "debug/IntRegs.hh"
+#include "mem/page_table.hh"
#include "mem/request.hh"
#include "sim/byteswap.hh"
#include "sim/eventq.hh"
+#include "sim/process.hh"
#include "sim/serialize.hh"
+#include "sim/system.hh"
class BaseCPU;
-#if FULL_SYSTEM
-
-#include "sim/system.hh"
class FunctionProfile;
class ProfileNode;
class FunctionalPort;
class PhysicalPort;
+class TranslatingPort;
namespace TheISA {
namespace Kernel {
};
};
-#else // !FULL_SYSTEM
-
-#include "mem/page_table.hh"
-#include "sim/process.hh"
-class TranslatingPort;
-
-#endif // FULL_SYSTEM
-
/**
* The SimpleThread object provides a combination of the ThreadState
* object and the ThreadContext interface. It implements the
dtb->demapPage(vaddr, asn);
}
-#if FULL_SYSTEM
void dumpFuncProfile();
Fault hwrei();
bool simPalCheck(int palFunc);
-#endif
-
/*******************************************
* ThreadContext interface functions.
******************************************/
void setStCondFailures(unsigned sc_failures)
{ storeCondFailures = sc_failures; }
-#if !FULL_SYSTEM
void syscall(int64_t callnum)
{
process->syscall(callnum, tc);
}
-#endif
};
panic("Float reg idx %d doesn't match, one: %#x, two: %#x",
i, t1, t2);
}
-#if FULL_SYSTEM
for (int i = 0; i < TheISA::NumMiscRegs; ++i) {
TheISA::MiscReg t1 = one->readMiscRegNoEffect(i);
TheISA::MiscReg t2 = two->readMiscRegNoEffect(i);
panic("Misc reg idx %d doesn't match, one: %#x, two: %#x",
i, t1, t2);
}
-#endif
if (!(one->pcState() == two->pcState()))
panic("PC state doesn't match.");
#include "arch/registers.hh"
#include "arch/types.hh"
#include "base/types.hh"
-#include "config/full_system.hh"
#include "config/the_isa.hh"
// @todo: Figure out a more architecture independent way to obtain the ITB and
virtual System *getSystemPtr() = 0;
-#if FULL_SYSTEM
virtual TheISA::Kernel::Statistics *getKernelStats() = 0;
virtual void connectMemPorts(ThreadContext *tc) = 0;
-#endif
+
virtual Process *getProcessPtr() = 0;
virtual TranslatingPort *getMemPort() = 0;
/// Set the status to Halted.
virtual void halt(int delay = 0) = 0;
-#if FULL_SYSTEM
virtual void dumpFuncProfile() = 0;
-#endif
virtual void takeOverFrom(ThreadContext *old_context) = 0;
virtual void serialize(std::ostream &os) = 0;
virtual void unserialize(Checkpoint *cp, const std::string §ion) = 0;
-#if FULL_SYSTEM
virtual EndQuiesceEvent *getQuiesceEvent() = 0;
// Not necessarily the best location for these...
virtual void profileClear() = 0;
virtual void profileSample() = 0;
-#endif
virtual void copyArchRegs(ThreadContext *tc) = 0;
// Only really makes sense for old CPU model. Still could be useful though.
virtual bool misspeculating() = 0;
-#if !FULL_SYSTEM
// Same with st cond failures.
virtual Counter readFuncExeInst() = 0;
// 1 if the CPU has no more active threads (meaning it's OK to exit);
// Used in syscall-emulation mode when a thread calls the exit syscall.
virtual int exit() { return 1; };
-#endif
/** function to compare two thread contexts (for debugging) */
static void compare(ThreadContext *one, ThreadContext *two);
System *getSystemPtr() { return actualTC->getSystemPtr(); }
-#if FULL_SYSTEM
TheISA::Kernel::Statistics *getKernelStats()
{ return actualTC->getKernelStats(); }
void connectMemPorts(ThreadContext *tc) { actualTC->connectMemPorts(tc); }
-#endif
+
Process *getProcessPtr() { return actualTC->getProcessPtr(); }
TranslatingPort *getMemPort() { return actualTC->getMemPort(); }
/// Set the status to Halted.
void halt(int delay = 0) { actualTC->halt(); }
-#if FULL_SYSTEM
void dumpFuncProfile() { actualTC->dumpFuncProfile(); }
-#endif
void takeOverFrom(ThreadContext *oldContext)
{ actualTC->takeOverFrom(oldContext); }
void unserialize(Checkpoint *cp, const std::string §ion)
{ actualTC->unserialize(cp, section); }
-#if FULL_SYSTEM
EndQuiesceEvent *getQuiesceEvent() { return actualTC->getQuiesceEvent(); }
Tick readLastActivate() { return actualTC->readLastActivate(); }
void profileClear() { return actualTC->profileClear(); }
void profileSample() { return actualTC->profileSample(); }
-#endif
// @todo: Do I need this?
void copyArchRegs(ThreadContext *tc) { actualTC->copyArchRegs(tc); }
// @todo: Fix this!
bool misspeculating() { return actualTC->misspeculating(); }
-#if !FULL_SYSTEM
void syscall(int64_t callnum)
{ actualTC->syscall(callnum); }
Counter readFuncExeInst() { return actualTC->readFuncExeInst(); }
-#endif
};
#endif
connectToMemFunc(virtPort);
}
-#if FULL_SYSTEM
void
ThreadState::connectMemPorts(ThreadContext *tc)
{
if (profile)
profile->sample(profileNode, profilePC);
}
-#endif
TranslatingPort *
ThreadState::getMemPort()
#include "mem/mem_object.hh"
#include "sim/process.hh"
-#if FULL_SYSTEM
class EndQuiesceEvent;
class FunctionProfile;
class ProfileNode;
class Statistics;
};
};
-#endif
class Checkpoint;
class Port;
void connectVirtPort(ThreadContext *tc);
-#if FULL_SYSTEM
void connectMemPorts(ThreadContext *tc);
void dumpFuncProfile();
void profileSample();
TheISA::Kernel::Statistics *getKernelStats() { return kernelStats; }
-#endif
+
Process *getProcessPtr() { return process; }
TranslatingPort *getMemPort();
/** Last time suspend was called on this thread. */
Tick lastSuspend;
-#if FULL_SYSTEM
public:
FunctionProfile *profile;
ProfileNode *profileNode;
EndQuiesceEvent *quiesceEvent;
TheISA::Kernel::Statistics *kernelStats;
-#endif
+
protected:
Process *process;
if env['TARGET_ISA'] == 'no':
Return()
+Source('kernel_stats.cc')
Source('linux/events.cc')
Source('linux/linux.cc')
Source('linux/printk.cc')
DebugFlag('Printf')
if env['FULL_SYSTEM']:
- Source('kernel_stats.cc')
Source('linux/linux_syscalls.cc')
if env['TARGET_ISA'] == 'alpha':
#include "base/trace.hh"
#include "cpu/thread_context.hh"
-#include "kern/tru64/tru64_syscalls.hh"
#include "kern/kernel_stats.hh"
+#if THE_ISA == ALPHA_ISA
+#include "kern/tru64/tru64_syscalls.hh"
+#endif
#include "sim/system.hh"
using namespace std;
;
_iplUsed = _iplGood / _iplCount;
-
+#if THE_ISA == ALPHA_ISA
_syscall
.init(SystemCalls<Tru64>::Number)
.name(name() + ".syscall")
.desc("number of syscalls executed")
.flags(total | pdf | nozero | nonan)
;
+#endif
//@todo This needs to get the names of syscalls from an appropriate place.
#if 0
Stats::Vector _iplTicks;
Stats::Formula _iplUsed;
+#if THE_ISA == ALPHA_ISA
Stats::Vector _syscall;
+#endif
// Stats::Vector _faults;
private:
#include <fstream>
#include <string>
+#include "arch/kernel_stats.hh"
#include "arch/vtophys.hh"
#include "base/debug.hh"
#include "config/full_system.hh"
#include "sim/stat_control.hh"
#include "sim/stats.hh"
#include "sim/system.hh"
-
-#if FULL_SYSTEM
-#include "arch/kernel_stats.hh"
#include "sim/vptr.hh"
-#endif
using namespace std;