X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fcpu%2Fo3%2Fcommit_impl.hh;h=ea77f18fb54613c916130c09c55284f70aec3aba;hb=a5802c823f4f6ec2bd97c953494551e31faa2cf8;hp=aa1948602c9e35a71903a4f6c0a545dea718d676;hpb=e5fbc67e16063cbfec90210d700fa79a8f3b1550;p=gem5.git diff --git a/src/cpu/o3/commit_impl.hh b/src/cpu/o3/commit_impl.hh index aa1948602..ea77f18fb 100644 --- a/src/cpu/o3/commit_impl.hh +++ b/src/cpu/o3/commit_impl.hh @@ -173,6 +173,7 @@ DefaultCommit::regProbePoints() { ppCommit = new ProbePointArg(cpu->getProbeManager(), "Commit"); ppCommitStall = new ProbePointArg(cpu->getProbeManager(), "CommitStall"); + ppSquash = new ProbePointArg(cpu->getProbeManager(), "Squash"); } template @@ -525,13 +526,16 @@ DefaultCommit::numROBFreeEntries(ThreadID tid) template void -DefaultCommit::generateTrapEvent(ThreadID tid) +DefaultCommit::generateTrapEvent(ThreadID tid, Fault inst_fault) { DPRINTF(Commit, "Generating trap event for [tid:%i]\n", tid); TrapEvent *trap = new TrapEvent(this, tid); - cpu->schedule(trap, cpu->clockEdge(trapLatency)); + Cycles latency = dynamic_pointer_cast(inst_fault) ? + cpu->syscallRetryLatency : trapLatency; + + cpu->schedule(trap, cpu->clockEdge(latency)); trapInFlight[tid] = true; thread[tid]->trapPending = true; } @@ -766,10 +770,11 @@ DefaultCommit::handleInterrupt() commitStatus[0] = TrapPending; + interrupt = NoFault; + // Generate trap squash event. - generateTrapEvent(0); + generateTrapEvent(0, interrupt); - interrupt = NoFault; avoidQuiesceLiveLock = false; } else { DPRINTF(Commit, "Interrupt pending: instruction is %sin " @@ -1010,6 +1015,8 @@ DefaultCommit::commitInsts() rob->retireHead(commit_thread); ++commitSquashedInsts; + // Notify potential listeners that this instruction is squashed + ppSquash->notify(head_inst); // Record that the number of ROB entries has changed. changedROBNumEntries[tid] = true; @@ -1145,7 +1152,7 @@ DefaultCommit::commitHead(DynInstPtr &head_inst, unsigned inst_num) // think are possible. assert(head_inst->isNonSpeculative() || head_inst->isStoreConditional() || head_inst->isMemBarrier() || head_inst->isWriteBarrier() || - (head_inst->isLoad() && head_inst->uncacheable())); + (head_inst->isLoad() && head_inst->strictlyOrdered())); DPRINTF(Commit, "Encountered a barrier or non-speculative " "instruction [sn:%lli] at the head of the ROB, PC %s.\n", @@ -1162,11 +1169,11 @@ DefaultCommit::commitHead(DynInstPtr &head_inst, unsigned inst_num) // it is executed. head_inst->clearCanCommit(); - if (head_inst->isLoad() && head_inst->uncacheable()) { - DPRINTF(Commit, "[sn:%lli]: Uncached load, PC %s.\n", + if (head_inst->isLoad() && head_inst->strictlyOrdered()) { + DPRINTF(Commit, "[sn:%lli]: Strictly ordered load, PC %s.\n", head_inst->seqNum, head_inst->pcState()); - toIEW->commitInfo[tid].uncached = true; - toIEW->commitInfo[tid].uncachedLoad = head_inst; + toIEW->commitInfo[tid].strictlyOrdered = true; + toIEW->commitInfo[tid].strictlyOrderedLoad = head_inst; } else { ++commitNonSpecStalls; } @@ -1237,7 +1244,7 @@ DefaultCommit::commitHead(DynInstPtr &head_inst, unsigned inst_num) } // Generate trap squash event. - generateTrapEvent(tid); + generateTrapEvent(tid, inst_fault); return false; }