User guide

21-67
OpenVera Native Testbench
Example 21-4
program {
...
AssertEngine assert_engine = new();
assert_engine.Configure(ASSERT_QUIET, ASSERT_FALSE);
assert_engine.Configure(ASSERT_INFO, ASSERT_TRUE);
}
Resetting Assertion
At any time during the simulation, you can reset all attempts at
matching assertions. You might want to reset when you switch to a
new test and do not want to be confused by attempts started in the
previous test. For example:
assert_engine.DoAction(ASSERT_RESET);
Instantiating Assertion Objects
Use AssertEngine functions to obtain handles to Assertion objects.
You can specify the assertion or expression by the full hierarchical
name. For example, for an assertion named check1 in a unit named
test:
Assertion assert_check1;
assert_check1 = assert_engine.GetAssert("test.check1");
Note:
When the assertion name is invalid, the value returned is “null.”
Another way is to create a loop and collect handles to all of the
assertions. This way the number of assertions and their names can
vary without changing the testbench. The GetFirstAssert() function
can be used anytime to obtain the first assertion or expression in the
compiled list. This is not necessarily the first in the Assertion source