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 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 |
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()); |
399 |
400 DPRINTF(Decode,"Decode: Decoded %s instruction: 0x%x\n", 401 curStaticInst->getName(), curStaticInst->machInst); |
402 |
403#if FULL_SYSTEM |
404 thread->setInst(inst); |
405#endif // FULL_SYSTEM |
406 } |
407} 408 409void 410BaseSimpleCPU::postExecute() 411{ 412#if FULL_SYSTEM 413 if (thread->profile) { 414 bool usermode = TheISA::inUserMode(tc); --- 74 unchanged lines hidden --- |