User guide

24-211
SystemVerilog Testbench Constructs
In the above example, if the modport passed to the testbench is of
asynchronous type “intf.master” then the program will be:
program tb(intf.master ckb);
virtual intf.master x = ckb;
initial begin
x.d <= 1; @(x.d); $display($time,,x.d);
x.d <= 2; @(x.d); $display($time,,x.d);
end
endprogram
The output of this example is:
0 1
0 2
Since clocking information is not passed through modport, the values
are driven irrespective of clock.
Array of Virtual Interface
You can declare an array of virtual interfaces like any other array.
Arrays of virtual interfaces can have aggregate assignment with
arrays of interface instance. You can pass the entire array of virtual
interfaces or a part of it can be passed to procedural methods
(including class constructor).
The following program illustrates how to use arrays of virtual
interfaces:
interface intf;
int k = 30;
endinterface