assert_delta

Ensures that the value of a specified expression changes only by a value in the specified range.

Parameters:
severity_level
width
min
max
property_type
msg
coverage_level
Class:
2-cycle assertion

Syntax

assert_delta 
		[#(severity_level, width, min, max, property_type, msg, coverage_level )] 
		instance_name (clk, reset_n, test_expr );

Parameters

 
severity_level
Severity of the failure. Default: ‘OVL_ERROR.
 
width
Width of the test_expr argument. Default: 1.
 
min
Minimum delta value allowed for test_expr. Default: 1.
 
max
Maximum delta value allowed for test_expr. Default: 1.
 
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.
 
test_expr
[ width - 1: 0 ]
Expression that should only change by a delta value in the range min to max.

Description

The assert_delta assertion checker checks the expression test_expr at each rising edge of clk to determine if its value has changed from its value at the previous rising edge of clk. If so, the checker verifies that the difference between the new value and the previous value (i.e., the delta value) is in the range from min to max, inclusive. If the delta value is less than min or greater than max, the assertion fails.

The checker is useful for ensuring proper changes in control structures such as up-down counters. For these structures, assert_delta can check for underflow and overflow. In datapath and arithmetic circuits, assert_delta can check for “smooth” transitions of the values of various variables (for example, for a variable that controls a physical variable that cannot detect a severe change from its previous value).

Assertion Check

 
ASSERT_DELTA
Expression changed value by a delta value not in the range min to max.

Cover Point

 
test_expr_change
Expression changed value.

Errors

The parameters min and max must be specified such that min is less than or equal to max. Otherwise, the assertion fails on each tested clock cycle.

Notes

1. The assertion check compares the current value of test_expr with its previous value. Therefore, checking does not start until the second rising clock edge of clk after reset_n deasserts.

2. The assertion check allows the value of test_expr to wrap. The overflow or underflow amount is included in the delta value calculation.

See also

assert_decrement, assert_increment, assert_no_overflow, 
assert_no_underflow, assert_range

Example

  
assert_delta #(
 
‘OVL_ERROR,
16,
0,
8,
‘OVL_ASSERT,
“Error: y values not smooth”,
‘OVL_COVER_ALL)
// severity_level
// width
// min
// max
// property_type
// msg
// coverage_level
 
valid_smooth (
 
 
 
clk,
reset_n,
y );
// clock
// reset
// test_expr
    

Ensures that the y output only changes by a maximum of 8 units each cycle (min is 0).


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