-
Notifications
You must be signed in to change notification settings - Fork 3
/
testbench.sv
46 lines (36 loc) · 1.38 KB
/
testbench.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
`include "interface.sv"
`include "tb_pkg.sv"
module top;
import uvm_pkg::*;
import tb_pkg::*;
bit clk; // external signal declaration
//----------------------------------------------------------------------------
intf i_intf(clk);
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
ring_counter DUT(.rst(i_intf.rst),
.clk(i_intf.clk),
.out(i_intf.out)
);
//----------------------------------------------------------------------------
initial begin
clk = 0;
end
always #5 clk = ~clk;
//----------------------------------------------------------------------------
initial begin
$dumpfile("dumpfile.vcd");
$dumpvars;
end
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
initial begin
uvm_config_db#(virtual intf)::set(uvm_root::get(),"","vif",i_intf);
end
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
initial begin
run_test("ring_test");
end
//----------------------------------------------------------------------------
endmodule