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

Subversion Repositories gpio

[/] [gpio/] [tags/] [rel_1/] [bench/] [verilog/] [tb_top.v] - Blame information for rev 65

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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