-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuvm_testbench_top.sv
31 lines (28 loc) · 1.12 KB
/
uvm_testbench_top.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
module uvm_testbench_top;
// QuestaSim has UVM integration out of the box!
import uvm_pkg::*;
// Warning, do not wildcard import into root namespace.
// You may get namespace collisions!
// TODO, figure out a good way to avoid this issue.
// Maybe learn how SystemVerilog namespaces work eventually...
// Designs with multiple clocks use UVM generator modules.
logic [0:0] clk;
//always #5 clk = ~clk;
always begin
#5 clk = 1'b1;
#5 clk = 1'b0;
end
// TODO, Figure out why the zero register hates this commented out one-liner clock?
// I spent some time fidling with initializing it on high instead of low but that's not it.
// EH. Don't break what's not causing current bugs.
// UVM library's interface
dut_if mr_dut_interface_handle(clk);
dut_wrapper mr_dut_wr(._if(mr_dut_interface_handle));
// At the very start of the simulation.
initial begin
// Connect the uvm interface you just made and the uvm config database.
uvm_config_db #(virtual dut_if)::set (null, "uvm_test_top", "dut_if", mr_dut_interface_handle);
// Run the set of tests by name.
run_test ("mr_uvm_test");
end
endmodule