Check for invalid branch decision when performing a branch as an

assertion
This commit is contained in:
Andreas Traber 2015-10-12 13:26:55 +02:00
parent 06cf9f1dfe
commit 4d2280bc3c
2 changed files with 6 additions and 1 deletions

2
alu.sv
View file

@ -536,7 +536,7 @@ module riscv_alu
shift_left = 1'b0;
shift_amt = operand_b_i;
result_o = 'x;
flag_o = 1'b0;
flag_o = 1'bx;
unique case (operator_i)
// Standard Operations

View file

@ -539,4 +539,9 @@ module riscv_controller
assign perf_jr_stall_o = jr_stall_o;
assign perf_ld_stall_o = load_stall_o;
// Assertions
assert property (
@(posedge clk) (pc_mux_sel_o == `PC_BRANCH) |-> (branch_decision_i !== 1'bx) );
endmodule // controller