Changed makeExtMI to take a ThreadContext instead of a pc.

--HG--
extra : convert_revision : e5b200e4e053702fc703f44149d18ce48ac4eaa6
This commit is contained in:
Gabe Black 2006-09-30 02:55:21 -04:00
parent 51425382ca
commit 76708a9a6c
6 changed files with 12 additions and 10 deletions

View file

@ -37,16 +37,17 @@
#include "arch/alpha/isa_traits.hh" #include "arch/alpha/isa_traits.hh"
#include "arch/alpha/regfile.hh" #include "arch/alpha/regfile.hh"
#include "base/misc.hh" #include "base/misc.hh"
#include "cpu/thread_context.hh"
namespace AlphaISA namespace AlphaISA
{ {
static inline ExtMachInst static inline ExtMachInst
makeExtMI(MachInst inst, const uint64_t &pc) { makeExtMI(MachInst inst, ThreadContext * xc) {
#if FULL_SYSTEM #if FULL_SYSTEM
ExtMachInst ext_inst = inst; ExtMachInst ext_inst = inst;
if (pc && 0x1) if (xc->readPC() && 0x1)
return ext_inst|=(static_cast<ExtMachInst>(pc & 0x1) << 32); return ext_inst|=(static_cast<ExtMachInst>(xc->readPC() & 0x1) << 32);
else else
return ext_inst; return ext_inst;
#else #else

View file

@ -35,6 +35,7 @@
#include "arch/mips/types.hh" #include "arch/mips/types.hh"
#include "base/misc.hh" #include "base/misc.hh"
#include "config/full_system.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 //XXX This is needed for size_t. We should use something other than size_t
//#include "kern/linux/linux.hh" //#include "kern/linux/linux.hh"
#include "sim/host.hh" #include "sim/host.hh"
@ -86,11 +87,11 @@ namespace MipsISA {
} }
static inline ExtMachInst static inline ExtMachInst
makeExtMI(MachInst inst, const uint64_t &pc) { makeExtMI(MachInst inst, ThreadContext * xc) {
#if FULL_SYSTEM #if FULL_SYSTEM
ExtMachInst ext_inst = inst; ExtMachInst ext_inst = inst;
if (pc && 0x1) if (xc->readPC() && 0x1)
return ext_inst|=(static_cast<ExtMachInst>(pc & 0x1) << 32); return ext_inst|=(static_cast<ExtMachInst>(xc->readPC() & 0x1) << 32);
else else
return ext_inst; return ext_inst;
#else #else

View file

@ -200,7 +200,7 @@ Checker<DynInstPtr>::verify(DynInstPtr &completed_inst)
validateInst(inst); validateInst(inst);
curStaticInst = StaticInst::decode(makeExtMI(machInst, curStaticInst = StaticInst::decode(makeExtMI(machInst,
thread->readPC())); thread->getTC()));
#if FULL_SYSTEM #if FULL_SYSTEM
thread->setInst(machInst); thread->setInst(machInst);

View file

@ -1109,7 +1109,7 @@ DefaultFetch<Impl>::fetch(bool &status_change)
inst = TheISA::gtoh(*reinterpret_cast<TheISA::MachInst *> inst = TheISA::gtoh(*reinterpret_cast<TheISA::MachInst *>
(&cacheData[tid][offset])); (&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. // Create a new DynInst from the instruction fetched.
DynInstPtr instruction = new DynInst(ext_inst, fetch_PC, DynInstPtr instruction = new DynInst(ext_inst, fetch_PC,

View file

@ -842,7 +842,7 @@ FrontEnd<Impl>::getInstFromCacheline()
// Get the instruction from the array of the cache line. // Get the instruction from the array of the cache line.
inst = htog(*reinterpret_cast<MachInst *>(&cacheData[offset])); 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. // Create a new DynInst from the instruction fetched.
DynInstPtr instruction = new DynInst(decode_inst, PC, PC+sizeof(MachInst), DynInstPtr instruction = new DynInst(decode_inst, PC, PC+sizeof(MachInst),

View file

@ -396,7 +396,7 @@ BaseSimpleCPU::preExecute()
// decode the instruction // decode the instruction
inst = gtoh(inst); inst = gtoh(inst);
curStaticInst = StaticInst::decode(makeExtMI(inst, thread->readPC())); curStaticInst = StaticInst::decode(makeExtMI(inst, thread->getTC()));
traceData = Trace::getInstRecord(curTick, tc, curStaticInst, traceData = Trace::getInstRecord(curTick, tc, curStaticInst,
thread->readPC()); thread->readPC());