-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEnvironment.sv
More file actions
56 lines (46 loc) · 1.28 KB
/
Environment.sv
File metadata and controls
56 lines (46 loc) · 1.28 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
class Environment;
//Virtual Interface to LC3
vLC3if vlc3if;
int clock_period;
Generator gen;
Agent agt;
Driver drv;
Monitor mon;
Scoreboard scb;
Checker chk;
mailbox #(MemoryTransaction) gen2agt, agt2drv, agt2scb, scb2chk, mon2chk, drv2mon;
int count;
event agt2scbhs, chk2gen, drv2chk;
function new(int count, int clock_periodi);
this.count = count;
clock_period=clock_periodi;
endfunction;
function void build();
vlc3if = $root.top.lc3_if;
gen2agt = new();
agt2drv = new();
agt2scb = new();
scb2chk = new();
mon2chk = new();
drv2mon = new();
gen = new(gen2agt, chk2gen);
agt = new(gen2agt,agt2drv, agt2scb,agt2scbhs);
drv = new(agt2drv, 3, vlc3if, chk2gen, drv2mon, drv2chk);
mon = new(mon2chk, vlc3if, clock_period, drv2mon);
scb = new(agt2scb, scb2chk, chk2gen);
chk = new(scb2chk, mon2chk,
chk2gen, scb,drv2chk);
endfunction
task run();
#(clock_period*6)
fork
gen.run(count);
agt.run(count);
drv.run(count);
mon.run(count);
scb.run(count);
chk.run(count);
//cast_opcode(count);
join
endtask
endclass