Is it possible to write assertions in a class?
Is it possible to write assertions in a class?
Model answer
**Immediate assertions** ( assert (...) , assume , cover ) **can** be written inside a class, in its methods (functions and tasks). The check is performed when the method that contains the assertion is called. (Simulated: assert passed .) **Concurrent assertions** ( assert property , with a clock and a property) **cannot** be declared in a class. They belong in modules, interfaces, programs or checkers. In QuestaSim, assert property as a class member gives a syntax error. To check protocol rules over time, put the concurrent assertions in an interface or a module (or in a bind ed checker) and let the class use the interface.