Lines Matching refs:inst

216 Execute::tryToBranch(MinorDynInstPtr inst, Fault fault, BranchData &branch)
218 ThreadContext *thread = cpu.getContext(inst->id.threadId);
219 const TheISA::PCState &pc_before = inst->pc;
225 !inst->isFault() &&
226 inst->isLastOpInInst() &&
227 (inst->staticInst->isSerializeAfter() ||
228 inst->staticInst->isSquashAfter() ||
229 inst->staticInst->isIprAccess());
244 TheISA::advancePC(target, inst->staticInst);
251 if (inst->predictedTaken && !force_branch) {
257 " none happened inst: %s\n",
258 inst->pc.instAddr(), inst->predictedTarget.instAddr(), *inst);
261 } else if (inst->predictedTarget == target) {
267 " inst: %s\n",
268 inst->pc.instAddr(), inst->predictedTarget.instAddr(), *inst);
274 " but got the wrong target (actual: 0x%x) inst: %s\n",
275 inst->pc.instAddr(), inst->predictedTarget.instAddr(),
276 target.instAddr(), *inst);
282 DPRINTF(Branch, "Unpredicted branch from 0x%x to 0x%x inst: %s\n",
283 inst->pc.instAddr(), target.instAddr(), *inst);
291 updateBranchData(inst->id.threadId, reason, inst, target, branch);
298 MinorDynInstPtr inst, const TheISA::PCState &target,
310 /* Maintaining predictionSeqNum if there's no inst is just a
312 (inst->isBubble() ? executeInfo[tid].lastPredictionSeqNum
313 : inst->id.predictionSeqNum),
314 target, inst);
321 Execute::handleMemResponse(MinorDynInstPtr inst,
324 ThreadID thread_id = inst->id.threadId;
327 ExecContext context(cpu, *cpu.threads[thread_id], *this, inst);
331 bool is_load = inst->staticInst->isLoad();
332 bool is_store = inst->staticInst->isStore();
333 bool is_atomic = inst->staticInst->isAtomic();
334 bool is_prefetch = inst->staticInst->isDataPrefetch();
340 if (inst->translationFault != NoFault) {
343 inst->translationFault->name());
345 if (inst->staticInst->isPrefetch()) {
347 inst->translationFault->name());
352 fault = inst->translationFault;
354 fault->invoke(thread, inst->staticInst);
357 DPRINTF(MinorMem, "Completing failed request inst: %s\n",
358 *inst);
361 inst->staticInst->completeAcc(nullptr, &context, inst->traceData);
364 *inst);
366 fatal("Received error response packet for inst: %s\n", *inst);
370 DPRINTF(MinorMem, "Memory response inst: %s addr: 0x%x size: %d\n",
371 *inst, packet->getAddr(), packet->getSize());
379 fault = inst->staticInst->completeAcc(packet, &context,
380 inst->traceData);
386 fault->invoke(thread, inst->staticInst);
400 if (inst->traceData) {
401 inst->traceData->setPredicate((use_context_predicate ?
405 doInstCommitAccounting(inst);
408 tryToBranch(inst, fault, branch);
448 Execute::executeMemRefInst(MinorDynInstPtr inst, BranchData &branch,
461 ThreadContext *thread = cpu.getContext(inst->id.threadId);
464 ExecContext context(cpu, *cpu.threads[inst->id.threadId],
465 *this, inst);
467 DPRINTF(MinorExecute, "Initiating memRef inst: %s\n", *inst);
469 Fault init_fault = inst->staticInst->initiateAcc(&context,
470 inst->traceData);
472 if (inst->inLSQ) {
474 assert(inst->translationFault != NoFault);
480 inst->translationFault = NoFault;
485 DPRINTF(MinorExecute, "Fault on memory inst: %s"
486 " initiateAcc: %s\n", *inst, init_fault->name());
492 DPRINTF(MinorMem, "No memory access for inst: %s\n", *inst);
498 if (inst->traceData)
499 inst->traceData->setPredicate(passed_predicate);
506 lsq.pushFailedRequest(inst);
572 MinorDynInstPtr inst = insts_in->insts[thread.inputIndex];
573 Fault fault = inst->fault;
577 if (inst->isBubble()) {
583 DPRINTF(MinorExecute, "Discarding inst: %s from suspended"
584 " thread\n", *inst);
588 } else if (inst->id.streamSeqNum != thread.streamSeqNum) {
589 DPRINTF(MinorExecute, "Discarding inst: %s as its stream"
591 *inst, thread.streamSeqNum);
607 DPRINTF(MinorExecute, "Trying to issue inst: %s to FU: %d\n",
608 *inst, fu_index);
614 bool fu_is_capable = (!inst->isFault() ?
615 fu->provides(inst->staticInst->opClass()) : true);
617 if (inst->isNoCostInst()) {
627 scoreboard[thread_id].markupInstDests(inst, cpu.curCycle() +
630 DPRINTF(MinorExecute, "Issuing %s to %d\n", inst->id, noCostFUIndex);
631 inst->fuIndex = noCostFUIndex;
632 inst->extraCommitDelay = Cycles(0);
633 inst->extraCommitDelayExpr = NULL;
637 QueuedInst fu_inst(inst);
652 DPRINTF(MinorExecute, "Can't issue inst: %s into FU: %d,"
654 *inst, fu_index);
656 DPRINTF(MinorExecute, "Can't issue inst: %s to busy FU"
658 *inst, fu->cyclesBeforeInsert());
660 MinorFUTiming *timing = (!inst->isFault() ?
661 fu->findTiming(inst->staticInst) : NULL);
671 DPRINTF(MinorExecute, "Can't issue inst: %s as extra"
673 *inst);
674 } else if (!scoreboard[thread_id].canInstIssue(inst,
678 DPRINTF(MinorExecute, "Can't issue inst: %s yet\n",
679 *inst);
682 DPRINTF(MinorExecute, "Issuing inst: %s"
683 " into FU %d\n", *inst,
701 issued_mem_ref = inst->isMemRef();
703 QueuedInst fu_inst(inst);
705 /* Decorate the inst with FU details */
706 inst->fuIndex = fu_index;
707 inst->extraCommitDelay = extra_dest_retire_lat;
708 inst->extraCommitDelayExpr =
716 inst->instToWaitFor =
717 scoreboard[thread_id].execSeqNumToWaitFor(inst,
721 inst->instToWaitFor)
725 " inst: %s until after inst"
726 " %d(exec)\n", *inst,
729 inst->instToWaitFor =
732 DPRINTF(MinorExecute, "Memory ref inst:"
733 " %s must wait for inst %d(exec)"
735 *inst, inst->instToWaitFor);
738 inst->canEarlyIssue = true;
742 DPRINTF(MinorExecute, "Pushing mem inst: %s\n",
743 *inst);
755 scoreboard[thread_id].markupInstDests(inst, cpu.curCycle() +
774 DPRINTF(MinorExecute, "Didn't issue inst: %s\n", *inst);
780 if (DTRACE(MinorTrace) && !inst->isBubble())
781 inst->minorTraceInst(*this);
784 if (!discarded && inst->isInst() &&
785 inst->staticInst->isMemBarrier())
787 DPRINTF(MinorMem, "Issuing memory barrier inst: %s\n", *inst);
788 lsq.issuedMemBarrierInst(inst);
791 if (inst->traceData && setTraceTimeOnIssue) {
792 inst->traceData->setWhen(curTick());
800 } else if (!inst->isBubble()) {
804 DPRINTF(MinorExecute, "Reached inst issue limit\n");
808 DPRINTF(MinorExecute, "Stepping to next inst inputIndex: %d\n",
857 Execute::doInstCommitAccounting(MinorDynInstPtr inst)
859 assert(!inst->isFault());
861 MinorThread *thread = cpu.threads[inst->id.threadId];
863 /* Increment the many and various inst and op counts in the
865 if (!inst->staticInst->isMicroop() || inst->staticInst->isLastMicroop())
873 cpu.comInstEventQueue[inst->id.threadId]->serviceEvents(thread->numInst);
879 cpu.stats.committedInstType[inst->id.threadId]
880 [inst->staticInst->opClass()]++;
883 if (inst->traceData)
884 inst->traceData->setCPSeq(thread->numOp);
886 cpu.probeInstCommit(inst->staticInst, inst->pc.instAddr());
890 Execute::commitInst(MinorDynInstPtr inst, bool early_memory_issue,
894 ThreadID thread_id = inst->id.threadId;
907 } else if (inst->isFault()) {
908 ExecContext context(cpu, *cpu.threads[thread_id], *this, inst);
910 DPRINTF(MinorExecute, "Fault inst reached Execute: %s\n",
911 inst->fault->name());
913 fault = inst->fault;
914 inst->fault->invoke(thread, NULL);
916 tryToBranch(inst, fault, branch);
917 } else if (inst->staticInst->isMemRef()) {
931 bool completed_mem_inst = executeMemRefInst(inst, branch,
936 DPRINTF(MinorExecute, "Fault in early executing inst: %s\n",
940 inst->canEarlyIssue = false;
949 tryToBranch(inst, fault, branch);
956 } else if (inst->isInst() && inst->staticInst->isMemBarrier() &&
959 DPRINTF(MinorExecute, "Can't commit data barrier inst: %s yet as"
960 " there isn't space in the store buffer\n", *inst);
963 } else if (inst->isInst() && inst->staticInst->isQuiesce()
969 ExecContext context(cpu, *cpu.threads[thread_id], *this, inst);
971 DPRINTF(MinorExecute, "Committing inst: %s\n", *inst);
973 fault = inst->staticInst->execute(&context,
974 inst->traceData);
977 if (inst->traceData)
978 inst->traceData->setPredicate(context.readPredicate());
983 DPRINTF(MinorExecute, "Fault in execute of inst: %s fault: %s\n",
984 *inst, fault->name());
985 fault->invoke(thread, inst->staticInst);
988 doInstCommitAccounting(inst);
989 tryToBranch(inst, fault, branch);
996 executeInfo[thread_id].lastPredictionSeqNum = inst->id.predictionSeqNum;
999 if (!inst->isFault() &&
1010 " inst: %s\n", thread_id, *inst);
1014 updateBranchData(thread_id, BranchData::SuspendThread, inst,
1068 *(ex_info.inFlightInsts->front().inst),
1082 *(ex_info.inFlightInsts->front().inst));
1088 head_inflight_inst->inst->id.execSeqNum;
1093 MinorDynInstPtr inst = head_inflight_inst->inst;
1110 /* Can we find a mem response for this inst */
1112 (inst->inLSQ ? lsq.findResponse(inst) : NULL);
1128 discard_inst = inst->id.streamSeqNum !=
1132 *inst);
1136 DPRINTF(MinorExecute, "Discarding mem inst: %s as its"
1138 *inst, ex_info.streamSeqNum);
1142 handleMemResponse(inst, mem_response, branch, fault);
1151 * the `if' tree a bit and allows other tests for inst
1168 ex_info.inFUMemInsts->front().inst;
1170 const MinorDynInstPtr &fu_inst = fu->front().inst;
1172 /* Use this, possibly out of order, inst as the one
1181 " inst: %s instToWaitFor: %d\n",
1184 inst = fu_inst;
1192 if (!completed_inst && inst->isNoCostInst()) {
1193 DPRINTF(MinorExecute, "Committing no cost inst: %s", *inst);
1201 if (!completed_inst && !inst->inLSQ) {
1205 /* Is the head inst of the expected inst's FU actually the
1206 * expected inst? */
1208 funcUnits[inst->fuIndex]->front();
1209 InstSeqNum fu_inst_seq_num = fu_inst.inst->id.execSeqNum;
1211 if (fu_inst.inst->isBubble()) {
1216 * in the same cycle and so the head inst isn't
1220 } else if (fu_inst.inst->id == inst->id) {
1230 discard_inst = inst->id.streamSeqNum !=
1241 if (inst->extraCommitDelayExpr) {
1243 " extra commit delay inst: %s\n", *inst);
1247 TimingExprEvalContext context(inst->staticInst,
1250 uint64_t extra_delay = inst->extraCommitDelayExpr->
1257 inst->extraCommitDelay += Cycles(extra_delay);
1262 inst->extraCommitDelayExpr = NULL;
1267 if (inst->extraCommitDelay != Cycles(0)) {
1268 inst->minimumCommitCycle = cpu.curCycle() +
1269 inst->extraCommitDelay;
1270 inst->extraCommitDelay = Cycles(0);
1275 if (!inst->isFault() && inst->isMemRef() &&
1277 inst->id.execSeqNum &&
1280 DPRINTF(MinorExecute, "Not committing inst: %s yet"
1282 *inst);
1284 } else if (inst->minimumCommitCycle > now) {
1285 DPRINTF(MinorExecute, "Not committing inst: %s yet"
1287 *inst, inst->minimumCommitCycle - now);
1290 completed_inst = commitInst(inst,
1304 if (inst->fuIndex != noCostFUIndex) {
1305 DPRINTF(MinorExecute, "Unstalling %d for inst %s\n", inst->fuIndex, inst->id);
1306 funcUnits[inst->fuIndex]->stalled = false;
1321 DPRINTF(MinorExecute, "Discarding inst: %s as its stream"
1323 *inst, ex_info.streamSeqNum);
1329 /* Mark the mem inst as being in the LSQ */
1331 inst->fuIndex = 0;
1332 inst->inLSQ = true;
1337 if (completed_inst && inst->isMemRef()) {
1341 ex_info.inFUMemInsts->front().inst == inst)
1349 DPRINTF(MinorExecute, "Completed inst: %s\n", *inst);
1352 ex_info.lastCommitWasEndOfMacroop = inst->isFault() ||
1353 inst->isLastOpInInst();
1357 ex_info.lastPredictionSeqNum = inst->id.predictionSeqNum;
1359 /* Finished with the inst, remove it from the inst queue and
1364 if (inst->isInst() && inst->staticInst->isMemBarrier()) {
1366 " inst: %s committed: %d\n", *inst, committed_inst);
1367 lsq.completeMemBarrierInst(inst, committed_inst);
1370 scoreboard[thread_id].clearInstDests(inst, inst->isMemRef());
1375 bool is_no_cost_inst = inst->isNoCostInst();
1380 ex_info.instsBeingCommitted.insts[num_insts_committed] = inst;
1386 DPRINTF(MinorExecute, "Reached inst commit limit\n");
1390 if (inst->traceData) {
1392 inst->traceData->setWhen(curTick());
1393 inst->traceData->dump();
1505 MinorDynInstPtr inst = getInput(tid)->insts[input_index];
1506 if (inst->isFault()) {
1508 } else if (!inst->isBubble()) {
1509 next_issuable_insts.push_back(inst);
1531 for (auto inst : next_issuable_insts) {
1532 if (!fu->stalled && fu->provides(inst->staticInst->opClass()) &&
1533 scoreboard[inst->id.threadId].canInstIssue(inst,
1535 cpu.getContext(inst->id.threadId))) {
1549 if (head_inst.inst->isNoCostInst()) {
1552 FUPipeline *fu = funcUnits[head_inst.inst->fuIndex];
1554 fu->front().inst->id == head_inst.inst->id) ||
1555 lsq.findResponse(head_inst.inst))
1567 (can_issue_next ? " (can issued next inst)" : ""),
1568 (head_inst_might_commit ? "(head inst might commit)" : ""),
1575 can_issue_next || /* Can still issue a new inst */
1576 head_inst_might_commit || /* Could possible commit the next inst */
1700 MinorDynInstPtr inst = head_inflight_inst->inst;
1703 (!inst->inLSQ || (lsq.findResponse(inst) != NULL));
1705 if (!inst->inLSQ) {
1709 ex_info.inFUMemInsts->front().inst;
1711 const MinorDynInstPtr &fu_inst = fu->front().inst;
1717 inst->id.execSeqNum > fu_inst->instToWaitFor;
1720 bool can_execute_fu_inst = inst->fuIndex == noCostFUIndex;
1722 inst->fuIndex != noCostFUIndex)
1724 QueuedInst& fu_inst = funcUnits[inst->fuIndex]->front();
1725 can_execute_fu_inst = !fu_inst.inst->isBubble() &&
1726 fu_inst.inst->id == inst->id;
1864 Execute::instIsRightStream(MinorDynInstPtr inst)
1866 return inst->id.streamSeqNum == executeInfo[inst->id.threadId].streamSeqNum;
1870 Execute::instIsHeadInst(MinorDynInstPtr inst)
1874 if (!executeInfo[inst->id.threadId].inFlightInsts->empty())
1875 ret = executeInfo[inst->id.threadId].inFlightInsts->front().inst->id == inst->id;