assert_one_cold

Ensures that the value of a specified expression is one-cold (or equals an inactive state value, if specified).

Parameters:
severity_level
width
inactive
property_type
msg
coverage_level
Class:
single-cycle assertion

Syntax

assert_one_cold 
		[#(severity_level, width, inactive, 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: 32.
 
inactive
Inactive state of test_expr: ‘OVL_ALL_ZEROS, ‘OVL_ALL_ONES or ‘OVL_ONE_COLD. Default: ‘OVL_ONE_COLD.
 
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 evaluate to a one-cold or inactive value on the rising clock edge.

Description

The assert_one_cold assertion checker checks the expression test_expr at each rising edge of clk to verify the expression evaluates to a one-cold or inactive state value. A one-cold value has exactly one bit set to 0. The inactive state value for the checker is set by the inactive parameter. Choices are: ‘OVL _ALL_ZEROS (e.g., 4‘b0000), ‘OVL_ALL_ONES (e.g.,4‘b1111) or ‘OVL_ONE_COLD. The default inactive parameter value is ‘OVL_ONE_COLD, which indicates test_expr has no inactive state (so only a one-cold value is valid for each check).

The checker is useful for verifying control circuits, for example, it can ensure that a finite-state machine with one-cold encoding operates properly and has exactly one bit asserted low. In a datapath circuit the checker can ensure that the enabling conditions for a bus do not result in bus contention.

Assertion Checks

 
ASSERT_ONE_COLD
Expression assumed an active state with multiple bits set to 0.
 
test_expr contains X/Z value
Expression evaluated to a value with an X or Z bit, and ‘OVL_XCHECK_OFF is not set.

Cover Points

 
all_one_colds_checked
Expression evaluated to all possible combinations of one-cold values.
 
test_expr_all_zeros
Expression evaluated to the inactive state and the inactive parameter was set to ‘OVL_ALL_ZEROS.
 
test_expr_all_ones
Expression evaluated to the inactive state and the inactive parameter was set to ‘OVL_ALL_ONES.
 
test_expr_change
Expression has changed value.

Notes

1. By default, the assert_one_cold assertion is pessimistic and the assertion fails if test_expr is active and multiple bits are not 1 (i.e.equals 0, X, Z, etc.). However, if ‘OVL_XCHECK_OFF is set, the assertion fails if and only if test_expr is active and multiple bits are 0.

See also

assert_one_hot, assert_zero_one_hot

Examples

assert_one_cold #(
 
‘OVL_ERROR,
4,
‘OVL_ONE_COLD,
‘OVL_ASSERT,
“Error: sel_n not one-cold”,
‘OVL_COVER_ALL)
// severity_level
// width
// inactive (no inactive state)
// property_type
// msg
// coverage_level
 
valid_sel_n_one_cold (
 
 
 
clk,
reset_n,
sel_n );
// clock
// reset
// test_expr

Ensures that sel_n is one-cold at each rising edge of clk.

assert_one_cold #(
 
‘OVL_ERROR,
4,
‘OVL_ALL_ONES,
‘OVL_ASSERT,
“Error: sel_n not one-cold or inactive”,
‘OVL_COVER_ALL)
// severity_level
// width
// inactive
// property_type
// msg
// coverage_level
 
valid_sel_n_one_cold (
 
 
 
clk,
reset_n,
sel_n );
// clock
// reset
// test_expr

Ensures that sel_n is one-cold or inactive (4’b1111) at each rising edge of clk.

assert_one_cold #(
 
‘OVL_ERROR,
4,
‘OVL_ALL_ZEROS,
‘OVL_ASSERT,
“Error: sel_n not one-cold”,
‘OVL_COVER_ALL)
// severity_level
// width
// inactive
// property_type
// msg
// coverage_level
 
valid_sel_n_one_cold (
 
 
 
clk,
reset_n,
sel_n );
// clock
// reset
// test_expr

Ensures that sel_n is one-cold or inactive (4’b0000) at each rising edge of clk.


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