base.cc (4156:a4667c990e12) base.cc (4181:6edaeff44647)
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;

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

362
363 // check for instruction-count-based events
364 comInstEventQueue[0]->serviceEvents(numInst);
365
366 // decode the instruction
367 inst = gtoh(inst);
368 //If we're not in the middle of a macro instruction
369 if (!curMacroStaticInst) {
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;

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

362
363 // check for instruction-count-based events
364 comInstEventQueue[0]->serviceEvents(numInst);
365
366 // decode the instruction
367 inst = gtoh(inst);
368 //If we're not in the middle of a macro instruction
369 if (!curMacroStaticInst) {
370#if THE_ISA == ALPHA_ISA
371 StaticInstPtr instPtr = StaticInst::decode(makeExtMI(inst, thread->readPC()));
372#elif THE_ISA == SPARC_ISA
373 StaticInstPtr instPtr = StaticInst::decode(makeExtMI(inst, thread->getTC()));
374#elif THE_ISA == X86_ISA
375 StaticInstPtr instPtr = StaticInst::decode(makeExtMI(inst, thread->getTC()));
376#elif THE_ISA == MIPS_ISA
377 //Mips doesn't do anything in it's MakeExtMI function right now,
378 //so it won't be called.
379 StaticInstPtr instPtr = StaticInst::decode(inst);
380#endif
381 if (instPtr->isMacroOp()) {
370 StaticInstPtr instPtr = NULL;
371
372 //Predecode, ie bundle up an ExtMachInst
373 unsigned int result =
374 predecode(extMachInst, thread->readPC(), inst, thread->getTC());
375 //If an instruction is ready, decode it
376 if (result & ExtMIReady)
377 instPtr = StaticInst::decode(extMachInst);
378
379 //If we decoded an instruction and it's microcoded, start pulling
380 //out micro ops
381 if (instPtr && instPtr->isMacroOp()) {
382 curMacroStaticInst = instPtr;
383 curStaticInst = curMacroStaticInst->
384 fetchMicroOp(thread->readMicroPC());
385 } else {
386 curStaticInst = instPtr;
387 }
388 } else {
389 //Read the next micro op from the macro op
390 curStaticInst = curMacroStaticInst->
391 fetchMicroOp(thread->readMicroPC());
392 }
393
382 curMacroStaticInst = instPtr;
383 curStaticInst = curMacroStaticInst->
384 fetchMicroOp(thread->readMicroPC());
385 } else {
386 curStaticInst = instPtr;
387 }
388 } else {
389 //Read the next micro op from the macro op
390 curStaticInst = curMacroStaticInst->
391 fetchMicroOp(thread->readMicroPC());
392 }
393
394 //If we decoded an instruction this "tick", record information about it.
395 if(curStaticInst)
396 {
397 traceData = Trace::getInstRecord(curTick, tc, curStaticInst,
398 thread->readPC());
394
399
395 traceData = Trace::getInstRecord(curTick, tc, curStaticInst,
396 thread->readPC());
400 DPRINTF(Decode,"Decode: Decoded %s instruction: 0x%x\n",
401 curStaticInst->getName(), curStaticInst->machInst);
397
402
398 DPRINTF(Decode,"Decode: Decoded %s instruction (opcode: 0x%x): 0x%x\n",
399 curStaticInst->getName(), curStaticInst->getOpcode(),
400 curStaticInst->machInst);
401
402#if FULL_SYSTEM
403#if FULL_SYSTEM
403 thread->setInst(inst);
404 thread->setInst(inst);
404#endif // FULL_SYSTEM
405#endif // FULL_SYSTEM
406 }
405}
406
407void
408BaseSimpleCPU::postExecute()
409{
410#if FULL_SYSTEM
411 if (thread->profile) {
412 bool usermode = TheISA::inUserMode(tc);

--- 74 unchanged lines hidden ---
407}
408
409void
410BaseSimpleCPU::postExecute()
411{
412#if FULL_SYSTEM
413 if (thread->profile) {
414 bool usermode = TheISA::inUserMode(tc);

--- 74 unchanged lines hidden ---