Get rid of the ParamContext for pseudo instructions and move
the parameters to the BaseCPU object. --HG-- extra : convert_revision : 557292cffb40918133647b0c9ac653ee5112df2e
This commit is contained in:
parent
cc77304676
commit
b16e559177
|
@ -155,6 +155,10 @@ class BaseCPU : public MemObject
|
||||||
int cpu_id;
|
int cpu_id;
|
||||||
#if FULL_SYSTEM
|
#if FULL_SYSTEM
|
||||||
Tick profile;
|
Tick profile;
|
||||||
|
|
||||||
|
bool do_statistics_insts;
|
||||||
|
bool do_checkpoint_insts;
|
||||||
|
bool do_quiesce;
|
||||||
#endif
|
#endif
|
||||||
Tick progress_interval;
|
Tick progress_interval;
|
||||||
BaseCPU *checker;
|
BaseCPU *checker;
|
||||||
|
|
|
@ -57,6 +57,10 @@ Param<int> cpu_id;
|
||||||
SimObjectParam<AlphaISA::ITB *> itb;
|
SimObjectParam<AlphaISA::ITB *> itb;
|
||||||
SimObjectParam<AlphaISA::DTB *> dtb;
|
SimObjectParam<AlphaISA::DTB *> dtb;
|
||||||
Param<Tick> profile;
|
Param<Tick> profile;
|
||||||
|
|
||||||
|
Param<bool> do_quiesce;
|
||||||
|
Param<bool> do_checkpoint_insts;
|
||||||
|
Param<bool> do_statistics_insts;
|
||||||
#else
|
#else
|
||||||
SimObjectVectorParam<Process *> workload;
|
SimObjectVectorParam<Process *> workload;
|
||||||
#endif // FULL_SYSTEM
|
#endif // FULL_SYSTEM
|
||||||
|
@ -163,6 +167,10 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(DerivO3CPU)
|
||||||
INIT_PARAM(itb, "Instruction translation buffer"),
|
INIT_PARAM(itb, "Instruction translation buffer"),
|
||||||
INIT_PARAM(dtb, "Data translation buffer"),
|
INIT_PARAM(dtb, "Data translation buffer"),
|
||||||
INIT_PARAM(profile, ""),
|
INIT_PARAM(profile, ""),
|
||||||
|
|
||||||
|
INIT_PARAM(do_quiesce, ""),
|
||||||
|
INIT_PARAM(do_checkpoint_insts, ""),
|
||||||
|
INIT_PARAM(do_statistics_insts, ""),
|
||||||
#else
|
#else
|
||||||
INIT_PARAM(workload, "Processes to run"),
|
INIT_PARAM(workload, "Processes to run"),
|
||||||
#endif // FULL_SYSTEM
|
#endif // FULL_SYSTEM
|
||||||
|
@ -306,6 +314,10 @@ CREATE_SIM_OBJECT(DerivO3CPU)
|
||||||
params->itb = itb;
|
params->itb = itb;
|
||||||
params->dtb = dtb;
|
params->dtb = dtb;
|
||||||
params->profile = profile;
|
params->profile = profile;
|
||||||
|
|
||||||
|
params->do_quiesce = do_quiesce;
|
||||||
|
params->do_checkpoint_insts = do_checkpoint_insts;
|
||||||
|
params->do_statistics_insts = do_statistics_insts;
|
||||||
#else
|
#else
|
||||||
params->workload = workload;
|
params->workload = workload;
|
||||||
#endif // FULL_SYSTEM
|
#endif // FULL_SYSTEM
|
||||||
|
|
|
@ -64,6 +64,10 @@ Param<int> cpu_id;
|
||||||
SimObjectParam<TheISA::ITB *> itb;
|
SimObjectParam<TheISA::ITB *> itb;
|
||||||
SimObjectParam<TheISA::DTB *> dtb;
|
SimObjectParam<TheISA::DTB *> dtb;
|
||||||
Param<Tick> profile;
|
Param<Tick> profile;
|
||||||
|
|
||||||
|
Param<bool> do_quiesce;
|
||||||
|
Param<bool> do_checkpoint_insts;
|
||||||
|
Param<bool> do_statistics_insts
|
||||||
#else
|
#else
|
||||||
SimObjectVectorParam<Process *> workload;
|
SimObjectVectorParam<Process *> workload;
|
||||||
//SimObjectParam<PageTable *> page_table;
|
//SimObjectParam<PageTable *> page_table;
|
||||||
|
@ -184,6 +188,9 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(DerivOzoneCPU)
|
||||||
INIT_PARAM(itb, "Instruction translation buffer"),
|
INIT_PARAM(itb, "Instruction translation buffer"),
|
||||||
INIT_PARAM(dtb, "Data translation buffer"),
|
INIT_PARAM(dtb, "Data translation buffer"),
|
||||||
INIT_PARAM(profile, ""),
|
INIT_PARAM(profile, ""),
|
||||||
|
INIT_PARAM(do_quiesce, ""),
|
||||||
|
INIT_PARAM(do_checkpoint_insts, ""),
|
||||||
|
INIT_PARAM(do_statistics_insts, ""),
|
||||||
#else
|
#else
|
||||||
INIT_PARAM(workload, "Processes to run"),
|
INIT_PARAM(workload, "Processes to run"),
|
||||||
// INIT_PARAM(page_table, "Page table"),
|
// INIT_PARAM(page_table, "Page table"),
|
||||||
|
@ -341,6 +348,9 @@ CREATE_SIM_OBJECT(DerivOzoneCPU)
|
||||||
params->itb = itb;
|
params->itb = itb;
|
||||||
params->dtb = dtb;
|
params->dtb = dtb;
|
||||||
params->profile = profile;
|
params->profile = profile;
|
||||||
|
params->do_quiesce = do_quiesce;
|
||||||
|
params->do_checkpoint_insts = do_checkpoint_insts;
|
||||||
|
params->do_statistics_insts = do_statistics_insts;
|
||||||
#else
|
#else
|
||||||
params->workload = workload;
|
params->workload = workload;
|
||||||
// params->pTable = page_table;
|
// params->pTable = page_table;
|
||||||
|
|
|
@ -500,6 +500,10 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(AtomicSimpleCPU)
|
||||||
SimObjectParam<TheISA::ITB *> itb;
|
SimObjectParam<TheISA::ITB *> itb;
|
||||||
SimObjectParam<TheISA::DTB *> dtb;
|
SimObjectParam<TheISA::DTB *> dtb;
|
||||||
Param<Tick> profile;
|
Param<Tick> profile;
|
||||||
|
|
||||||
|
Param<bool> do_quiesce;
|
||||||
|
Param<bool> do_checkpoint_insts;
|
||||||
|
Param<bool> do_statistics_insts;
|
||||||
#else
|
#else
|
||||||
SimObjectParam<Process *> workload;
|
SimObjectParam<Process *> workload;
|
||||||
#endif // FULL_SYSTEM
|
#endif // FULL_SYSTEM
|
||||||
|
@ -532,6 +536,9 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(AtomicSimpleCPU)
|
||||||
INIT_PARAM(itb, "Instruction TLB"),
|
INIT_PARAM(itb, "Instruction TLB"),
|
||||||
INIT_PARAM(dtb, "Data TLB"),
|
INIT_PARAM(dtb, "Data TLB"),
|
||||||
INIT_PARAM(profile, ""),
|
INIT_PARAM(profile, ""),
|
||||||
|
INIT_PARAM(do_quiesce, ""),
|
||||||
|
INIT_PARAM(do_checkpoint_insts, ""),
|
||||||
|
INIT_PARAM(do_statistics_insts, ""),
|
||||||
#else
|
#else
|
||||||
INIT_PARAM(workload, "processes to run"),
|
INIT_PARAM(workload, "processes to run"),
|
||||||
#endif // FULL_SYSTEM
|
#endif // FULL_SYSTEM
|
||||||
|
@ -569,6 +576,9 @@ CREATE_SIM_OBJECT(AtomicSimpleCPU)
|
||||||
params->itb = itb;
|
params->itb = itb;
|
||||||
params->dtb = dtb;
|
params->dtb = dtb;
|
||||||
params->profile = profile;
|
params->profile = profile;
|
||||||
|
params->do_quiesce = do_quiesce;
|
||||||
|
params->do_checkpoint_insts = do_checkpoint_insts;
|
||||||
|
params->do_statistics_insts = do_statistics_insts;
|
||||||
#else
|
#else
|
||||||
params->process = workload;
|
params->process = workload;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -665,6 +665,10 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(TimingSimpleCPU)
|
||||||
SimObjectParam<TheISA::ITB *> itb;
|
SimObjectParam<TheISA::ITB *> itb;
|
||||||
SimObjectParam<TheISA::DTB *> dtb;
|
SimObjectParam<TheISA::DTB *> dtb;
|
||||||
Param<Tick> profile;
|
Param<Tick> profile;
|
||||||
|
|
||||||
|
Param<bool> do_quiesce;
|
||||||
|
Param<bool> do_checkpoint_insts;
|
||||||
|
Param<bool> do_statistics_insts;
|
||||||
#else
|
#else
|
||||||
SimObjectParam<Process *> workload;
|
SimObjectParam<Process *> workload;
|
||||||
#endif // FULL_SYSTEM
|
#endif // FULL_SYSTEM
|
||||||
|
@ -697,6 +701,9 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(TimingSimpleCPU)
|
||||||
INIT_PARAM(itb, "Instruction TLB"),
|
INIT_PARAM(itb, "Instruction TLB"),
|
||||||
INIT_PARAM(dtb, "Data TLB"),
|
INIT_PARAM(dtb, "Data TLB"),
|
||||||
INIT_PARAM(profile, ""),
|
INIT_PARAM(profile, ""),
|
||||||
|
INIT_PARAM(do_quiesce, ""),
|
||||||
|
INIT_PARAM(do_checkpoint_insts, ""),
|
||||||
|
INIT_PARAM(do_statistics_insts, ""),
|
||||||
#else
|
#else
|
||||||
INIT_PARAM(workload, "processes to run"),
|
INIT_PARAM(workload, "processes to run"),
|
||||||
#endif // FULL_SYSTEM
|
#endif // FULL_SYSTEM
|
||||||
|
@ -732,6 +739,9 @@ CREATE_SIM_OBJECT(TimingSimpleCPU)
|
||||||
params->itb = itb;
|
params->itb = itb;
|
||||||
params->dtb = dtb;
|
params->dtb = dtb;
|
||||||
params->profile = profile;
|
params->profile = profile;
|
||||||
|
params->do_quiesce = do_quiesce;
|
||||||
|
params->do_checkpoint_insts = do_checkpoint_insts;
|
||||||
|
params->do_statistics_insts = do_statistics_insts;
|
||||||
#else
|
#else
|
||||||
params->process = workload;
|
params->process = workload;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -15,6 +15,12 @@ class BaseCPU(SimObject):
|
||||||
cpu_id = Param.Int("CPU identifier")
|
cpu_id = Param.Int("CPU identifier")
|
||||||
|
|
||||||
if build_env['FULL_SYSTEM']:
|
if build_env['FULL_SYSTEM']:
|
||||||
|
do_qiesce = Param.Bool(True, "enable quiesce instructions")
|
||||||
|
do_checkpoint_insts = Param.Bool(True,
|
||||||
|
"enable checkpoint pseudo instructions")
|
||||||
|
do_statistics_insts = Param.Bool(True,
|
||||||
|
"enable statistics pseudo instructions")
|
||||||
|
|
||||||
if build_env['TARGET_ISA'] == 'sparc':
|
if build_env['TARGET_ISA'] == 'sparc':
|
||||||
dtb = Param.SparcDTB(SparcDTB(), "Data TLB")
|
dtb = Param.SparcDTB(SparcDTB(), "Data TLB")
|
||||||
itb = Param.SparcITB(SparcITB(), "Instruction TLB")
|
itb = Param.SparcITB(SparcITB(), "Instruction TLB")
|
||||||
|
|
|
@ -40,7 +40,6 @@
|
||||||
#include "cpu/thread_context.hh"
|
#include "cpu/thread_context.hh"
|
||||||
#include "cpu/quiesce_event.hh"
|
#include "cpu/quiesce_event.hh"
|
||||||
#include "arch/kernel_stats.hh"
|
#include "arch/kernel_stats.hh"
|
||||||
#include "sim/param.hh"
|
|
||||||
#include "sim/pseudo_inst.hh"
|
#include "sim/pseudo_inst.hh"
|
||||||
#include "sim/serialize.hh"
|
#include "sim/serialize.hh"
|
||||||
#include "sim/sim_exit.hh"
|
#include "sim/sim_exit.hh"
|
||||||
|
@ -57,10 +56,6 @@ using namespace TheISA;
|
||||||
|
|
||||||
namespace AlphaPseudo
|
namespace AlphaPseudo
|
||||||
{
|
{
|
||||||
bool doStatisticsInsts;
|
|
||||||
bool doCheckpointInsts;
|
|
||||||
bool doQuiesce;
|
|
||||||
|
|
||||||
void
|
void
|
||||||
arm(ThreadContext *tc)
|
arm(ThreadContext *tc)
|
||||||
{
|
{
|
||||||
|
@ -71,7 +66,7 @@ namespace AlphaPseudo
|
||||||
void
|
void
|
||||||
quiesce(ThreadContext *tc)
|
quiesce(ThreadContext *tc)
|
||||||
{
|
{
|
||||||
if (!doQuiesce)
|
if (!tc->getCpuPtr()->params->do_quiesce)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DPRINTF(Quiesce, "%s: quiesce()\n", tc->getCpuPtr()->name());
|
DPRINTF(Quiesce, "%s: quiesce()\n", tc->getCpuPtr()->name());
|
||||||
|
@ -84,7 +79,7 @@ namespace AlphaPseudo
|
||||||
void
|
void
|
||||||
quiesceNs(ThreadContext *tc, uint64_t ns)
|
quiesceNs(ThreadContext *tc, uint64_t ns)
|
||||||
{
|
{
|
||||||
if (!doQuiesce || ns == 0)
|
if (!tc->getCpuPtr()->params->do_quiesce || ns == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
EndQuiesceEvent *quiesceEvent = tc->getQuiesceEvent();
|
EndQuiesceEvent *quiesceEvent = tc->getQuiesceEvent();
|
||||||
|
@ -107,7 +102,7 @@ namespace AlphaPseudo
|
||||||
void
|
void
|
||||||
quiesceCycles(ThreadContext *tc, uint64_t cycles)
|
quiesceCycles(ThreadContext *tc, uint64_t cycles)
|
||||||
{
|
{
|
||||||
if (!doQuiesce || cycles == 0)
|
if (!tc->getCpuPtr()->params->do_quiesce || cycles == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
EndQuiesceEvent *quiesceEvent = tc->getQuiesceEvent();
|
EndQuiesceEvent *quiesceEvent = tc->getQuiesceEvent();
|
||||||
|
@ -197,7 +192,7 @@ namespace AlphaPseudo
|
||||||
void
|
void
|
||||||
resetstats(ThreadContext *tc, Tick delay, Tick period)
|
resetstats(ThreadContext *tc, Tick delay, Tick period)
|
||||||
{
|
{
|
||||||
if (!doStatisticsInsts)
|
if (!tc->getCpuPtr()->params->do_statistics_insts)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
@ -211,7 +206,7 @@ namespace AlphaPseudo
|
||||||
void
|
void
|
||||||
dumpstats(ThreadContext *tc, Tick delay, Tick period)
|
dumpstats(ThreadContext *tc, Tick delay, Tick period)
|
||||||
{
|
{
|
||||||
if (!doStatisticsInsts)
|
if (!tc->getCpuPtr()->params->do_statistics_insts)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
@ -252,7 +247,7 @@ namespace AlphaPseudo
|
||||||
void
|
void
|
||||||
dumpresetstats(ThreadContext *tc, Tick delay, Tick period)
|
dumpresetstats(ThreadContext *tc, Tick delay, Tick period)
|
||||||
{
|
{
|
||||||
if (!doStatisticsInsts)
|
if (!tc->getCpuPtr()->params->do_statistics_insts)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
@ -266,7 +261,7 @@ namespace AlphaPseudo
|
||||||
void
|
void
|
||||||
m5checkpoint(ThreadContext *tc, Tick delay, Tick period)
|
m5checkpoint(ThreadContext *tc, Tick delay, Tick period)
|
||||||
{
|
{
|
||||||
if (!doCheckpointInsts)
|
if (!tc->getCpuPtr()->params->do_checkpoint_insts)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Tick when = curTick + delay * Clock::Int::ns;
|
Tick when = curTick + delay * Clock::Int::ns;
|
||||||
|
@ -278,7 +273,7 @@ namespace AlphaPseudo
|
||||||
uint64_t
|
uint64_t
|
||||||
readfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset)
|
readfile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset)
|
||||||
{
|
{
|
||||||
const string &file = tc->getCpuPtr()->system->params()->readfile;
|
const string &file = tc->getSystemPtr()->params()->readfile;
|
||||||
if (file.empty()) {
|
if (file.empty()) {
|
||||||
return ULL(0);
|
return ULL(0);
|
||||||
}
|
}
|
||||||
|
@ -310,33 +305,6 @@ namespace AlphaPseudo
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Context : public ParamContext
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Context(const string §ion) : ParamContext(section) {}
|
|
||||||
void checkParams();
|
|
||||||
};
|
|
||||||
|
|
||||||
Context context("pseudo_inst");
|
|
||||||
|
|
||||||
Param<bool> __quiesce(&context, "quiesce",
|
|
||||||
"enable quiesce instructions",
|
|
||||||
true);
|
|
||||||
Param<bool> __statistics(&context, "statistics",
|
|
||||||
"enable statistics pseudo instructions",
|
|
||||||
true);
|
|
||||||
Param<bool> __checkpoint(&context, "checkpoint",
|
|
||||||
"enable checkpoint pseudo instructions",
|
|
||||||
true);
|
|
||||||
|
|
||||||
void
|
|
||||||
Context::checkParams()
|
|
||||||
{
|
|
||||||
doQuiesce = __quiesce;
|
|
||||||
doStatisticsInsts = __statistics;
|
|
||||||
doCheckpointInsts = __checkpoint;
|
|
||||||
}
|
|
||||||
|
|
||||||
void debugbreak(ThreadContext *tc)
|
void debugbreak(ThreadContext *tc)
|
||||||
{
|
{
|
||||||
debug_break();
|
debug_break();
|
||||||
|
|
Loading…
Reference in a new issue