Changed makeExtMI to take a ThreadContext instead of a pc.
--HG-- extra : convert_revision : e5b200e4e053702fc703f44149d18ce48ac4eaa6
This commit is contained in:
parent
51425382ca
commit
76708a9a6c
6 changed files with 12 additions and 10 deletions
|
@ -37,16 +37,17 @@
|
|||
#include "arch/alpha/isa_traits.hh"
|
||||
#include "arch/alpha/regfile.hh"
|
||||
#include "base/misc.hh"
|
||||
#include "cpu/thread_context.hh"
|
||||
|
||||
namespace AlphaISA
|
||||
{
|
||||
|
||||
static inline ExtMachInst
|
||||
makeExtMI(MachInst inst, const uint64_t &pc) {
|
||||
makeExtMI(MachInst inst, ThreadContext * xc) {
|
||||
#if FULL_SYSTEM
|
||||
ExtMachInst ext_inst = inst;
|
||||
if (pc && 0x1)
|
||||
return ext_inst|=(static_cast<ExtMachInst>(pc & 0x1) << 32);
|
||||
if (xc->readPC() && 0x1)
|
||||
return ext_inst|=(static_cast<ExtMachInst>(xc->readPC() & 0x1) << 32);
|
||||
else
|
||||
return ext_inst;
|
||||
#else
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "arch/mips/types.hh"
|
||||
#include "base/misc.hh"
|
||||
#include "config/full_system.hh"
|
||||
#include "cpu/thread_context.hh"
|
||||
//XXX This is needed for size_t. We should use something other than size_t
|
||||
//#include "kern/linux/linux.hh"
|
||||
#include "sim/host.hh"
|
||||
|
@ -86,11 +87,11 @@ namespace MipsISA {
|
|||
}
|
||||
|
||||
static inline ExtMachInst
|
||||
makeExtMI(MachInst inst, const uint64_t &pc) {
|
||||
makeExtMI(MachInst inst, ThreadContext * xc) {
|
||||
#if FULL_SYSTEM
|
||||
ExtMachInst ext_inst = inst;
|
||||
if (pc && 0x1)
|
||||
return ext_inst|=(static_cast<ExtMachInst>(pc & 0x1) << 32);
|
||||
if (xc->readPC() && 0x1)
|
||||
return ext_inst|=(static_cast<ExtMachInst>(xc->readPC() & 0x1) << 32);
|
||||
else
|
||||
return ext_inst;
|
||||
#else
|
||||
|
|
|
@ -200,7 +200,7 @@ Checker<DynInstPtr>::verify(DynInstPtr &completed_inst)
|
|||
validateInst(inst);
|
||||
|
||||
curStaticInst = StaticInst::decode(makeExtMI(machInst,
|
||||
thread->readPC()));
|
||||
thread->getTC()));
|
||||
|
||||
#if FULL_SYSTEM
|
||||
thread->setInst(machInst);
|
||||
|
|
|
@ -1109,7 +1109,7 @@ DefaultFetch<Impl>::fetch(bool &status_change)
|
|||
inst = TheISA::gtoh(*reinterpret_cast<TheISA::MachInst *>
|
||||
(&cacheData[tid][offset]));
|
||||
|
||||
ext_inst = TheISA::makeExtMI(inst, fetch_PC);
|
||||
ext_inst = TheISA::makeExtMI(inst, cpu->tcBase(tid));
|
||||
|
||||
// Create a new DynInst from the instruction fetched.
|
||||
DynInstPtr instruction = new DynInst(ext_inst, fetch_PC,
|
||||
|
|
|
@ -842,7 +842,7 @@ FrontEnd<Impl>::getInstFromCacheline()
|
|||
// Get the instruction from the array of the cache line.
|
||||
inst = htog(*reinterpret_cast<MachInst *>(&cacheData[offset]));
|
||||
|
||||
ExtMachInst decode_inst = TheISA::makeExtMI(inst, PC);
|
||||
ExtMachInst decode_inst = TheISA::makeExtMI(inst, tc);
|
||||
|
||||
// Create a new DynInst from the instruction fetched.
|
||||
DynInstPtr instruction = new DynInst(decode_inst, PC, PC+sizeof(MachInst),
|
||||
|
|
|
@ -396,7 +396,7 @@ BaseSimpleCPU::preExecute()
|
|||
|
||||
// decode the instruction
|
||||
inst = gtoh(inst);
|
||||
curStaticInst = StaticInst::decode(makeExtMI(inst, thread->readPC()));
|
||||
curStaticInst = StaticInst::decode(makeExtMI(inst, thread->getTC()));
|
||||
|
||||
traceData = Trace::getInstRecord(curTick, tc, curStaticInst,
|
||||
thread->readPC());
|
||||
|
|
Loading…
Reference in a new issue