Fix up microcode support.

src/arch/sparc/isa/formats/blockmem.isa:
    Several small and medium bug fixes.
src/cpu/simple/base.cc:
    Fixed a few compiler errors and made sure the next micro pc is set to 1 to prevent the first microop from executing twice. Also fixed a fetching bug.
src/cpu/thread_state.cc:
    Made sure the microPC and nextMicroPC are initialized properly.

--HG--
extra : convert_revision : a0fc8aa18d1ade916f17c557181a793c6108a8af
This commit is contained in:
Gabe Black
2006-10-16 15:56:46 -04:00
parent 7fefa2a621
commit f1661baf30
3 changed files with 54 additions and 62 deletions

View File

@@ -402,10 +402,12 @@ BaseSimpleCPU::preExecute()
if (instPtr->isMacroOp()) {
curMacroStaticInst = instPtr;
curStaticInst = curMacroStaticInst->fetchMicroOp(0);
} else {
curStaticInst = instPtr;
}
} else {
//Read the next micro op from the macro op
curStaticInst = curMacroStaticInst->fetchMicroOp(thread->readMicroPc());
curStaticInst = curMacroStaticInst->fetchMicroOp(thread->readMicroPC());
}
@@ -464,17 +466,17 @@ BaseSimpleCPU::advancePC(Fault fault)
assert(curMacroStaticInst);
//Close out this macro op, and clean up the
//microcode state
curMacroStaticInst = nullStaticInst;
curMacroStaticInst = StaticInst::nullStaticInstPtr;
thread->setMicroPC(0);
thread->setNextMicroPC(0);
thread->setNextMicroPC(1);
}
//If we're still in a macro op
if (curMacroStaticInst) {
//Advance the micro pc
thread->setMicroPC(thread->getNextMicroPC());
thread->setMicroPC(thread->readNextMicroPC());
//Advance the "next" micro pc. Note that there are no delay
//slots, and micro ops are "word" addressed.
thread->setNextMicroPC(thread->getNextMicroPC() + 1);
thread->setNextMicroPC(thread->readNextMicroPC() + 1);
} else {
// go to the next instruction
thread->setPC(thread->readNextPC());