📄 assert_unchange_logic.sv
字号:
// Accellera Standard V1.0 Open Verification Library (OVL).
// Accellera Copyright (c) 2005. All rights reserved.
parameter assert_name = "ASSERT_UNCHANGE";
`include "std_ovl_task.h"
`ifdef OVL_INIT_MSG
initial
ovl_init_msg_t; // Call the User Defined Init Message Routine
`endif
initial begin
if ((num_cks <=0) ||
~((action_on_new_start == `OVL_IGNORE_NEW_START) ||
(action_on_new_start == `OVL_RESET_ON_NEW_START) ||
(action_on_new_start == `OVL_ERROR_ON_NEW_START))) begin
ovl_error_t("illegal action_on_new_start parameter");
end
end
`ifdef OVL_SHARED_CODE
reg window = 0;
integer i = 0;
always @ (posedge clk) begin
if (`OVL_RESET_SIGNAL != 1'b0) begin
if (!window && start_event == 1'b1) begin
window <= 1'b1;
i <= num_cks;
end
else if (window) begin
if (i == 1 && (action_on_new_start != `OVL_RESET_ON_NEW_START || start_event != 1'b1))
window <= 1'b0;
if (action_on_new_start == `OVL_RESET_ON_NEW_START && start_event == 1'b1)
i <= num_cks;
else if (i != 1)
i <= i - 1;
end // if (window)
end
else begin
window <= 1'b0;
i <= 0;
end
end
`endif // OVL_SHARED_CODE
property ASSERT_UNCHANGE_P;
@(posedge clk)
disable iff (`OVL_RESET_SIGNAL != 1'b1)
(start_event && !window) |=> ($stable(test_expr)[*num_cks]);
endproperty
property ASSERT_UNCHANGE_RESET_ON_START_P;
@(posedge clk)
disable iff (`OVL_RESET_SIGNAL != 1'b1)
(start_event) |=> (
($stable(test_expr)[*num_cks])
or
($stable(test_expr)[*0:num_cks-1] ##1 start_event)
);
endproperty
property ASSERT_UNCHANGE_ERR_ON_START_P;
@(posedge clk)
disable iff (`OVL_RESET_SIGNAL != 1'b1)
window |-> !start_event;
endproperty
`ifdef OVL_ASSERT_ON
generate
case (property_type)
`OVL_ASSERT : begin
if (action_on_new_start != `OVL_RESET_ON_NEW_START)
A_ASSERT_UNCHANGE_P:
assert property (ASSERT_UNCHANGE_P)
else ovl_error_t("");
if (action_on_new_start == `OVL_RESET_ON_NEW_START)
A_ASSERT_UNCHANGE_RESET_ON_START_P:
assert property (ASSERT_UNCHANGE_RESET_ON_START_P)
else ovl_error_t("");
if (action_on_new_start == `OVL_ERROR_ON_NEW_START)
A_ASSERT_UNCHANGE_ERR_ON_START_P:
assert property (ASSERT_UNCHANGE_ERR_ON_START_P)
else ovl_error_t("illegal start event");
end
`OVL_ASSUME : begin
if (action_on_new_start != `OVL_RESET_ON_NEW_START)
M_ASSERT_UNCHANGE_P:
assume property (ASSERT_UNCHANGE_P);
if (action_on_new_start == `OVL_RESET_ON_NEW_START)
M_ASSERT_UNCHANGE_RESET_ON_START_P:
assume property (ASSERT_UNCHANGE_RESET_ON_START_P);
if (action_on_new_start == `OVL_ERROR_ON_NEW_START)
M_ASSERT_UNCHANGE_ERR_ON_START_P:
assume property (ASSERT_UNCHANGE_ERR_ON_START_P);
end
default : ovl_error_t("");
endcase
endgenerate
`endif // OVL_ASSERT_ON
`ifdef OVL_COVER_ON
generate
if (coverage_level != `OVL_COVER_NONE) begin
cover_window_open:
cover property (@(posedge clk) ( (`OVL_RESET_SIGNAL != 1'b0) &&
start_event && !window) )
ovl_cover_t("window_open covered");
cover_window_close:
cover property (@(posedge clk) ( (`OVL_RESET_SIGNAL != 1'b0) &&
window && (i == 1 && (action_on_new_start != `OVL_RESET_ON_NEW_START || start_event != 1'b1))
)
)
ovl_cover_t("window_close covered");
if (action_on_new_start == `OVL_RESET_ON_NEW_START)
cover_window_resets:
cover property (@(posedge clk) ( (`OVL_RESET_SIGNAL != 1'b0) &&
start_event && window) )
ovl_cover_t("window_resets covered");
end
endgenerate
`endif // OVL_COVER_ON
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -