User guide

21-70
OpenVera Native Testbench
Or, to watch for a global reset by the AssertEngine, use the following:
AssertEvent assert_engine_reset = new(ASSERT_RESET);
assert_engine.EnableTrigger(assert_engine_reset);
Each AssertEvent object can be used with only one AssertEngine or
Assertion object. For example, to watch for ASSERT_SUCCESS on
three assertions, you must create three AssertEvent objects and
attach each one to a different assertion object.
Suspending Threads
AssertEvent objects are normally used to suspend a thread until the
event happens. There are two ways to do this: the object’s Wait()
task or with Vera’s sync() task and the object’s Event variable. For
example, using the Wait() task to wait for a global reset action:
assert_engine_reset.Wait();
After a thread resumes, you can see which events happened with
the AssertEvent object’s GetNextEvent() function. If called
repeatedly, the function returns a list of events starting with the most
recent and ending with ASSERT_NULL. For example:
reason = assert_engine_reset.GetNextEvent();
Eliminating AssertEvent Objects
When finished with an event, disable the trigger and recover the
AssertEvent object’s memory space with the associated
AssertEngine or Assertion object’s DisableTrigger() task.
Example 21-7
assert_engine.DisableTrigger(assert_engine_reset);