Because the assertion is a statement that something must be true, the failure of an assertion shall have a
severity associated with it. By default, the severity of an assertion failure is error. Other severity levels can
be specified by including one of the following severity system tasks in the fail statement:
$fatal is a run-time fatal.
$error is a run-time error.
$warning is a run-time warning, which can be suppressed in a tool-specific manner.
$info indicates that the assertion failure carries no specific severity.
Assertion Control System Tasks:
SystemVerilog provides three system tasks to control assertions.
$assertoff shall stop the checking of all specified assertions until a subsequent $asserton. An assertion that is already executing, including execution of the pass or fail statement, is not affected.
$assertkill shall abort execution of any currently executing specified assertions and then stop the checking of all specified assertions until a subsequent $asserton.
$asserton shall reenable the execution of all specified assertions. When invoked with no arguments, the system task shall apply to all assertions. When the task is specified with arguments, the first argument indicates levels of the hierarchy, consistent with the corresponding argument to the Verilog $dumpvars system task. Subsequent arguments specify which scopes of the model to control. These arguments can specify entire modules or individual assertions.
Boolean System Function:
$countones : Returns the numbers of 1's in a bit vector.
$past : Returns the values of the past.
$stable : If the Signal is stable, then it returns 1.
$isunknown : If th X is seen in expression , then it returns 1.
$rose : returns true if the LSB of the expression changed to 1. Otherwise, it returns false.
$fell : returns true if the LSB of the expression changed to 0. Otherwise, it returns false.
$onehot : returns true if only 1 bit of the expression is high.
$onehot0 : returns true if at most 1 bit of the expression is high.
What is the difference between $rose and posedge?
posedge returns event where as $rose returns a boolean value. Events cannot be used in expression, $rose can be used.