base.cc (3276:dc3cd126b479) base.cc (3280:91bfa4f79c53)
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 388 unchanged lines hidden (view full) ---

397 // decode the instruction
398 inst = gtoh(inst);
399 //If we're not in the middle of a macro instruction
400 if (!curMacroStaticInst) {
401 StaticInstPtr instPtr = StaticInst::decode(makeExtMI(inst, thread->getTC()));
402 if (instPtr->isMacroOp()) {
403 curMacroStaticInst = instPtr;
404 curStaticInst = curMacroStaticInst->fetchMicroOp(0);
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 388 unchanged lines hidden (view full) ---

397 // decode the instruction
398 inst = gtoh(inst);
399 //If we're not in the middle of a macro instruction
400 if (!curMacroStaticInst) {
401 StaticInstPtr instPtr = StaticInst::decode(makeExtMI(inst, thread->getTC()));
402 if (instPtr->isMacroOp()) {
403 curMacroStaticInst = instPtr;
404 curStaticInst = curMacroStaticInst->fetchMicroOp(0);
405 } else {
406 curStaticInst = instPtr;
405 }
406 } else {
407 //Read the next micro op from the macro op
407 }
408 } else {
409 //Read the next micro op from the macro op
408 curStaticInst = curMacroStaticInst->fetchMicroOp(thread->readMicroPc());
410 curStaticInst = curMacroStaticInst->fetchMicroOp(thread->readMicroPC());
409 }
410
411
412 traceData = Trace::getInstRecord(curTick, tc, curStaticInst,
413 thread->readPC());
414
415 DPRINTF(Decode,"Decode: Decoded %s instruction (opcode: 0x%x): 0x%x\n",
416 curStaticInst->getName(), curStaticInst->getOpcode(),

--- 42 unchanged lines hidden (view full) ---

459 fault->invoke(tc);
460 } else {
461 //If we're at the last micro op for this instruction
462 if (curStaticInst->isLastMicroOp()) {
463 //We should be working with a macro op
464 assert(curMacroStaticInst);
465 //Close out this macro op, and clean up the
466 //microcode state
411 }
412
413
414 traceData = Trace::getInstRecord(curTick, tc, curStaticInst,
415 thread->readPC());
416
417 DPRINTF(Decode,"Decode: Decoded %s instruction (opcode: 0x%x): 0x%x\n",
418 curStaticInst->getName(), curStaticInst->getOpcode(),

--- 42 unchanged lines hidden (view full) ---

461 fault->invoke(tc);
462 } else {
463 //If we're at the last micro op for this instruction
464 if (curStaticInst->isLastMicroOp()) {
465 //We should be working with a macro op
466 assert(curMacroStaticInst);
467 //Close out this macro op, and clean up the
468 //microcode state
467 curMacroStaticInst = nullStaticInst;
469 curMacroStaticInst = StaticInst::nullStaticInstPtr;
468 thread->setMicroPC(0);
470 thread->setMicroPC(0);
469 thread->setNextMicroPC(0);
471 thread->setNextMicroPC(1);
470 }
471 //If we're still in a macro op
472 if (curMacroStaticInst) {
473 //Advance the micro pc
472 }
473 //If we're still in a macro op
474 if (curMacroStaticInst) {
475 //Advance the micro pc
474 thread->setMicroPC(thread->getNextMicroPC());
476 thread->setMicroPC(thread->readNextMicroPC());
475 //Advance the "next" micro pc. Note that there are no delay
476 //slots, and micro ops are "word" addressed.
477 //Advance the "next" micro pc. Note that there are no delay
478 //slots, and micro ops are "word" addressed.
477 thread->setNextMicroPC(thread->getNextMicroPC() + 1);
479 thread->setNextMicroPC(thread->readNextMicroPC() + 1);
478 } else {
479 // go to the next instruction
480 thread->setPC(thread->readNextPC());
481#if ISA_HAS_DELAY_SLOT
482 thread->setNextPC(thread->readNextNPC());
483 thread->setNextNPC(thread->readNextNPC() + sizeof(MachInst));
484 assert(thread->readNextPC() != thread->readNextNPC());
485#else

--- 14 unchanged lines hidden ---
480 } else {
481 // go to the next instruction
482 thread->setPC(thread->readNextPC());
483#if ISA_HAS_DELAY_SLOT
484 thread->setNextPC(thread->readNextNPC());
485 thread->setNextNPC(thread->readNextNPC() + sizeof(MachInst));
486 assert(thread->readNextPC() != thread->readNextNPC());
487#else

--- 14 unchanged lines hidden ---