//--------------------------------------------------------------------------- // // ASSERT_WIN_UNCHANGE // //--------------------------------------------------------------------------- // NAME // ASSERT_WIN_UNCHANGE - Event bounded window expecting a change. // //--------------------------------------------------------------------------- module assert_win_unchange (clk, reset_n, start_event, test_expr, end_event); // synopsys template parameter severity_level=0; parameter width=1; `ifdef ASSERT_V1_0_1 // Previous version of the library `else // New version to allow for future options parameter options = 0; `endif parameter msg="VIOLATION"; input clk; input reset_n; input start_event; input [width-1:0] test_expr; input end_event; //synopsys translate_off `ifdef ASSERT_ON reg r_change; reg [width-1:0] r_test_expr; reg r_state; parameter WIN_UNCHANGE_START = 1'b0; parameter WIN_UNCHANGE_CHECK = 1'b1; initial begin r_state=WIN_UNCHANGE_START; r_change=1'b0; end parameter assert_name = "ASSERT_WIN_UNCHANGE"; integer error_count; initial error_count = 0; `include "ovl_task.h" `ifdef ASSERT_INIT_MSG initial ovl_init_msg; // Call the User Defined Init Message Routine `endif always @(posedge clk) begin `ifdef ASSERT_GLOBAL_RESET if (`ASSERT_GLOBAL_RESET != 1'b0) begin `else if (reset_n != 0) begin // active low reset `endif case (r_state) WIN_UNCHANGE_START: if (start_event == 1'b1) begin r_change <= 1'b0; r_state <= WIN_UNCHANGE_CHECK; r_test_expr <= test_expr; end WIN_UNCHANGE_CHECK: begin if (r_test_expr != test_expr) begin r_change <= 1'b1; end // go to start state on last check if (end_event == 1'b1) begin r_state <= WIN_UNCHANGE_START; end // Check that the property is true if ((r_change == 1'b1) || (r_test_expr != test_expr)) begin ovl_error(""); end r_test_expr <= test_expr; end endcase end else begin r_state<=WIN_UNCHANGE_START; r_change<=1'b0; end end // always `endif //synopsys translate_on endmodule