|
gem5 [DEVELOP-FOR-25.1]
|
The fetch target class. More...
#include <ftq.hh>
Public Member Functions | |
| FetchTarget (const ThreadID _tid, const PCStateBase &_start_pc, FTSeqNum _seqNum) | |
| Fetch Target Methods -----------------------------—. | |
| Addr | startAddress () |
| Addr | endAddress () |
| unsigned | size () |
| bool | inRange (Addr addr) |
| bool | isExitInst (Addr addr) |
| bool | isExitBranch (Addr addr) |
| bool | hasExceeded (Addr addr) |
| FTSeqNum | ftNum () |
| Returns the fetch target number. | |
| ThreadID | getTid () |
| Returns the thread ID. | |
| void | setPredTarg (const PCStateBase &pred_pc) |
| Set the predicted target of the exit branch. | |
| const PCStateBase & | readPredTarg () |
| Read the predicted target of the exit branch. | |
| const PCStateBase & | readStartPC () |
| Read the start address PC. | |
| const PCStateBase & | readEndPC () |
| Read the exit/end address PC. | |
| bool | predTaken () |
| Check if the exit branch was predicted taken. | |
| void | finalize (const PCStateBase &exit_pc, bool _is_branch, bool pred_taken, const PCStateBase &pred_pc) |
| Complete a fetch target with the exit instruction. | |
| std::string | toString () |
| Print the fetch target for debugging. | |
Public Attributes | |
| branch_prediction::BPredUnit::PredictorHistory * | bpuHistory |
| Anchor point to attach a branch predictor history. | |
Private Attributes | |
| std::unique_ptr< PCStateBase > | startPC |
| Start address of the fetch target. | |
| std::unique_ptr< PCStateBase > | endPC |
| End address of the fetch target. | |
| std::unique_ptr< PCStateBase > | predPC |
| Predicted target address of the fetch target. | |
| const FTSeqNum | ftSeqNum |
| const ThreadID | tid |
| The thread this FT belongs to. | |
| bool | is_branch |
| Whether the exit instruction is a branch. | |
| bool | taken |
| If the exit branch is predicted taken. | |
The fetch target class.
A fetch target is used to cary branch prediction information from the decoupled branch predictor to the fetch stage. It is similar to a basic block in that it contains a continous block of instructios and typically ends with a branch. The fetch target may not contain a branch if the block exceeds the maximum size of the fetch target. In this case the next fetch target will start with the susequent address of the current fetch targets end. A fetch target may also span multiple 'surprise' branches which are branches that are never taken and thus not in the BTB and therfore invisible to the branch predictor which will treat these branches as ordinary instructions.
| gem5::o3::FetchTarget::FetchTarget | ( | const ThreadID | _tid, |
| const PCStateBase & | _start_pc, | ||
| FTSeqNum | _seqNum ) |
Fetch Target Methods -----------------------------—.
Definition at line 54 of file ftq.cc.
References bpuHistory, ftSeqNum, is_branch, gem5::ArmISA::set, startPC, taken, and tid.
|
inline |
Definition at line 125 of file ftq.hh.
References endPC, and gem5::MaxAddr.
Referenced by hasExceeded(), inRange(), isExitBranch(), isExitInst(), and size().
| void gem5::o3::FetchTarget::finalize | ( | const PCStateBase & | exit_pc, |
| bool | _is_branch, | ||
| bool | pred_taken, | ||
| const PCStateBase & | pred_pc ) |
|
inline |
|
inline |
|
inline |
Definition at line 156 of file ftq.hh.
References gem5::X86ISA::addr, and endAddress().
|
inline |
Definition at line 138 of file ftq.hh.
References gem5::X86ISA::addr, endAddress(), and startAddress().
|
inline |
Definition at line 150 of file ftq.hh.
References gem5::X86ISA::addr, endAddress(), and is_branch.
|
inline |
Definition at line 144 of file ftq.hh.
References gem5::X86ISA::addr, and endAddress().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set the predicted target of the exit branch.
Definition at line 177 of file ftq.hh.
References predPC, and gem5::ArmISA::set.
|
inline |
Definition at line 132 of file ftq.hh.
References endAddress(), and startAddress().
|
inline |
| std::string gem5::o3::FetchTarget::toString | ( | ) |
| branch_prediction::BPredUnit::PredictorHistory* gem5::o3::FetchTarget::bpuHistory |
Anchor point to attach a branch predictor history.
Will carry information while FT is waiting in th FTQ.
Definition at line 114 of file ftq.hh.
Referenced by FetchTarget().
|
private |
End address of the fetch target.
Definition at line 93 of file ftq.hh.
Referenced by endAddress(), finalize(), readEndPC(), and toString().
|
private |
Definition at line 100 of file ftq.hh.
Referenced by FetchTarget(), ftNum(), and toString().
|
private |
Whether the exit instruction is a branch.
Definition at line 106 of file ftq.hh.
Referenced by FetchTarget(), finalize(), isExitBranch(), and toString().
|
private |
Predicted target address of the fetch target.
Only valid when the ft ends with branch.
Definition at line 97 of file ftq.hh.
Referenced by finalize(), readPredTarg(), and setPredTarg().
|
private |
Start address of the fetch target.
Definition at line 90 of file ftq.hh.
Referenced by FetchTarget(), readStartPC(), startAddress(), and toString().
|
private |
If the exit branch is predicted taken.
Definition at line 109 of file ftq.hh.
Referenced by FetchTarget(), finalize(), and predTaken().
|
private |
The thread this FT belongs to.
Definition at line 103 of file ftq.hh.
Referenced by FetchTarget(), and getTid().