1 |
50 |
qaztronic |
//////////////////////////////////////////////////////////////////////
|
2 |
|
|
//// ////
|
3 |
|
|
//// Copyright (C) 2017 Authors and OPENCORES.ORG ////
|
4 |
|
|
//// ////
|
5 |
|
|
//// This source file may be used and distributed without ////
|
6 |
|
|
//// restriction provided that this copyright statement is not ////
|
7 |
|
|
//// removed from the file and that any derivative work contains ////
|
8 |
|
|
//// the original copyright notice and the associated disclaimer. ////
|
9 |
|
|
//// ////
|
10 |
|
|
//// This source file is free software; you can redistribute it ////
|
11 |
|
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
12 |
|
|
//// Public License as published by the Free Software Foundation; ////
|
13 |
|
|
//// either version 2.1 of the License, or (at your option) any ////
|
14 |
|
|
//// later version. ////
|
15 |
|
|
//// ////
|
16 |
|
|
//// This source is distributed in the hope that it will be ////
|
17 |
|
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
18 |
|
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
19 |
|
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
20 |
|
|
//// details. ////
|
21 |
|
|
//// ////
|
22 |
|
|
//// You should have received a copy of the GNU Lesser General ////
|
23 |
|
|
//// Public License along with this source; if not, download it ////
|
24 |
|
|
//// from http://www.opencores.org/lgpl.shtml ////
|
25 |
|
|
//// ////
|
26 |
|
|
//////////////////////////////////////////////////////////////////////
|
27 |
|
|
// ----------------------------------------------------------------------------
|
28 |
|
|
|
29 |
|
|
import tb_axis_gear_box_pkg::*;
|
30 |
|
|
import tests_pkg::*;
|
31 |
|
|
import uvm_pkg::*;
|
32 |
|
|
`include "uvm_macros.svh"
|
33 |
|
|
|
34 |
|
|
module tb_top();
|
35 |
|
|
|
36 |
|
|
// --------------------------------------------------------------------
|
37 |
|
|
// test bench clock & reset
|
38 |
|
|
wire clk_100mhz;
|
39 |
|
|
wire tb_clk = clk_100mhz;
|
40 |
|
|
wire tb_rst;
|
41 |
|
|
|
42 |
|
|
tb_base #(.PERIOD(10_000)) tb(clk_100mhz, tb_rst);
|
43 |
|
|
|
44 |
|
|
// --------------------------------------------------------------------
|
45 |
|
|
//
|
46 |
|
|
wire tb_rst_s;
|
47 |
|
|
wire aclk = tb_clk;
|
48 |
|
|
wire aresetn = ~tb_rst_s;
|
49 |
|
|
wire clk = tb_clk;
|
50 |
|
|
wire reset = tb_rst_s;
|
51 |
|
|
|
52 |
|
|
sync_reset sync_reset_i(tb_clk, tb_rst, tb_rst_s);
|
53 |
|
|
|
54 |
|
|
// --------------------------------------------------------------------
|
55 |
|
|
//
|
56 |
|
|
import tb_axis_gear_box_pkg::*;
|
57 |
|
|
|
58 |
|
|
// --------------------------------------------------------------------
|
59 |
|
|
//
|
60 |
|
|
tb_dut_if #(dut_cfg) dut_bus(.*);
|
61 |
|
|
|
62 |
|
|
// --------------------------------------------------------------------
|
63 |
|
|
//
|
64 |
|
|
axis_gear_box
|
65 |
|
|
dut
|
66 |
|
|
(
|
67 |
|
|
.axis_in(dut_bus.axis_in),
|
68 |
|
|
.axis_out(dut_bus.axis_out),
|
69 |
|
|
.aclk(dut_bus.aclk),
|
70 |
|
|
.aresetn(dut_bus.aresetn)
|
71 |
|
|
);
|
72 |
|
|
|
73 |
|
|
// --------------------------------------------------------------------
|
74 |
|
|
//
|
75 |
|
|
assign dut_bus.axis_out.tready = 1;
|
76 |
|
|
|
77 |
|
|
// --------------------------------------------------------------------
|
78 |
|
|
//
|
79 |
|
|
tb_dut_config #(dut_cfg) cfg_h;
|
80 |
|
|
|
81 |
|
|
initial
|
82 |
|
|
begin
|
83 |
|
|
cfg_h = new(dut_bus);
|
84 |
|
|
uvm_config_db #(tb_dut_config #(dut_cfg))::set(null, "*env_h", "tb_dut_config", cfg_h);
|
85 |
|
|
run_test("t_debug");
|
86 |
|
|
end
|
87 |
|
|
|
88 |
|
|
// --------------------------------------------------------------------
|
89 |
|
|
//
|
90 |
|
|
endmodule
|