Branch Prediction

(Ask a Question)
Branch prediction is supported by all the processor cores. The branch prediction block includes the following components:

The branch prediction incurs a one-cycle latency, such that correctly predicted control-flow instructions result in no penalty. Mispredicted control-flow instructions incur a three-cycle latency. The Branch Prediction Mode (bpm) M-mode CSR at 0x7C0 is used to customize the current branch prediction behavior for predictable execution time. The following table lists the bpm CSR.

Table 1. Branch Prediction Mode (bpm) CSR
Branch Prediction Mode (0x7C0)
Bits Field Name Attribute Description
0 bdp WARL Branch Direction Prediction. Determines the value returned by the BHT component of the branch prediction system.
  • A zero value indicates the dynamic direction prediction
  • a non-zero value indicates the static-taken direction prediction.

The BTB is cleared on any write to bdp, and the RAS is unaffected by writes to bdp.

[63:1] Reserved RO