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

Subversion Repositories pci

[/] [pci/] [tags/] [rel_13/] [rtl/] [verilog/] [pci_user_constants.v] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 18 mihad
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  File name "pci_user_constants.v"                            ////
4
////                                                              ////
5
////  This file is part of the "PCI bridge" project               ////
6
////  http://www.opencores.org/cores/pci/                         ////
7
////                                                              ////
8
////  Author(s):                                                  ////
9
////      - Miha Dolenc (mihad@opencores.org)                     ////
10
////      - Tadej Markovic (tadej@opencores.org)                  ////
11
////                                                              ////
12
//////////////////////////////////////////////////////////////////////
13
////                                                              ////
14
//// Copyright (C) 2000 Miha Dolenc, mihad@opencores.org          ////
15
////                                                              ////
16
//// This source file may be used and distributed without         ////
17
//// restriction provided that this copyright statement is not    ////
18
//// removed from the file and that any derivative work contains  ////
19
//// the original copyright notice and the associated disclaimer. ////
20
////                                                              ////
21
//// This source file is free software; you can redistribute it   ////
22
//// and/or modify it under the terms of the GNU Lesser General   ////
23
//// Public License as published by the Free Software Foundation; ////
24
//// either version 2.1 of the License, or (at your option) any   ////
25
//// later version.                                               ////
26
////                                                              ////
27
//// This source is distributed in the hope that it will be       ////
28
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
29
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
30
//// PURPOSE.  See the GNU Lesser General Public License for more ////
31
//// details.                                                     ////
32
////                                                              ////
33
//// You should have received a copy of the GNU Lesser General    ////
34
//// Public License along with this source; if not, download it   ////
35
//// from http://www.opencores.org/lgpl.shtml                     ////
36
////                                                              ////
37
//////////////////////////////////////////////////////////////////////
38
//
39
// CVS Revision History
40
//
41
// $Log: not supported by cvs2svn $
42 132 mihad
// Revision 1.9  2003/08/03 18:05:06  mihad
43
// Added limited WISHBONE B3 support for WISHBONE Slave Unit.
44
// Doesn't support full speed bursts yet.
45
//
46 106 mihad
// Revision 1.8  2003/03/14 15:31:57  mihad
47
// Entered the option to disable no response counter in wb master.
48
//
49 86 mihad
// Revision 1.7  2003/01/27 17:05:50  mihad
50
// Updated.
51
//
52 79 mihad
// Revision 1.6  2003/01/27 16:51:19  mihad
53
// Old files with wrong names removed.
54
//
55 78 mihad
// Revision 1.5  2003/01/21 16:06:56  mihad
56
// Bug fixes, testcases added.
57
//
58 73 mihad
// Revision 1.4  2002/09/30 17:22:45  mihad
59
// Added support for Virtual Silicon two port RAM. Didn't run regression on it yet!
60
//
61 60 mihad
// Revision 1.3  2002/08/13 11:03:53  mihad
62
// Added a few testcases. Repaired wrong reset value for PCI_AM5 register. Repaired Parity Error Detected bit setting. Changed PCI_AM0 to always enabled(regardles of PCI_AM0 define), if image 0 is used as configuration image
63
//
64 45 mihad
// Revision 1.2  2002/03/05 11:53:47  mihad
65
// Added some testcases, removed un-needed fifo signals
66
//
67 33 mihad
// Revision 1.1  2002/02/01 14:43:31  mihad
68
// *** empty log message ***
69 18 mihad
//
70 33 mihad
//
71 18 mihad
 
72
// Fifo implementation defines:
73
// If FPGA and XILINX are defined, Xilinx's BlockSelectRAM+ is instantiated for Fifo storage.
74
// 16 bit width is used, so 8 bits of address ( 256 ) locations are available. If RAM_DONT_SHARE is not defined (commented out),
75
// then one block RAM is shared between two FIFOs. That means each Fifo can have a maximum address length of 7 - depth of 128 and only 6 block rams are used
76
// If RAM_DONT_SHARE is defined ( not commented out ), then 12 block RAMs are used and each Fifo can have a maximum address length of 8 ( 256 locations )
77
// If FPGA is not defined, then ASIC RAMs are used. Currently there is only one version of ARTISAN RAM supported. User should generate synchronous RAM with
78
// width of 40 and instantiate it in pci_tpram.v. If RAM_DONT_SHARE is defined, then these can be dual port rams ( write port
79
// in one clock domain, read in other ), otherwise it must be two port RAM ( read and write ports in both clock domains ).
80
// If RAM_DONT_SHARE is defined, then all RAM address lengths must be specified accordingly, otherwise there are two relevant lengths - PCI_FIFO_RAM_ADDR_LENGTH and
81
// WB_FIFO_RAM_ADDR_LENGTH.
82
 
83 132 mihad
`define WBW_ADDR_LENGTH 7
84
`define WBR_ADDR_LENGTH 7
85
`define PCIW_ADDR_LENGTH 7
86
`define PCIR_ADDR_LENGTH 7
87 18 mihad
 
88 132 mihad
//`define FPGA
89
//`define XILINX
90 18 mihad
 
91
//`define WB_RAM_DONT_SHARE
92 132 mihad
//`define PCI_RAM_DONT_SHARE
93 18 mihad
 
94
`ifdef FPGA
95
    `ifdef XILINX
96 132 mihad
        `define PCI_FIFO_RAM_ADDR_LENGTH 8      // PCI target unit fifo storage definition
97 18 mihad
        `define WB_FIFO_RAM_ADDR_LENGTH 8       // WB slave unit fifo storage definition
98 132 mihad
        `define PCI_XILINX_RAMB4
99 18 mihad
        `define WB_XILINX_RAMB4
100 132 mihad
        //`define PCI_XILINX_DIST_RAM
101 18 mihad
        //`define WB_XILINX_DIST_RAM
102
    `endif
103
`else
104 132 mihad
    `define PCI_FIFO_RAM_ADDR_LENGTH 8      // PCI target unit fifo storage definition when RAM sharing is used ( both pcir and pciw fifo use same instance of RAM )
105
    `define WB_FIFO_RAM_ADDR_LENGTH 8       // WB slave unit fifo storage definition when RAM sharing is used ( both wbr and wbw fifo use same instance of RAM )
106 33 mihad
//    `define WB_ARTISAN_SDP
107
//    `define PCI_ARTISAN_SDP
108 60 mihad
//    `define PCI_VS_STP
109
//    `define WB_VS_STP
110 18 mihad
`endif
111
 
112
// these two defines allow user to select active high or low output enables on PCI bus signals, depending on
113
// output buffers instantiated. Xilinx FPGAs use active low output enables.
114
`define ACTIVE_LOW_OE
115
//`define ACTIVE_HIGH_OE
116
 
117
// HOST/GUEST implementation selection - see design document and specification for description of each implementation
118
// only one can be defined at same time
119 79 mihad
//`define HOST
120 45 mihad
`define GUEST
121 18 mihad
 
122
// if NO_CNF_IMAGE is commented out, then READ-ONLY access to configuration space is ENABLED:
123
// - ENABLED Read-Only access from WISHBONE for GUEST bridges
124
// - ENABLED Read-Only access from PCI for HOST bridges
125
// with defining NO_CNF_IMAGE, one decoder and one multiplexer are saved
126
`define NO_CNF_IMAGE
127
 
128
// number defined here specifies how many MS bits in PCI address are compared with base address, to decode
129
// accesses. Maximum number allows for minimum image size ( number = 20, image size = 4KB ), minimum number
130
// allows for maximum image size ( number = 1, image size = 2GB ). If you intend on using different sizes of PCI images,
131
// you have to define a number of minimum sized image and enlarge others by specifying different address mask.
132
// smaller the number here, faster the decoder operation
133 132 mihad
`define PCI_NUM_OF_DEC_ADDR_LINES 20
134 18 mihad
 
135
// no. of PCI Target IMAGES
136
// - PCI provides 6 base address registers for image implementation.
137
// PCI_IMAGE1 definition is not required and has no effect, since PCI image 1 is always implemented
138
// If GUEST is defined, PCI Image 0 is also always implemented and is used for configuration space
139
// access.
140
// If HOST is defined and NO_CNF_IMAGE is not, then PCI Image 0 is used for Read Only access to configuration
141
// space. If HOST is defined and NO_CNF_IMAGE is defined, then user can define PCI_IMAGE0 as normal image, and there
142
// is no access to Configuration space possible from PCI bus.
143
// Implementation of all other PCI images is selected by defining PCI_IMAGE2 through PCI_IMAGE5 regardles of HOST
144
// or GUEST implementation.
145
`ifdef HOST
146
    `ifdef NO_CNF_IMAGE
147 132 mihad
        //`define PCI_IMAGE0
148 18 mihad
    `endif
149
`endif
150
 
151 132 mihad
`define PCI_IMAGE2
152
`define PCI_IMAGE3
153
`define PCI_IMAGE4
154
`define PCI_IMAGE5
155 18 mihad
 
156
// initial value for PCI image address masks. Address masks can be defined in enabled state,
157
// to allow device independent software to detect size of image and map base addresses to
158
// memory space. If initial mask for an image is defined as 0, then device independent software
159
// won't detect base address implemented and device dependent software will have to configure
160
// address masks as well as base addresses!
161 78 mihad
`define PCI_AM0 20'hffff_f
162
`define PCI_AM1 20'hffff_f
163 45 mihad
`define PCI_AM2 20'hffff_8
164
`define PCI_AM3 20'hffff_0
165
`define PCI_AM4 20'hfffe_0
166
`define PCI_AM5 20'h0000_0
167 18 mihad
 
168
// initial value for PCI image maping to MEMORY or IO spaces.  If initial define is set to 0,
169
// then IMAGE with that base address points to MEMORY space, othervise it points ti IO space. D
170
// Device independent software sets the base addresses acording to MEMORY or IO maping!
171
`define PCI_BA0_MEM_IO 1'b0 // considered only when PCI_IMAGE0 is used as general PCI-WB image!
172 78 mihad
`define PCI_BA1_MEM_IO 1'b0
173 18 mihad
`define PCI_BA2_MEM_IO 1'b0
174 45 mihad
`define PCI_BA3_MEM_IO 1'b1
175 18 mihad
`define PCI_BA4_MEM_IO 1'b0
176 45 mihad
`define PCI_BA5_MEM_IO 1'b1
177 18 mihad
 
178
// number defined here specifies how many MS bits in WB address are compared with base address, to decode
179
// accesses. Maximum number allows for minimum image size ( number = 20, image size = 4KB ), minimum number
180
// allows for maximum image size ( number = 1, image size = 2GB ). If you intend on using different sizes of WB images,
181
// you have to define a number of minimum sized image and enlarge others by specifying different address mask.
182
// smaller the number here, faster the decoder operation
183 132 mihad
`define WB_NUM_OF_DEC_ADDR_LINES 20
184 18 mihad
 
185
// no. of WISHBONE Slave IMAGES
186
// WB image 0 is always used for access to configuration space. In case configuration space access is not implemented,
187
// ( both GUEST and NO_CNF_IMAGE defined ), then WB image 0 is not implemented. User doesn't need to define image 0.
188
// WB Image 1 is always implemented and user doesnt need to specify its definition
189
// WB images' 2 through 5 implementation by defining each one.
190 132 mihad
`define WB_IMAGE2
191
`define WB_IMAGE3
192
`define WB_IMAGE4
193
`define WB_IMAGE5
194 18 mihad
 
195
// If this define is commented out, then address translation will not be implemented.
196
// addresses will pass through bridge unchanged, regardles of address translation enable bits.
197
// Address translation also slows down the decoding
198 132 mihad
`define ADDR_TRAN_IMPL
199 18 mihad
 
200
// decode speed for WISHBONE definition - initial cycle on WISHBONE bus will take 1 WS for FAST, 2 WSs for MEDIUM and 3 WSs for slow.
201
// slower decode speed can be used, to provide enough time for address to be decoded.
202 78 mihad
`define WB_DECODE_FAST
203
//`define WB_DECODE_MEDIUM
204 18 mihad
//`define WB_DECODE_SLOW
205
 
206
// Base address for Configuration space access from WB bus. This value cannot be changed during runtime
207 132 mihad
`define WB_CONFIGURATION_BASE 20'h0000_0
208 18 mihad
 
209
// Turn registered WISHBONE slave outputs on or off
210
// all outputs from WB Slave state machine are registered, if this is defined - WB bus outputs as well as
211
// outputs to internals of the core.
212 33 mihad
//`define REGISTER_WBS_OUTPUTS
213 18 mihad
 
214
/*-----------------------------------------------------------------------------------------------------------
215
Core speed definition - used for simulation and 66MHz Capable bit value in status register indicating 66MHz
216
capable device
217
-----------------------------------------------------------------------------------------------------------*/
218
`define PCI33
219
//`define PCI66
220
 
221
/*-----------------------------------------------------------------------------------------------------------
222
[000h-00Ch] First 4 DWORDs (32-bit) of PCI configuration header - the same regardless of the HEADER type !
223
        Vendor_ID is an ID for a specific vendor defined by PCI_SIG - 2321h does not belong to anyone (e.g.
224
        Xilinx's Vendor_ID is 10EEh and Altera's Vendor_ID is 1172h). Device_ID and Revision_ID should be used
225
        together by application.
226
-----------------------------------------------------------------------------------------------------------*/
227 73 mihad
`define HEADER_VENDOR_ID    16'h1895
228 18 mihad
`define HEADER_DEVICE_ID    16'h0001
229
`define HEADER_REVISION_ID  8'h01
230
 
231
// Turn registered WISHBONE master outputs on or off
232
// all outputs from WB Master state machine are registered, if this is defined - WB bus outputs as well as
233
// outputs to internals of the core.
234 132 mihad
//`define REGISTER_WBM_OUTPUTS
235 18 mihad
 
236
// MAX Retry counter value for WISHBONE Master state-machine
237
//      This value is 8-bit because of 8-bit retry counter !!!
238
`define WB_RTY_CNT_MAX                  8'hff
239 86 mihad
 
240
// define the macro below to disable internal retry generation in the wishbone master interface
241
// used when wb master accesses extremly slow devices.
242 132 mihad
//`define PCI_WBM_NO_RESPONSE_CNT_DISABLE
243 106 mihad
 
244 132 mihad
`define PCI_WB_REV_B3
245 106 mihad
//`define PCI_WBS_B3_RTY_DISABLE
246
 
247 132 mihad
`ifdef GUEST
248
    `define PCI_CPCI_HS_IMPLEMENT
249
`endif

powered by: WebSVN 2.1.0

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