User guide

24-54
SystemVerilog Testbench Constructs
This is the display within MyPacket
This is the display within YourPacket
This is a typical, albeit small, example of polymorphism at work.
Scope Resolution Operator ::
Scope resolution operator allows you to access user defined class
types as shown in the following example:
program p;
class A;
typedef enum {red,yellow,blue} color;
typedef byte MYBYTE;
endclass
A::MYBYTE b1 = 8'hff; //declaring b1 of class byte type
A::color c1; //declaring c1 of class enum type
initial begin
$display("%h",b1);
$display("%0d",c1.first);
$display("%0d",c1.next);
end
endprogram
The Output of the program is:
ff
0
1