-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv.sv
More file actions
60 lines (43 loc) · 1.09 KB
/
env.sv
File metadata and controls
60 lines (43 loc) · 1.09 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
class env;
virtual mem_intf vif;
mailbox gen_drv;
mailbox gen_scb;
mailbox mon_scb;
// mailbox drv_scb;
generator gen;
driver drv;
monitor mon;
scoreboard scb;
event gen_ended;
event scb_ended;
int repeat_count;
function new(int repeat_count, virtual mem_intf vif);
gen_drv = new();
gen_scb = new();
mon_scb = new();
// drv_scb=new();
this.vif = vif;
this.repeat_count = repeat_count;
gen = new(gen_drv, gen_scb, repeat_count, gen_ended);
drv = new(gen_drv, vif);
mon = new(mon_scb, vif);
scb = new(mon_scb, gen_scb, scb_ended, repeat_count);
endfunction
task test();
fork
gen.run();
drv.run();
mon.run();
scb.run();
join_any
endtask
task post_test();
wait(scb_ended.triggered);
wait(drv.txns_received == repeat_count && scb.txns_received == repeat_count);
endtask
task run();
test();
post_test();
$finish;
endtask
endclass