-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTestProgram.sv
52 lines (40 loc) · 1.32 KB
/
TestProgram.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import pkg_arbiter_types::*;
import pkg_arbiter_driver::*;
import pkg_arbiter_receiver::*;
import pkg_arbiter_generator::*;
import pkg_arbiter_scoreboard::*;
program automatic TestProgram(if_to_arbiter bfm);
parameter num_unit = NUMUNITS;
parameter addr_wd = ADDRESSWIDTH;
MiniDriver drvr;
MiniReceiver rcvr;
Generator generator;
Scoreboard scoreboard;
mailbox generator_driver_mailbox, scorebard_driver_mailbox, scoreboard_receiver_mailbox;
initial begin
//1 slot in mailbox to prevent memory overflow
generator_driver_mailbox = new(1024);
scorebard_driver_mailbox = new(1024);
scoreboard_receiver_mailbox = new(1);
drvr = new("drvr[0]", bfm, generator_driver_mailbox, scorebard_driver_mailbox);
rcvr = new("rcvr[0]", bfm, scoreboard_receiver_mailbox);
generator = new(generator_driver_mailbox);
scoreboard = new(scorebard_driver_mailbox, scoreboard_receiver_mailbox);
reset();
fork : test
drvr.start();
rcvr.start();
generator.start();
scoreboard.start();
join_any;
disable test;
$display ($time, " [END] Test done.");
scoreboard.bilan();
$finish;
end
task reset();
$display ($time, " [RESET] Design Reset Start");
bfm.reset_if();
$display ($time, " [RESET] Design Reset End");
endtask
endprogram