mode_32bit: std_ulogic;
rd_is_niap4: std_ulogic;
predicted_taken: std_ulogic;
- pred_not_taken: std_ulogic;
predicted_nia: std_ulogic_vector(63 downto 0);
end record;
signal r, r_next : Fetch1ToIcacheType;
r.pred_ntaken <= r_next.pred_ntaken;
r.nia <= r_next.nia;
r_int.predicted_taken <= r_next_int.predicted_taken;
- r_int.pred_not_taken <= r_next_int.pred_not_taken;
r_int.predicted_nia <= r_next_int.predicted_nia;
r_int.rd_is_niap4 <= r_next_int.rd_is_niap4;
end if;
v.predicted := '0';
v.pred_ntaken := '0';
v_int.predicted_taken := '0';
- v_int.pred_not_taken := '0';
v_int.rd_is_niap4 := '0';
if rst = '1' then
end if;
elsif r_int.predicted_taken = '1' then
v.nia := r_int.predicted_nia;
- v.predicted := '1';
- else
+ elsif r.req = '1' then
v_int.rd_is_niap4 := '1';
- v.pred_ntaken := r_int.pred_not_taken;
v.nia := std_ulogic_vector(unsigned(r.nia) + 4);
if r_int.mode_32bit = '1' then
v.nia(63 downto 32) := x"00000000";
btc_rd_data(BTC_WIDTH - 3 downto BTC_TARGET_BITS)
= v.nia(BTC_TAG_BITS + BTC_ADDR_BITS + 1 downto BTC_ADDR_BITS + 2) then
v_int.predicted_taken := btc_rd_data(BTC_WIDTH - 1);
- v_int.pred_not_taken := not btc_rd_data(BTC_WIDTH - 1);
+ v.predicted := btc_rd_data(BTC_WIDTH - 1);
+ v.pred_ntaken := not btc_rd_data(BTC_WIDTH - 1);
end if;
end if;
v_int.predicted_nia := btc_rd_data(BTC_TARGET_BITS - 1 downto 0) & "00";
hit_smark : std_ulogic;
hit_valid : std_ulogic;
big_endian: std_ulogic;
+ predicted : std_ulogic;
+ pred_ntaken: std_ulogic;
-- Cache miss state (reload state machine)
state : state_t;
i_out.stop_mark <= r.hit_smark;
i_out.fetch_failed <= r.fetch_failed;
i_out.big_endian <= r.big_endian;
- i_out.next_predicted <= i_in.predicted;
- i_out.next_pred_ntaken <= i_in.pred_ntaken;
+ i_out.next_predicted <= r.predicted;
+ i_out.next_pred_ntaken <= r.pred_ntaken;
-- Stall fetch1 if we have a miss on cache or TLB or a protection fault
stall_out <= not (is_hit and access_ok);
r.hit_smark <= i_in.stop_mark;
r.hit_nia <= i_in.nia;
r.big_endian <= i_in.big_endian;
+ r.predicted <= i_in.predicted;
+ r.pred_ntaken <= i_in.pred_ntaken;
end if;
if i_out.valid = '1' then
assert not is_X(i_out.insn) severity failure;