User guide

23-34
SystemVerilog Assertion Constructs
cbAssertionLocalVarDestroyed
VCS calls this callback type when it destroys an SVA local
variable. This happens when an assertion succeeds or fails.
All these callback types return a handle to the local variable that
caused the event. Use the handle provided in the callback to get the
name and value of the local variable. Your application is responsible
for keeping track of the destroyed local variable handles. Using a
destroyed variable handle results in unpredictable behavior.
You use the vpi_register_assertion_cb method to register a callback
on an SVA. Whenever a local variable event happens on that SVA,
VCS invokes the corresponding callback with that local variable
handle embedded in the attempt information.
Note:
You do not have the flexibility to register a callback on a single
local variable or part (bit or part select) of the variable. For
embedding the local variable handle the attempt_info structure is
extended as follows.
typedef struct t_vpi_attempt_info {
union {
vpiHandle failExpr;
p_vpi_assertion_step_info step;
p_vpi_attempt_local_var_info local_var_info;
} detail;
s_vpi_time attemptStartTime; /* Time attempt triggered */
} s_vpi_attempt_info, *p_vpi_attempt_info;
typedef struct t_vpi_attempt_local_var_info {
vpiHandle localVar;
} s_vpi_attempt_local_var_info,
*p_vpi_attempt_local_var_info;