assert_change

Ensures that the value of a specified expression changes within a specified number of cycles after a start event initiates checking.

Parameters:
severity_level
width
num_cks
action_on_new_start
property_type
msg
coverage_level
Class:
n-cycle assertion

Syntax

assert_change 
		[#(severity_level, width, num_cks, action_on_new_start, property_type,  
		msg, coverage_level )] 
		instance_name (clk, reset_n, start_event, test_expr );

Parameters

 
severity_level
Severity of the failure. Default: ‘OVL_ERROR.
 
width
Width of the test_expr argument. Default: 1.
 
num_cks
Number of cycles to check for a change in the value of test_expr. Default: 1.
 
action_on_new_start
Method for handling a new start event that occurs before test_expr changes value or num_cks clock cycles transpire without a change. Values are: ‘OVL_IGNORE_NEW_START, ‘OVL_RESET_ON_NEW_START and ‘OVL_ERROR_ON_NEW_START. Default: ‘OVL_IGNORE_NEW_START.
 
property_type
Property type. Default: ‘OVL_ASSERT.
 
msg
Error message printed when assertion fails. Default: “VIOLATION”.
 
coverage_level
Coverage level. Default: ‘OVL_COVER_ALL.

Ports

 
clk
 
Clock event for the assertion. The checker samples on the rising edge of the clock.
 
reset_n
 
Active low synchronous reset signal indicating completed initialization.
 
start_event
 
Expression that (along with action_on_new_start) identifies when to start checking test_expr .
 
test_expr
[ width - 1 : 0 ]
Expression that should change value within num_cks cycles from the start event unless the check is interrupted by a valid new start event.

Description

The assert_change assertion checker checks the expression start_event at each rising edge of clk to determine if it should check for a change in the value of test_expr. If start_event is sampled TRUE, the checker evaluates test_expr and re-evaluates test_expr at each of the subsequent num_cks rising edges of clk. If the value of test_expr has not been sampled changed from its start value by the last of the num_cks cycles, the assertion fails.

The method used to determine how to handle a new start event, when the checker is in the state of checking for a change in test_expr, is controlled by the action_on_new_start parameter. The checker has the following actions:

‘OVL_IGNORE_NEW_START

The checker does not sample start_event for the next num_cks cycles after a start event.

‘OVL_RESET_ON_NEW_START

The checker samples start_event every cycle. If a check is pending and the value of start_event is TRUE, the checker terminates the check and initiates a new check with the current value of test_expr (even on the last cycle of a check).

‘OVL_ERROR_ON_NEW_START

The checker samples start_event every cycle. If a check is pending and the value of start_event is TRUE, the assertion fails with an illegal start event violation. In this case, the checker does not initiate a new check and does not terminate a pending check.

The checker is useful for ensuring proper changes in structures after various events, such as verifying synchronization circuits respond after initial stimuli. For example, it can be used to check the protocol that an “acknowledge” occurs within a certain number of cycles after a “request”. It also can be used to check that a finite-state machine changes state after an initial stimulus.

Assertion Check

 
ASSERT_CHANGE
The test_expr expression did not change value for num_cks cycles after start_event was sampled TRUE.
 
illegal start event
The action_on_new_start parameter is set to ‘OVL_ERROR_ON_NEW_START and start_event expression evaluated to TRUE while the checker was in the state of checking for a change in the value of test_expr.

Cover Points

 
window_open
A change check was initiated.
 
window_close
A change check lasted the full num_cks cycles. If no assertion failure occurred, the value of test_expr changed in the last cycle.
 
window_resets
The action_on_new_start parameter is ‘OVL_RESET_ON_NEW_START, and start_event was sampled TRUE while the checker was monitoring test_expr, but it had not changed value.

See also

assert_time, assert_unchange, assert_win_change, assert_win_unchange, 
assert_window

Examples

  
assert_change #(
 
‘OVL_ERROR,
1,
3,
‘OVL_IGNORE_NEW_START,
‘OVL_ASSERT,
“Error: invalid synchronization”,
‘OVL_COVER_ALL)
// severity_level
// width
// num_cks
// action_on_new_start
// property_type
// msg
// coverage_level
 
valid_sync_out (
 
 
 
clk,
reset_n,
sync == 1,
out );
// clock
// reset
// start_event
// test_expr
    

Ensures that out changes within 3 cycles after sync asserts. New starts are ignored.

  
assert_change #(
 
‘OVL_ERROR,
1,
3,
‘OVL_RESET_ON_NEW_START,
‘OVL_ASSERT,
“Error: invalid synchronization”,
‘OVL_COVER_ALL)
// severity_level
// width
// num_cks
// action_on_new_start
// property_type
// msg
// coverage_level
 
valid_sync_out (
 
 
 
clk,
reset_n,
sync == 1,
out );
// clock
// reset
// start_event
// test_expr
    

Ensures that out changes within 3 cycles after sync asserts. A new start terminates the pending check and initiates a new check.

  
assert_change #(
 
‘OVL_ERROR,
1,
3,
‘OVL_ERROR_ON_NEW_START,
‘OVL_ASSERT,
“Error: invalid synchronization”,
‘OVL_COVER_ALL)
// severity_level
// width
// num_cks
// action_on_new_start
// property_type
// msg
// coverage_level
 
valid_sync_out (
 
 
 
clk,
reset_n,
sync == 1,
out );
// clock
// reset
// start_event
// test_expr
    

Ensures that out changes within 3 cycles after sync asserts. A new start reports an illegal start event violation (without initiating a new check) but any pending check is retained (even on the last check cycle).


  © Accellera Organization, Inc. 2005
All Rights Reserved.
Standard OVL V1.1a