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

Subversion Repositories gpio

[/] [gpio/] [tags/] [rel_9/] [rtl/] [verilog/] [gpio_defines.v] - Blame information for rev 67

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

Line No. Rev Author Line
1 14 lampret
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  WISHBONE GPIO Definitions                                   ////
4
////                                                              ////
5
////  This file is part of the GPIO project                       ////
6
////  http://www.opencores.org/cores/gpio/                        ////
7
////                                                              ////
8
////  Description                                                 ////
9
////  GPIO IP Definitions.                                        ////
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 34 gorand
// Revision 1.2  2003/10/02 18:54:35  simons
48
// GPIO signals muxed with other peripherals, higland_board fixed.
49
//
50
// Revision 1.1.1.1  2003/06/24 09:09:23  simons
51
// This files were moved here from toplevel folder.
52
//
53
// Revision 1.1.1.1  2003/06/11 18:51:13  simons
54
// Initial import.
55
//
56
// Revision 1.5  2002/11/11 21:36:28  lampret
57
// Added ifdef to remove mux from clk_pad_i if mux is not allowed. This also removes RGPIO_CTRL[NEC].
58
//
59 29 lampret
// Revision 1.4  2002/05/06 18:25:31  lampret
60
// negedge flops are enabled by default.
61
//
62 27 lampret
// Revision 1.3  2001/12/25 17:12:35  lampret
63
// Added RGPIO_INTS.
64
//
65 21 lampret
// Revision 1.2  2001/11/15 02:24:37  lampret
66
// Added GPIO_REGISTERED_WB_OUTPUTS, GPIO_REGISTERED_IO_OUTPUTS and GPIO_NO_NEGEDGE_FLOPS.
67
//
68 17 lampret
// Revision 1.1  2001/09/18 18:49:07  lampret
69
// Changed top level ptc into gpio_top. Changed defines.v into gpio_defines.v.
70
//
71 14 lampret
// Revision 1.1  2001/08/21 21:39:28  lampret
72
// Changed directory structure, port names and drfines.
73
//
74
// Revision 1.3  2001/07/15 00:21:10  lampret
75
// Registers can be omitted and will have certain default values
76
//
77
// Revision 1.2  2001/07/14 20:39:26  lampret
78
// Better configurability.
79
//
80
// Revision 1.1  2001/06/05 07:45:26  lampret
81
// Added initial RTL and test benches. There are still some issues with these files.
82
//
83
//
84
 
85
//
86
// Number of GPIO I/O signals
87
//
88
// This is the most important parameter of the GPIO IP core. It defines how many
89
// I/O signals core has. Range is from 1 to 32. If more than 32 I/O signals are
90
// required, use several instances of GPIO IP core.
91
//
92
// Default is 16.
93
//
94 34 gorand
`define GPIO_IOS 31
95 14 lampret
 
96 34 gorand
 
97 14 lampret
//
98
// Undefine this one if you don't want to remove GPIO block from your design
99
// but you also don't need it. When it is undefined, all GPIO ports still
100
// remain valid and the core can be synthesized however internally there is
101
// no GPIO funationality.
102
//
103
// Defined by default (duhh !).
104
//
105
`define GPIO_IMPLEMENTED
106
 
107 17 lampret
//
108
// Define to register all WISHBONE outputs.
109
//
110
// Register outputs if you are using GPIO core as a block and synthesizing
111
// and place&routing it separately from the rest of the system.
112
//
113
// If you do not need registered outputs, you can save some area by not defining
114
// this macro. By default it is defined.
115
//
116
`define GPIO_REGISTERED_WB_OUTPUTS
117
 
118
//
119
// Define to register all GPIO pad outputs.
120
//
121
// Register outputs if you are using GPIO core as a block and synthesizing
122
// and place&routing it separately from the rest of the system.
123
//
124
// If you do not need registered outputs, you can save some area by not defining
125
// this macro. By default it is defined.
126
//
127
`define GPIO_REGISTERED_IO_OUTPUTS
128
 
129
//
130
// Define to avoid using negative edge clock flip-flops for external clock
131
// (caused by RGPIO_CTRL[NEC] bit. Instead an inverted external clock with
132
// positive edge clock flip-flops will be used.
133
//
134 27 lampret
// By default it is not defined.
135 17 lampret
//
136 27 lampret
//`define GPIO_NO_NEGEDGE_FLOPS
137 17 lampret
 
138 29 lampret
//
139
// If GPIO_NO_NEGEDGE_FLOPS is defined, a mux needs to be placed on external clock
140
// clk_pad_i to implement RGPIO_CTRL[NEC] functionality. If no mux is allowed on
141
// clock signal, enable the following define.
142
//
143
// By default it is not defined.
144
//
145
//`define GPIO_NO_CLKPAD_LOGIC
146
 
147 14 lampret
// 
148
// Undefine if you don't need to read GPIO registers except for RGPIO_IN register.
149
// When it is undefined all reads of GPIO registers return RGPIO_IN register. This
150
// is usually useful if you want really small area (for example when implemented in
151
// FPGA).
152
//
153
// To follow GPIO IP core specification document this one must be defined. Also to
154
// successfully run the test bench it must be defined. By default it is defined.
155
//
156
`define GPIO_READREGS
157
 
158
//
159
// Full WISHBONE address decoding
160
//
161
// It is is undefined, partial WISHBONE address decoding is performed.
162
// Undefine it if you need to save some area.
163
//
164
// By default it is defined.
165
//
166
`define GPIO_FULL_DECODE
167
 
168
//
169
// Strict 32-bit WISHBONE access
170
//
171
// If this one is defined, all WISHBONE accesses must be 32-bit. If it is
172
// not defined, err_o is asserted whenever 8- or 16-bit access is made.
173
// Undefine it if you need to save some area.
174
//
175
// By default it is defined.
176
//
177 34 gorand
//`define GPIO_STRICT_32BIT_ACCESS
178
//
179
`ifndef GPIO_STRICT_32BIT_ACCESS
180
// added by gorand :
181
// if GPIO_STRICT_32BIT_ACCESS is not defined,
182
// depending on number of gpio I/O lines, the following are defined :
183
// if the number of I/O lines is in range 1-8,   GPIO_WB_BYTES1 is defined,
184
// if the number of I/O lines is in range 9-16,  GPIO_WB_BYTES2 is defined,
185
// if the number of I/O lines is in range 17-24, GPIO_WB_BYTES3 is defined,
186
// if the number of I/O lines is in range 25-32, GPIO_WB_BYTES4 is defined,
187 14 lampret
 
188 34 gorand
`define GPIO_WB_BYTES4
189
`endif
190
 
191 14 lampret
//
192
// WISHBONE address bits used for full decoding of GPIO registers.
193
//
194 17 lampret
`define GPIO_ADDRHH 6
195 14 lampret
`define GPIO_ADDRHL 5
196
`define GPIO_ADDRLH 1
197
`define GPIO_ADDRLL 0
198
 
199
//
200
// Bits of WISHBONE address used for partial decoding of GPIO registers.
201
//
202
// Default 4:2.
203
//
204
`define GPIO_OFS_BITS   `GPIO_ADDRHL-1:`GPIO_ADDRLH+1
205
 
206
//
207
// Addresses of GPIO registers
208
//
209
// To comply with GPIO IP core specification document they must go from
210
// address 0 to address 0x18 in the following order: RGPIO_IN, RGPIO_OUT,
211
// RGPIO_OE, RGPIO_INTE, RGPIO_PTRIG, RGPIO_AUX and RGPIO_CTRL
212
//
213
// If particular register is not needed, it's address definition can be omitted
214
// and the register will not be implemented. Instead a fixed default value will
215
// be used.
216
//
217
`define GPIO_RGPIO_IN           3'h0    // Address 0x00
218
`define GPIO_RGPIO_OUT          3'h1    // Address 0x04
219
`define GPIO_RGPIO_OE           3'h2    // Address 0x08
220
`define GPIO_RGPIO_INTE         3'h3    // Address 0x0c
221
`define GPIO_RGPIO_PTRIG        3'h4    // Address 0x10
222
`define GPIO_RGPIO_AUX          3'h5    // Address 0x14
223
`define GPIO_RGPIO_CTRL         3'h6    // Address 0x18
224 21 lampret
`define GPIO_RGPIO_INTS         3'h7    // Address 0x1c
225 14 lampret
 
226
//
227
// Default values for unimplemented GPIO registers
228
//
229
`define GPIO_DEF_RGPIO_IN       `GPIO_IOS'h0
230
`define GPIO_DEF_RGPIO_OUT      `GPIO_IOS'h0
231
`define GPIO_DEF_RGPIO_OE       `GPIO_IOS'h0
232
`define GPIO_DEF_RGPIO_INTE     `GPIO_IOS'h0
233
`define GPIO_DEF_RGPIO_PTRIG    `GPIO_IOS'h0
234
`define GPIO_DEF_RGPIO_AUX      `GPIO_IOS'h0
235
`define GPIO_DEF_RGPIO_CTRL     `GPIO_IOS'h0
236
 
237
//
238
// RGPIO_CTRL bits
239
//
240
// To comply with the GPIO IP core specification document they must go from
241
// bit 0 to bit 3 in the following order: ECLK, NEC, INTE, INT
242
//
243
`define GPIO_RGPIO_CTRL_ECLK            0
244
`define GPIO_RGPIO_CTRL_NEC             1
245
`define GPIO_RGPIO_CTRL_INTE            2
246 21 lampret
`define GPIO_RGPIO_CTRL_INTS            3

powered by: WebSVN 2.1.0

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