SE/FS: Get rid of FULL_SYSTEM in sim.
This commit is contained in:
parent
fb15604f2c
commit
8b4a3f4070
|
@ -134,6 +134,7 @@
|
|||
#include "mem/port.hh"
|
||||
#include "mem/translating_port.hh"
|
||||
#include "mem/vport.hh"
|
||||
#include "sim/full_system.hh"
|
||||
#include "sim/system.hh"
|
||||
|
||||
using namespace std;
|
||||
|
|
|
@ -78,10 +78,10 @@ class BaseCPU(MemObject):
|
|||
do_statistics_insts = Param.Bool(True,
|
||||
"enable statistics pseudo instructions")
|
||||
|
||||
if buildEnv['FULL_SYSTEM']:
|
||||
profile = Param.Latency('0ns', "trace the kernel stack")
|
||||
do_quiesce = Param.Bool(True, "enable quiesce instructions")
|
||||
else:
|
||||
|
||||
if not buildEnv['FULL_SYSTEM']:
|
||||
workload = VectorParam.Process("processes to run")
|
||||
|
||||
if buildEnv['TARGET_ISA'] == 'sparc':
|
||||
|
|
|
@ -57,7 +57,7 @@ if env['TARGET_ISA'] != 'no':
|
|||
Source('pseudo_inst.cc')
|
||||
Source('system.cc')
|
||||
|
||||
if not env['FULL_SYSTEM'] and env['TARGET_ISA'] != 'no':
|
||||
if env['TARGET_ISA'] != 'no':
|
||||
Source('tlb.cc')
|
||||
|
||||
DebugFlag('Checkpoint')
|
||||
|
|
|
@ -36,11 +36,12 @@
|
|||
#include "debug/Fault.hh"
|
||||
#include "mem/page_table.hh"
|
||||
#include "sim/faults.hh"
|
||||
#include "sim/full_system.hh"
|
||||
#include "sim/process.hh"
|
||||
|
||||
void FaultBase::invoke(ThreadContext * tc, StaticInstPtr inst)
|
||||
{
|
||||
if (FULL_SYSTEM) {
|
||||
if (FullSystem) {
|
||||
DPRINTF(Fault, "Fault %s at PC: %s\n", name(), tc->pcState());
|
||||
assert(!tc->misspeculating());
|
||||
} else {
|
||||
|
@ -61,11 +62,10 @@ void ReExec::invoke(ThreadContext *tc, StaticInstPtr inst)
|
|||
void GenericPageTableFault::invoke(ThreadContext *tc, StaticInstPtr inst)
|
||||
{
|
||||
bool handled = false;
|
||||
#if !FULL_SYSTEM
|
||||
if (!FullSystem) {
|
||||
Process *p = tc->getProcessPtr();
|
||||
|
||||
handled = p->fixupStackFault(vaddr);
|
||||
#endif
|
||||
}
|
||||
if (!handled)
|
||||
panic("Page table fault when accessing virtual address %#x\n", vaddr);
|
||||
|
||||
|
|
|
@ -570,7 +570,6 @@ LiveProcess::LiveProcess(LiveProcessParams * params, ObjectFile *_objFile)
|
|||
void
|
||||
LiveProcess::syscall(int64_t callnum, ThreadContext *tc)
|
||||
{
|
||||
#if !FULL_SYSTEM
|
||||
num_syscalls++;
|
||||
|
||||
SyscallDesc *desc = getDesc(callnum);
|
||||
|
@ -578,7 +577,6 @@ LiveProcess::syscall(int64_t callnum, ThreadContext *tc)
|
|||
fatal("Syscall %d out of range", callnum);
|
||||
|
||||
desc->doSyscall(callnum, this, tc);
|
||||
#endif
|
||||
}
|
||||
|
||||
IntReg
|
||||
|
@ -604,7 +602,6 @@ LiveProcess::create(LiveProcessParams * params)
|
|||
"executables are supported!\n Please recompile your "
|
||||
"executable as a static binary and try again.\n");
|
||||
|
||||
#if !FULL_SYSTEM
|
||||
#if THE_ISA == ALPHA_ISA
|
||||
if (objFile->getArch() != ObjectFile::Alpha)
|
||||
fatal("Object file architecture does not match compiled ISA (Alpha).");
|
||||
|
@ -714,7 +711,6 @@ LiveProcess::create(LiveProcessParams * params)
|
|||
}
|
||||
#else
|
||||
#error "THE_ISA not set"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (process == NULL)
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
#include "debug/Quiesce.hh"
|
||||
#include "debug/WorkItems.hh"
|
||||
#include "params/BaseCPU.hh"
|
||||
#include "sim/full_system.hh"
|
||||
#include "sim/pseudo_inst.hh"
|
||||
#include "sim/serialize.hh"
|
||||
#include "sim/sim_events.hh"
|
||||
|
@ -76,18 +77,27 @@ using namespace TheISA;
|
|||
|
||||
namespace PseudoInst {
|
||||
|
||||
#if FULL_SYSTEM
|
||||
static inline void
|
||||
panicFsOnlyPseudoInst(const char *name)
|
||||
{
|
||||
panic("Pseudo inst \"%s\" is only available in Full System mode.");
|
||||
}
|
||||
|
||||
void
|
||||
arm(ThreadContext *tc)
|
||||
{
|
||||
if (FullSystem) {
|
||||
if (tc->getKernelStats())
|
||||
tc->getKernelStats()->arm();
|
||||
} else {
|
||||
panicFsOnlyPseudoInst("arm");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
quiesce(ThreadContext *tc)
|
||||
{
|
||||
if (FullSystem) {
|
||||
if (!tc->getCpuPtr()->params()->do_quiesce)
|
||||
return;
|
||||
|
||||
|
@ -96,11 +106,15 @@ quiesce(ThreadContext *tc)
|
|||
tc->suspend();
|
||||
if (tc->getKernelStats())
|
||||
tc->getKernelStats()->quiesce();
|
||||
} else {
|
||||
panicFsOnlyPseudoInst("quiesce");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
quiesceSkip(ThreadContext *tc)
|
||||
{
|
||||
if (FullSystem) {
|
||||
BaseCPU *cpu = tc->getCpuPtr();
|
||||
|
||||
if (!cpu->params()->do_quiesce)
|
||||
|
@ -118,11 +132,15 @@ quiesceSkip(ThreadContext *tc)
|
|||
tc->suspend();
|
||||
if (tc->getKernelStats())
|
||||
tc->getKernelStats()->quiesce();
|
||||
} else {
|
||||
panicFsOnlyPseudoInst("quiesceSkip");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
quiesceNs(ThreadContext *tc, uint64_t ns)
|
||||
{
|
||||
if (FullSystem) {
|
||||
BaseCPU *cpu = tc->getCpuPtr();
|
||||
|
||||
if (!cpu->params()->do_quiesce || ns == 0)
|
||||
|
@ -140,11 +158,15 @@ quiesceNs(ThreadContext *tc, uint64_t ns)
|
|||
tc->suspend();
|
||||
if (tc->getKernelStats())
|
||||
tc->getKernelStats()->quiesce();
|
||||
} else {
|
||||
panicFsOnlyPseudoInst("quiesceNs");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
quiesceCycles(ThreadContext *tc, uint64_t cycles)
|
||||
{
|
||||
if (FullSystem) {
|
||||
BaseCPU *cpu = tc->getCpuPtr();
|
||||
|
||||
if (!cpu->params()->do_quiesce || cycles == 0)
|
||||
|
@ -162,17 +184,23 @@ quiesceCycles(ThreadContext *tc, uint64_t cycles)
|
|||
tc->suspend();
|
||||
if (tc->getKernelStats())
|
||||
tc->getKernelStats()->quiesce();
|
||||
} else {
|
||||
panicFsOnlyPseudoInst("quiesceCycles");
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t
|
||||
quiesceTime(ThreadContext *tc)
|
||||
{
|
||||
if (FullSystem) {
|
||||
return (tc->readLastActivate() - tc->readLastSuspend()) /
|
||||
SimClock::Int::ns;
|
||||
} else {
|
||||
panicFsOnlyPseudoInst("quiesceTime");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
uint64_t
|
||||
rpns(ThreadContext *tc)
|
||||
{
|
||||
|
@ -195,11 +223,10 @@ m5exit(ThreadContext *tc, Tick delay)
|
|||
exitSimLoop("m5_exit instruction encountered", 0, when);
|
||||
}
|
||||
|
||||
#if FULL_SYSTEM
|
||||
|
||||
void
|
||||
loadsymbol(ThreadContext *tc)
|
||||
{
|
||||
if (FullSystem) {
|
||||
const string &filename = tc->getCpuPtr()->system->params()->symbolfile;
|
||||
if (filename.empty()) {
|
||||
return;
|
||||
|
@ -243,11 +270,15 @@ loadsymbol(ThreadContext *tc)
|
|||
DPRINTF(Loader, "Loaded symbol: %s @ %#llx\n", symbol, addr);
|
||||
}
|
||||
file.close();
|
||||
} else {
|
||||
panicFsOnlyPseudoInst("loadsymbol");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
addsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr)
|
||||
{
|
||||
if (FullSystem) {
|
||||
char symb[100];
|
||||
CopyStringOut(tc, symb, symbolAddr, 100);
|
||||
std::string symbol(symb);
|
||||
|
@ -256,16 +287,22 @@ addsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr)
|
|||
|
||||
tc->getSystemPtr()->kernelSymtab->insert(addr,symbol);
|
||||
debugSymbolTable->insert(addr,symbol);
|
||||
} else {
|
||||
panicFsOnlyPseudoInst("addSymbol");
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t
|
||||
initParam(ThreadContext *tc)
|
||||
{
|
||||
if (FullSystem) {
|
||||
return tc->getCpuPtr()->system->init_param;
|
||||
} else {
|
||||
panicFsOnlyPseudoInst("initParam");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
void
|
||||
resetstats(ThreadContext *tc, Tick delay, Tick period)
|
||||
|
@ -318,11 +355,10 @@ m5checkpoint(ThreadContext *tc, Tick delay, Tick period)
|
|||
exitSimLoop("checkpoint", 0, when, repeat);
|
||||
}
|
||||
|
||||
#if FULL_SYSTEM
|
||||
|
||||
uint64_t
|
||||
readfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset)
|
||||
{
|
||||
if (FullSystem) {
|
||||
const string &file = tc->getSystemPtr()->params()->readfile;
|
||||
if (file.empty()) {
|
||||
return ULL(0);
|
||||
|
@ -353,10 +389,12 @@ readfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset)
|
|||
CopyIn(tc, vaddr, buf, result);
|
||||
delete [] buf;
|
||||
return result;
|
||||
} else {
|
||||
panicFsOnlyPseudoInst("readfile");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void
|
||||
debugbreak(ThreadContext *tc)
|
||||
{
|
||||
|
|
|
@ -45,8 +45,6 @@ extern bool doStatisticsInsts;
|
|||
extern bool doCheckpointInsts;
|
||||
extern bool doQuiesce;
|
||||
|
||||
#if FULL_SYSTEM
|
||||
|
||||
void arm(ThreadContext *tc);
|
||||
void quiesce(ThreadContext *tc);
|
||||
void quiesceSkip(ThreadContext *tc);
|
||||
|
@ -58,71 +56,6 @@ uint64_t readfile(ThreadContext *tc, Addr vaddr, uint64_t len,
|
|||
void loadsymbol(ThreadContext *xc);
|
||||
void addsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr);
|
||||
uint64_t initParam(ThreadContext *xc);
|
||||
|
||||
#else
|
||||
|
||||
static inline void
|
||||
panicFsOnlyPseudoInst(const char *name)
|
||||
{
|
||||
panic("Pseudo inst \"%s\" is only available in Full System mode.");
|
||||
}
|
||||
|
||||
static inline void
|
||||
arm(ThreadContext *tc)
|
||||
{
|
||||
panicFsOnlyPseudoInst("arm");
|
||||
}
|
||||
static inline void
|
||||
quiesce(ThreadContext *tc)
|
||||
{
|
||||
panicFsOnlyPseudoInst("quiesce");
|
||||
}
|
||||
static inline void
|
||||
quiesceSkip(ThreadContext *tc)
|
||||
{
|
||||
panicFsOnlyPseudoInst("quiesceSkip");
|
||||
}
|
||||
static inline void
|
||||
quiesceNs(ThreadContext *tc, uint64_t ns)
|
||||
{
|
||||
panicFsOnlyPseudoInst("quiesceNs");
|
||||
}
|
||||
static inline void
|
||||
quiesceCycles(ThreadContext *tc, uint64_t cycles)
|
||||
{
|
||||
panicFsOnlyPseudoInst("quiesceCycles");
|
||||
}
|
||||
static inline uint64_t
|
||||
quiesceTime(ThreadContext *tc)
|
||||
{
|
||||
panicFsOnlyPseudoInst("quiesceTime");
|
||||
return 0;
|
||||
}
|
||||
static inline uint64_t
|
||||
readfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset)
|
||||
{
|
||||
panicFsOnlyPseudoInst("readFile");
|
||||
return 0;
|
||||
}
|
||||
static inline void
|
||||
loadsymbol(ThreadContext *xc)
|
||||
{
|
||||
panicFsOnlyPseudoInst("loadSymbol");
|
||||
}
|
||||
static inline void
|
||||
addsymbol(ThreadContext *tc, Addr addr, Addr symbolAddr)
|
||||
{
|
||||
panicFsOnlyPseudoInst("addSymbol");
|
||||
}
|
||||
static inline uint64_t
|
||||
initParam(ThreadContext *tc)
|
||||
{
|
||||
panicFsOnlyPseudoInst("initParam");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
uint64_t rpns(ThreadContext *tc);
|
||||
void wakeCPU(ThreadContext *tc, uint64_t cpuid);
|
||||
void m5exit(ThreadContext *tc, Tick delay);
|
||||
|
|
|
@ -31,15 +31,16 @@
|
|||
#include "cpu/thread_context.hh"
|
||||
#include "mem/page_table.hh"
|
||||
#include "sim/faults.hh"
|
||||
#include "sim/full_system.hh"
|
||||
#include "sim/process.hh"
|
||||
#include "sim/tlb.hh"
|
||||
|
||||
Fault
|
||||
GenericTLB::translateAtomic(RequestPtr req, ThreadContext *tc, Mode)
|
||||
{
|
||||
#if FULL_SYSTEM
|
||||
if (FullSystem)
|
||||
panic("Generic translation shouldn't be used in full system mode.\n");
|
||||
#else
|
||||
|
||||
Process * p = tc->getProcessPtr();
|
||||
|
||||
Fault fault = p->pTable->translate(req);
|
||||
|
@ -47,7 +48,6 @@ GenericTLB::translateAtomic(RequestPtr req, ThreadContext *tc, Mode)
|
|||
return fault;
|
||||
|
||||
return NoFault;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue