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

Subversion Repositories gpio

[/] [gpio/] [tags/] [asyst_2/] [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 56 gorand
// Revision 1.7  2003/12/01 17:10:44  simons
48
// ifndef directive is not supported by all tools.
49
//
50 52 simons
// Revision 1.6  2003/11/06 13:59:07  gorand
51
// added support for 8-bit access to registers.
52
//
53 34 gorand
// Revision 1.2  2003/10/02 18:54:35  simons
54
// GPIO signals muxed with other peripherals, higland_board fixed.
55
//
56
// Revision 1.1.1.1  2003/06/24 09:09:23  simons
57
// This files were moved here from toplevel folder.
58
//
59
// Revision 1.1.1.1  2003/06/11 18:51:13  simons
60
// Initial import.
61
//
62
// Revision 1.5  2002/11/11 21:36:28  lampret
63
// Added ifdef to remove mux from clk_pad_i if mux is not allowed. This also removes RGPIO_CTRL[NEC].
64
//
65 29 lampret
// Revision 1.4  2002/05/06 18:25:31  lampret
66
// negedge flops are enabled by default.
67
//
68 27 lampret
// Revision 1.3  2001/12/25 17:12:35  lampret
69
// Added RGPIO_INTS.
70
//
71 21 lampret
// Revision 1.2  2001/11/15 02:24:37  lampret
72
// Added GPIO_REGISTERED_WB_OUTPUTS, GPIO_REGISTERED_IO_OUTPUTS and GPIO_NO_NEGEDGE_FLOPS.
73
//
74 17 lampret
// Revision 1.1  2001/09/18 18:49:07  lampret
75
// Changed top level ptc into gpio_top. Changed defines.v into gpio_defines.v.
76
//
77 14 lampret
// Revision 1.1  2001/08/21 21:39:28  lampret
78
// Changed directory structure, port names and drfines.
79
//
80
// Revision 1.3  2001/07/15 00:21:10  lampret
81
// Registers can be omitted and will have certain default values
82
//
83
// Revision 1.2  2001/07/14 20:39:26  lampret
84
// Better configurability.
85
//
86
// Revision 1.1  2001/06/05 07:45:26  lampret
87
// Added initial RTL and test benches. There are still some issues with these files.
88
//
89
//
90
 
91
//
92
// Number of GPIO I/O signals
93
//
94
// This is the most important parameter of the GPIO IP core. It defines how many
95
// I/O signals core has. Range is from 1 to 32. If more than 32 I/O signals are
96
// required, use several instances of GPIO IP core.
97
//
98
// Default is 16.
99
//
100 34 gorand
`define GPIO_IOS 31
101 14 lampret
 
102 56 gorand
//depending on number of GPIO_IOS, define this...
103
// for example: if there is 26 GPIO_IOS, define GPIO_LINES26
104
//
105 34 gorand
 
106 56 gorand
`define GPIO_LINES31
107
 
108 14 lampret
//
109
// Undefine this one if you don't want to remove GPIO block from your design
110
// but you also don't need it. When it is undefined, all GPIO ports still
111
// remain valid and the core can be synthesized however internally there is
112
// no GPIO funationality.
113
//
114
// Defined by default (duhh !).
115
//
116
`define GPIO_IMPLEMENTED
117
 
118 17 lampret
//
119
// Define to register all WISHBONE 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_WB_OUTPUTS
128
 
129
//
130
// Define to register all GPIO pad outputs.
131
//
132
// Register outputs if you are using GPIO core as a block and synthesizing
133
// and place&routing it separately from the rest of the system.
134
//
135
// If you do not need registered outputs, you can save some area by not defining
136
// this macro. By default it is defined.
137
//
138
`define GPIO_REGISTERED_IO_OUTPUTS
139
 
140
//
141
// Define to avoid using negative edge clock flip-flops for external clock
142 56 gorand
// (caused by NEC register. Instead an inverted external clock with
143 17 lampret
// positive edge clock flip-flops will be used.
144
//
145 27 lampret
// By default it is not defined.
146 17 lampret
//
147 27 lampret
//`define GPIO_NO_NEGEDGE_FLOPS
148 17 lampret
 
149 29 lampret
//
150
// If GPIO_NO_NEGEDGE_FLOPS is defined, a mux needs to be placed on external clock
151
// clk_pad_i to implement RGPIO_CTRL[NEC] functionality. If no mux is allowed on
152
// clock signal, enable the following define.
153
//
154
// By default it is not defined.
155
//
156
//`define GPIO_NO_CLKPAD_LOGIC
157
 
158 14 lampret
// 
159
// Undefine if you don't need to read GPIO registers except for RGPIO_IN register.
160
// When it is undefined all reads of GPIO registers return RGPIO_IN register. This
161
// is usually useful if you want really small area (for example when implemented in
162
// FPGA).
163
//
164
// To follow GPIO IP core specification document this one must be defined. Also to
165
// successfully run the test bench it must be defined. By default it is defined.
166
//
167
`define GPIO_READREGS
168
 
169
//
170
// Full WISHBONE address decoding
171
//
172
// It is is undefined, partial WISHBONE address decoding is performed.
173
// Undefine it if you need to save some area.
174
//
175
// By default it is defined.
176
//
177
`define GPIO_FULL_DECODE
178
 
179
//
180
// Strict 32-bit WISHBONE access
181
//
182
// If this one is defined, all WISHBONE accesses must be 32-bit. If it is
183
// not defined, err_o is asserted whenever 8- or 16-bit access is made.
184
// Undefine it if you need to save some area.
185
//
186
// By default it is defined.
187
//
188 34 gorand
//`define GPIO_STRICT_32BIT_ACCESS
189
//
190 52 simons
`ifdef GPIO_STRICT_32BIT_ACCESS
191
`else
192 34 gorand
// added by gorand :
193
// if GPIO_STRICT_32BIT_ACCESS is not defined,
194
// depending on number of gpio I/O lines, the following are defined :
195
// if the number of I/O lines is in range 1-8,   GPIO_WB_BYTES1 is defined,
196
// if the number of I/O lines is in range 9-16,  GPIO_WB_BYTES2 is defined,
197
// if the number of I/O lines is in range 17-24, GPIO_WB_BYTES3 is defined,
198
// if the number of I/O lines is in range 25-32, GPIO_WB_BYTES4 is defined,
199 14 lampret
 
200 34 gorand
`define GPIO_WB_BYTES4
201
`endif
202
 
203 14 lampret
//
204
// WISHBONE address bits used for full decoding of GPIO registers.
205
//
206 56 gorand
`define GPIO_ADDRHH 7
207
`define GPIO_ADDRHL 6
208 14 lampret
`define GPIO_ADDRLH 1
209
`define GPIO_ADDRLL 0
210
 
211
//
212
// Bits of WISHBONE address used for partial decoding of GPIO registers.
213
//
214 56 gorand
// Default 5:2.
215 14 lampret
//
216
`define GPIO_OFS_BITS   `GPIO_ADDRHL-1:`GPIO_ADDRLH+1
217
 
218
//
219
// Addresses of GPIO registers
220
//
221
// To comply with GPIO IP core specification document they must go from
222
// address 0 to address 0x18 in the following order: RGPIO_IN, RGPIO_OUT,
223
// RGPIO_OE, RGPIO_INTE, RGPIO_PTRIG, RGPIO_AUX and RGPIO_CTRL
224
//
225
// If particular register is not needed, it's address definition can be omitted
226
// and the register will not be implemented. Instead a fixed default value will
227
// be used.
228
//
229 56 gorand
`define GPIO_RGPIO_IN             4'h0  // Address 0x00
230
`define GPIO_RGPIO_OUT          4'h1    // Address 0x04
231
`define GPIO_RGPIO_OE             4'h2  // Address 0x08
232
`define GPIO_RGPIO_INTE         4'h3    // Address 0x0c
233
`define GPIO_RGPIO_PTRIG        4'h4    // Address 0x10
234
`define GPIO_RGPIO_AUX          4'h5    // Address 0x14
235
`define GPIO_RGPIO_CTRL         4'h6    // Address 0x18
236
`define GPIO_RGPIO_INTS         4'h7    // Address 0x1c
237
`define GPIO_RGPIO_ECLK   4'h8  // Address 0x20
238
`define GPIO_RGPIO_NEC    4'h9  // Address 0x24
239 14 lampret
 
240
//
241
// Default values for unimplemented GPIO registers
242
//
243
`define GPIO_DEF_RGPIO_IN       `GPIO_IOS'h0
244
`define GPIO_DEF_RGPIO_OUT      `GPIO_IOS'h0
245
`define GPIO_DEF_RGPIO_OE       `GPIO_IOS'h0
246
`define GPIO_DEF_RGPIO_INTE     `GPIO_IOS'h0
247
`define GPIO_DEF_RGPIO_PTRIG    `GPIO_IOS'h0
248
`define GPIO_DEF_RGPIO_AUX      `GPIO_IOS'h0
249
`define GPIO_DEF_RGPIO_CTRL     `GPIO_IOS'h0
250 56 gorand
`define GPIO_DEF_RGPIO_ECLK `GPIO_IOS'h0
251
`define GPIO_DEF_RGPIO_NEC `GPIO_IOS'h0
252 14 lampret
 
253 56 gorand
 
254 14 lampret
//
255
// RGPIO_CTRL bits
256
//
257
// To comply with the GPIO IP core specification document they must go from
258 56 gorand
// bit 0 to bit 1 in the following order: INTE, INT
259 14 lampret
//
260 56 gorand
`define GPIO_RGPIO_CTRL_INTE            0
261
`define GPIO_RGPIO_CTRL_INTS            1
262
 
263
`ifdef GPIO_LINES32
264
`define GPIO_LINES31
265
`endif
266
`ifdef GPIO_LINES31
267
`define GPIO_LINES30
268
`endif
269
`ifdef GPIO_LINES30
270
`define GPIO_LINES29
271
`endif
272
`ifdef GPIO_LINES29
273
`define GPIO_LINES28
274
`endif
275
`ifdef GPIO_LINES28
276
`define GPIO_LINES27
277
`endif
278
`ifdef GPIO_LINES27
279
`define GPIO_LINES26
280
`endif
281
`ifdef GPIO_LINES26
282
`define GPIO_LINES25
283
`endif
284
`ifdef GPIO_LINES25
285
`define GPIO_LINES24
286
`endif
287
`ifdef GPIO_LINES24
288
`define GPIO_LINES23
289
`endif
290
`ifdef GPIO_LINES23
291
`define GPIO_LINES22
292
`endif
293
`ifdef GPIO_LINES22
294
`define GPIO_LINES21
295
`endif
296
`ifdef GPIO_LINES21
297
`define GPIO_LINES20
298
`endif
299
`ifdef GPIO_LINES20
300
`define GPIO_LINES19
301
`endif
302
`ifdef GPIO_LINES19
303
`define GPIO_LINES18
304
`endif
305
`ifdef GPIO_LINES18
306
`define GPIO_LINES17
307
`endif
308
`ifdef GPIO_LINES17
309
`define GPIO_LINES16
310
`endif
311
`ifdef GPIO_LINES16
312
`define GPIO_LINES15
313
`endif
314
`ifdef GPIO_LINES15
315
`define GPIO_LINES14
316
`endif
317
`ifdef GPIO_LINES14
318
`define GPIO_LINES13
319
`endif
320
`ifdef GPIO_LINES13
321
`define GPIO_LINES12
322
`endif
323
`ifdef GPIO_LINES12
324
`define GPIO_LINES11
325
`endif
326
`ifdef GPIO_LINES11
327
`define GPIO_LINES10
328
`endif
329
`ifdef GPIO_LINES10
330
`define GPIO_LINES9
331
`endif
332
`ifdef GPIO_LINES9
333
`define GPIO_LINES8
334
`endif
335
`ifdef GPIO_LINES8
336
`define GPIO_LINES7
337
`endif
338
`ifdef GPIO_LINES7
339
`define GPIO_LINES6
340
`endif
341
`ifdef GPIO_LINES6
342
`define GPIO_LINES5
343
`endif
344
`ifdef GPIO_LINES5
345
`define GPIO_LINES4
346
`endif
347
`ifdef GPIO_LINES4
348
`define GPIO_LINES3
349
`endif
350
`ifdef GPIO_LINES3
351
`define GPIO_LINES2
352
`endif
353
`ifdef GPIO_LINES2
354
`define GPIO_LINES1
355
`endif
356
 

powered by: WebSVN 2.1.0

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