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

Subversion Repositories gpio

[/] [gpio/] [trunk/] [bench/] [verilog/] [gpio_testbench.v] - Blame information for rev 66

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 47 gorand
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  GPIO Testbench Top                                          ////
4
////                                                              ////
5
////  This file is part of the GPIO project                       ////
6
////  http://www.opencores.org/cores/gpio/                        ////
7
////                                                              ////
8
////  Description                                                 ////
9
////  Top level of testbench. It instantiates all blocks.         ////
10
////                                                              ////
11
////  To Do:                                                      ////
12
////   Nothing                                                    ////
13
////                                                              ////
14
////  Author(s):                                                  ////
15
////      - Damjan Lampret, lampret@opencores.org                 ////
16
////                                                              ////
17
//////////////////////////////////////////////////////////////////////
18
////                                                              ////
19
//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
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 source file is free software; you can redistribute it   ////
27
//// and/or modify it under the terms of the GNU Lesser General   ////
28
//// Public License as published by the Free Software Foundation; ////
29
//// either version 2.1 of the License, or (at your option) any   ////
30
//// later version.                                               ////
31
////                                                              ////
32
//// This source is distributed in the hope that it will be       ////
33
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
34
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
35
//// PURPOSE.  See the GNU Lesser General Public License for more ////
36
//// details.                                                     ////
37
////                                                              ////
38
//// You should have received a copy of the GNU Lesser General    ////
39
//// Public License along with this source; if not, download it   ////
40
//// from http://www.opencores.org/lgpl.shtml                     ////
41
////                                                              ////
42
//////////////////////////////////////////////////////////////////////
43
//
44
// CVS Revision History
45
//
46
// $Log: not supported by cvs2svn $
47 63 simont
// Revision 1.2  2003/12/17 13:00:14  gorand
48
// added ECLK and NEC registers, all tests passed.
49
//
50 56 gorand
// Revision 1.1  2003/11/30 12:28:19  gorand
51
// small "names" modification...
52
//
53 47 gorand
// Revision 1.5  2003/11/29 16:22:05  gorand
54
// small changes, for VATS...
55
//
56
// Revision 1.4  2003/11/10 23:23:57  gorand
57
// tests passed.
58
//
59
// Revision 1.3  2002/03/13 20:56:16  lampret
60
// Removed zero padding as per Avi Shamli suggestion.
61
//
62
// Revision 1.2  2001/09/18 15:43:28  lampret
63
// Changed gpio top level into gpio_top. Changed defines.v into gpio_defines.v.
64
//
65
// Revision 1.1  2001/08/21 21:39:27  lampret
66
// Changed directory structure, port names and drfines.
67
//
68
// Revision 1.2  2001/07/14 20:37:24  lampret
69
// Test bench improvements.
70
//
71
// Revision 1.1  2001/06/05 07:45:22  lampret
72
// Added initial RTL and test benches. There are still some issues with these files.
73
//
74
//
75
 
76
`include "timescale.v"
77
`include "gpio_defines.v"
78
 
79
module gpio_testbench();
80
 
81
parameter aw = `GPIO_ADDRHH+1 ;
82
parameter dw = 32;
83
parameter gw = `GPIO_IOS;
84
 
85
//
86
// Interconnect wires
87
//
88
wire                    clk;    // Clock
89
wire                    rst;    // Reset
90
wire                    cyc;    // Cycle valid
91
wire    [aw-1:0] adr;    // Address bus
92
wire    [dw-1:0] dat_m;  // Data bus from PTC to WBM
93
wire    [3:0]            sel;    // Data selects
94
wire                    we;     // Write enable
95
wire                    stb;    // Strobe
96
wire    [dw-1:0] dat_ptc;// Data bus from WBM to PTC
97
wire                    ack;    // Successful cycle termination
98
wire                    err;    // Failed cycle termination
99
wire    [gw-1:0] gpio_aux;       // GPIO auxiliary signals
100
wire    [gw-1:0] gpio_in;        // GPIO inputs
101 56 gorand
wire  gpio_eclk;        // GPIO external clock
102 47 gorand
wire    [gw-1:0] gpio_out;       // GPIO outputs
103
wire    [gw-1:0] gpio_oen;       // GPIO output enables
104 63 simont
wire  [ 3 : 0] tag_o ;
105 47 gorand
 
106
//
107 63 simont
// description of current test.
108
//
109
reg   [127:0]  text;
110
 
111
//
112 47 gorand
// Instantiation of Clock/Reset Generator
113
//
114
clkrst clkrst(
115
        // Clock
116
        .clk_o(clk),
117
        // Reset
118
        .rst_o(rst)
119
);
120
 
121
//
122
// Instantiation of Master WISHBONE BFM
123
//
124
wb_master wb_master(
125
        // WISHBONE Interface
126
        .CLK_I(clk),
127
        .RST_I(rst),
128
        .CYC_O(cyc),
129
        .ADR_O(adr),
130
        .DAT_O(dat_ptc),
131
        .SEL_O(sel),
132
        .WE_O(we),
133
        .STB_O(stb),
134
        .DAT_I(dat_m),
135
        .ACK_I(ack),
136
        .ERR_I(err),
137
        .RTY_I(1'b0),
138
        .TAG_I(4'b0),
139
  .TAG_O ( tag_o )
140
);
141
 
142
//
143
// Instantiation of PTC core
144
//
145
gpio_top gpio_top(
146
        // WISHBONE Interface
147
        .wb_clk_i(clk),
148
        .wb_rst_i(rst),
149
        .wb_cyc_i(cyc),
150
        .wb_adr_i(adr),
151
        .wb_dat_i(dat_ptc),
152
        .wb_sel_i(sel),
153
        .wb_we_i(we),
154
        .wb_stb_i(stb),
155
        .wb_dat_o(dat_m),
156
        .wb_ack_o(ack),
157
        .wb_err_o(err),
158
        .wb_inta_o(),
159
 
160
        // Auxiliary inputs interface
161 63 simont
`ifdef GPIO_AUX_IMPLEMENT
162 47 gorand
        .aux_i(gpio_aux),
163 63 simont
`endif //  GPIO_AUX_IMPLEMENT
164 47 gorand
 
165
        // External GPIO Interface
166
        .ext_pad_i(gpio_in),
167 63 simont
 
168
`ifdef GPIO_CLKPAD
169 47 gorand
        .clk_pad_i(gpio_eclk),
170 63 simont
`endif // GPIO_CLKPAD
171 47 gorand
        .ext_pad_o(gpio_out),
172 63 simont
        .ext_padoe_o(gpio_oen)
173 47 gorand
);
174
 
175
//
176
// GPIO Monitor
177
//
178
gpio_mon gpio_mon(
179
        .gpio_aux(gpio_aux),
180
        .gpio_in(gpio_in),
181
        .gpio_eclk(gpio_eclk),
182
        .gpio_out(gpio_out),
183
        .gpio_oen(gpio_oen)
184
);
185
 
186 63 simont
initial
187
  text = " ";
188
 
189 47 gorand
endmodule

powered by: WebSVN 2.1.0

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