Calling functions or tasks in a sequence
On a successful match of a sequence, task or function (including system task/function) can be called.
Calling functions or tasks in a sequence example
On matching a sequence, function func is called and its return value is stored locally in variable value and system task $display is used to print the local variable.
sequence seq;
logic value;
req1 ##1 (req2, value = func, $display("Output of function value = %0h", value)) ;
endsequence
Instantiation of property in another property
The property expression can be instantiated in another property as shown in the below example.
Instantiation of property in another property example
property p1(req1, req2);
req1 |-> req2;
endproperty
property p2;
@(posedge clk);
Req3 ##2 |=>
if(en)
p1(req1, req2)
else out = 0;
endproperty
SystemVerilog Assertions