3737#include < unistd.h>
3838
3939#include " CustomHWUnits/MCADLSUnit.h"
40+ #include " CustomStages/MCADFetchDelayStage.h"
4041#include " MCAViews/SummaryView.h"
4142#include " MCAViews/TimelineView.h"
4243#include " MCAWorker.h"
@@ -183,6 +184,7 @@ std::unique_ptr<mca::Pipeline> MCAWorker::createDefaultPipeline() {
183184
184185 // Create the pipeline stages.
185186 auto Fetch = std::make_unique<EntryStage>(SrcMgr);
187+ auto FetchDelay = std::make_unique<MCADFetchDelayStage>(MCII);
186188 auto Dispatch = std::make_unique<DispatchStage>(STI, MRI, MCAPO.DispatchWidth ,
187189 *RCU, *PRF);
188190 auto Execute =
@@ -198,6 +200,7 @@ std::unique_ptr<mca::Pipeline> MCAWorker::createDefaultPipeline() {
198200 // Build the pipeline.
199201 auto StagePipeline = std::make_unique<Pipeline>();
200202 StagePipeline->appendStage (std::move (Fetch));
203+ StagePipeline->appendStage (std::move (FetchDelay));
201204 if (MCAPO.MicroOpQueueSize )
202205 StagePipeline->appendStage (std::make_unique<MicroOpQueueStage>(
203206 MCAPO.MicroOpQueueSize , MCAPO.DecodersThroughput ));
@@ -224,6 +227,7 @@ std::unique_ptr<mca::Pipeline> MCAWorker::createInOrderPipeline() {
224227
225228 // Create the pipeline stages.
226229 auto Entry = std::make_unique<EntryStage>(SrcMgr);
230+ auto FetchDelay = std::make_unique<MCADFetchDelayStage>(MCII);
227231 auto InOrderIssue = std::make_unique<InOrderIssueStage>(STI, *PRF, *CB, *LSU);
228232 auto StagePipeline = std::make_unique<Pipeline>();
229233
@@ -233,6 +237,7 @@ std::unique_ptr<mca::Pipeline> MCAWorker::createInOrderPipeline() {
233237
234238 // Build the pipeline.
235239 StagePipeline->appendStage (std::move (Entry));
240+ StagePipeline->appendStage (std::move (FetchDelay));
236241 StagePipeline->appendStage (std::move (InOrderIssue));
237242
238243 for (auto *listener : Listeners) {
@@ -420,6 +425,9 @@ Error MCAWorker::run() {
420425 << " has Token " << MDTok << " \n " );
421426 NewInst->setIdentifier (MDTok);
422427 }
428+
429+ // Add this instruction to be processed by the pipeline
430+ // (Entry stage will consume from source manager.)
423431 SrcMgr.addInst (std::move (NewInst));
424432 }
425433 }
0 commit comments