assert_always_on_edge

Ensures that the value of a specified expression is TRUE when a sampling event undergoes a specified transition.

Parameters:
severity_level
edge_type
property_type
msg
coverage_level
Class:
2-cycle assertion

Syntax

assert_always_on_edge 
		[#(severity_level, edge_type, property_type, msg, coverage_level )] 
		instance_name (clk, reset_n, sampling_event, test_expr );

Parameters

 
severity_level
Severity of the failure. Default: ‘OVL_ERROR.
 
edge_type
Transition type for sampling event: ‘OVL_NOEDGE, ‘OVL_POSEDGE, ‘OVL_NEGEDGE or ‘OVL_ANYEDGE. Default: ‘OVL_NOEDGE.
 
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.
 
sampling_event
Expression that (along with edge_type) identifies when to evaluate and test test_expr.
 
test_expr
 
Expression that should evaluate to TRUE on the rising clock edge.

Description

The assert_always_on_edge assertion checker checks the single-bit expression sampling_event for a particular type of transition. If the specified transition of the sampling event occurs, the single-bit expression test_expr is evaluated at the rising edge of clk to verify the expression does not evaluate to FALSE.

The edge_type parameter determines which type of transition of sampling_event initiates the check:

‘OVL_POSEDGE performs the check if sampling_event transitions from FALSE to TRUE.

‘OVL_NEGEDGE performs the check if sampling_event transitions from TRUE to FALSE.

‘OVL_ANYEDGE performs the check if sampling_event transitions from TRUE to FALSE or from FALSE to TRUE.

‘OVL_NOEDGE always initiates the check. This is the default value of edge_type. In this case, sampling_event is never sampled and the checker has the same functionality as assert_always.

The checker is a variant of assert_always, with the added capability of qualifying the assertion with a sampling event transition. This checker is useful when events are identified by their transition in addition to their logical state.

Assertion Check

 
ASSERT_ALWAYS_ON_EDGE
Expression evaluated to FALSE when the sampling event transitioned as specified by edge_type.

Cover Points

none

See also

assert_always, assert_implication, assert_never, assert_proposition

Examples

assert_always_on_edge #(
 
‘OVL_ERROR,
‘OVL_POSEDGE,
‘OVL_ASSERT,
“Error: new req when FSM not ready”,
‘OVL_COVER_ALL)
// severity_level
// edge_type
// property_type
// msg
// coverage_level
 
request_when_FSM_idle (
 
 
 
clk,
reset_n,
req,
state == ‘IDLE);
// clock
// reset
// sampling_event
// test_expr

Ensures that (state == ‘IDLE) is TRUE at each rising edge of clk when req transitions from FALSE to TRUE.

assert_always_on_edge #(
 
‘OVL_ERROR,
‘OVL_ANYEDGE,
‘OVL_ASSERT,
“Error: req transition when FSM not idle”,
‘OVL_COVER_ALL)
// severity_level
// edge_type
// property_type
// msg
// coverage_level
 
req_transition_when_FSM_idle (
 
 
 
clk,
reset_n,
req,
state == ‘IDLE);
// clock
// reset
// sampling_event
// test_expr

Ensures that (state == ‘IDLE) is TRUE at each rising edge of clk when req transitions from TRUE to FALSE or from FALSE to TRUE.

assert_always_on_edge #(
 
‘OVL_ERROR,
‘OVL_NOEDGE,
‘OVL_ASSERT,
“Error: req when FSM not idle”,
‘OVL_COVER_ALL)
// severity_level
// edge_type
// property_type
// msg
// coverage_level
 
req_when_FSM_idle (
 
 
 
clk,
reset_n,
1’b0,
!req || (state == ‘IDLE) );
// clock
// reset
// sampling_event
// test_expr

Ensures that (!req || (state == ‘IDLE)) is TRUE at each rising edge of clk.


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