User guide
21-68
OpenVera Native Testbench
file: the order might change while compiling. The GetNextAssert()
function fetches more Assertion handles until it delivers a null,
indicating the end of the list. You can identify the handles with the
Assertion object’s GetName() function.
In Example 21-5, the testbench sets up Assertion objects for all
assertions and expressions, however many there might be:
Example 21-5
Assertion assert_check[];
string assert_name[];
int i = 0;
assert_check[0] = assert_engine.GetFirstAssert()
while (assert_check[i] != null)
{
assert_name[i] = assert_check[i].GetName();
...
assert_check[++i] = assert_engine.GetNextAssert();
}
This testbench also creates arrays of handles and names.
Controlling Evaluation Attempts
You can control attempts on individual assertions at any time during
the simulation with the DoAction() task. For example, to reset
attempts on the test.check1 assertion shown in the example in the
previous section, you could use the following:
assert_check1.DoAction(ASSERT_RESET);
Counting Successes and Failures
You can set up a running count of evaluation successes or failures.
This does not need an AssertEvent object. To start the counting, just
call the Assertion object’s EnableCount() task. To see the current