| 1 |
32 |
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 |
|
|
`timescale 1ps/1ps
|
| 29 |
|
|
|
| 30 |
|
|
|
| 31 |
|
|
module the_test(input tb_clk, input tb_rst);
|
| 32 |
|
|
|
| 33 |
|
|
// --------------------------------------------------------------------
|
| 34 |
|
|
//
|
| 35 |
|
|
import verbosity_pkg::*;
|
| 36 |
|
|
|
| 37 |
|
|
|
| 38 |
|
|
// --------------------------------------------------------------------
|
| 39 |
|
|
//
|
| 40 |
|
|
task run_the_test;
|
| 41 |
|
|
|
| 42 |
|
|
// --------------------------------------------------------------------
|
| 43 |
|
|
// insert test below
|
| 44 |
|
|
// --------------------------------------------------------------------
|
| 45 |
|
|
$display("^^^---------------------------------");
|
| 46 |
|
|
$display("^^^ %16.t | Testbench begun.\n", $time);
|
| 47 |
|
|
$display("^^^---------------------------------");
|
| 48 |
|
|
// --------------------------------------------------------------------
|
| 49 |
|
|
|
| 50 |
|
|
// --------------------------------------------------------------------
|
| 51 |
|
|
tb_top.tb.timeout_stop(50us);
|
| 52 |
|
|
|
| 53 |
|
|
// --------------------------------------------------------------------
|
| 54 |
|
|
// set_verbosity(VERBOSITY_DEBUG);
|
| 55 |
33 |
qaztronic |
tb_top.ast_source_i.bfm.init();
|
| 56 |
|
|
tb_top.ast_sink_i.bfm.init();
|
| 57 |
32 |
qaztronic |
|
| 58 |
|
|
// --------------------------------------------------------------------
|
| 59 |
|
|
wait(~tb_rst);
|
| 60 |
|
|
|
| 61 |
|
|
// --------------------------------------------------------------------
|
| 62 |
|
|
#200ns;
|
| 63 |
33 |
qaztronic |
tb_top.ast_source_i.bfm.set_transaction_data(32'h0000_0000);
|
| 64 |
|
|
tb_top.ast_source_i.bfm.set_transaction_sop(1);
|
| 65 |
|
|
tb_top.ast_source_i.bfm.set_transaction_eop(0);
|
| 66 |
|
|
tb_top.ast_source_i.bfm.push_transaction();
|
| 67 |
32 |
qaztronic |
|
| 68 |
33 |
qaztronic |
tb_top.ast_source_i.bfm.set_transaction_data(32'h1111_1111);
|
| 69 |
|
|
tb_top.ast_source_i.bfm.set_transaction_sop(0);
|
| 70 |
|
|
tb_top.ast_source_i.bfm.set_transaction_eop(0);
|
| 71 |
|
|
tb_top.ast_source_i.bfm.push_transaction();
|
| 72 |
32 |
qaztronic |
|
| 73 |
33 |
qaztronic |
tb_top.ast_source_i.bfm.set_transaction_data(32'h2222_2222);
|
| 74 |
|
|
tb_top.ast_source_i.bfm.set_transaction_sop(0);
|
| 75 |
|
|
tb_top.ast_source_i.bfm.set_transaction_eop(1);
|
| 76 |
|
|
tb_top.ast_source_i.bfm.push_transaction();
|
| 77 |
32 |
qaztronic |
|
| 78 |
33 |
qaztronic |
tb_top.ast_source_i.bfm.set_transaction_data(32'h3333_3333);
|
| 79 |
|
|
tb_top.ast_source_i.bfm.set_transaction_sop(1);
|
| 80 |
|
|
tb_top.ast_source_i.bfm.set_transaction_eop(0);
|
| 81 |
|
|
tb_top.ast_source_i.bfm.push_transaction();
|
| 82 |
|
|
|
| 83 |
|
|
tb_top.ast_source_i.bfm.set_transaction_data(32'h4444_4444);
|
| 84 |
|
|
tb_top.ast_source_i.bfm.set_transaction_sop(0);
|
| 85 |
|
|
tb_top.ast_source_i.bfm.set_transaction_eop(0);
|
| 86 |
|
|
tb_top.ast_source_i.bfm.push_transaction();
|
| 87 |
|
|
|
| 88 |
|
|
tb_top.ast_source_i.bfm.set_transaction_data(32'h5555_5555);
|
| 89 |
|
|
tb_top.ast_source_i.bfm.set_transaction_sop(0);
|
| 90 |
|
|
tb_top.ast_source_i.bfm.set_transaction_eop(1);
|
| 91 |
|
|
tb_top.ast_source_i.bfm.push_transaction();
|
| 92 |
|
|
|
| 93 |
32 |
qaztronic |
|
| 94 |
|
|
// --------------------------------------------------------------------
|
| 95 |
|
|
#200ns;
|
| 96 |
33 |
qaztronic |
@(posedge tb_clk) tb_top.ast_sink_i.bfm.set_ready(1);
|
| 97 |
|
|
@(posedge tb_clk) tb_top.ast_sink_i.bfm.set_ready(0);
|
| 98 |
|
|
repeat(2) @(posedge tb_clk);
|
| 99 |
|
|
tb_top.ast_sink_i.bfm.set_ready(1);
|
| 100 |
|
|
@(posedge tb_clk) tb_top.ast_sink_i.bfm.set_ready(0);
|
| 101 |
|
|
repeat(3) @(posedge tb_clk);
|
| 102 |
|
|
tb_top.ast_sink_i.bfm.set_ready(1);
|
| 103 |
|
|
repeat(3) @(posedge tb_clk);
|
| 104 |
|
|
tb_top.ast_sink_i.bfm.set_ready(0);
|
| 105 |
|
|
repeat(10) @(posedge tb_clk);
|
| 106 |
|
|
tb_top.ast_sink_i.bfm.set_ready(1);
|
| 107 |
|
|
@(posedge tb_clk) tb_top.ast_sink_i.bfm.set_ready(0);
|
| 108 |
32 |
qaztronic |
|
| 109 |
|
|
|
| 110 |
|
|
// --------------------------------------------------------------------
|
| 111 |
|
|
#1us;
|
| 112 |
|
|
|
| 113 |
|
|
|
| 114 |
|
|
// --------------------------------------------------------------------
|
| 115 |
|
|
// insert test above
|
| 116 |
|
|
// --------------------------------------------------------------------
|
| 117 |
|
|
|
| 118 |
|
|
endtask
|
| 119 |
|
|
|
| 120 |
|
|
// --------------------------------------------------------------------
|
| 121 |
|
|
//
|
| 122 |
|
|
endmodule
|
| 123 |
|
|
|