-
Notifications
You must be signed in to change notification settings - Fork 2
/
mac_tb.sv
54 lines (44 loc) · 1011 Bytes
/
mac_tb.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
////////////////////////////////////////////////
//File:mac_tb_top
//Data:2017/06/03
//Description:mac test bench
///////////////////////////////////////////////
`timescale 1ps/1fs
`include "uvm_pkg.sv"
`include "mac_pkg.sv"
module mac_tb_top;
import uvm_pkg::*;
import mac_pkg::*;
logic clk;
logic rst;
parameter clk_cycle = 12_500;//clk_cycle=12.5ns
//interface declaration
mac_if mac_if(.rst(rst),.clk(clk));
//connect the interface to the dut
dut u_dut(.clk(clk),
.rst(rst),
.tx_frame(mac_if.tx_frame),
.tx_valid(mac_if.tx_valid),
.tx_data(mac_if.tx_data),
.rx_frame(mac_if.rx_frame),
.rx_valid(mac_if.rx_valid),
.rx_data(mac_if.rx_data)
);
initial
begin
uvm_config_db#(virtual mac_if)::set(uvm_root::get(),"*","vif",drv_if);
run_test();
end
initial
begin
clk = 1'b1;
forever begin
clk = #(clk_cycle/2) ~clk;
end
end
initial
begin
rst = 1'b1;
#(100ns) rst = 1'b0;
end
endmodule