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

Subversion Repositories gpio

[/] [gpio/] [tags/] [rel_12/] [bench/] [verilog/] [gpio_testbench.v] - Blame information for rev 67

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
// Revision 1.5  2003/11/29 16:22:05  gorand
48
// small changes, for VATS...
49
//
50
// Revision 1.4  2003/11/10 23:23:57  gorand
51
// tests passed.
52
//
53
// Revision 1.3  2002/03/13 20:56:16  lampret
54
// Removed zero padding as per Avi Shamli suggestion.
55
//
56
// Revision 1.2  2001/09/18 15:43:28  lampret
57
// Changed gpio top level into gpio_top. Changed defines.v into gpio_defines.v.
58
//
59
// Revision 1.1  2001/08/21 21:39:27  lampret
60
// Changed directory structure, port names and drfines.
61
//
62
// Revision 1.2  2001/07/14 20:37:24  lampret
63
// Test bench improvements.
64
//
65
// Revision 1.1  2001/06/05 07:45:22  lampret
66
// Added initial RTL and test benches. There are still some issues with these files.
67
//
68
//
69
 
70
`include "timescale.v"
71
`include "gpio_defines.v"
72
 
73
module gpio_testbench();
74
 
75
parameter aw = `GPIO_ADDRHH+1 ;
76
parameter dw = 32;
77
parameter gw = `GPIO_IOS;
78
 
79
//
80
// Interconnect wires
81
//
82
wire                    clk;    // Clock
83
wire                    rst;    // Reset
84
wire                    cyc;    // Cycle valid
85
wire    [aw-1:0] adr;    // Address bus
86
wire    [dw-1:0] dat_m;  // Data bus from PTC to WBM
87
wire    [3:0]            sel;    // Data selects
88
wire                    we;     // Write enable
89
wire                    stb;    // Strobe
90
wire    [dw-1:0] dat_ptc;// Data bus from WBM to PTC
91
wire                    ack;    // Successful cycle termination
92
wire                    err;    // Failed cycle termination
93
wire    [gw-1:0] gpio_aux;       // GPIO auxiliary signals
94
wire    [gw-1:0] gpio_in;        // GPIO inputs
95
wire                    gpio_eclk;      // GPIO external clock
96
wire    [gw-1:0] gpio_out;       // GPIO outputs
97
wire    [gw-1:0] gpio_oen;       // GPIO output enables
98
wire [ 3 : 0 ] tag_o ;
99
 
100
//
101
// Instantiation of Clock/Reset Generator
102
//
103
clkrst clkrst(
104
        // Clock
105
        .clk_o(clk),
106
        // Reset
107
        .rst_o(rst)
108
);
109
 
110
//
111
// Instantiation of Master WISHBONE BFM
112
//
113
wb_master wb_master(
114
        // WISHBONE Interface
115
        .CLK_I(clk),
116
        .RST_I(rst),
117
        .CYC_O(cyc),
118
        .ADR_O(adr),
119
        .DAT_O(dat_ptc),
120
        .SEL_O(sel),
121
        .WE_O(we),
122
        .STB_O(stb),
123
        .DAT_I(dat_m),
124
        .ACK_I(ack),
125
        .ERR_I(err),
126
        .RTY_I(1'b0),
127
        .TAG_I(4'b0),
128
  .TAG_O ( tag_o )
129
);
130
 
131
//
132
// Instantiation of PTC core
133
//
134
gpio_top gpio_top(
135
        // WISHBONE Interface
136
        .wb_clk_i(clk),
137
        .wb_rst_i(rst),
138
        .wb_cyc_i(cyc),
139
        .wb_adr_i(adr),
140
        .wb_dat_i(dat_ptc),
141
        .wb_sel_i(sel),
142
        .wb_we_i(we),
143
        .wb_stb_i(stb),
144
        .wb_dat_o(dat_m),
145
        .wb_ack_o(ack),
146
        .wb_err_o(err),
147
        .wb_inta_o(),
148
 
149
        // Auxiliary inputs interface
150
        .aux_i(gpio_aux),
151
 
152
        // External GPIO Interface
153
        .ext_pad_i(gpio_in),
154
        .clk_pad_i(gpio_eclk),
155
        .ext_pad_o(gpio_out),
156
        .ext_padoen_o(gpio_oen)
157
);
158
 
159
//
160
// GPIO Monitor
161
//
162
gpio_mon gpio_mon(
163
        .gpio_aux(gpio_aux),
164
        .gpio_in(gpio_in),
165
        .gpio_eclk(gpio_eclk),
166
        .gpio_out(gpio_out),
167
        .gpio_oen(gpio_oen)
168
);
169
 
170
endmodule

powered by: WebSVN 2.1.0

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