assert_increment

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

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

Syntax

assert_increment 
		[#(severity_level, width, value, 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.
 
value
Increment value 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 increment by value whenever its value changes from the rising edge of clk to the next rising edge of clk.

Description

The assert_increment 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 new value equals the previous value incremented by value. The checker allows the value of test_expr to wrap, if the total change equals the increment value. For example, if width is 5 and value is 4, then the following change in test_expr is valid:

	5’b11110 ——> 5’b00010

The checker is useful for ensuring proper changes in structures such as counters and finite-state machines. For example, the checker is useful for circular queue structures with address counters that can wrap. Do not use this checker for variables or expressions that can decrement. Instead consider using the assert_delta checker.

Assertion Check

 
ASSERT_INCREMENT
Expression evaluated to a value that is not its previous value incremented by value.

Cover Point

 
test_expr_change
Expression changed value.

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.

See also

assert_decrement, assert_delta, assert_no_overflow

Example

  
assert_increment #(
 
‘OVL_ERROR,
4,
1,
‘OVL_ASSERT,
“Error: invalid binary increment”,
‘OVL_COVER_ALL)
// severity_level
// width
// value
// property_type
// msg
// coverage_level
 
valid_count (
 
 
 
clk,
reset_n,
count );
// clock
// reset
// test_expr
    

Ensures that the programmable counter’s count variable only increments by 1. If count wraps, the assertion fails, because the change is not a binary increment.


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