-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdefault_test.sv
More file actions
43 lines (31 loc) · 861 Bytes
/
default_test.sv
File metadata and controls
43 lines (31 loc) · 861 Bytes
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
33
34
35
36
37
38
39
40
41
42
43
`ifndef DEFAULT_TEST
`define DEFAULT_TEST
`include "environment.sv"
program test(mem_intf intf);
class my_trans extends transaction;
bit [1:0] count;
function void pre_randomize();
wr_en.rand_mode(0);
rd_en.rand_mode(0);
addr.rand_mode(0);
wr_en = 0;
rd_en = 1;
addr = cnt;
cnt++;
endfunction
endclass
//declaring environment instance
environment env;
my_trans my_tr;
initial begin
//creating environment
env = new(intf);
my_tr = new();
//setting the repeat count of generator as 4, means to generate 4 packets
env.gen.repeat_count = 4;
env.gen.trans = my_tr;
//calling run of env, it interns calls generator and driver main tasks.
env.run();
end
endprogram
`endif