assert_unchange

Ensures that the value of a specified expression does not change for 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_unchange 
		[#(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 test_expr should remain unchanged after a start event. Default: 1.
 
action_on_new_start
Method for handling a new start event that occurs before num_cks clock cycles transpire without a change in the value of test_expr. 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 not change value for num_cks cycles from the start event unless the check is interrupted by a valid new start event.

Description

The assert_unchange 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. Each time the checker re-evaluates test_expr, if its value has changed from its value in the previous cycle, 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.

‘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. For example, it can be used to check that multiple-cycle operations with enabling conditions function properly with the same data. It can be used to check that single-cycle operations function correctly with data loaded at different cycles. It also can be used to verify synchronizing conditions that require date to be stable after an initial triggering event.

Assertion Checks

 
ASSERT_UNCHANGE
The test_expr expression changed value within 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.
 
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 without detecting a changed value.

See also

assert_change, assert_time, assert_win_change, assert_win_unchange, 
assert_window

Examples

  
assert_unchange #(
 
‘OVL_ERROR,
8,
8,
‘OVL_IGNORE_NEW_START,
‘OVL_ASSERT,
“Error: a changed during divide”,
‘OVL_COVER_ALL)
// severity_level
// width
// num_cks
// action_on_new_start
// property_type
// msg
// coverage_level
 
valid_div_unchange_a (
 
 
 
clk,
reset_n,
start == 1,
a);
// clock
// reset
// start_event
// test_expr
    

Ensures that a remains unchanged while a divide operation is performed (8 cycles). Restarts during divide operations are ignored.

  
assert_unchange #(
 
‘OVL_ERROR,
8,
8,
‘OVL_RESET_ON_NEW_START,
‘OVL_ASSERT,
“Error: a changed during divide”,
‘OVL_COVER_ALL)
// severity_level
// width
// num_cks
// action_on_new_start
// property_type
// msg
// coverage_level
 
valid_div_unchange_a (
 
 
 
clk,
reset_n,
start == 1,
a);
// clock
// reset
// start_event
// test_expr
    

Ensures that a remains unchanged while a divide operation is performed (8 cycles). A restart during a divide operation starts the check over.

  
assert_unchange #(
 
‘OVL_ERROR,
8,
8,
‘OVL_ERROR_ON_NEW_START,
‘OVL_ASSERT,
“Error: a changed during divide”,
‘OVL_COVER_ALL)
// severity_level
// width
// num_cks
// action_on_new_start
// property_type
// msg
// coverage_level
 
valid_div_unchange_a (
 
 
 
clk,
reset_n,
start == 1,
a);
// clock
// reset
// start_event
// test_expr
    

Ensures that a remains unchanged while a divide operation is performed (8 cycles). A restart during a divide operation is a violation.


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