[if,pmp] Check second bit instead of third for instruction alignment

Signed-off-by: Marno van der Maas <mvdmaas+git@lowrisc.org>
This commit is contained in:
Marno van der Maas 2022-10-05 18:28:35 +01:00 committed by Marno van der Maas
parent 0e396d5944
commit 7ab2571bea

View file

@ -386,13 +386,13 @@ module ibex_if_stage import ibex_pkg::*; #(
// An error can come from the instruction address, or the next instruction address for unaligned,
// uncompressed instructions.
assign if_instr_pmp_err = pmp_err_if_i |
(if_instr_addr[2] & ~instr_is_compressed & pmp_err_if_plus2_i);
(if_instr_addr[1] & ~instr_is_compressed & pmp_err_if_plus2_i);
// Combine bus errors and pmp errors
assign if_instr_err = if_instr_bus_err | if_instr_pmp_err;
// Capture the second half of the address for errors on the second part of an instruction
assign if_instr_err_plus2 = ((if_instr_addr[2] & ~instr_is_compressed & pmp_err_if_plus2_i) |
assign if_instr_err_plus2 = ((if_instr_addr[1] & ~instr_is_compressed & pmp_err_if_plus2_i) |
fetch_err_plus2) & ~pmp_err_if_i;
// compressed instruction decoding, or more precisely compressed instruction