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

Subversion Repositories gpio

[/] [gpio/] [tags/] [rel_7/] [bench/] [verilog/] [tb_top.v] - Blame information for rev 67

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

powered by: WebSVN 2.1.0

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