base.cc (3064:e907dd767a63) base.cc (3093:b09c33e66bce)
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;

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

353#endif
354}
355
356
357Fault
358BaseSimpleCPU::setupFetchRequest(Request *req)
359{
360 // set up memory request for instruction fetch
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;

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

353#endif
354}
355
356
357Fault
358BaseSimpleCPU::setupFetchRequest(Request *req)
359{
360 // set up memory request for instruction fetch
361#if THE_ISA == ALPHA_ISA
362 DPRINTF(Fetch,"Fetch: PC:%08p NPC:%08p",thread->readPC(),
363 thread->readNextPC());
364#else
361#if ISA_HAS_DELAY_SLOT
365 DPRINTF(Fetch,"Fetch: PC:%08p NPC:%08p NNPC:%08p\n",thread->readPC(),
366 thread->readNextPC(),thread->readNextNPC());
362 DPRINTF(Fetch,"Fetch: PC:%08p NPC:%08p NNPC:%08p\n",thread->readPC(),
363 thread->readNextPC(),thread->readNextNPC());
364#else
365 DPRINTF(Fetch,"Fetch: PC:%08p NPC:%08p",thread->readPC(),
366 thread->readNextPC());
367#endif
368
369 req->setVirt(0, thread->readPC() & ~3, sizeof(MachInst),
370 (FULL_SYSTEM && (thread->readPC() & 1)) ? PHYSICAL : 0,
371 thread->readPC());
372
373 Fault fault = thread->translateInstReq(req);
374

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

393
394 // check for instruction-count-based events
395 comInstEventQueue[0]->serviceEvents(numInst);
396
397 // decode the instruction
398 inst = gtoh(inst);
399 curStaticInst = StaticInst::decode(makeExtMI(inst, thread->readPC()));
400
367#endif
368
369 req->setVirt(0, thread->readPC() & ~3, sizeof(MachInst),
370 (FULL_SYSTEM && (thread->readPC() & 1)) ? PHYSICAL : 0,
371 thread->readPC());
372
373 Fault fault = thread->translateInstReq(req);
374

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

393
394 // check for instruction-count-based events
395 comInstEventQueue[0]->serviceEvents(numInst);
396
397 // decode the instruction
398 inst = gtoh(inst);
399 curStaticInst = StaticInst::decode(makeExtMI(inst, thread->readPC()));
400
401 traceData = Trace::getInstRecord(curTick, tc, curStaticInst,
401 traceData = Trace::getInstRecord(curTick, tc, this, curStaticInst,
402 thread->readPC());
403
404 DPRINTF(Decode,"Decode: Decoded %s instruction (opcode: 0x%x): 0x%x\n",
405 curStaticInst->getName(), curStaticInst->getOpcode(),
406 curStaticInst->machInst);
407
408#if FULL_SYSTEM
409 thread->setInst(inst);

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

445BaseSimpleCPU::advancePC(Fault fault)
446{
447 if (fault != NoFault) {
448 fault->invoke(tc);
449 }
450 else {
451 // go to the next instruction
452 thread->setPC(thread->readNextPC());
402 thread->readPC());
403
404 DPRINTF(Decode,"Decode: Decoded %s instruction (opcode: 0x%x): 0x%x\n",
405 curStaticInst->getName(), curStaticInst->getOpcode(),
406 curStaticInst->machInst);
407
408#if FULL_SYSTEM
409 thread->setInst(inst);

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

445BaseSimpleCPU::advancePC(Fault fault)
446{
447 if (fault != NoFault) {
448 fault->invoke(tc);
449 }
450 else {
451 // go to the next instruction
452 thread->setPC(thread->readNextPC());
453#if THE_ISA == ALPHA_ISA
454 thread->setNextPC(thread->readNextPC() + sizeof(MachInst));
455#else
453#if ISA_HAS_DELAY_SLOT
456 thread->setNextPC(thread->readNextNPC());
457 thread->setNextNPC(thread->readNextNPC() + sizeof(MachInst));
458 assert(thread->readNextPC() != thread->readNextNPC());
454 thread->setNextPC(thread->readNextNPC());
455 thread->setNextNPC(thread->readNextNPC() + sizeof(MachInst));
456 assert(thread->readNextPC() != thread->readNextNPC());
457#else
458 thread->setNextPC(thread->readNextPC() + sizeof(MachInst));
459#endif
460
461 }
462
463#if FULL_SYSTEM
464 Addr oldpc;
465 do {
466 oldpc = thread->readPC();
467 system->pcEventQueue.service(tc);
468 } while (oldpc != thread->readPC());
469#endif
470}
471
459#endif
460
461 }
462
463#if FULL_SYSTEM
464 Addr oldpc;
465 do {
466 oldpc = thread->readPC();
467 system->pcEventQueue.service(tc);
468 } while (oldpc != thread->readPC());
469#endif
470}
471