forked from hemanth-VP/SystemVerilog_Course
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sro_static.sv
32 lines (24 loc) · 901 Bytes
/
sro_static.sv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//--------------------------------------------------------------------------------------------
//with help of the scope resolution operator we can access the static properties of class or
//package inside the module
//
//--------------------------------------------------------------------------------------------
class my_class;
int a;
static int b;
function void display();
$display("value of a=%0d",a);
$display("value of b=%0d",b);
endfunction
endclass:my_class
module static_exm;
initial begin:BEGIN_I
my_class A1;
A1 =new();
A1.a=10;
$display("Using the scope resolution operator we can access the static properties");
my_class::b=20;
//Here using the scope resolution operator we declare the value of static properties b inside the module
A1.display();
end:BEGIN_I
endmodule:static_exm