| 1 |
31 |
qaztronic |
//////////////////////////////////////////////////////////////////////
|
| 2 |
|
|
//// ////
|
| 3 |
|
|
//// Copyright (C) 2015 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 |
|
|
module tb_top();
|
| 29 |
|
|
|
| 30 |
|
|
// --------------------------------------------------------------------
|
| 31 |
|
|
// test bench clock & reset
|
| 32 |
|
|
wire clk_100mhz;
|
| 33 |
|
|
wire tb_clk = clk_100mhz;
|
| 34 |
|
|
wire tb_rst;
|
| 35 |
|
|
wire aclk = tb_clk;
|
| 36 |
|
|
wire aresetn = ~tb_rst;
|
| 37 |
|
|
wire clk = tb_clk;
|
| 38 |
|
|
wire reset = tb_rst;
|
| 39 |
|
|
|
| 40 |
|
|
tb_base #(.PERIOD(10_000)) tb(clk_100mhz, tb_rst);
|
| 41 |
|
|
|
| 42 |
|
|
|
| 43 |
|
|
// --------------------------------------------------------------------
|
| 44 |
|
|
//
|
| 45 |
|
|
localparam A = 32;
|
| 46 |
|
|
localparam N = 8;
|
| 47 |
|
|
localparam B = 7;
|
| 48 |
|
|
|
| 49 |
|
|
|
| 50 |
|
|
// --------------------------------------------------------------------
|
| 51 |
|
|
//
|
| 52 |
|
|
amm_if #(.A(A), .N(N), .B(B))
|
| 53 |
|
|
amm_m(.*);
|
| 54 |
|
|
|
| 55 |
|
|
amm_if #(.A(A), .N(N), .B(B))
|
| 56 |
|
|
amm_s(.*);
|
| 57 |
|
|
|
| 58 |
|
|
|
| 59 |
|
|
// --------------------------------------------------------------------
|
| 60 |
|
|
//
|
| 61 |
|
|
|
| 62 |
|
|
|
| 63 |
|
|
// --------------------------------------------------------------------
|
| 64 |
|
|
// sim models
|
| 65 |
|
|
// | | | | | | | | | | | | | | | | |
|
| 66 |
|
|
// \|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/
|
| 67 |
|
|
// ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
|
| 68 |
|
|
|
| 69 |
|
|
// --------------------------------------------------------------------
|
| 70 |
|
|
//
|
| 71 |
|
|
import tb_amm_bfm_agent_pkg::*;
|
| 72 |
|
|
|
| 73 |
|
|
|
| 74 |
|
|
// --------------------------------------------------------------------
|
| 75 |
|
|
//
|
| 76 |
|
|
amm_checker #(.A(A), .N(N), .B(B))
|
| 77 |
|
|
amm_checker_i(.*);
|
| 78 |
|
|
|
| 79 |
|
|
|
| 80 |
|
|
// --------------------------------------------------------------------
|
| 81 |
|
|
//
|
| 82 |
|
|
amm_master_bfm_if #(.A(A), .N(N))
|
| 83 |
|
|
tb_amm_m(.*);
|
| 84 |
|
|
|
| 85 |
|
|
amm_slave_bfm_if #(.A(A), .N(N))
|
| 86 |
|
|
tb_amm_s(.*);
|
| 87 |
|
|
|
| 88 |
|
|
|
| 89 |
|
|
// --------------------------------------------------------------------
|
| 90 |
|
|
//
|
| 91 |
|
|
tb_amm_bfm_agent_class bfm;
|
| 92 |
|
|
|
| 93 |
|
|
initial
|
| 94 |
|
|
bfm = new(tb_amm_m, tb_amm_s);
|
| 95 |
|
|
|
| 96 |
|
|
|
| 97 |
|
|
// ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
|
| 98 |
|
|
// /|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\-/|\
|
| 99 |
|
|
// | | | | | | | | | | | | | | | | |
|
| 100 |
|
|
// sim models
|
| 101 |
|
|
// --------------------------------------------------------------------
|
| 102 |
|
|
|
| 103 |
|
|
|
| 104 |
|
|
// --------------------------------------------------------------------
|
| 105 |
|
|
// debug wires
|
| 106 |
|
|
|
| 107 |
|
|
|
| 108 |
|
|
// --------------------------------------------------------------------
|
| 109 |
|
|
// test
|
| 110 |
|
|
the_test test( tb_clk, tb_rst );
|
| 111 |
|
|
|
| 112 |
|
|
initial
|
| 113 |
|
|
begin
|
| 114 |
|
|
|
| 115 |
|
|
test.run_the_test();
|
| 116 |
|
|
|
| 117 |
|
|
$display("^^^---------------------------------");
|
| 118 |
|
|
$display("^^^ %16.t | Testbench done.", $time);
|
| 119 |
|
|
$display("^^^---------------------------------");
|
| 120 |
|
|
|
| 121 |
|
|
$display("^^^---------------------------------");
|
| 122 |
|
|
|
| 123 |
|
|
$stop();
|
| 124 |
|
|
|
| 125 |
|
|
end
|
| 126 |
|
|
|
| 127 |
|
|
endmodule
|
| 128 |
|
|
|
| 129 |
|
|
|
| 130 |
|
|
|