3737#include < unistd.h>
3838
3939#include " CustomHWUnits/MCADLSUnit.h"
40+ #include " CustomHWUnits/NaiveBranchPredictorUnit.h"
4041#include " CustomStages/MCADFetchDelayStage.h"
4142#include " MCAViews/SummaryView.h"
4243#include " MCAViews/TimelineView.h"
@@ -181,10 +182,11 @@ std::unique_ptr<mca::Pipeline> MCAWorker::createDefaultPipeline() {
181182 MCAPO.StoreQueueSize ,
182183 MCAPO.AssumeNoAlias , &MDRegistry);
183184 auto HWS = std::make_unique<Scheduler>(SM, *LSU);
185+ auto BPU = std::make_unique<NaiveBranchPredictorUnit>(20 );
184186
185187 // Create the pipeline stages.
186188 auto Fetch = std::make_unique<EntryStage>(SrcMgr);
187- auto FetchDelay = std::make_unique<MCADFetchDelayStage>(MCII);
189+ auto FetchDelay = std::make_unique<MCADFetchDelayStage>(MCII, MDRegistry, *BPU );
188190 auto Dispatch = std::make_unique<DispatchStage>(STI, MRI, MCAPO.DispatchWidth ,
189191 *RCU, *PRF);
190192 auto Execute =
@@ -196,6 +198,7 @@ std::unique_ptr<mca::Pipeline> MCAWorker::createDefaultPipeline() {
196198 TheMCA.addHardwareUnit (std::move (PRF));
197199 TheMCA.addHardwareUnit (std::move (LSU));
198200 TheMCA.addHardwareUnit (std::move (HWS));
201+ TheMCA.addHardwareUnit (std::move (BPU));
199202
200203 // Build the pipeline.
201204 auto StagePipeline = std::make_unique<Pipeline>();
@@ -224,16 +227,18 @@ std::unique_ptr<mca::Pipeline> MCAWorker::createInOrderPipeline() {
224227 auto LSU = std::make_unique<MCADLSUnit>(SM, MCAPO.LoadQueueSize ,
225228 MCAPO.StoreQueueSize ,
226229 MCAPO.AssumeNoAlias , &MDRegistry);
230+ auto BPU = std::make_unique<NaiveBranchPredictorUnit>(20 );
227231
228232 // Create the pipeline stages.
229233 auto Entry = std::make_unique<EntryStage>(SrcMgr);
230- auto FetchDelay = std::make_unique<MCADFetchDelayStage>(MCII);
234+ auto FetchDelay = std::make_unique<MCADFetchDelayStage>(MCII, MDRegistry, *BPU );
231235 auto InOrderIssue = std::make_unique<InOrderIssueStage>(STI, *PRF, *CB, *LSU);
232236 auto StagePipeline = std::make_unique<Pipeline>();
233237
234238 // Pass the ownership of all the hardware units to this Context.
235239 TheMCA.addHardwareUnit (std::move (PRF));
236240 TheMCA.addHardwareUnit (std::move (LSU));
241+ TheMCA.addHardwareUnit (std::move (BPU));
237242
238243 // Build the pipeline.
239244 StagePipeline->appendStage (std::move (Entry));
0 commit comments