@@ -656,8 +656,8 @@ Fetch::processCacheCompletion(PacketPtr pkt)
656656 }
657657
658658 // Verify fetchBufferPC alignment with the supplying FSQ entry.
659- if (threads[tid].valid && dbpbtb->ftqHasFetching (0 )) {
660- const auto &stream = dbpbtb->ftqFetchingTarget (0 );
659+ if (threads[tid].valid && dbpbtb->ftqHasFetching (tid )) {
660+ const auto &stream = dbpbtb->ftqFetchingTarget (tid );
661661 if (threads[tid].startPC != stream.startPC ) {
662662 panic (" fetchBufferPC %#x should be aligned with FSQ startPC %#x" ,
663663 threads[tid].startPC , stream.startPC );
@@ -793,7 +793,7 @@ Fetch::lookupAndUpdateNextPC(const DynInstPtr &inst, PCStateBase &next_pc)
793793 // Decoupled+BTB-only: compute next PC directly from the supplying FSQ entry.
794794 ThreadID tid = inst->threadNumber ;
795795 assert (dbpbtb);
796- assert (dbpbtb->ftqHasFetching (0 ));
796+ assert (dbpbtb->ftqHasFetching (tid ));
797797 const auto &stream = dbpbtb->ftqFetchingTarget (tid);
798798
799799 const Addr curr_pc = next_pc.instAddr ();
@@ -1002,7 +1002,7 @@ Fetch::handleTranslationFault(ThreadID tid, const RequestPtr &mem_req, const Fau
10021002 // We will use a nop in order to carry the fault.
10031003 DynInstPtr instruction = buildInst (tid, nopStaticInstPtr, nullptr ,
10041004 fetch_pc, fetch_pc, false );
1005- instruction->setVersion (localSquashVer);
1005+ instruction->setVersion (localSquashVer[tid] );
10061006 instruction->setNotAnInst ();
10071007
10081008 instruction->setPredTarg (fetch_pc);
@@ -1522,35 +1522,42 @@ Fetch::handleIEWSignals()
15221522 return ;
15231523 }
15241524
1525- auto &incoming = fromIEW->iewInfo ->resolvedCFIs ;
15261525 const bool had_pending_resolve = !resolveQueue.empty ();
1527- uint8_t enqueueSize = fromIEW->iewInfo ->resolvedCFIs .size ();
15281526 uint8_t enqueueCount = 0 ;
1527+ uint8_t enqueueSize = 0 ;
1528+
1529+ for (ThreadID tid = 0 ; tid < numThreads; ++tid) {
1530+ enqueueSize += fromIEW->iewInfo [tid].resolvedCFIs .size ();
1531+ }
15291532
15301533 if (resolveQueueSize && resolveQueue.size () > resolveQueueSize - 4 ) {
15311534 fetchStats.resolveQueueFullEvents ++;
15321535 fetchStats.resolveEnqueueFailEvent += enqueueSize;
15331536 } else {
1537+ for (ThreadID tid = 0 ; tid < numThreads; ++tid) {
1538+ auto &incoming = fromIEW->iewInfo [tid].resolvedCFIs ;
1539+ for (const auto &resolved : incoming) {
1540+ bool merged = false ;
1541+ for (auto &queued : resolveQueue) {
1542+ if (queued.resolvedTid == tid &&
1543+ queued.resolvedFTQId == resolved.ftqId ) {
1544+ queued.resolvedInstPC .push_back (resolved.pc );
1545+ merged = true ;
1546+ break ;
1547+ }
1548+ }
15341549
1535- for (const auto &resolved : incoming) {
1536- bool merged = false ;
1537- for (auto &queued : resolveQueue) {
1538- if (queued.resolvedFTQId == resolved.ftqId ) {
1539- queued.resolvedInstPC .push_back (resolved.pc );
1540- merged = true ;
1541- break ;
1550+ if (merged) {
1551+ continue ;
15421552 }
1543- }
15441553
1545- if (merged) {
1546- continue ;
1554+ ResolveQueueEntry new_entry;
1555+ new_entry.resolvedTid = tid;
1556+ new_entry.resolvedFTQId = resolved.ftqId ;
1557+ new_entry.resolvedInstPC .push_back (resolved.pc );
1558+ resolveQueue.push_back (std::move (new_entry));
1559+ enqueueCount++;
15471560 }
1548-
1549- ResolveQueueEntry new_entry;
1550- new_entry.resolvedFTQId = resolved.ftqId ;
1551- new_entry.resolvedInstPC .push_back (resolved.pc );
1552- resolveQueue.push_back (std::move (new_entry));
1553- enqueueCount++;
15541561 }
15551562 fetchStats.resolveEnqueueCount .sample (enqueueCount);
15561563 }
@@ -1562,12 +1569,13 @@ Fetch::handleIEWSignals()
15621569 // and fetch consuming them as predictor resolved updates.
15631570 if (had_pending_resolve && !resolveQueue.empty ()) {
15641571 auto &entry = resolveQueue.front ();
1572+ ThreadID tid = entry.resolvedTid ;
15651573 unsigned int stream_id = entry.resolvedFTQId ;
1566- dbpbtb->prepareResolveUpdateEntries (stream_id, 0 );
1574+ dbpbtb->prepareResolveUpdateEntries (stream_id, tid );
15671575 for (const auto resolvedInstPC : entry.resolvedInstPC ) {
1568- dbpbtb->markCFIResolved (stream_id, resolvedInstPC, 0 );
1576+ dbpbtb->markCFIResolved (stream_id, resolvedInstPC, tid );
15691577 }
1570- bool success = dbpbtb->resolveUpdate (stream_id, 0 );
1578+ bool success = dbpbtb->resolveUpdate (stream_id, tid );
15711579 if (success) {
15721580 dbpbtb->notifyResolveSuccess ();
15731581 resolveQueue.pop_front ();
@@ -1612,8 +1620,10 @@ Fetch::handleCommitSignals(ThreadID tid)
16121620 squash (*fromCommit->commitInfo [tid].pc , squash_seq,
16131621 squash_inst, tid);
16141622
1615- localSquashVer.update (fromCommit->commitInfo [tid].squashVersion .getVersion ());
1616- DPRINTF (Fetch, " Updating squash version to %u\n " , localSquashVer.getVersion ());
1623+ localSquashVer[tid].update (
1624+ fromCommit->commitInfo [tid].squashVersion .getVersion ());
1625+ DPRINTF (Fetch, " Updating squash version to %u\n " ,
1626+ localSquashVer[tid].getVersion ());
16171627
16181628 auto mispred_inst = fromCommit->commitInfo [tid].mispredictInst ;
16191629
@@ -1924,7 +1934,7 @@ Fetch::processSingleInstruction(ThreadID tid, PCStateBase &pc,
19241934 tid, waitForVsetvl);
19251935 }
19261936
1927- instruction->setVersion (localSquashVer);
1937+ instruction->setVersion (localSquashVer[tid] );
19281938 ppFetch->notify (instruction);
19291939 numInst++;
19301940
0 commit comments