forked from hemanth-VP/SystemVerilog_Course
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stat_arr_rndm.sv
28 lines (22 loc) · 932 Bytes
/
stat_arr_rndm.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
class static_array;
randc byte a[7];
endclass
module stat_array;
static_array stat_arr;
initial begin
stat_arr = new();
$display ("Static array - Size is already declare. So, we can only randomize ");
$display (" the elements of it . ");
$display ("-------------------------------------------------------------------");
$display ("rand byte a[5]; // Data type is byte");
$display ("-------------------------------------------------------------------");
$display ("Before randomize the elements of arrayi 'a'");
$display ("Assign by default value of array data type.");
$display (" %0p", stat_arr.a);
void '(stat_arr.randomize ());
$display ("------------------------------------------------------------------");
$display ("After randomize the elements of array 'a'");
$display ("Output = %0p ",stat_arr.a);
$display ("-------------------------------------------------------------------");
end
endmodule