-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheth_testbench_top.sv
64 lines (52 loc) · 1.62 KB
/
eth_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
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
61
62
63
64
`include "uvm_pkg.sv"
import uvm_pkg::*;
`include "eth_intf.sv"
`include "eth_seq_tx.sv"
`include "eth_seq.sv"
`include "eth_sequencer.sv"
`include "eth_driver.sv"
`include "eth_monitor.sv"
`include "eth_agent.sv"
`include "eth_scoreboard.sv"
`include "eth_environment.sv"
`include "eth_test.sv"
`include "eth_sw2x2.v"
module eth_tbench_top;
//creatinng instance of interface, inorder to connect DUT and testcase
eth_if intf();
//DUT instance, interface signals are connected to the DUT ports
eth_sw2x2 DUT(
.clk(intf.clk),
.reset_n(intf.reset_n),
.inDataA(intf.inDataA),
.inSopA(intf.inSopA),
.inEopA(intf.inEopA),
.inDataB(intf.inDataB),
.inSopB(intf.inSopB),
.inEopB(intf.inEopB),
.outDataA(intf.outDataA),
.outSopA(intf.outSopA),
.outEopA(intf.outEopA),
.outDataB(intf.outDataB),
.outSopB(intf.outSopB),
.outEopB(intf.outEopB),
.portAStall(intf.portAStall),
.portBStall(intf.portBStall)
);
initial begin
//Registers the Interface in the configuration block so that other
//blocks can use it
uvm_resource_db#(virtual eth_if)::set(.scope("ifs"),.name("eth_if"),.val(intf));
run_test();//Executes the test
end
initial begin //enabling the wave dump
uvm_config_db#(virtual eth_if)::set(uvm_root::get(),"*","vif",intf);
$dumpfile("dump.vcd"); $dumpvars;
end
initial begin
intf.clk <= 1'b1;
end
//Clock generation
always
#5 intf.clk = ~intf.clk;
endmodule