Fix branch prediction for compressed instruction with unaligned addresses (#756)

Signed-off-by: Gianmarco Ottavi <gianmarco@openhwgroup.org>

Co-authored-by: Gianmarco Ottavi <gianmarco@openhwgroup.org>
This commit is contained in:
Gianmarco Ottavi 2021-10-10 11:09:45 +02:00 committed by GitHub
parent 56165adc82
commit 010eed815b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -123,8 +123,8 @@ module frontend import ariane_pkg::*; #(
// select the right branch prediction result
// in case we are serving an unaligned instruction in instr[0] we need to take
// the prediction we saved from the previous fetch
assign bht_prediction_shifted[0] = (serving_unaligned) ? bht_q : bht_prediction[0];
assign btb_prediction_shifted[0] = (serving_unaligned) ? btb_q : btb_prediction[0];
assign bht_prediction_shifted[0] = (serving_unaligned) ? bht_q : bht_prediction[addr[0][1]];
assign btb_prediction_shifted[0] = (serving_unaligned) ? btb_q : btb_prediction[addr[0][1]];
// for all other predictions we can use the generated address to index
// into the branch prediction data structures
for (genvar i = 1; i < INSTR_PER_FETCH; i++) begin : gen_prediction_address