@@ -629,8 +629,8 @@ Fetch::processCacheCompletion(PacketPtr pkt)
629629 }
630630
631631 // Verify fetchBufferPC alignment with the supplying FSQ entry.
632- if (fetchBuffer[tid].valid && dbpbtb->fsqHasHead ()) {
633- const auto &stream = dbpbtb->fsqHead ();
632+ if (fetchBuffer[tid].valid && dbpbtb->ftqHasHead ()) {
633+ const auto &stream = dbpbtb->ftqHead ();
634634 if (fetchBuffer[tid].startPC != stream.startPC ) {
635635 panic (" fetchBufferPC %#x should be aligned with FSQ startPC %#x" ,
636636 fetchBuffer[tid].startPC , stream.startPC );
@@ -782,10 +782,8 @@ Fetch::lookupAndUpdateNextPC(const DynInstPtr &inst, PCStateBase &next_pc)
782782 // Decoupled+BTB-only: compute next PC directly from the supplying FSQ entry.
783783 ThreadID tid = inst->threadNumber ;
784784 assert (dbpbtb);
785- assert (dbpbtb->fsqHasHead ());
786- const auto &stream = dbpbtb->fsqHead ();
787- const auto fsq_id = dbpbtb->fsqHeadId ();
788- const auto ftq_id = dbpbtb->fsqHeadFtqId ();
785+ assert (dbpbtb->ftqHasHead ());
786+ const auto &stream = dbpbtb->ftqHead ();
789787
790788 const Addr curr_pc = next_pc.instAddr ();
791789 assert (stream.startPC <= curr_pc && curr_pc < stream.predEndPC );
@@ -818,7 +816,7 @@ Fetch::lookupAndUpdateNextPC(const DynInstPtr &inst, PCStateBase &next_pc)
818816 // Track how many dynamic instructions were fetched for this (legacy) FTQ/FSQ entry.
819817 ftqEntryFetchedInsts[tid]++;
820818 if (run_out) {
821- dbpbtb->consumeFetchTarget (ftq_id, fsq_id, ftqEntryFetchedInsts[tid]);
819+ dbpbtb->consumeFetchTarget (ftqEntryFetchedInsts[tid]);
822820 ftqEntryFetchedInsts[tid] = 0 ;
823821 fetchBuffer[tid].valid = false ;
824822 DPRINTF (DecoupleBP, " Used up fetch targets.\n " );
@@ -1519,7 +1517,7 @@ Fetch::handleIEWSignals()
15191517 for (const auto &resolved : incoming) {
15201518 bool merged = false ;
15211519 for (auto &queued : resolveQueue) {
1522- if (queued.resolvedFSQId == resolved.fsqId ) {
1520+ if (queued.resolvedFTQId == resolved.ftqId ) {
15231521 queued.resolvedInstPC .push_back (resolved.pc );
15241522 merged = true ;
15251523 break ;
@@ -1531,7 +1529,7 @@ Fetch::handleIEWSignals()
15311529 }
15321530
15331531 ResolveQueueEntry new_entry;
1534- new_entry.resolvedFSQId = resolved.fsqId ;
1532+ new_entry.resolvedFTQId = resolved.ftqId ;
15351533 new_entry.resolvedInstPC .push_back (resolved.pc );
15361534 resolveQueue.push_back (std::move (new_entry));
15371535 enqueueCount++;
@@ -1543,7 +1541,7 @@ Fetch::handleIEWSignals()
15431541
15441542 if (!resolveQueue.empty ()) {
15451543 auto &entry = resolveQueue.front ();
1546- unsigned int stream_id = entry.resolvedFSQId ;
1544+ unsigned int stream_id = entry.resolvedFTQId ;
15471545 dbpbtb->prepareResolveUpdateEntries (stream_id);
15481546 for (const auto resolvedInstPC : entry.resolvedInstPC ) {
15491547 dbpbtb->markCFIResolved (stream_id, resolvedInstPC);
@@ -1564,10 +1562,10 @@ Fetch::handleCommitSignals(ThreadID tid)
15641562{
15651563 // Check squash signals from commit.
15661564 if (!fromCommit->commitInfo [tid].squash ) {
1567- if (fromCommit->commitInfo [tid].doneSeqNum ) {
1568- DPRINTF (DecoupleBP, " Commit stream Id: %lu\n " , fromCommit->commitInfo [tid].doneFsqId );
1565+ if (fromCommit->commitInfo [tid].doneFtqId ) {
1566+ DPRINTF (DecoupleBP, " Commit stream Id: %lu\n " , fromCommit->commitInfo [tid].doneFtqId );
15691567 assert (dbpbtb);
1570- dbpbtb->update (fromCommit->commitInfo [tid].doneFsqId , tid);
1568+ dbpbtb->update (fromCommit->commitInfo [tid].doneFtqId , tid);
15711569 }
15721570 return false ;
15731571 }
@@ -1602,24 +1600,22 @@ Fetch::handleCommitSignals(ThreadID tid)
16021600 DPRINTF (Fetch, " Use mispred inst to redirect, treating as control squash\n " );
16031601 const auto corr_pc = fromCommit->commitInfo [tid].pc ->as <RiscvISA::PCState>();
16041602 assert (dbpbtb);
1605- dbpbtb->controlSquash (mispred_inst->getFtqId (), mispred_inst->getFsqId (), mispred_inst-> pcState (),
1603+ dbpbtb->controlSquash (mispred_inst->getFtqId (), mispred_inst->pcState (),
16061604 corr_pc, mispred_inst->staticInst ,
16071605 mispred_inst->getInstBytes (), fromCommit->commitInfo [tid].branchTaken ,
16081606 mispred_inst->seqNum , tid, mispred_inst->getLoopIteration (), true );
16091607 } else if (fromCommit->commitInfo [tid].isTrapSquash ) {
16101608 DPRINTF (Fetch, " Treating as trap squash\n " , tid);
16111609 const auto trap_pc = fromCommit->commitInfo [tid].pc ->as <RiscvISA::PCState>();
16121610 assert (dbpbtb);
1613- dbpbtb->trapSquash (fromCommit->commitInfo [tid].squashedTargetId ,
1614- fromCommit->commitInfo [tid].squashedStreamId , fromCommit->commitInfo [tid].committedPC ,
1611+ dbpbtb->trapSquash (fromCommit->commitInfo [tid].squashedTargetId , fromCommit->commitInfo [tid].committedPC ,
16151612 trap_pc, tid, fromCommit->commitInfo [tid].squashedLoopIter );
16161613 } else {
1617- if (fromCommit->commitInfo [tid].pc && fromCommit->commitInfo [tid].squashedStreamId != 0 ) {
1614+ if (fromCommit->commitInfo [tid].pc && fromCommit->commitInfo [tid].squashedTargetId != 0 ) {
16181615 DPRINTF (Fetch, " Squash with stream id and target id from IEW\n " );
16191616 const auto nc_pc = fromCommit->commitInfo [tid].pc ->as <RiscvISA::PCState>();
16201617 assert (dbpbtb);
1621- dbpbtb->nonControlSquash (fromCommit->commitInfo [tid].squashedTargetId ,
1622- fromCommit->commitInfo [tid].squashedStreamId , nc_pc,
1618+ dbpbtb->nonControlSquash (fromCommit->commitInfo [tid].squashedTargetId , nc_pc,
16231619 0 , tid, fromCommit->commitInfo [tid].squashedLoopIter );
16241620 } else {
16251621 DPRINTF (Fetch, " Dont squash dbq because no meaningful stream\n " );
@@ -1643,7 +1639,7 @@ Fetch::handleDecodeSquash(ThreadID tid)
16431639 const auto next_pc =
16441640 fromDecode->decodeInfo [tid].nextPC ->as <RiscvISA::PCState>();
16451641 dbpbtb->controlSquash (
1646- mispred_inst->getFtqId (), mispred_inst-> getFsqId (),
1642+ mispred_inst->getFtqId (),
16471643 mispred_inst->pcState (),
16481644 next_pc,
16491645 mispred_inst->staticInst , mispred_inst->getInstBytes (),
@@ -1703,11 +1699,9 @@ Fetch::buildInst(ThreadID tid, StaticInstPtr staticInst,
17031699 DPRINTF (Fetch, " Is nop: %i, is move: %i\n " , instruction->isNop (),
17041700 instruction->isMov ());
17051701 assert (dbpbtb);
1706- DPRINTF (DecoupleBP, " Set instruction %lu with stream id %lu, fetch id %lu\n " ,
1707- instruction->seqNum , dbpbtb->fsqHeadId (),
1708- dbpbtb->fsqHeadFtqId ());
1709- instruction->setFsqId (dbpbtb->fsqHeadId ());
1710- instruction->setFtqId (dbpbtb->fsqHeadFtqId ());
1702+ DPRINTF (DecoupleBP, " Set instruction %lu with fetch id %lu\n " ,
1703+ instruction->seqNum , dbpbtb->ftqHeadId ());
1704+ instruction->setFtqId (dbpbtb->ftqHeadId ());
17111705
17121706#if TRACING_ON
17131707 if (trace) {
@@ -1763,7 +1757,7 @@ bool
17631757Fetch::checkDecoupledFrontend (ThreadID tid)
17641758{
17651759 assert (dbpbtb);
1766- if (!isTraceMode () && !dbpbtb->fsqHasHead ()) {
1760+ if (!isTraceMode () && !dbpbtb->ftqHasHead ()) {
17671761 dbpbtb->addFtqNotValid ();
17681762 DPRINTF (Fetch, " Skip fetch when FSQ head is not available\n " );
17691763 setAllFetchStalls (StallReason::FTQBubble);
@@ -1991,7 +1985,7 @@ Fetch::performInstructionFetch(ThreadID tid)
19911985 // For decoupled frontend (including trace mode), check FTQ availability
19921986 StallReason stall = StallReason::NoStall;
19931987 while (numInst < fetchWidth && fetchQueue[tid].size () < fetchQueueSize &&
1994- !predictedBranch && !fsqEmpty () && !waitForVsetvl) {
1988+ !predictedBranch && !ftqEmpty () && !waitForVsetvl) {
19951989
19961990 // Check memory needs and supply bytes to decoder if required
19971991 stall = checkMemoryNeeds (tid, pc_state, curMacroop);
@@ -2051,13 +2045,13 @@ Fetch::sendNextCacheRequest(ThreadID tid, const PCStateBase &pc_state) {
20512045 return ;
20522046 }
20532047
2054- if (fsqEmpty ()) {
2048+ if (ftqEmpty ()) {
20552049 DPRINTF (Fetch, " [tid:%i] No FSQ entry available for next fetch\n " , tid);
20562050 return ;
20572051 }
20582052
20592053 assert (dbpbtb);
2060- const auto &stream = dbpbtb->fsqHead ();
2054+ const auto &stream = dbpbtb->ftqHead ();
20612055 const Addr start_pc = stream.startPC ;
20622056 fetchBuffer[tid].startPC = start_pc;
20632057
0 commit comments