SE/FS: Make the functions available from the TC consistent between SE and FS.
This commit is contained in:
@@ -37,9 +37,12 @@ if env['TARGET_ISA'] == 'alpha':
|
||||
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')
|
||||
@@ -51,9 +54,6 @@ if env['TARGET_ISA'] == 'alpha':
|
||||
SimObject('AlphaSystem.py')
|
||||
|
||||
Source('idle_event.cc')
|
||||
Source('kernel_stats.cc')
|
||||
Source('osfpal.cc')
|
||||
Source('stacktrace.cc')
|
||||
Source('system.cc')
|
||||
|
||||
Source('freebsd/system.cc')
|
||||
|
||||
@@ -60,6 +60,7 @@ if env['TARGET_ISA'] == 'arm':
|
||||
Source('nativetrace.cc')
|
||||
Source('predecoder.cc')
|
||||
Source('remote_gdb.cc')
|
||||
Source('stacktrace.cc')
|
||||
Source('table_walker.cc')
|
||||
Source('tlb.cc')
|
||||
Source('utility.cc')
|
||||
@@ -74,7 +75,6 @@ if env['TARGET_ISA'] == 'arm':
|
||||
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')
|
||||
|
||||
|
||||
@@ -122,6 +122,7 @@ Source('inteltrace.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')
|
||||
@@ -129,8 +130,6 @@ Source('thread_context.cc')
|
||||
Source('thread_state.cc')
|
||||
|
||||
if env['FULL_SYSTEM']:
|
||||
Source('profile.cc')
|
||||
|
||||
if env['TARGET_ISA'] == 'sparc':
|
||||
SimObject('LegionTrace.py')
|
||||
Source('legiontrace.cc')
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#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"
|
||||
@@ -57,11 +58,7 @@
|
||||
#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"
|
||||
@@ -786,7 +783,6 @@ InOrderCPU::getPort(const std::string &if_name, int idx)
|
||||
return resPool->getPort(if_name, idx);
|
||||
}
|
||||
|
||||
#if FULL_SYSTEM
|
||||
Fault
|
||||
InOrderCPU::hwrei(ThreadID tid)
|
||||
{
|
||||
@@ -891,7 +887,6 @@ InOrderCPU::processInterrupts(Fault interrupt)
|
||||
trap(interrupt, threadContexts[0]->contextId(), dummyBufferInst);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
InOrderCPU::updateMemPorts()
|
||||
{
|
||||
@@ -901,7 +896,6 @@ 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)
|
||||
@@ -1709,7 +1703,6 @@ InOrderCPU::wakeup()
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !FULL_SYSTEM
|
||||
void
|
||||
InOrderCPU::syscallContext(Fault fault, ThreadID tid, DynInstPtr inst, int delay)
|
||||
{
|
||||
@@ -1747,7 +1740,6 @@ InOrderCPU::syscall(int64_t callnum, ThreadID tid)
|
||||
// Clear Non-Speculative Block Variable
|
||||
nonSpecInstActive[tid] = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
TheISA::TLB*
|
||||
InOrderCPU::getITBPtr()
|
||||
|
||||
@@ -413,7 +413,6 @@ class InOrderCPU : public BaseCPU
|
||||
/** 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);
|
||||
|
||||
@@ -439,14 +438,13 @@ class InOrderCPU : public BaseCPU
|
||||
|
||||
/** 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);
|
||||
|
||||
@@ -43,8 +43,6 @@ InOrderThreadContext::getVirtPort()
|
||||
return thread->getVirtPort();
|
||||
}
|
||||
|
||||
#if FULL_SYSTEM
|
||||
|
||||
void
|
||||
InOrderThreadContext::dumpFuncProfile()
|
||||
{
|
||||
@@ -78,7 +76,6 @@ InOrderThreadContext::profileSample()
|
||||
{
|
||||
thread->profileSample();
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
InOrderThreadContext::takeOverFrom(ThreadContext *old_context)
|
||||
|
||||
@@ -113,6 +113,7 @@ class InOrderThreadContext : public ThreadContext
|
||||
/** 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()
|
||||
@@ -142,7 +143,7 @@ class InOrderThreadContext : public ThreadContext
|
||||
{
|
||||
return this->thread->quiesceEvent;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Returns a pointer to this thread's process. */
|
||||
Process *getProcessPtr() { return thread->getProcessPtr(); }
|
||||
|
||||
@@ -271,11 +272,9 @@ class InOrderThreadContext : public ThreadContext
|
||||
* 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; }
|
||||
|
||||
@@ -36,12 +36,9 @@
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -86,9 +86,7 @@ class InOrderThreadState : public ThreadState {
|
||||
/** 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;
|
||||
|
||||
@@ -983,8 +983,6 @@ FullO3CPU<Impl>::trap(Fault fault, ThreadID tid, StaticInstPtr inst)
|
||||
fault->invoke(this->threadContexts[tid], inst);
|
||||
}
|
||||
|
||||
#if !FULL_SYSTEM
|
||||
|
||||
template <class Impl>
|
||||
void
|
||||
FullO3CPU<Impl>::syscall(int64_t callnum, ThreadID tid)
|
||||
@@ -1005,8 +1003,6 @@ FullO3CPU<Impl>::syscall(int64_t callnum, ThreadID tid)
|
||||
--(this->thread[tid]->funcExeInst);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
template <class Impl>
|
||||
void
|
||||
FullO3CPU<Impl>::serialize(std::ostream &os)
|
||||
|
||||
@@ -350,12 +350,10 @@ class FullO3CPU : public BaseO3CPU
|
||||
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. */
|
||||
|
||||
@@ -92,13 +92,13 @@ class O3ThreadContext : public ThreadContext
|
||||
/** 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(); }
|
||||
|
||||
@@ -125,12 +125,11 @@ class O3ThreadContext : public ThreadContext
|
||||
/** 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);
|
||||
|
||||
@@ -142,7 +141,6 @@ class O3ThreadContext : public ThreadContext
|
||||
/** 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. */
|
||||
@@ -152,7 +150,6 @@ class O3ThreadContext : public ThreadContext
|
||||
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);
|
||||
@@ -229,20 +226,18 @@ class O3ThreadContext : public ThreadContext
|
||||
* 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
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -54,14 +54,12 @@ O3ThreadContext<Impl>::getVirtPort()
|
||||
return thread->getVirtPort();
|
||||
}
|
||||
|
||||
#if FULL_SYSTEM
|
||||
template <class Impl>
|
||||
void
|
||||
O3ThreadContext<Impl>::dumpFuncProfile()
|
||||
{
|
||||
thread->dumpFuncProfile();
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class Impl>
|
||||
void
|
||||
@@ -197,7 +195,6 @@ O3ThreadContext<Impl>::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
|
||||
}
|
||||
|
||||
#if FULL_SYSTEM
|
||||
template <class Impl>
|
||||
Tick
|
||||
O3ThreadContext<Impl>::readLastActivate()
|
||||
@@ -225,7 +222,6 @@ O3ThreadContext<Impl>::profileSample()
|
||||
{
|
||||
thread->profileSample();
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class Impl>
|
||||
void
|
||||
|
||||
@@ -37,17 +37,12 @@
|
||||
#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
|
||||
@@ -102,18 +97,14 @@ struct O3ThreadState : public ThreadState {
|
||||
/** 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__
|
||||
|
||||
@@ -34,30 +34,26 @@
|
||||
#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;
|
||||
|
||||
@@ -211,14 +207,12 @@ SimpleThread::unserialize(Checkpoint *cp, const std::string §ion)
|
||||
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)
|
||||
|
||||
@@ -45,21 +45,22 @@
|
||||
#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 {
|
||||
@@ -67,14 +68,6 @@ namespace TheISA {
|
||||
};
|
||||
};
|
||||
|
||||
#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
|
||||
@@ -184,15 +177,12 @@ class SimpleThread : public ThreadState
|
||||
dtb->demapPage(vaddr, asn);
|
||||
}
|
||||
|
||||
#if FULL_SYSTEM
|
||||
void dumpFuncProfile();
|
||||
|
||||
Fault hwrei();
|
||||
|
||||
bool simPalCheck(int palFunc);
|
||||
|
||||
#endif
|
||||
|
||||
/*******************************************
|
||||
* ThreadContext interface functions.
|
||||
******************************************/
|
||||
@@ -382,12 +372,10 @@ class SimpleThread : public ThreadState
|
||||
void setStCondFailures(unsigned sc_failures)
|
||||
{ storeCondFailures = sc_failures; }
|
||||
|
||||
#if !FULL_SYSTEM
|
||||
void syscall(int64_t callnum)
|
||||
{
|
||||
process->syscall(callnum, tc);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -56,7 +56,6 @@ ThreadContext::compare(ThreadContext *one, ThreadContext *two)
|
||||
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);
|
||||
@@ -64,7 +63,6 @@ ThreadContext::compare(ThreadContext *one, ThreadContext *two)
|
||||
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.");
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#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
|
||||
@@ -125,11 +124,10 @@ class ThreadContext
|
||||
|
||||
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;
|
||||
@@ -152,9 +150,7 @@ class ThreadContext
|
||||
/// 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;
|
||||
|
||||
@@ -163,7 +159,6 @@ class ThreadContext
|
||||
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...
|
||||
@@ -173,7 +168,6 @@ class ThreadContext
|
||||
|
||||
virtual void profileClear() = 0;
|
||||
virtual void profileSample() = 0;
|
||||
#endif
|
||||
|
||||
virtual void copyArchRegs(ThreadContext *tc) = 0;
|
||||
|
||||
@@ -235,7 +229,6 @@ class ThreadContext
|
||||
// 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;
|
||||
|
||||
@@ -245,7 +238,6 @@ class ThreadContext
|
||||
// 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);
|
||||
@@ -293,12 +285,11 @@ class ProxyThreadContext : public ThreadContext
|
||||
|
||||
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(); }
|
||||
@@ -321,9 +312,7 @@ class ProxyThreadContext : public ThreadContext
|
||||
/// 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); }
|
||||
@@ -334,7 +323,6 @@ class ProxyThreadContext : public ThreadContext
|
||||
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(); }
|
||||
@@ -342,7 +330,6 @@ class ProxyThreadContext : public ThreadContext
|
||||
|
||||
void profileClear() { return actualTC->profileClear(); }
|
||||
void profileSample() { return actualTC->profileSample(); }
|
||||
#endif
|
||||
|
||||
// @todo: Do I need this?
|
||||
void copyArchRegs(ThreadContext *tc) { actualTC->copyArchRegs(tc); }
|
||||
@@ -410,12 +397,10 @@ class ProxyThreadContext : public ThreadContext
|
||||
// @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
|
||||
|
||||
@@ -125,7 +125,6 @@ ThreadState::connectVirtPort(ThreadContext *tc)
|
||||
connectToMemFunc(virtPort);
|
||||
}
|
||||
|
||||
#if FULL_SYSTEM
|
||||
void
|
||||
ThreadState::connectMemPorts(ThreadContext *tc)
|
||||
{
|
||||
@@ -146,7 +145,6 @@ ThreadState::profileSample()
|
||||
if (profile)
|
||||
profile->sample(profileNode, profilePC);
|
||||
}
|
||||
#endif
|
||||
|
||||
TranslatingPort *
|
||||
ThreadState::getMemPort()
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
#include "mem/mem_object.hh"
|
||||
#include "sim/process.hh"
|
||||
|
||||
#if FULL_SYSTEM
|
||||
class EndQuiesceEvent;
|
||||
class FunctionProfile;
|
||||
class ProfileNode;
|
||||
@@ -48,7 +47,6 @@ namespace TheISA {
|
||||
class Statistics;
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
class Checkpoint;
|
||||
class Port;
|
||||
@@ -89,7 +87,6 @@ struct ThreadState {
|
||||
|
||||
void connectVirtPort(ThreadContext *tc);
|
||||
|
||||
#if FULL_SYSTEM
|
||||
void connectMemPorts(ThreadContext *tc);
|
||||
|
||||
void dumpFuncProfile();
|
||||
@@ -101,7 +98,7 @@ struct ThreadState {
|
||||
void profileSample();
|
||||
|
||||
TheISA::Kernel::Statistics *getKernelStats() { return kernelStats; }
|
||||
#endif
|
||||
|
||||
Process *getProcessPtr() { return process; }
|
||||
|
||||
TranslatingPort *getMemPort();
|
||||
@@ -169,7 +166,6 @@ struct ThreadState {
|
||||
/** Last time suspend was called on this thread. */
|
||||
Tick lastSuspend;
|
||||
|
||||
#if FULL_SYSTEM
|
||||
public:
|
||||
FunctionProfile *profile;
|
||||
ProfileNode *profileNode;
|
||||
@@ -177,7 +173,7 @@ struct ThreadState {
|
||||
EndQuiesceEvent *quiesceEvent;
|
||||
|
||||
TheISA::Kernel::Statistics *kernelStats;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
Process *process;
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ Import('*')
|
||||
if env['TARGET_ISA'] == 'no':
|
||||
Return()
|
||||
|
||||
Source('kernel_stats.cc')
|
||||
Source('linux/events.cc')
|
||||
Source('linux/linux.cc')
|
||||
Source('linux/printk.cc')
|
||||
@@ -50,7 +51,6 @@ DebugFlag('DebugPrintf')
|
||||
DebugFlag('Printf')
|
||||
|
||||
if env['FULL_SYSTEM']:
|
||||
Source('kernel_stats.cc')
|
||||
Source('linux/linux_syscalls.cc')
|
||||
|
||||
if env['TARGET_ISA'] == 'alpha':
|
||||
|
||||
@@ -33,8 +33,10 @@
|
||||
|
||||
#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;
|
||||
@@ -90,13 +92,14 @@ Statistics::regStats(const string &_name)
|
||||
;
|
||||
|
||||
_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
|
||||
|
||||
@@ -61,7 +61,9 @@ class Statistics : public Serializable
|
||||
Stats::Vector _iplTicks;
|
||||
Stats::Formula _iplUsed;
|
||||
|
||||
#if THE_ISA == ALPHA_ISA
|
||||
Stats::Vector _syscall;
|
||||
#endif
|
||||
// Stats::Vector _faults;
|
||||
|
||||
private:
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
#include "arch/kernel_stats.hh"
|
||||
#include "arch/vtophys.hh"
|
||||
#include "base/debug.hh"
|
||||
#include "config/full_system.hh"
|
||||
@@ -66,11 +67,7 @@
|
||||
#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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user