OpenCores
URL https://opencores.org/ocsvn/alu_with_selectable_inputs_and_outputs/alu_with_selectable_inputs_and_outputs/trunk

Subversion Repositories alu_with_selectable_inputs_and_outputs

[/] [alu_with_selectable_inputs_and_outputs/] [trunk/] [tests/] [improved_test.v] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dragos_don
/////////////////////////////////////////////////////////////////////
2
////                                                             ////
3
////      This project has been provided to you on behalf of:    ////
4
////                                                             ////
5
////            S.C. ASICArt S.R.L.                              ////
6
////                            www.asicart.com                  ////
7
////                            eli_f@asicart.com                ////
8
////                                                             ////
9
////        Author: Dragos Constantin Doncean                    ////
10
////        Email: doncean@asicart.com                           ////
11
////        Mobile: +40-740-936997                               ////
12
////                                                             ////
13
////      Downloaded from: http://www.opencores.org/             ////
14
////                                                             ////
15
/////////////////////////////////////////////////////////////////////
16
////                                                             ////
17
//// Copyright (C) 2007 Dragos Constantin Doncean                ////
18
////                         www.asicart.com                     ////
19
////                         doncean@asicart.com                 ////
20
////                                                             ////
21
//// This source file may be used and distributed without        ////
22
//// restriction provided that this copyright statement is not   ////
23
//// removed from the file and that any derivative work contains ////
24
//// the original copyright notice and the associated disclaimer.////
25
////                                                             ////
26
////     THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY     ////
27
//// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED   ////
28
//// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS   ////
29
//// FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR      ////
30
//// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,         ////
31
//// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES    ////
32
//// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE   ////
33
//// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR        ////
34
//// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF  ////
35
//// LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT  ////
36
//// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT  ////
37
//// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE         ////
38
//// POSSIBILITY OF SUCH DAMAGE.                                 ////
39
////                                                             ////
40
/////////////////////////////////////////////////////////////////////
41
 
42
 
43
//TEST MODULE - IMPROVED TEST
44
 
45
module proj_improved_test;
46
 
47
wire test_clk, test_res, test_stb;
48
wire [1:0] test_sel;
49
wire [7:0] test_data_in_0, test_data_in_1, test_data_in_2;
50
wire test_data_valid_in;
51
wire test_valid_0, test_valid_1;
52
wire [15:0] test_out_0, test_out_1;
53
wire test_parity_0, test_parity_1;
54
wire [7:0] test_ic_data_0, test_ic_data_1, test_ic_data_2, test_ic_data_3;
55
wire [15:0] test_oc_data;
56
wire test_oc_parity;
57
wire [0:127] test_ic_data_collected, test_oc_data_collected;
58
 
59
//DUT instantiation
60
DUT dut(.dut_clk(test_clk), .dut_res(test_res), .dut_stb(test_stb),
61
                .dut_sel(test_sel),
62
                .dut_data_in_0(test_data_in_0), .dut_data_in_1(test_data_in_1), .dut_data_in_2(test_data_in_2),
63
                .dut_data_valid_in(test_data_valid_in),
64
                .dut_valid_0(test_valid_0), .dut_valid_1(test_valid_1),
65
                .dut_out_0(test_out_0), .dut_out_1(test_out_1),
66
                .dut_parity_0(test_parity_0), .dut_parity_1(test_parity_1));
67
 
68
//DUT VERIFICATION ENVIRONMENT
69
//Contains CLK generator, monitors, BFMs, collectors and the checker
70
//They are instantiated here, in the test module
71
 
72
//--------BFMs' instantiations--------
73
CLK_GEN clk_gen(.gen_clk(test_clk));
74
 
75
RES_BFM res_bfm(.bfm_res(test_res));
76
 
77
DATA_IN_BFM data_in_bfm(.bfm_stb(test_stb),
78
        .bfm_sel(test_sel),
79
        .bfm_data_in_0(test_data_in_0), .bfm_data_in_1(test_data_in_1), .bfm_data_in_2(test_data_in_2),
80
        .bfm_data_valid_in(test_data_valid_in));
81
 
82
//--------Monitors' instantiations--------
83
CLK_MONITOR clk_monitor(.m_clk(test_clk));
84
 
85
RES_MONITOR res_monitor(.m_res(test_res));
86
 
87
STB_MONITOR stb_monitor(.m_clk(test_clk), .m_stb(test_stb));
88
 
89
SEL_MONITOR sel_monitor(.m_clk(test_clk), .m_stb(test_stb), .m_sel(test_sel));
90
 
91
DATA_IN_MONITOR data_in_monitor(.m_clk(test_clk), .m_stb(test_stb),
92
        .m_data_in_0(test_data_in_0), .m_data_in_1(test_data_in_1), .m_data_in_2(test_data_in_2));
93
 
94
DATA_VALID_IN_MONITOR data_valid_in_monitor(.m_clk(test_clk), .m_stb(test_stb),
95
        .m_data_valid_in(test_data_valid_in));
96
 
97
VALID_MONITOR valid_monitor(.m_clk(test_clk), .m_res(test_res),
98
        .m_valid_0(test_valid_0), .m_valid_1(test_valid_1));
99
 
100
DATA_OUT_MONITOR data_out_monitor(.m_clk(test_clk), .m_res(test_res),
101
        .m_out_0(test_out_0), .m_out_1(test_out_1));
102
 
103
PARITY_MONITOR parity_monitor(.m_clk(test_clk), .m_res(test_res),
104
        .m_parity_0(test_parity_0), .m_parity_1(test_parity_1));
105
 
106
//--------Collectors' instantiations--------
107
INPUT_COLLECTOR input_collector(.ic_clk(test_clk), .ic_res(test_res), .ic_stb(test_stb),
108
        .ic_sel(test_sel),
109
        .ic_data_in_0(test_data_in_0), .ic_data_in_1(test_data_in_1), .ic_data_in_2(test_data_in_2),
110
        .ic_data_valid_in(test_data_valid_in),
111
        .ic_data_out_0(test_ic_data_0), .ic_data_out_1(test_ic_data_1), .ic_data_out_2(test_ic_data_2), .ic_data_out_3(test_ic_data_3),
112
        .ic_data_collected(test_ic_data_collected));
113
 
114
OUTPUT_COLLECTOR output_collector(.oc_clk(test_clk), .oc_res(test_res),
115
        .oc_valid_0(test_valid_0), .oc_valid_1(test_valid_1),
116
        .oc_out_0(test_out_0), .oc_out_1(test_out_1),
117
        .oc_parity_0(test_parity_0), .oc_parity_1(test_parity_1),
118
        .oc_data(test_oc_data),
119
        .oc_parity(test_oc_parity),
120
        .oc_data_collected(test_oc_data_collected));
121
 
122
//--------Checker's instantiation--------
123
CHECKER checker(.c_clk(test_clk), .c_res(test_res),
124
        .ic_data_0(test_ic_data_0), .ic_data_1(test_ic_data_1), .ic_data_2(test_ic_data_2), .ic_data_3(test_ic_data_3),
125
        .oc_data(test_oc_data),
126
        .oc_parity(test_oc_parity),
127
        .ic_data_collected(test_ic_data_collected),
128
        .oc_data_collected(test_oc_data_collected));
129
 
130
//Waveform database
131
initial
132
begin
133
 
134
        $shm_open("../run/waves/waves_improved_test");  // Open database named "waves"
135
        $shm_probe(proj_improved_test, "AS"); // Record tb scope and all sub hierarchy
136
end
137
 
138
/*
139
//for waveform viewing with GTKWave
140
initial
141
begin
142
        $dumpfile ("proj0.dump") ;
143
        $dumpvars;
144
        $dumpon;
145
        //$dumpall;
146
end
147
*/
148
 
149
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.