|
@ -13,7 +13,9 @@ module properties ( |
|
|
input DoutAccept_i, |
|
|
input DoutAccept_i, |
|
|
// Internals
|
|
|
// Internals
|
|
|
input [2:0] s_fsm_state, |
|
|
input [2:0] s_fsm_state, |
|
|
input [7:0] s_header |
|
|
|
|
|
|
|
|
input [7:0] s_header, |
|
|
|
|
|
input s_error, |
|
|
|
|
|
input [7:0] s_register [0:7] |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -33,13 +35,22 @@ module properties ( |
|
|
always @(posedge Clk_i) |
|
|
always @(posedge Clk_i) |
|
|
init_state = 0; |
|
|
init_state = 0; |
|
|
|
|
|
|
|
|
|
|
|
// Default clocking & reset
|
|
|
|
|
|
|
|
|
default clocking |
|
|
default clocking |
|
|
@(posedge Clk_i); |
|
|
@(posedge Clk_i); |
|
|
endclocking |
|
|
endclocking |
|
|
|
|
|
|
|
|
|
|
|
default disable iff (!Reset_n_i); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Constraints
|
|
|
// Constraints
|
|
|
|
|
|
|
|
|
|
|
|
assume property ( |
|
|
|
|
|
DinValid_i && !DinAccept_o |=> |
|
|
|
|
|
$stable(DinValid_i) |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
assume property ( |
|
|
assume property ( |
|
|
DinValid_i && !DinAccept_o |=> |
|
|
DinValid_i && !DinAccept_o |=> |
|
|
$stable(Din_i) |
|
|
$stable(Din_i) |
|
@ -90,33 +101,33 @@ module properties ( |
|
|
|
|
|
|
|
|
// State changes
|
|
|
// State changes
|
|
|
|
|
|
|
|
|
assert property (disable iff (!Reset_n_i) |
|
|
|
|
|
|
|
|
assert property ( |
|
|
s_fsm_state == 0 |=> s_fsm_state == 1 |
|
|
s_fsm_state == 0 |=> s_fsm_state == 1 |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
assert property (disable iff (!Reset_n_i) |
|
|
|
|
|
|
|
|
assert property ( |
|
|
s_fsm_state == 1 && DinValid_i && DinStart_i && DinStop_i && Din_i[3:0] == `READ |=> |
|
|
s_fsm_state == 1 && DinValid_i && DinStart_i && DinStop_i && Din_i[3:0] == `READ |=> |
|
|
s_fsm_state == 2 |
|
|
s_fsm_state == 2 |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
assert property (disable iff (!Reset_n_i) |
|
|
|
|
|
|
|
|
assert property ( |
|
|
s_fsm_state == 1 && DinValid_i && DinStart_i && !DinStop_i && Din_i[3:0] == `WRITE |=> |
|
|
s_fsm_state == 1 && DinValid_i && DinStart_i && !DinStop_i && Din_i[3:0] == `WRITE |=> |
|
|
s_fsm_state == 3 |
|
|
s_fsm_state == 3 |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
assert property (disable iff (!Reset_n_i) |
|
|
|
|
|
|
|
|
assert property ( |
|
|
s_fsm_state == 2 |=> s_fsm_state == 4 |
|
|
s_fsm_state == 2 |=> s_fsm_state == 4 |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
assert property (disable iff (!Reset_n_i) |
|
|
|
|
|
|
|
|
assert property ( |
|
|
s_fsm_state == 4 && DoutValid_o && DoutAccept_i && s_header[3:0] == `READ |=> s_fsm_state == 5 |
|
|
s_fsm_state == 4 && DoutValid_o && DoutAccept_i && s_header[3:0] == `READ |=> s_fsm_state == 5 |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
assert property (disable iff (!Reset_n_i) |
|
|
|
|
|
|
|
|
assert property ( |
|
|
s_fsm_state == 4 && DoutValid_o && DoutAccept_i && s_header[3:0] != `READ |=> s_fsm_state == 6 |
|
|
s_fsm_state == 4 && DoutValid_o && DoutAccept_i && s_header[3:0] != `READ |=> s_fsm_state == 6 |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
assert property (disable iff (!Reset_n_i) |
|
|
|
|
|
|
|
|
assert property ( |
|
|
s_fsm_state == 6 && DoutValid_o && DoutAccept_i |=> s_fsm_state == 0 |
|
|
s_fsm_state == 6 && DoutValid_o && DoutAccept_i |=> s_fsm_state == 0 |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
@ -128,11 +139,31 @@ module properties ( |
|
|
s_header[3:0] inside {`READ, `WRITE} |
|
|
s_header[3:0] inside {`READ, `WRITE} |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
assert property ( |
|
|
|
|
|
s_fsm_state > 1 |=> |
|
|
|
|
|
$stable(s_header) |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
assert property ( |
|
|
assert property ( |
|
|
DoutStart_o && DoutValid_o |-> |
|
|
DoutStart_o && DoutValid_o |-> |
|
|
Dout_o[3:0] == s_header[3:0] |
|
|
Dout_o[3:0] == s_header[3:0] |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
assert property ( |
|
|
|
|
|
s_fsm_state inside {1, 2, 3} |-> |
|
|
|
|
|
!s_error |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
assert property ( |
|
|
|
|
|
s_fsm_state >= 4 |-> |
|
|
|
|
|
s_error == !(s_header[7:4] <= 7) |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
assert property ( |
|
|
|
|
|
DoutStop_o && DoutValid_o |-> |
|
|
|
|
|
Dout_o == s_error |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
assert property ( |
|
|
assert property ( |
|
|
DoutValid_o && !DoutAccept_i |=> |
|
|
DoutValid_o && !DoutAccept_i |=> |
|
|
$stable(Dout_o) |
|
|
$stable(Dout_o) |
|
@ -164,6 +195,32 @@ module properties ( |
|
|
DoutValid_o |-> s_fsm_state >= 4 && s_fsm_state <= 6 |
|
|
DoutValid_o |-> s_fsm_state >= 4 && s_fsm_state <= 6 |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Write ack frame
|
|
|
|
|
|
assert property ( |
|
|
|
|
|
DoutValid_o && DoutStart_o && DoutAccept_i && Dout_o[3:0] == `WRITE |=> |
|
|
|
|
|
!DoutValid_o ##1 |
|
|
|
|
|
DoutValid_o && DoutStop_o |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Read ack frame
|
|
|
|
|
|
assert property ( |
|
|
|
|
|
DoutValid_o && DoutStart_o && DoutAccept_i && Dout_o[3:0] == `READ |=> |
|
|
|
|
|
!DoutValid_o ##1 |
|
|
|
|
|
DoutValid_o && !DoutStart_o && !DoutStop_o && !DoutAccept_i [*] ##1 |
|
|
|
|
|
DoutValid_o && !DoutStart_o && !DoutStop_o && DoutAccept_i ##1 |
|
|
|
|
|
!DoutValid_o ##1 |
|
|
|
|
|
DoutValid_o && DoutStop_o |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Can only be proven with abc at the moment
|
|
|
|
|
|
// smtbmc fails with unbounded proof
|
|
|
|
|
|
assert property ( |
|
|
|
|
|
s_fsm_state == 1 && DinValid_i && DinStart_i && !DinStop_i && DinAccept_o && Din_i[3:0] == `WRITE && Din_i[7:4] <= 7 ##1 |
|
|
|
|
|
!DinValid_i [*] ##1 |
|
|
|
|
|
s_fsm_state == 3 && DinValid_i && DinAccept_o && DinStop_i |=> |
|
|
|
|
|
s_register[s_header[7:4]] == $past(Din_i) |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
endmodule |
|
|
endmodule |
|
|
|
|
|
|
|
|