45#ifndef __CPU_MINOR_FETCH2_HH__
46#define __CPU_MINOR_FETCH2_HH__
55#include "params/BaseMinorCPU.hh"
130 std::unique_ptr<PCStateBase>
pc;
203 const BaseMinorCPUParams ¶ms,
Classes for buffer, queue and FIFO behaviour.
MinorCPU is an in-order CPU model with four fixed pipeline stages:
Interface for things with names.
virtual std::string name() const
Basically a wrapper class to hold both the branch predictor and the BTB.
Forward data betwen Execute and Fetch1 carrying change-of-address/stream information.
This stage receives lines of data from Fetch1, separates them into instructions and passes them to De...
gem5::minor::Fetch2::Fetch2Stats stats
Fetch2(const std::string &name, MinorCPU &cpu_, const BaseMinorCPUParams ¶ms, Latch< ForwardLineData >::Output inp_, Latch< BranchData >::Output branchInp_, Latch< BranchData >::Input predictionOut_, Latch< ForwardInstData >::Input out_, std::vector< InputBuffer< ForwardInstData > > &next_stage_input_buffer)
void evaluate()
Pass on input/buffer data to the output if you can.
void updateBranchPrediction(const BranchData &branch)
Update local branch prediction structures from feedback from Execute.
const ForwardLineData * getInput(ThreadID tid)
Get a piece of data to work on from the inputBuffer, or 0 if there is no data.
std::vector< InputBuffer< ForwardLineData > > inputBuffer
void popInput(ThreadID tid)
Pop an element off the input buffer, if there are any.
MinorCPU & cpu
Pointer back to the containing CPU.
branch_prediction::BPredUnit & branchPredictor
Branch predictor passed from Python configuration.
Latch< ForwardLineData >::Output inp
Input port carrying lines from Fetch1.
bool isDrained()
Is this stage drained? For Fetch2, draining is initiated by Execute halting Fetch1 causing Fetch2 to ...
Latch< BranchData >::Input predictionOut
Output port carrying predictions back to Fetch1.
ThreadID getScheduledThread()
Use the current threading policy to determine the next thread to fetch from.
Latch< ForwardInstData >::Input out
Output port carrying instructions into Decode.
void dumpAllInput(ThreadID tid)
Dump the whole contents of the input buffer.
void predictBranch(MinorDynInstPtr inst, BranchData &branch)
Predicts branches for the given instruction.
std::vector< InputBuffer< ForwardInstData > > & nextStageReserve
Interface to reserve space in the next stage.
bool processMoreThanOneInput
If true, more than one input word can be processed each cycle if there is room in the output to conta...
std::vector< Fetch2ThreadInfo > fetchInfo
unsigned int outputWidth
Width of output of this stage/input of next in instructions.
Latch< BranchData >::Output branchInp
Input port carrying branches from Execute.
Line fetch data in the forward direction.
static const InstSeqNum firstFetchSeqNum
static const InstSeqNum firstStreamSeqNum
First sequence numbers to use in initialisation of the pipeline and to be expected on the first line/...
static const InstSeqNum firstPredictionSeqNum
This is a simple scalar statistic, like a counter.
Top level definition of the Minor in-order CPU model.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
int16_t ThreadID
Thread index/ID type.
Minor contains all the definitions within the MinorCPU apart from the CPU class itself.
Contains class definitions for data flowing between pipeline stages in the top-level structure portio...
statistics::Scalar loadInstructions
statistics::Scalar fpInstructions
Fetch2Stats(MinorCPU *cpu)
statistics::Scalar intInstructions
Stats.
statistics::Scalar storeInstructions
statistics::Scalar amoInstructions
statistics::Scalar vecInstructions
Data members after this line are cycle-to-cycle state.
InstSeqNum expectedStreamSeqNum
Stream sequence number remembered from last time the predictionSeqNum changed.
InstSeqNum fetchSeqNum
Fetch2 is the source of fetch sequence numbers.
bool havePC
PC is currently valid.
InstSeqNum lastStreamSeqNum
Stream sequence number of the last seen line used to identify changes of instruction stream.
std::unique_ptr< PCStateBase > pc
Remembered program counter value.
Fetch2ThreadInfo(const Fetch2ThreadInfo &other)
unsigned int inputIndex
Index into an incompletely processed input line that instructions are to be extracted from.
InstSeqNum predictionSeqNum
Fetch2 is the source of prediction sequence numbers.
bool blocked
Blocked indication for report.