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

Subversion Repositories gpio

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