1 |
77 |
mihad |
//////////////////////////////////////////////////////////////////////
|
2 |
|
|
//// ////
|
3 |
140 |
mihad |
//// File name: pci_conf_space.v ////
|
4 |
77 |
mihad |
//// ////
|
5 |
|
|
//// This file is part of the "PCI bridge" project ////
|
6 |
|
|
//// http://www.opencores.org/cores/pci/ ////
|
7 |
|
|
//// ////
|
8 |
|
|
//// Author(s): ////
|
9 |
|
|
//// - tadej@opencores.org ////
|
10 |
|
|
//// - Tadej Markovic ////
|
11 |
|
|
//// ////
|
12 |
|
|
//// All additional information is avaliable in the README.txt ////
|
13 |
|
|
//// file. ////
|
14 |
|
|
//// ////
|
15 |
|
|
//// ////
|
16 |
|
|
//////////////////////////////////////////////////////////////////////
|
17 |
|
|
//// ////
|
18 |
|
|
//// Copyright (C) 2000 Tadej Markovic, tadej@opencores.org ////
|
19 |
|
|
//// ////
|
20 |
|
|
//// This source file may be used and distributed without ////
|
21 |
|
|
//// restriction provided that this copyright statement is not ////
|
22 |
|
|
//// removed from the file and that any derivative work contains ////
|
23 |
|
|
//// the original copyright notice and the associated disclaimer. ////
|
24 |
|
|
//// ////
|
25 |
|
|
//// This source file is free software; you can redistribute it ////
|
26 |
|
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
27 |
|
|
//// Public License as published by the Free Software Foundation; ////
|
28 |
|
|
//// either version 2.1 of the License, or (at your option) any ////
|
29 |
|
|
//// later version. ////
|
30 |
|
|
//// ////
|
31 |
|
|
//// This source is distributed in the hope that it will be ////
|
32 |
|
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
33 |
|
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
34 |
|
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
35 |
|
|
//// details. ////
|
36 |
|
|
//// ////
|
37 |
|
|
//// You should have received a copy of the GNU Lesser General ////
|
38 |
|
|
//// Public License along with this source; if not, download it ////
|
39 |
|
|
//// from http://www.opencores.org/lgpl.shtml ////
|
40 |
|
|
//// ////
|
41 |
|
|
//////////////////////////////////////////////////////////////////////
|
42 |
|
|
//
|
43 |
|
|
// CVS Revision History
|
44 |
|
|
//
|
45 |
|
|
// $Log: not supported by cvs2svn $
|
46 |
149 |
mihad |
// Revision 1.9 2004/08/19 15:27:34 mihad
|
47 |
|
|
// Changed minimum pci image size to 256 bytes because
|
48 |
|
|
// of some PC system problems with size of IO images.
|
49 |
|
|
//
|
50 |
148 |
mihad |
// Revision 1.8 2004/07/07 12:45:01 mihad
|
51 |
|
|
// Added SubsystemVendorID, SubsystemID, MAXLatency, MinGnt defines.
|
52 |
|
|
// Enabled value loading from serial EEPROM for all of the above + VendorID and DeviceID registers.
|
53 |
|
|
//
|
54 |
143 |
mihad |
// Revision 1.7 2004/01/24 11:54:18 mihad
|
55 |
|
|
// Update! SPOCI Implemented!
|
56 |
|
|
//
|
57 |
140 |
mihad |
// Revision 1.6 2003/12/28 09:54:48 fr2201
|
58 |
|
|
// def_wb_imagex_addr_map defined correctly
|
59 |
|
|
//
|
60 |
137 |
fr2201 |
// Revision 1.5 2003/12/28 09:20:00 fr2201
|
61 |
|
|
// Reset values for PCI, WB defined (PCI_TAx,WB_BAx,WB_TAx,WB_AMx,WB_BAx_MEM_IO)
|
62 |
|
|
//
|
63 |
136 |
fr2201 |
// Revision 1.4 2003/12/19 11:11:30 mihad
|
64 |
|
|
// Compact PCI Hot Swap support added.
|
65 |
|
|
// New testcases added.
|
66 |
|
|
// Specification updated.
|
67 |
|
|
// Test application changed to support WB B3 cycles.
|
68 |
|
|
//
|
69 |
132 |
mihad |
// Revision 1.3 2003/08/14 13:06:02 simons
|
70 |
|
|
// synchronizer_flop replaced with pci_synchronizer_flop, artisan ram instance updated.
|
71 |
|
|
//
|
72 |
111 |
simons |
// Revision 1.2 2003/03/26 13:16:18 mihad
|
73 |
|
|
// Added the reset value parameter to the synchronizer flop module.
|
74 |
|
|
// Added resets to all synchronizer flop instances.
|
75 |
|
|
// Repaired initial sync value in fifos.
|
76 |
|
|
//
|
77 |
88 |
mihad |
// Revision 1.1 2003/01/27 16:49:31 mihad
|
78 |
|
|
// Changed module and file names. Updated scripts accordingly. FIFO synchronizations changed.
|
79 |
|
|
//
|
80 |
77 |
mihad |
// Revision 1.4 2002/08/13 11:03:53 mihad
|
81 |
|
|
// 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
|
82 |
|
|
//
|
83 |
|
|
// Revision 1.3 2002/02/01 15:25:12 mihad
|
84 |
|
|
// Repaired a few bugs, updated specification, added test bench files and design document
|
85 |
|
|
//
|
86 |
|
|
// Revision 1.2 2001/10/05 08:14:28 mihad
|
87 |
|
|
// Updated all files with inclusion of timescale file for simulation purposes.
|
88 |
|
|
//
|
89 |
|
|
// Revision 1.1.1.1 2001/10/02 15:33:46 mihad
|
90 |
|
|
// New project directory structure
|
91 |
|
|
//
|
92 |
|
|
//
|
93 |
|
|
|
94 |
|
|
`include "pci_constants.v"
|
95 |
|
|
|
96 |
|
|
// synopsys translate_off
|
97 |
|
|
`include "timescale.v"
|
98 |
|
|
// synopsys translate_on
|
99 |
|
|
|
100 |
|
|
/*-----------------------------------------------------------------------------------------------------------
|
101 |
|
|
w_ prefix is a sign for Write (and read) side of Dual-Port registers
|
102 |
|
|
r_ prefix is a sign for Read only side of Dual-Port registers
|
103 |
|
|
In the first line there are DATA and ADDRESS ports, in the second line there are write enable and read
|
104 |
|
|
enable signals with chip-select (conf_hit) for config. space.
|
105 |
|
|
In the third line there are output signlas from Command register of the PCI configuration header !!!
|
106 |
|
|
In the fourth line there are input signals to Status register of the PCI configuration header !!!
|
107 |
|
|
In the fifth line there is output from Latency Timer & r_Interrupt pin registers of the PCI conf. header !!!
|
108 |
|
|
Following are IMAGE specific registers, from which PCI_BASE_ADDR registers are the same as base address
|
109 |
|
|
registers from the PCI conf. header !!!
|
110 |
|
|
-----------------------------------------------------------------------------------------------------------*/
|
111 |
|
|
// normal R/W address, data and control
|
112 |
|
|
module pci_conf_space
|
113 |
|
|
( w_conf_address_in, w_conf_data_in, w_conf_data_out, r_conf_address_in, r_conf_data_out,
|
114 |
140 |
mihad |
w_we_i, w_re, r_re, w_byte_en_in, w_clock, reset, pci_clk, wb_clk,
|
115 |
77 |
mihad |
// outputs from command register of the PCI header
|
116 |
|
|
serr_enable, perr_response, pci_master_enable, memory_space_enable, io_space_enable,
|
117 |
|
|
// inputs to status register of the PCI header
|
118 |
|
|
perr_in, serr_in, master_abort_recv, target_abort_recv, target_abort_set, master_data_par_err,
|
119 |
|
|
// output from cache_line_size, latency timer and r_interrupt_pin register of the PCI header
|
120 |
|
|
cache_line_size_to_pci, cache_line_size_to_wb, cache_lsize_not_zero_to_wb,
|
121 |
|
|
latency_tim,
|
122 |
|
|
// output from all pci IMAGE registers
|
123 |
|
|
pci_base_addr0, pci_base_addr1, pci_base_addr2, pci_base_addr3, pci_base_addr4, pci_base_addr5,
|
124 |
|
|
pci_memory_io0, pci_memory_io1, pci_memory_io2, pci_memory_io3, pci_memory_io4, pci_memory_io5,
|
125 |
|
|
pci_addr_mask0, pci_addr_mask1, pci_addr_mask2, pci_addr_mask3, pci_addr_mask4, pci_addr_mask5,
|
126 |
|
|
pci_tran_addr0, pci_tran_addr1, pci_tran_addr2, pci_tran_addr3, pci_tran_addr4, pci_tran_addr5,
|
127 |
|
|
pci_img_ctrl0, pci_img_ctrl1, pci_img_ctrl2, pci_img_ctrl3, pci_img_ctrl4, pci_img_ctrl5,
|
128 |
|
|
// input to pci error control and status register, error address and error data registers
|
129 |
|
|
pci_error_be, pci_error_bc, pci_error_rty_exp, pci_error_es, pci_error_sig, pci_error_addr,
|
130 |
|
|
pci_error_data,
|
131 |
|
|
// output from all wishbone IMAGE registers
|
132 |
|
|
wb_base_addr0, wb_base_addr1, wb_base_addr2, wb_base_addr3, wb_base_addr4, wb_base_addr5,
|
133 |
|
|
wb_memory_io0, wb_memory_io1, wb_memory_io2, wb_memory_io3, wb_memory_io4, wb_memory_io5,
|
134 |
|
|
wb_addr_mask0, wb_addr_mask1, wb_addr_mask2, wb_addr_mask3, wb_addr_mask4, wb_addr_mask5,
|
135 |
|
|
wb_tran_addr0, wb_tran_addr1, wb_tran_addr2, wb_tran_addr3, wb_tran_addr4, wb_tran_addr5,
|
136 |
|
|
wb_img_ctrl0, wb_img_ctrl1, wb_img_ctrl2, wb_img_ctrl3, wb_img_ctrl4, wb_img_ctrl5,
|
137 |
|
|
// input to wb error control and status register, error address and error data registers
|
138 |
|
|
wb_error_be, wb_error_bc, wb_error_rty_exp, wb_error_es, wb_error_sig, wb_error_addr, wb_error_data,
|
139 |
|
|
// output from conf. cycle generation register (sddress), int. control register & interrupt output
|
140 |
|
|
config_addr, icr_soft_res, int_out,
|
141 |
|
|
// input to interrupt status register
|
142 |
132 |
mihad |
isr_sys_err_int, isr_par_err_int, isr_int_prop,
|
143 |
77 |
mihad |
|
144 |
140 |
mihad |
pci_init_complete_out, wb_init_complete_out
|
145 |
77 |
mihad |
|
146 |
132 |
mihad |
`ifdef PCI_CPCI_HS_IMPLEMENT
|
147 |
|
|
,
|
148 |
|
|
pci_cpci_hs_enum_oe_o, pci_cpci_hs_led_oe_o, pci_cpci_hs_es_i
|
149 |
|
|
`endif
|
150 |
140 |
mihad |
|
151 |
|
|
`ifdef PCI_SPOCI
|
152 |
|
|
,
|
153 |
|
|
spoci_scl_oe_o, spoci_sda_i, spoci_sda_oe_o
|
154 |
|
|
`endif
|
155 |
132 |
mihad |
) ;
|
156 |
|
|
|
157 |
|
|
|
158 |
77 |
mihad |
/*###########################################################################################################
|
159 |
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
160 |
|
|
Input and output ports
|
161 |
|
|
======================
|
162 |
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
163 |
|
|
###########################################################################################################*/
|
164 |
|
|
|
165 |
|
|
// output data
|
166 |
|
|
output [31 : 0] w_conf_data_out ;
|
167 |
|
|
output [31 : 0] r_conf_data_out ;
|
168 |
|
|
reg [31 : 0] w_conf_data_out ;
|
169 |
|
|
|
170 |
|
|
`ifdef NO_CNF_IMAGE
|
171 |
|
|
`else
|
172 |
|
|
reg [31 : 0] r_conf_data_out ;
|
173 |
|
|
`endif
|
174 |
|
|
|
175 |
|
|
// input data
|
176 |
|
|
input [31 : 0] w_conf_data_in ;
|
177 |
|
|
wire [31 : 0] w_conf_pdata_reduced ; // reduced data written into PCI image registers
|
178 |
|
|
wire [31 : 0] w_conf_wdata_reduced ; // reduced data written into WB image registers
|
179 |
|
|
// input address
|
180 |
|
|
input [11 : 0] w_conf_address_in ;
|
181 |
|
|
input [11 : 0] r_conf_address_in ;
|
182 |
|
|
// input control signals
|
183 |
140 |
mihad |
input w_we_i ;
|
184 |
|
|
input w_re ;
|
185 |
|
|
input r_re ;
|
186 |
|
|
input [3 : 0] w_byte_en_in ;
|
187 |
77 |
mihad |
input w_clock ;
|
188 |
|
|
input reset ;
|
189 |
|
|
input pci_clk ;
|
190 |
|
|
input wb_clk ;
|
191 |
|
|
// PCI header outputs from command register
|
192 |
|
|
output serr_enable ;
|
193 |
|
|
output perr_response ;
|
194 |
|
|
output pci_master_enable ;
|
195 |
|
|
output memory_space_enable ;
|
196 |
|
|
output io_space_enable ;
|
197 |
|
|
// PCI header inputs to status register
|
198 |
|
|
input perr_in ;
|
199 |
|
|
input serr_in ;
|
200 |
|
|
input master_abort_recv ;
|
201 |
|
|
input target_abort_recv ;
|
202 |
|
|
input target_abort_set ;
|
203 |
|
|
input master_data_par_err ;
|
204 |
|
|
// PCI header output from cache_line_size, latency timer and interrupt pin
|
205 |
|
|
output [7 : 0] cache_line_size_to_pci ; // sinchronized to PCI clock
|
206 |
|
|
output [7 : 0] cache_line_size_to_wb ; // sinchronized to WB clock
|
207 |
|
|
output cache_lsize_not_zero_to_wb ; // used in WBU and PCIU
|
208 |
|
|
output [7 : 0] latency_tim ;
|
209 |
|
|
//output [2 : 0] int_pin ; // only 3 LSbits are important!
|
210 |
|
|
// PCI output from image registers
|
211 |
148 |
mihad |
`ifdef GUEST
|
212 |
|
|
output [31:12] pci_base_addr0 ;
|
213 |
|
|
`endif
|
214 |
|
|
|
215 |
|
|
`ifdef HOST
|
216 |
|
|
`ifdef NO_CNF_IMAGE
|
217 |
|
|
output [31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] pci_base_addr0 ;
|
218 |
|
|
`else
|
219 |
|
|
output [31:12] pci_base_addr0 ;
|
220 |
|
|
`endif
|
221 |
|
|
`endif
|
222 |
|
|
|
223 |
77 |
mihad |
output [31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] pci_base_addr1 ;
|
224 |
|
|
output [31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] pci_base_addr2 ;
|
225 |
|
|
output [31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] pci_base_addr3 ;
|
226 |
|
|
output [31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] pci_base_addr4 ;
|
227 |
|
|
output [31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] pci_base_addr5 ;
|
228 |
|
|
output pci_memory_io0 ;
|
229 |
|
|
output pci_memory_io1 ;
|
230 |
|
|
output pci_memory_io2 ;
|
231 |
|
|
output pci_memory_io3 ;
|
232 |
|
|
output pci_memory_io4 ;
|
233 |
|
|
output pci_memory_io5 ;
|
234 |
|
|
output [31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] pci_addr_mask0 ;
|
235 |
|
|
output [31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] pci_addr_mask1 ;
|
236 |
|
|
output [31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] pci_addr_mask2 ;
|
237 |
|
|
output [31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] pci_addr_mask3 ;
|
238 |
|
|
output [31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] pci_addr_mask4 ;
|
239 |
|
|
output [31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] pci_addr_mask5 ;
|
240 |
|
|
output [31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] pci_tran_addr0 ;
|
241 |
|
|
output [31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] pci_tran_addr1 ;
|
242 |
|
|
output [31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] pci_tran_addr2 ;
|
243 |
|
|
output [31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] pci_tran_addr3 ;
|
244 |
|
|
output [31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] pci_tran_addr4 ;
|
245 |
|
|
output [31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] pci_tran_addr5 ;
|
246 |
|
|
output [2 : 1] pci_img_ctrl0 ;
|
247 |
|
|
output [2 : 1] pci_img_ctrl1 ;
|
248 |
|
|
output [2 : 1] pci_img_ctrl2 ;
|
249 |
|
|
output [2 : 1] pci_img_ctrl3 ;
|
250 |
|
|
output [2 : 1] pci_img_ctrl4 ;
|
251 |
|
|
output [2 : 1] pci_img_ctrl5 ;
|
252 |
|
|
// PCI input to pci error control and status register, error address and error data registers
|
253 |
|
|
input [3 : 0] pci_error_be ;
|
254 |
|
|
input [3 : 0] pci_error_bc ;
|
255 |
|
|
input pci_error_rty_exp ;
|
256 |
|
|
input pci_error_es ;
|
257 |
|
|
input pci_error_sig ;
|
258 |
|
|
input [31 : 0] pci_error_addr ;
|
259 |
|
|
input [31 : 0] pci_error_data ;
|
260 |
|
|
// WISHBONE output from image registers
|
261 |
|
|
output [31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] wb_base_addr0 ;
|
262 |
|
|
output [31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] wb_base_addr1 ;
|
263 |
|
|
output [31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] wb_base_addr2 ;
|
264 |
|
|
output [31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] wb_base_addr3 ;
|
265 |
|
|
output [31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] wb_base_addr4 ;
|
266 |
|
|
output [31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] wb_base_addr5 ;
|
267 |
|
|
output wb_memory_io0 ;
|
268 |
|
|
output wb_memory_io1 ;
|
269 |
|
|
output wb_memory_io2 ;
|
270 |
|
|
output wb_memory_io3 ;
|
271 |
|
|
output wb_memory_io4 ;
|
272 |
|
|
output wb_memory_io5 ;
|
273 |
|
|
output [31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] wb_addr_mask0 ;
|
274 |
|
|
output [31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] wb_addr_mask1 ;
|
275 |
|
|
output [31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] wb_addr_mask2 ;
|
276 |
|
|
output [31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] wb_addr_mask3 ;
|
277 |
|
|
output [31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] wb_addr_mask4 ;
|
278 |
|
|
output [31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] wb_addr_mask5 ;
|
279 |
|
|
output [31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] wb_tran_addr0 ;
|
280 |
|
|
output [31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] wb_tran_addr1 ;
|
281 |
|
|
output [31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] wb_tran_addr2 ;
|
282 |
|
|
output [31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] wb_tran_addr3 ;
|
283 |
|
|
output [31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] wb_tran_addr4 ;
|
284 |
|
|
output [31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] wb_tran_addr5 ;
|
285 |
|
|
output [2 : 0] wb_img_ctrl0 ;
|
286 |
|
|
output [2 : 0] wb_img_ctrl1 ;
|
287 |
|
|
output [2 : 0] wb_img_ctrl2 ;
|
288 |
|
|
output [2 : 0] wb_img_ctrl3 ;
|
289 |
|
|
output [2 : 0] wb_img_ctrl4 ;
|
290 |
|
|
output [2 : 0] wb_img_ctrl5 ;
|
291 |
|
|
// WISHBONE input to wb error control and status register, error address and error data registers
|
292 |
|
|
input [3 : 0] wb_error_be ;
|
293 |
|
|
input [3 : 0] wb_error_bc ;
|
294 |
|
|
input wb_error_rty_exp ;
|
295 |
|
|
input wb_error_es ;
|
296 |
|
|
input wb_error_sig ;
|
297 |
|
|
input [31 : 0] wb_error_addr ;
|
298 |
|
|
input [31 : 0] wb_error_data ;
|
299 |
|
|
// GENERAL output from conf. cycle generation register & int. control register
|
300 |
|
|
output [23 : 0] config_addr ;
|
301 |
|
|
output icr_soft_res ;
|
302 |
|
|
output int_out ;
|
303 |
|
|
// GENERAL input to interrupt status register
|
304 |
|
|
input isr_sys_err_int ;
|
305 |
|
|
input isr_par_err_int ;
|
306 |
|
|
input isr_int_prop ;
|
307 |
|
|
|
308 |
140 |
mihad |
output pci_init_complete_out ;
|
309 |
|
|
output wb_init_complete_out ;
|
310 |
77 |
mihad |
|
311 |
132 |
mihad |
`ifdef PCI_CPCI_HS_IMPLEMENT
|
312 |
|
|
output pci_cpci_hs_enum_oe_o ;
|
313 |
|
|
output pci_cpci_hs_led_oe_o ;
|
314 |
|
|
input pci_cpci_hs_es_i ;
|
315 |
|
|
|
316 |
|
|
reg pci_cpci_hs_enum_oe_o ;
|
317 |
|
|
reg pci_cpci_hs_led_oe_o ;
|
318 |
|
|
|
319 |
|
|
// set the hot swap ejector switch debounce counter width
|
320 |
|
|
// it is only 4 for simulation purposes
|
321 |
|
|
`ifdef PCI_CPCI_SIM
|
322 |
|
|
|
323 |
|
|
parameter hs_es_cnt_width = 4 ;
|
324 |
|
|
|
325 |
|
|
`else
|
326 |
|
|
|
327 |
|
|
`ifdef PCI33
|
328 |
|
|
|
329 |
|
|
parameter hs_es_cnt_width = 16 ;
|
330 |
|
|
|
331 |
|
|
`endif
|
332 |
|
|
|
333 |
|
|
`ifdef PCI66
|
334 |
|
|
|
335 |
|
|
parameter hs_es_cnt_width = 17 ;
|
336 |
|
|
|
337 |
|
|
`endif
|
338 |
|
|
`endif
|
339 |
|
|
|
340 |
|
|
`endif
|
341 |
140 |
mihad |
|
342 |
|
|
`ifdef PCI_SPOCI
|
343 |
|
|
output spoci_scl_oe_o ;
|
344 |
|
|
input spoci_sda_i ;
|
345 |
|
|
output spoci_sda_oe_o ;
|
346 |
|
|
|
347 |
|
|
reg spoci_cs_nack,
|
348 |
|
|
spoci_cs_write,
|
349 |
|
|
spoci_cs_read;
|
350 |
|
|
|
351 |
|
|
reg [10: 0] spoci_cs_adr ;
|
352 |
|
|
reg [ 7: 0] spoci_cs_dat ;
|
353 |
|
|
`endif
|
354 |
|
|
|
355 |
77 |
mihad |
/*###########################################################################################################
|
356 |
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
357 |
|
|
REGISTERS definition
|
358 |
|
|
====================
|
359 |
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
360 |
|
|
###########################################################################################################*/
|
361 |
|
|
|
362 |
|
|
// Decoded Register Select signals for writting (only one address decoder)
|
363 |
132 |
mihad |
reg [56 : 0] w_reg_select_dec ;
|
364 |
77 |
mihad |
|
365 |
|
|
/*###########################################################################################################
|
366 |
|
|
-------------------------------------------------------------------------------------------------------------
|
367 |
|
|
PCI CONFIGURATION SPACE HEADER (type 00h) registers
|
368 |
|
|
|
369 |
|
|
BIST and some other registers are not implemented and therefor written in correct
|
370 |
|
|
place with comment line. There are also some registers with NOT all bits implemented and therefor uses
|
371 |
|
|
_bitX or _bitX2_X1 to sign which bit or range of bits are implemented.
|
372 |
|
|
Some special cases and examples are described below!
|
373 |
|
|
-------------------------------------------------------------------------------------------------------------
|
374 |
|
|
###########################################################################################################*/
|
375 |
|
|
|
376 |
|
|
/*-----------------------------------------------------------------------------------------------------------
|
377 |
|
|
[000h-00Ch] First 4 DWORDs (32-bit) of PCI configuration header - the same regardless of the HEADER type !
|
378 |
|
|
r_ prefix is a sign for read only registers
|
379 |
|
|
Vendor_ID is an ID for a specific vendor defined by PCI_SIG - 2321h does not belong to anyone (e.g.
|
380 |
|
|
Xilinx's Vendor_ID is 10EEh and Altera's Vendor_ID is 1172h). Device_ID and Revision_ID should be used
|
381 |
|
|
together by application. Class_Code has 3 bytes to define BASE class (06h for PCI Bridge), SUB class
|
382 |
|
|
(00h for HOST type, 80h for Other Bridge type) and Interface type (00h for normal).
|
383 |
|
|
-----------------------------------------------------------------------------------------------------------*/
|
384 |
143 |
mihad |
reg [15: 0] r_vendor_id ;
|
385 |
|
|
reg [15: 0] r_device_id ;
|
386 |
|
|
reg [15: 0] r_subsys_vendor_id ;
|
387 |
|
|
reg [15: 0] r_subsys_id ;
|
388 |
|
|
|
389 |
77 |
mihad |
reg command_bit8 ;
|
390 |
|
|
reg command_bit6 ;
|
391 |
|
|
reg [2 : 0] command_bit2_0 ;
|
392 |
|
|
reg [15 : 11] status_bit15_11 ;
|
393 |
|
|
parameter r_status_bit10_9 = 2'b01 ; // 2'b01 means MEDIUM devsel timing !!!
|
394 |
|
|
reg status_bit8 ;
|
395 |
|
|
parameter r_status_bit7 = 1'b1 ; // fast back-to-back capable response !!!
|
396 |
|
|
parameter r_status_bit5 = `HEADER_66MHz ; // 1'b0 indicates 33 MHz capable !!!
|
397 |
132 |
mihad |
|
398 |
|
|
`ifdef PCI_CPCI_HS_IMPLEMENT
|
399 |
|
|
wire r_status_bit4 = 1 ;
|
400 |
|
|
reg hs_ins ;
|
401 |
|
|
reg hs_ext ;
|
402 |
|
|
wire [ 1: 0] hs_pi = 2'b00 ;
|
403 |
|
|
reg hs_loo ;
|
404 |
|
|
reg hs_eim ;
|
405 |
|
|
wire [ 7: 0] hs_cap_id = 8'h06 ;
|
406 |
|
|
reg hs_ins_armed ;
|
407 |
|
|
reg hs_ext_armed ;
|
408 |
|
|
`else
|
409 |
|
|
wire r_status_bit4 = 0 ;
|
410 |
|
|
`endif
|
411 |
|
|
|
412 |
143 |
mihad |
reg [ 7: 0] r_revision_id ;
|
413 |
|
|
|
414 |
77 |
mihad |
`ifdef HOST
|
415 |
|
|
parameter r_class_code = 24'h06_00_00 ;
|
416 |
|
|
`else
|
417 |
|
|
parameter r_class_code = 24'h06_80_00 ;
|
418 |
|
|
`endif
|
419 |
|
|
reg [7 : 0] cache_line_size_reg ;
|
420 |
|
|
reg [7 : 0] latency_timer ;
|
421 |
|
|
parameter r_header_type = 8'h00 ;
|
422 |
|
|
// REG bist NOT implemented !!!
|
423 |
|
|
|
424 |
|
|
/*-----------------------------------------------------------------------------------------------------------
|
425 |
|
|
[010h-03Ch] all other DWORDs (32-bit) of PCI configuration header - only for HEADER type 00h !
|
426 |
|
|
r_ prefix is a sign for read only registers
|
427 |
|
|
BASE_ADDRESS_REGISTERS are the same as ones in the PCI Target configuration registers section. They
|
428 |
|
|
are duplicated and therefor defined just ones and used with the same name as written below. If
|
429 |
|
|
IMAGEx is NOT defined there is only parameter image_X assigned to '0' and this parameter is used
|
430 |
|
|
elsewhere in the code. This parameter is defined in the INTERNAL SIGNALS part !!!
|
431 |
|
|
Interrupt_Pin value 8'h01 is used for INT_A pin used.
|
432 |
|
|
MIN_GNT and MAX_LAT are used for device's desired values for Latency Timer value. The value in boath
|
433 |
|
|
registers specifies a period of time in units of 1/4 microsecond. ZERO indicates that there are no
|
434 |
|
|
major requirements for the settings of Latency Timer.
|
435 |
|
|
MIN_GNT specifieshow how long a burst period the device needs at 33MHz. MAX_LAT specifies how often
|
436 |
|
|
the device needs to gain access to the PCI bus. Values are choosen assuming that the target does not
|
437 |
|
|
insert any wait states. Follow the expamle of settings for simple display card.
|
438 |
|
|
If we use 64 (32-bit) FIFO locations for one burst then we need 8 x 1/4 microsecond periods at 33MHz
|
439 |
|
|
clock rate => MIN_GNT = 08h ! Resolution is 1024 x 768 (= 786432 pixels for one frame) with 16-bit
|
440 |
|
|
color mode. We can transfere 2 16-bit pixels in one FIFO location. From that we calculate, that for
|
441 |
|
|
one frame we need 6144 burst transferes in 1/25 second. So we need one burst every 6,51 microsecond
|
442 |
|
|
and that is 26 x 1/4 microsecond or 1Ah x 1/4 microsecond => MAX_LAT = 1Ah !
|
443 |
|
|
-----------------------------------------------------------------------------------------------------------*/
|
444 |
|
|
// REG x 6 base_address_register_X IMPLEMENTED as pci_ba_X !!!
|
445 |
|
|
// REG r_cardbus_cis_pointer NOT implemented !!!
|
446 |
|
|
// REG r_subsystem_vendor_id NOT implemented !!!
|
447 |
|
|
// REG r_subsystem_id NOT implemented !!!
|
448 |
|
|
// REG r_expansion_rom_base_address NOT implemented !!!
|
449 |
|
|
// REG r_cap_list_pointer NOT implemented !!!
|
450 |
|
|
reg [7 : 0] interrupt_line ;
|
451 |
|
|
parameter r_interrupt_pin = 8'h01 ;
|
452 |
143 |
mihad |
reg [7 : 0] r_min_gnt ;
|
453 |
|
|
reg [7 : 0] r_max_lat ;
|
454 |
77 |
mihad |
|
455 |
|
|
/*###########################################################################################################
|
456 |
|
|
-------------------------------------------------------------------------------------------------------------
|
457 |
|
|
PCI Target configuration registers
|
458 |
|
|
There are also some registers with NOT all bits implemented and therefor uses _bitX or _bitX2_X1 to
|
459 |
|
|
sign which bit or range of bits are implemented. Some special cases and examples are described below!
|
460 |
|
|
-------------------------------------------------------------------------------------------------------------
|
461 |
|
|
###########################################################################################################*/
|
462 |
|
|
|
463 |
|
|
/*-----------------------------------------------------------------------------------------------------------
|
464 |
|
|
[100h-168h]
|
465 |
|
|
Depending on defines (PCI_IMAGE1 or .. or PCI_IMAGE5 or (PCI_IMAGE0 and HOST)) in constants.v file,
|
466 |
|
|
there are registers corresponding to each IMAGE defined to REG and parameter pci_image_X assigned to '1'.
|
467 |
|
|
The maximum number of images is "6". By default there are first two images used and the first (PCI_IMAGE0)
|
468 |
|
|
is assigned to Configuration space! With a 'define' PCI_IMAGEx you choose the number of used PCI IMAGES
|
469 |
|
|
in a bridge without PCI_IMAGE0 (e.g. PCI_IMAGE3 tells, that PCI_IMAGE1, PCI_IMAGE2 and PCI_IMAGE3 are
|
470 |
|
|
used for mapping the space from WB to PCI. Offcourse, PCI_IMAGE0 is assigned to Configuration space).
|
471 |
|
|
That leave us PCI_IMAGE5 as the maximum number of images.
|
472 |
|
|
There is one exeption, when the core is implemented as HOST. If so, then the PCI specification allowes
|
473 |
|
|
the Configuration space NOT to be visible on the PCI bus. With `define PCI_IMAGE0 (and `define HOST), we
|
474 |
|
|
assign PCI_IMAGE0 to normal WB to PCI image and not to configuration space!
|
475 |
|
|
|
476 |
|
|
When error occurs, PCI ERR_ADDR and ERR_DATA registers stores address and data on the bus that
|
477 |
|
|
caused error. While ERR_CS register stores Byte Enables and Bus Command in the MSByte. In bits 10
|
478 |
|
|
and 8 it reports Retry Counter Expired (for posted writes), Error Source (Master Abort) and Error
|
479 |
|
|
Report Signal (signals that error has occured) respectively. With bit 0 we enable Error Reporting
|
480 |
|
|
mechanism.
|
481 |
|
|
-----------------------------------------------------------------------------------------------------------*/
|
482 |
|
|
`ifdef HOST
|
483 |
|
|
`ifdef NO_CNF_IMAGE
|
484 |
|
|
`ifdef PCI_IMAGE0 // if PCI bridge is HOST and IMAGE0 is assigned as general image space
|
485 |
148 |
mihad |
reg [31 : 8] pci_ba0_bit31_8 ;
|
486 |
77 |
mihad |
reg [2 : 1] pci_img_ctrl0_bit2_1 ;
|
487 |
|
|
reg pci_ba0_bit0 ;
|
488 |
148 |
mihad |
reg [31 : 8] pci_am0 ;
|
489 |
|
|
reg [31 : 8] pci_ta0 ;
|
490 |
77 |
mihad |
`else // if PCI bridge is HOST and IMAGE0 is not used
|
491 |
148 |
mihad |
wire [31 : 8] pci_ba0_bit31_8 = 24'h0000_00 ; // NO base address needed
|
492 |
77 |
mihad |
wire [2 : 1] pci_img_ctrl0_bit2_1 = 2'b00 ; // NO addr.transl. and pre-fetch
|
493 |
|
|
wire pci_ba0_bit0 = 0 ; // config. space is MEMORY space
|
494 |
148 |
mihad |
wire [31 : 8] pci_am0 = 24'h0000_00 ; // NO address mask needed
|
495 |
|
|
wire [31 : 8] pci_ta0 = 24'h0000_00 ; // NO address translation needed
|
496 |
77 |
mihad |
`endif
|
497 |
|
|
`else // if PCI bridge is HOST and IMAGE0 is assigned to PCI configuration space
|
498 |
148 |
mihad |
reg [31 : 8] pci_ba0_bit31_8 ;
|
499 |
77 |
mihad |
wire [2 : 1] pci_img_ctrl0_bit2_1 = 2'b00 ; // NO pre-fetch and read line support
|
500 |
|
|
wire pci_ba0_bit0 = 0 ; // config. space is MEMORY space
|
501 |
148 |
mihad |
wire [31 : 8] pci_am0 = 24'hFFFF_F0 ; // address mask for configuration image always 20'hffff_f
|
502 |
|
|
wire [31 : 8] pci_ta0 = 24'h0000_00 ; // NO address translation needed
|
503 |
77 |
mihad |
`endif
|
504 |
148 |
mihad |
`endif
|
505 |
|
|
|
506 |
|
|
`ifdef GUEST // if PCI bridge is GUEST, then IMAGE0 is assigned to PCI configuration space
|
507 |
|
|
reg [31 : 8] pci_ba0_bit31_8 ;
|
508 |
77 |
mihad |
wire [2 : 1] pci_img_ctrl0_bit2_1 = 2'b00 ; // NO addr.transl. and pre-fetch
|
509 |
|
|
wire pci_ba0_bit0 = 0 ; // config. space is MEMORY space
|
510 |
148 |
mihad |
wire [31 : 8] pci_am0 = 24'hffff_f0 ; // address mask for configuration image always 24'hffff_f0 - 4KB mem image
|
511 |
|
|
wire [31 : 8] pci_ta0 = 24'h0000_00 ; // NO address translation needed
|
512 |
77 |
mihad |
`endif
|
513 |
148 |
mihad |
|
514 |
77 |
mihad |
// IMAGE1 is included by default, meanwhile other IMAGEs are optional !!!
|
515 |
|
|
reg [2 : 1] pci_img_ctrl1_bit2_1 ;
|
516 |
148 |
mihad |
reg [31 : 8] pci_ba1_bit31_8 ;
|
517 |
77 |
mihad |
`ifdef HOST
|
518 |
|
|
reg pci_ba1_bit0 ;
|
519 |
|
|
`else
|
520 |
|
|
wire pci_ba1_bit0 = `PCI_BA1_MEM_IO ;
|
521 |
|
|
`endif
|
522 |
148 |
mihad |
reg [31 : 8] pci_am1 ;
|
523 |
|
|
reg [31 : 8] pci_ta1 ;
|
524 |
77 |
mihad |
`ifdef PCI_IMAGE2
|
525 |
|
|
reg [2 : 1] pci_img_ctrl2_bit2_1 ;
|
526 |
148 |
mihad |
reg [31 : 8] pci_ba2_bit31_8 ;
|
527 |
77 |
mihad |
`ifdef HOST
|
528 |
|
|
reg pci_ba2_bit0 ;
|
529 |
|
|
`else
|
530 |
|
|
wire pci_ba2_bit0 = `PCI_BA2_MEM_IO ;
|
531 |
|
|
`endif
|
532 |
148 |
mihad |
reg [31 : 8] pci_am2 ;
|
533 |
|
|
reg [31 : 8] pci_ta2 ;
|
534 |
77 |
mihad |
`else
|
535 |
|
|
wire [2 : 1] pci_img_ctrl2_bit2_1 = 2'b00 ;
|
536 |
148 |
mihad |
wire [31 : 8] pci_ba2_bit31_8 = 24'h0000_00 ;
|
537 |
77 |
mihad |
wire pci_ba2_bit0 = 1'b0 ;
|
538 |
148 |
mihad |
wire [31 : 8] pci_am2 = 24'h0000_00 ;
|
539 |
|
|
wire [31 : 8] pci_ta2 = 24'h0000_00 ;
|
540 |
77 |
mihad |
`endif
|
541 |
|
|
`ifdef PCI_IMAGE3
|
542 |
|
|
reg [2 : 1] pci_img_ctrl3_bit2_1 ;
|
543 |
148 |
mihad |
reg [31 : 8] pci_ba3_bit31_8 ;
|
544 |
77 |
mihad |
`ifdef HOST
|
545 |
|
|
reg pci_ba3_bit0 ;
|
546 |
|
|
`else
|
547 |
|
|
wire pci_ba3_bit0 = `PCI_BA3_MEM_IO ;
|
548 |
|
|
`endif
|
549 |
148 |
mihad |
reg [31 : 8] pci_am3 ;
|
550 |
|
|
reg [31 : 8] pci_ta3 ;
|
551 |
77 |
mihad |
`else
|
552 |
|
|
wire [2 : 1] pci_img_ctrl3_bit2_1 = 2'b00 ;
|
553 |
148 |
mihad |
wire [31 : 8] pci_ba3_bit31_8 = 24'h0000_00 ;
|
554 |
77 |
mihad |
wire pci_ba3_bit0 = 1'b0 ;
|
555 |
148 |
mihad |
wire [31 : 8] pci_am3 = 24'h0000_00 ;
|
556 |
|
|
wire [31 : 8] pci_ta3 = 24'h0000_00 ;
|
557 |
77 |
mihad |
`endif
|
558 |
|
|
`ifdef PCI_IMAGE4
|
559 |
|
|
reg [2 : 1] pci_img_ctrl4_bit2_1 ;
|
560 |
148 |
mihad |
reg [31 : 8] pci_ba4_bit31_8 ;
|
561 |
77 |
mihad |
`ifdef HOST
|
562 |
|
|
reg pci_ba4_bit0 ;
|
563 |
|
|
`else
|
564 |
|
|
wire pci_ba4_bit0 = `PCI_BA4_MEM_IO ;
|
565 |
|
|
`endif
|
566 |
148 |
mihad |
reg [31 : 8] pci_am4 ;
|
567 |
|
|
reg [31 : 8] pci_ta4 ;
|
568 |
77 |
mihad |
`else
|
569 |
|
|
wire [2 : 1] pci_img_ctrl4_bit2_1 = 2'b00 ;
|
570 |
148 |
mihad |
wire [31 : 8] pci_ba4_bit31_8 = 24'h0000_00 ;
|
571 |
77 |
mihad |
wire pci_ba4_bit0 = 1'b0 ;
|
572 |
148 |
mihad |
wire [31 : 8] pci_am4 = 24'h0000_00 ;
|
573 |
|
|
wire [31 : 8] pci_ta4 = 24'h0000_00 ;
|
574 |
77 |
mihad |
`endif
|
575 |
|
|
`ifdef PCI_IMAGE5
|
576 |
|
|
reg [2 : 1] pci_img_ctrl5_bit2_1 ;
|
577 |
148 |
mihad |
reg [31 : 8] pci_ba5_bit31_8 ;
|
578 |
77 |
mihad |
`ifdef HOST
|
579 |
|
|
reg pci_ba5_bit0 ;
|
580 |
|
|
`else
|
581 |
|
|
wire pci_ba5_bit0 = `PCI_BA5_MEM_IO ;
|
582 |
|
|
`endif
|
583 |
148 |
mihad |
reg [31 : 8] pci_am5 ;
|
584 |
|
|
reg [31 : 8] pci_ta5 ;
|
585 |
77 |
mihad |
`else
|
586 |
|
|
wire [2 : 1] pci_img_ctrl5_bit2_1 = 2'b00 ;
|
587 |
148 |
mihad |
wire [31 : 8] pci_ba5_bit31_8 = 24'h0000_00 ;
|
588 |
77 |
mihad |
wire pci_ba5_bit0 = 1'b0 ;
|
589 |
148 |
mihad |
wire [31 : 8] pci_am5 = 24'h0000_00 ;
|
590 |
|
|
wire [31 : 8] pci_ta5 = 24'h0000_00 ;
|
591 |
77 |
mihad |
`endif
|
592 |
|
|
reg [31 : 24] pci_err_cs_bit31_24 ;
|
593 |
|
|
reg pci_err_cs_bit10 ;
|
594 |
|
|
reg pci_err_cs_bit9 ;
|
595 |
|
|
reg pci_err_cs_bit8 ;
|
596 |
|
|
reg pci_err_cs_bit0 ;
|
597 |
|
|
reg [31 : 0] pci_err_addr ;
|
598 |
|
|
reg [31 : 0] pci_err_data ;
|
599 |
|
|
|
600 |
|
|
|
601 |
|
|
/*###########################################################################################################
|
602 |
|
|
-------------------------------------------------------------------------------------------------------------
|
603 |
|
|
WISHBONE Slave configuration registers
|
604 |
|
|
There are also some registers with NOT all bits implemented and therefor uses _bitX or _bitX2_X1 to
|
605 |
|
|
sign which bit or range of bits are implemented. Some special cases and examples are described below!
|
606 |
|
|
-------------------------------------------------------------------------------------------------------------
|
607 |
|
|
###########################################################################################################*/
|
608 |
|
|
|
609 |
|
|
/*-----------------------------------------------------------------------------------------------------------
|
610 |
|
|
[800h-85Ch]
|
611 |
|
|
Depending on defines (WB_IMAGE1 or .. or WB_IMAGE4 or WB_IMAGE5) in constants.v file, there are
|
612 |
|
|
registers corresponding to each IMAGE defined to REG and parameter wb_image_X assigned to '1'.
|
613 |
|
|
The maximum number of images is "6". By default there are first two images used and the first (WB_IMAGE0)
|
614 |
|
|
is assigned to Configuration space! With a 'define' WB_IMAGEx you choose the number of used WB IMAGES in
|
615 |
|
|
a bridge without WB_IMAGE0 (e.g. WB_IMAGE3 tells, that WB_IMAGE1, WB_IMAGE2 and WB_IMAGE3 are used for
|
616 |
|
|
mapping the space from PCI to WB. Offcourse, WB_IMAGE0 is assigned to Configuration space). That leave
|
617 |
|
|
us WB_IMAGE5 as the maximum number of images.
|
618 |
|
|
|
619 |
|
|
When error occurs, WISHBONE ERR_ADDR and ERR_DATA registers stores address and data on the bus that
|
620 |
|
|
caused error. While ERR_CS register stores Byte Enables and Bus Command in the MSByte. In bits 10, 9
|
621 |
|
|
and 8 it reports Retry Counter Expired (for posted writes), Error Source (Master Abort) and Error
|
622 |
|
|
Report Signal (signals that error has occured) respectively. With bit 0 we enable Error Reporting
|
623 |
|
|
mechanism.
|
624 |
|
|
-----------------------------------------------------------------------------------------------------------*/
|
625 |
|
|
// WB_IMAGE0 is always assigned to config. space or is not used
|
626 |
|
|
wire [2 : 0] wb_img_ctrl0_bit2_0 = 3'b000 ; // NO addr.transl., pre-fetch and read-line
|
627 |
|
|
wire [31 : 12] wb_ba0_bit31_12 = `WB_CONFIGURATION_BASE ;
|
628 |
|
|
wire wb_ba0_bit0 = 0 ; // config. space is MEMORY space
|
629 |
|
|
wire [31 : 12] wb_am0 = `WB_AM0 ; // 4KBytes of configuration space is minimum
|
630 |
|
|
wire [31 : 12] wb_ta0 = 20'h0000_0 ; // NO address translation needed
|
631 |
|
|
// WB_IMAGE1 is included by default meanwhile others are optional !
|
632 |
|
|
reg [2 : 0] wb_img_ctrl1_bit2_0 ;
|
633 |
|
|
reg [31 : 12] wb_ba1_bit31_12 ;
|
634 |
|
|
reg wb_ba1_bit0 ;
|
635 |
|
|
reg [31 : 12] wb_am1 ;
|
636 |
|
|
reg [31 : 12] wb_ta1 ;
|
637 |
|
|
`ifdef WB_IMAGE2
|
638 |
|
|
reg [2 : 0] wb_img_ctrl2_bit2_0 ;
|
639 |
|
|
reg [31 : 12] wb_ba2_bit31_12 ;
|
640 |
|
|
reg wb_ba2_bit0 ;
|
641 |
|
|
reg [31 : 12] wb_am2 ;
|
642 |
|
|
reg [31 : 12] wb_ta2 ;
|
643 |
|
|
`else
|
644 |
|
|
wire [2 : 0] wb_img_ctrl2_bit2_0 = 3'b000 ;
|
645 |
|
|
wire [31 : 12] wb_ba2_bit31_12 = 20'h0000_0 ;
|
646 |
|
|
wire wb_ba2_bit0 = 1'b0 ;
|
647 |
|
|
wire [31 : 12] wb_am2 = 20'h0000_0 ;
|
648 |
|
|
wire [31 : 12] wb_ta2 = 20'h0000_0 ;
|
649 |
|
|
`endif
|
650 |
|
|
`ifdef WB_IMAGE3
|
651 |
|
|
reg [2 : 0] wb_img_ctrl3_bit2_0 ;
|
652 |
|
|
reg [31 : 12] wb_ba3_bit31_12 ;
|
653 |
|
|
reg wb_ba3_bit0 ;
|
654 |
|
|
reg [31 : 12] wb_am3 ;
|
655 |
|
|
reg [31 : 12] wb_ta3 ;
|
656 |
|
|
`else
|
657 |
|
|
wire [2 : 0] wb_img_ctrl3_bit2_0 = 3'b000 ;
|
658 |
|
|
wire [31 : 12] wb_ba3_bit31_12 = 20'h0000_0 ;
|
659 |
|
|
wire wb_ba3_bit0 = 1'b0 ;
|
660 |
|
|
wire [31 : 12] wb_am3 = 20'h0000_0 ;
|
661 |
|
|
wire [31 : 12] wb_ta3 = 20'h0000_0 ;
|
662 |
|
|
`endif
|
663 |
|
|
`ifdef WB_IMAGE4
|
664 |
|
|
reg [2 : 0] wb_img_ctrl4_bit2_0 ;
|
665 |
|
|
reg [31 : 12] wb_ba4_bit31_12 ;
|
666 |
|
|
reg wb_ba4_bit0 ;
|
667 |
|
|
reg [31 : 12] wb_am4 ;
|
668 |
|
|
reg [31 : 12] wb_ta4 ;
|
669 |
|
|
`else
|
670 |
|
|
wire [2 : 0] wb_img_ctrl4_bit2_0 = 3'b000 ;
|
671 |
|
|
wire [31 : 12] wb_ba4_bit31_12 = 20'h0000_0 ;
|
672 |
|
|
wire wb_ba4_bit0 = 1'b0 ;
|
673 |
|
|
wire [31 : 12] wb_am4 = 20'h0000_0 ;
|
674 |
|
|
wire [31 : 12] wb_ta4 = 20'h0000_0 ;
|
675 |
|
|
`endif
|
676 |
|
|
`ifdef WB_IMAGE5
|
677 |
|
|
reg [2 : 0] wb_img_ctrl5_bit2_0 ;
|
678 |
|
|
reg [31 : 12] wb_ba5_bit31_12 ;
|
679 |
|
|
reg wb_ba5_bit0 ;
|
680 |
|
|
reg [31 : 12] wb_am5 ;
|
681 |
|
|
reg [31 : 12] wb_ta5 ;
|
682 |
|
|
`else
|
683 |
|
|
wire [2 : 0] wb_img_ctrl5_bit2_0 = 3'b000 ;
|
684 |
|
|
wire [31 : 12] wb_ba5_bit31_12 = 20'h0000_0 ;
|
685 |
|
|
wire wb_ba5_bit0 = 1'b0 ;
|
686 |
|
|
wire [31 : 12] wb_am5 = 20'h0000_0 ;
|
687 |
|
|
wire [31 : 12] wb_ta5 = 20'h0000_0 ;
|
688 |
|
|
`endif
|
689 |
|
|
reg [31 : 24] wb_err_cs_bit31_24 ;
|
690 |
|
|
/* reg wb_err_cs_bit10 ;*/
|
691 |
|
|
reg wb_err_cs_bit9 ;
|
692 |
|
|
reg wb_err_cs_bit8 ;
|
693 |
|
|
reg wb_err_cs_bit0 ;
|
694 |
|
|
reg [31 : 0] wb_err_addr ;
|
695 |
|
|
reg [31 : 0] wb_err_data ;
|
696 |
|
|
|
697 |
|
|
|
698 |
|
|
/*###########################################################################################################
|
699 |
|
|
-------------------------------------------------------------------------------------------------------------
|
700 |
|
|
Configuration Cycle address register
|
701 |
|
|
There are also some registers with NOT all bits implemented and therefor uses _bitX or _bitX2_X1 to
|
702 |
|
|
sign which bit or range of bits are implemented.
|
703 |
|
|
-------------------------------------------------------------------------------------------------------------
|
704 |
|
|
###########################################################################################################*/
|
705 |
|
|
|
706 |
|
|
/*-----------------------------------------------------------------------------------------------------------
|
707 |
|
|
[860h-868h]
|
708 |
|
|
PCI bridge must ignore Type 1 configuration cycles (Master Abort) since they are used for PCI to PCI
|
709 |
|
|
bridges. This is single function device, that means responding on configuration cycles to all functions
|
710 |
|
|
(or responding only to function 0). Configuration address register for generating configuration cycles
|
711 |
|
|
is prepared for all options (it includes Bus Number, Device, Function, Offset and Type).
|
712 |
|
|
Interrupt acknowledge register stores interrupt vector data returned during Interrupt Acknowledge cycle.
|
713 |
|
|
-----------------------------------------------------------------------------------------------------------*/
|
714 |
|
|
`ifdef HOST
|
715 |
|
|
reg [23 : 2] cnf_addr_bit23_2 ;
|
716 |
|
|
reg cnf_addr_bit0 ;
|
717 |
|
|
`else // GUEST
|
718 |
|
|
wire [23 : 2] cnf_addr_bit23_2 = 22'h0 ;
|
719 |
|
|
wire cnf_addr_bit0 = 1'b0 ;
|
720 |
|
|
`endif
|
721 |
|
|
// reg [31 : 0] cnf_data ; IMPLEMENTED elsewhere !!!!!
|
722 |
|
|
// reg [31 : 0] int_ack ; IMPLEMENTED elsewhere !!!!!
|
723 |
|
|
|
724 |
|
|
|
725 |
|
|
/*###########################################################################################################
|
726 |
|
|
-------------------------------------------------------------------------------------------------------------
|
727 |
|
|
General Interrupt registers
|
728 |
|
|
There are also some registers with NOT all bits implemented and therefor uses _bitX or _bitX2_X1 to
|
729 |
|
|
sign which bit or range of bits are implemented.
|
730 |
|
|
-------------------------------------------------------------------------------------------------------------
|
731 |
|
|
###########################################################################################################*/
|
732 |
|
|
|
733 |
|
|
/*-----------------------------------------------------------------------------------------------------------
|
734 |
|
|
[FF8h-FFCh]
|
735 |
|
|
Bit 31 in the Interrupt Control register is set by software and used to generate SOFT RESET. Other 4
|
736 |
|
|
bits are used to enable interrupt generations.
|
737 |
|
|
5 LSbits in the Interrupt Status register are indicating System Error Int, Parity Error Int, PCI & WB
|
738 |
|
|
Error Int and Inerrupt respecively. System and Parity errors are implented only in HOST bridge
|
739 |
|
|
implementations!
|
740 |
|
|
-----------------------------------------------------------------------------------------------------------*/
|
741 |
|
|
reg icr_bit31 ;
|
742 |
|
|
`ifdef HOST
|
743 |
132 |
mihad |
reg [4 : 3] icr_bit4_3 ;
|
744 |
|
|
reg [4 : 3] isr_bit4_3 ;
|
745 |
|
|
reg [2 : 0] icr_bit2_0 ;
|
746 |
|
|
reg [2 : 0] isr_bit2_0 ;
|
747 |
77 |
mihad |
`else // GUEST
|
748 |
|
|
wire [4 : 3] icr_bit4_3 = 2'h0 ;
|
749 |
|
|
wire [4 : 3] isr_bit4_3 = 2'h0 ;
|
750 |
|
|
reg [2 : 0] icr_bit2_0 ;
|
751 |
|
|
reg [2 : 0] isr_bit2_0 ;
|
752 |
|
|
`endif
|
753 |
|
|
|
754 |
132 |
mihad |
/*###########################################################################################################
|
755 |
|
|
-------------------------------------------------------------------------------------------------------------
|
756 |
|
|
Initialization complete identifier
|
757 |
|
|
When using I2C or similar initialisation mechanism,
|
758 |
|
|
the bridge must not respond to transaction requests on PCI bus,
|
759 |
|
|
not even to configuration cycles.
|
760 |
|
|
Therefore, only when init_complete is set, the bridge starts
|
761 |
|
|
participating on the PCI bus as an active device.
|
762 |
|
|
Two additional flip flops are also provided for GUEST implementation,
|
763 |
|
|
to synchronize to the pci clock after PCI reset is asynchronously de-asserted.
|
764 |
|
|
-------------------------------------------------------------------------------------------------------------
|
765 |
|
|
###########################################################################################################*/
|
766 |
77 |
mihad |
|
767 |
132 |
mihad |
`ifdef GUEST
|
768 |
|
|
|
769 |
|
|
reg rst_inactive_sync ;
|
770 |
|
|
reg rst_inactive ;
|
771 |
|
|
|
772 |
|
|
`else
|
773 |
|
|
|
774 |
|
|
wire rst_inactive = 1'b1 ;
|
775 |
|
|
|
776 |
|
|
`endif
|
777 |
|
|
|
778 |
|
|
reg init_complete ;
|
779 |
|
|
|
780 |
140 |
mihad |
wire sync_init_complete ;
|
781 |
|
|
|
782 |
|
|
`ifdef HOST
|
783 |
|
|
assign wb_init_complete_out = init_complete ;
|
784 |
|
|
|
785 |
|
|
pci_synchronizer_flop #(1, 0) i_pci_init_complete_sync
|
786 |
|
|
(
|
787 |
|
|
.data_in ( init_complete ),
|
788 |
|
|
.clk_out ( pci_clk ),
|
789 |
|
|
.sync_data_out ( sync_init_complete ),
|
790 |
|
|
.async_reset ( reset )
|
791 |
|
|
);
|
792 |
|
|
|
793 |
|
|
reg pci_init_complete_out ;
|
794 |
|
|
|
795 |
|
|
always@(posedge pci_clk or posedge reset)
|
796 |
|
|
begin
|
797 |
|
|
if (reset)
|
798 |
|
|
pci_init_complete_out <= 1'b0 ;
|
799 |
|
|
else
|
800 |
|
|
pci_init_complete_out <= sync_init_complete ;
|
801 |
|
|
end
|
802 |
|
|
|
803 |
|
|
`endif
|
804 |
|
|
|
805 |
|
|
`ifdef GUEST
|
806 |
|
|
|
807 |
|
|
assign pci_init_complete_out = init_complete ;
|
808 |
|
|
|
809 |
|
|
pci_synchronizer_flop #(1, 0) i_wb_init_complete_sync
|
810 |
|
|
(
|
811 |
|
|
.data_in ( init_complete ),
|
812 |
|
|
.clk_out ( wb_clk ),
|
813 |
|
|
.sync_data_out ( sync_init_complete ),
|
814 |
|
|
.async_reset ( reset )
|
815 |
|
|
);
|
816 |
|
|
|
817 |
|
|
reg wb_init_complete_out ;
|
818 |
|
|
|
819 |
|
|
always@(posedge wb_clk or posedge reset)
|
820 |
|
|
begin
|
821 |
|
|
if (reset)
|
822 |
|
|
wb_init_complete_out <= 1'b0 ;
|
823 |
|
|
else
|
824 |
|
|
wb_init_complete_out <= sync_init_complete ;
|
825 |
|
|
end
|
826 |
|
|
|
827 |
|
|
`endif
|
828 |
|
|
|
829 |
77 |
mihad |
/*###########################################################################################################
|
830 |
|
|
-------------------------------------------------------------------------------------------------------------
|
831 |
|
|
|
832 |
|
|
|
833 |
|
|
-----------------------------------------------------------------------------------------------------------*/
|
834 |
|
|
|
835 |
|
|
`ifdef NO_CNF_IMAGE // if IMAGE0 is assigned as general image space
|
836 |
|
|
|
837 |
|
|
assign r_conf_data_out = 32'h0000_0000 ;
|
838 |
|
|
|
839 |
|
|
`else
|
840 |
|
|
|
841 |
|
|
always@(r_conf_address_in or
|
842 |
132 |
mihad |
status_bit15_11 or status_bit8 or r_status_bit4 or command_bit8 or command_bit6 or command_bit2_0 or
|
843 |
143 |
mihad |
latency_timer or cache_line_size_reg or r_vendor_id or r_device_id or r_revision_id or
|
844 |
|
|
r_subsys_vendor_id or r_subsys_id or r_max_lat or r_min_gnt or
|
845 |
148 |
mihad |
pci_ba0_bit31_8 or
|
846 |
77 |
mihad |
pci_img_ctrl0_bit2_1 or pci_am0 or pci_ta0 or pci_ba0_bit0 or
|
847 |
148 |
mihad |
pci_img_ctrl1_bit2_1 or pci_am1 or pci_ta1 or pci_ba1_bit31_8 or pci_ba1_bit0 or
|
848 |
|
|
pci_img_ctrl2_bit2_1 or pci_am2 or pci_ta2 or pci_ba2_bit31_8 or pci_ba2_bit0 or
|
849 |
|
|
pci_img_ctrl3_bit2_1 or pci_am3 or pci_ta3 or pci_ba3_bit31_8 or pci_ba3_bit0 or
|
850 |
|
|
pci_img_ctrl4_bit2_1 or pci_am4 or pci_ta4 or pci_ba4_bit31_8 or pci_ba4_bit0 or
|
851 |
|
|
pci_img_ctrl5_bit2_1 or pci_am5 or pci_ta5 or pci_ba5_bit31_8 or pci_ba5_bit0 or
|
852 |
77 |
mihad |
interrupt_line or
|
853 |
|
|
pci_err_cs_bit31_24 or pci_err_cs_bit10 or pci_err_cs_bit9 or pci_err_cs_bit8 or pci_err_cs_bit0 or
|
854 |
|
|
pci_err_addr or pci_err_data or
|
855 |
|
|
wb_ba0_bit31_12 or wb_ba0_bit0 or
|
856 |
|
|
wb_img_ctrl1_bit2_0 or wb_ba1_bit31_12 or wb_ba1_bit0 or wb_am1 or wb_ta1 or
|
857 |
|
|
wb_img_ctrl2_bit2_0 or wb_ba2_bit31_12 or wb_ba2_bit0 or wb_am2 or wb_ta2 or
|
858 |
|
|
wb_img_ctrl3_bit2_0 or wb_ba3_bit31_12 or wb_ba3_bit0 or wb_am3 or wb_ta3 or
|
859 |
|
|
wb_img_ctrl4_bit2_0 or wb_ba4_bit31_12 or wb_ba4_bit0 or wb_am4 or wb_ta4 or
|
860 |
|
|
wb_img_ctrl5_bit2_0 or wb_ba5_bit31_12 or wb_ba5_bit0 or wb_am5 or wb_ta5 or
|
861 |
|
|
wb_err_cs_bit31_24 or /*wb_err_cs_bit10 or*/ wb_err_cs_bit9 or wb_err_cs_bit8 or wb_err_cs_bit0 or
|
862 |
|
|
wb_err_addr or wb_err_data or
|
863 |
|
|
cnf_addr_bit23_2 or cnf_addr_bit0 or icr_bit31 or icr_bit4_3 or icr_bit2_0 or isr_bit4_3 or isr_bit2_0
|
864 |
132 |
mihad |
|
865 |
|
|
`ifdef PCI_CPCI_HS_IMPLEMENT
|
866 |
|
|
or hs_ins or hs_ext or hs_pi or hs_loo or hs_eim or hs_cap_id
|
867 |
|
|
`endif
|
868 |
140 |
mihad |
|
869 |
|
|
`ifdef PCI_SPOCI
|
870 |
|
|
or spoci_cs_nack or spoci_cs_write or spoci_cs_read or spoci_cs_adr or spoci_cs_dat
|
871 |
|
|
`endif
|
872 |
77 |
mihad |
)
|
873 |
|
|
begin
|
874 |
140 |
mihad |
case (r_conf_address_in[9:2])
|
875 |
|
|
// PCI header - configuration space
|
876 |
|
|
8'h0: r_conf_data_out = { r_device_id, r_vendor_id } ;
|
877 |
|
|
8'h1: r_conf_data_out = { status_bit15_11, r_status_bit10_9, status_bit8, r_status_bit7, 1'h0, r_status_bit5, r_status_bit4,
|
878 |
|
|
4'h0, 7'h00, command_bit8, 1'h0, command_bit6, 3'h0, command_bit2_0 } ;
|
879 |
|
|
8'h2: r_conf_data_out = { r_class_code, r_revision_id } ;
|
880 |
|
|
8'h3: r_conf_data_out = { 8'h00, r_header_type, latency_timer, cache_line_size_reg } ;
|
881 |
|
|
8'h4:
|
882 |
77 |
mihad |
begin
|
883 |
148 |
mihad |
`ifdef HOST
|
884 |
|
|
`ifdef NO_CNF_IMAGE
|
885 |
|
|
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba0_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
886 |
|
|
pci_am0[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
887 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
888 |
|
|
r_conf_data_out[0] = pci_ba0_bit0 & pci_am0[31];
|
889 |
|
|
`else
|
890 |
|
|
r_conf_data_out[31:12] = pci_ba0_bit31_8[31:12] ;
|
891 |
|
|
r_conf_data_out[11: 0] = 12'h000 ;
|
892 |
|
|
`endif
|
893 |
|
|
`endif
|
894 |
|
|
|
895 |
|
|
`ifdef GUEST
|
896 |
|
|
r_conf_data_out[31:12] = pci_ba0_bit31_8[31:12] ;
|
897 |
|
|
r_conf_data_out[11: 0] = 12'h000 ;
|
898 |
|
|
`endif
|
899 |
77 |
mihad |
end
|
900 |
140 |
mihad |
8'h5:
|
901 |
77 |
mihad |
begin
|
902 |
148 |
mihad |
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba1_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
903 |
140 |
mihad |
pci_am1[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
904 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
905 |
|
|
r_conf_data_out[0] = pci_ba1_bit0 & pci_am1[31];
|
906 |
|
|
end
|
907 |
|
|
8'h6:
|
908 |
|
|
begin
|
909 |
148 |
mihad |
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba2_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
910 |
140 |
mihad |
pci_am2[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
911 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
912 |
|
|
r_conf_data_out[0] = pci_ba2_bit0 & pci_am2[31];
|
913 |
|
|
end
|
914 |
|
|
8'h7:
|
915 |
|
|
begin
|
916 |
148 |
mihad |
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba3_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
917 |
140 |
mihad |
pci_am3[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
918 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
919 |
|
|
r_conf_data_out[0] = pci_ba3_bit0 & pci_am3[31];
|
920 |
|
|
end
|
921 |
|
|
8'h8:
|
922 |
|
|
begin
|
923 |
148 |
mihad |
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba4_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
924 |
140 |
mihad |
pci_am4[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
925 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
926 |
|
|
r_conf_data_out[0] = pci_ba4_bit0 & pci_am4[31];
|
927 |
|
|
end
|
928 |
|
|
8'h9:
|
929 |
|
|
begin
|
930 |
148 |
mihad |
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba5_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
931 |
140 |
mihad |
pci_am5[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
932 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
933 |
|
|
r_conf_data_out[0] = pci_ba5_bit0 & pci_am5[31];
|
934 |
|
|
end
|
935 |
143 |
mihad |
8'hB:
|
936 |
|
|
begin
|
937 |
|
|
r_conf_data_out = {r_subsys_id, r_subsys_vendor_id} ;
|
938 |
|
|
end
|
939 |
140 |
mihad |
`ifdef PCI_CPCI_HS_IMPLEMENT
|
940 |
|
|
8'hD:
|
941 |
|
|
begin
|
942 |
|
|
r_conf_data_out = {24'h0000_00, `PCI_CAP_PTR_VAL} ;
|
943 |
|
|
end
|
944 |
|
|
`endif
|
945 |
|
|
8'hf: r_conf_data_out = { r_max_lat, r_min_gnt, r_interrupt_pin, interrupt_line } ;
|
946 |
|
|
`ifdef PCI_CPCI_HS_IMPLEMENT
|
947 |
|
|
(`PCI_CAP_PTR_VAL >> 2):
|
948 |
|
|
begin
|
949 |
|
|
r_conf_data_out = {8'h00, hs_ins, hs_ext, hs_pi, hs_loo, 1'b0, hs_eim, 1'b0, 8'h00, hs_cap_id} ;
|
950 |
|
|
end
|
951 |
|
|
`endif
|
952 |
|
|
// PCI target - configuration space
|
953 |
|
|
{2'b01, `P_IMG_CTRL0_ADDR}: r_conf_data_out = { 29'h00000000, pci_img_ctrl0_bit2_1, 1'h0 } ;
|
954 |
|
|
{2'b01, `P_BA0_ADDR} :
|
955 |
|
|
begin
|
956 |
148 |
mihad |
`ifdef HOST
|
957 |
|
|
`ifdef NO_CNF_IMAGE
|
958 |
|
|
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba0_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
959 |
|
|
pci_am0[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
960 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
961 |
|
|
r_conf_data_out[0] = pci_ba0_bit0 & pci_am0[31];
|
962 |
|
|
`else
|
963 |
|
|
r_conf_data_out[31:12] = pci_ba0_bit31_8[31:12] ;
|
964 |
|
|
r_conf_data_out[11: 0] = 12'h000 ;
|
965 |
|
|
`endif
|
966 |
|
|
`endif
|
967 |
|
|
|
968 |
|
|
`ifdef GUEST
|
969 |
|
|
r_conf_data_out[31:12] = pci_ba0_bit31_8[31:12] ;
|
970 |
|
|
r_conf_data_out[11: 0] = 12'h000 ;
|
971 |
|
|
`endif
|
972 |
140 |
mihad |
end
|
973 |
|
|
{2'b01, `P_AM0_ADDR}:
|
974 |
|
|
begin
|
975 |
148 |
mihad |
`ifdef HOST
|
976 |
|
|
`ifdef NO_CNF_IMAGE
|
977 |
|
|
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_am0[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
978 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
979 |
|
|
`else
|
980 |
|
|
r_conf_data_out[31:12] = pci_am0[31:12] ;
|
981 |
|
|
r_conf_data_out[11: 0] = 12'h000 ;
|
982 |
|
|
`endif
|
983 |
|
|
`endif
|
984 |
|
|
|
985 |
|
|
`ifdef GUEST
|
986 |
|
|
r_conf_data_out[31:12] = pci_am0[31:12] ;
|
987 |
|
|
r_conf_data_out[11: 0] = 12'h000 ;
|
988 |
|
|
`endif
|
989 |
140 |
mihad |
end
|
990 |
|
|
{2'b01, `P_TA0_ADDR}:
|
991 |
|
|
begin
|
992 |
|
|
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ta0[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
993 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
994 |
|
|
end
|
995 |
|
|
{2'b01, `P_IMG_CTRL1_ADDR}: r_conf_data_out = { 29'h00000000, pci_img_ctrl1_bit2_1, 1'h0 } ;
|
996 |
|
|
{2'b01, `P_BA1_ADDR}:
|
997 |
|
|
begin
|
998 |
148 |
mihad |
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba1_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
999 |
140 |
mihad |
pci_am1[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1000 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1001 |
|
|
r_conf_data_out[0] = pci_ba1_bit0 & pci_am1[31];
|
1002 |
|
|
end
|
1003 |
|
|
{2'b01, `P_AM1_ADDR}:
|
1004 |
|
|
begin
|
1005 |
|
|
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_am1[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1006 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1007 |
|
|
end
|
1008 |
|
|
{2'b01, `P_TA1_ADDR}:
|
1009 |
|
|
begin
|
1010 |
|
|
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ta1[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1011 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1012 |
|
|
end
|
1013 |
|
|
{2'b01, `P_IMG_CTRL2_ADDR}: r_conf_data_out = { 29'h00000000, pci_img_ctrl2_bit2_1, 1'h0 } ;
|
1014 |
|
|
{2'b01, `P_BA2_ADDR}:
|
1015 |
|
|
begin
|
1016 |
148 |
mihad |
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba2_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
1017 |
140 |
mihad |
pci_am2[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1018 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1019 |
|
|
r_conf_data_out[0] = pci_ba2_bit0 & pci_am2[31];
|
1020 |
|
|
end
|
1021 |
|
|
{2'b01, `P_AM2_ADDR}:
|
1022 |
|
|
begin
|
1023 |
|
|
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_am2[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1024 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1025 |
|
|
end
|
1026 |
|
|
{2'b01, `P_TA2_ADDR}:
|
1027 |
|
|
begin
|
1028 |
|
|
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ta2[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1029 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1030 |
|
|
end
|
1031 |
|
|
{2'b01, `P_IMG_CTRL3_ADDR}: r_conf_data_out = { 29'h00000000, pci_img_ctrl3_bit2_1, 1'h0 } ;
|
1032 |
|
|
{2'b01, `P_BA3_ADDR}:
|
1033 |
|
|
begin
|
1034 |
148 |
mihad |
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba3_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
1035 |
140 |
mihad |
pci_am3[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1036 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1037 |
|
|
r_conf_data_out[0] = pci_ba3_bit0 & pci_am3[31];
|
1038 |
|
|
end
|
1039 |
|
|
{2'b01, `P_AM3_ADDR}:
|
1040 |
|
|
begin
|
1041 |
|
|
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_am3[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1042 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1043 |
|
|
end
|
1044 |
|
|
{2'b01, `P_TA3_ADDR}:
|
1045 |
|
|
begin
|
1046 |
|
|
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ta3[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1047 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1048 |
|
|
end
|
1049 |
|
|
{2'b01, `P_IMG_CTRL4_ADDR}: r_conf_data_out = { 29'h00000000, pci_img_ctrl4_bit2_1, 1'h0 } ;
|
1050 |
|
|
{2'b01, `P_BA4_ADDR}:
|
1051 |
|
|
begin
|
1052 |
148 |
mihad |
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba4_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
1053 |
140 |
mihad |
pci_am4[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1054 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1055 |
|
|
r_conf_data_out[0] = pci_ba4_bit0 & pci_am4[31];
|
1056 |
|
|
end
|
1057 |
|
|
{2'b01, `P_AM4_ADDR}:
|
1058 |
|
|
begin
|
1059 |
|
|
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_am4[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1060 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1061 |
|
|
end
|
1062 |
|
|
{2'b01, `P_TA4_ADDR}:
|
1063 |
|
|
begin
|
1064 |
|
|
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ta4[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1065 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1066 |
|
|
end
|
1067 |
|
|
{2'b01, `P_IMG_CTRL5_ADDR}: r_conf_data_out = { 29'h00000000, pci_img_ctrl5_bit2_1, 1'h0 } ;
|
1068 |
|
|
{2'b01, `P_BA5_ADDR}:
|
1069 |
|
|
begin
|
1070 |
148 |
mihad |
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba5_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
1071 |
140 |
mihad |
pci_am5[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1072 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1073 |
|
|
r_conf_data_out[0] = pci_ba5_bit0 & pci_am5[31];
|
1074 |
|
|
end
|
1075 |
|
|
{2'b01, `P_AM5_ADDR}:
|
1076 |
|
|
begin
|
1077 |
|
|
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_am5[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1078 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1079 |
|
|
end
|
1080 |
|
|
{2'b01, `P_TA5_ADDR}:
|
1081 |
|
|
begin
|
1082 |
|
|
r_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ta5[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1083 |
|
|
r_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1084 |
|
|
end
|
1085 |
|
|
{2'b01, `P_ERR_CS_ADDR}: r_conf_data_out = { pci_err_cs_bit31_24, 13'h0000, pci_err_cs_bit10, pci_err_cs_bit9,
|
1086 |
|
|
pci_err_cs_bit8, 7'h00, pci_err_cs_bit0 } ;
|
1087 |
|
|
{2'b01, `P_ERR_ADDR_ADDR}: r_conf_data_out = pci_err_addr ;
|
1088 |
|
|
{2'b01, `P_ERR_DATA_ADDR}: r_conf_data_out = pci_err_data ;
|
1089 |
77 |
mihad |
// WB slave - configuration space
|
1090 |
140 |
mihad |
{2'b01, `WB_CONF_SPC_BAR_ADDR}: r_conf_data_out = { wb_ba0_bit31_12, 11'h000, wb_ba0_bit0 } ;
|
1091 |
|
|
{2'b01, `W_IMG_CTRL1_ADDR}: r_conf_data_out = { 29'h00000000, wb_img_ctrl1_bit2_0 } ;
|
1092 |
|
|
{2'b01, `W_BA1_ADDR}:
|
1093 |
|
|
begin
|
1094 |
|
|
r_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_ba1_bit31_12[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] &
|
1095 |
|
|
wb_am1[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1096 |
|
|
r_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1097 |
|
|
r_conf_data_out[0] = wb_ba1_bit0 ;
|
1098 |
|
|
end
|
1099 |
|
|
{2'b01, `W_AM1_ADDR}:
|
1100 |
|
|
begin
|
1101 |
|
|
r_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_am1[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1102 |
|
|
r_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1103 |
|
|
end
|
1104 |
|
|
{2'b01, `W_TA1_ADDR}:
|
1105 |
|
|
begin
|
1106 |
|
|
r_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_ta1[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1107 |
|
|
r_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1108 |
|
|
end
|
1109 |
|
|
{2'b01, `W_IMG_CTRL2_ADDR}: r_conf_data_out = { 29'h00000000, wb_img_ctrl2_bit2_0 } ;
|
1110 |
|
|
`W_BA2_ADDR :
|
1111 |
|
|
begin
|
1112 |
|
|
r_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_ba2_bit31_12[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] &
|
1113 |
|
|
wb_am2[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1114 |
|
|
r_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1115 |
|
|
r_conf_data_out[0] = wb_ba2_bit0 ;
|
1116 |
|
|
end
|
1117 |
|
|
{2'b01, `W_AM2_ADDR}:
|
1118 |
|
|
begin
|
1119 |
|
|
r_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_am2[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1120 |
|
|
r_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1121 |
|
|
end
|
1122 |
|
|
{2'b01, `W_TA2_ADDR}:
|
1123 |
|
|
begin
|
1124 |
|
|
r_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_ta2[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1125 |
|
|
r_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1126 |
|
|
end
|
1127 |
|
|
{2'b01, `W_IMG_CTRL3_ADDR}: r_conf_data_out = { 29'h00000000, wb_img_ctrl3_bit2_0 } ;
|
1128 |
|
|
{2'b01, `W_BA3_ADDR}:
|
1129 |
|
|
begin
|
1130 |
|
|
r_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_ba3_bit31_12[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] &
|
1131 |
|
|
wb_am3[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1132 |
|
|
r_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1133 |
|
|
r_conf_data_out[0] = wb_ba3_bit0 ;
|
1134 |
|
|
end
|
1135 |
|
|
{2'b01, `W_AM3_ADDR}:
|
1136 |
|
|
begin
|
1137 |
|
|
r_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_am3[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1138 |
|
|
r_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1139 |
|
|
end
|
1140 |
|
|
{2'b01, `W_TA3_ADDR}:
|
1141 |
|
|
begin
|
1142 |
|
|
r_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_ta3[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1143 |
|
|
r_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1144 |
|
|
end
|
1145 |
|
|
{2'b01, `W_IMG_CTRL4_ADDR}: r_conf_data_out = { 29'h00000000, wb_img_ctrl4_bit2_0 } ;
|
1146 |
|
|
{2'b01, `W_BA4_ADDR}:
|
1147 |
|
|
begin
|
1148 |
|
|
r_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_ba4_bit31_12[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] &
|
1149 |
|
|
wb_am4[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1150 |
|
|
r_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1151 |
|
|
r_conf_data_out[0] = wb_ba4_bit0 ;
|
1152 |
|
|
end
|
1153 |
|
|
{2'b01, `W_AM4_ADDR}:
|
1154 |
|
|
begin
|
1155 |
|
|
r_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_am4[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1156 |
|
|
r_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1157 |
|
|
end
|
1158 |
|
|
{2'b01, `W_TA4_ADDR}:
|
1159 |
|
|
begin
|
1160 |
|
|
r_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_ta4[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1161 |
|
|
r_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1162 |
|
|
end
|
1163 |
|
|
{2'b01, `W_IMG_CTRL5_ADDR}: r_conf_data_out = { 29'h00000000, wb_img_ctrl5_bit2_0 } ;
|
1164 |
|
|
{2'b01, `W_BA5_ADDR}:
|
1165 |
|
|
begin
|
1166 |
|
|
r_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_ba5_bit31_12[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] &
|
1167 |
|
|
wb_am5[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1168 |
|
|
r_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1169 |
|
|
r_conf_data_out[0] = wb_ba5_bit0 ;
|
1170 |
|
|
end
|
1171 |
|
|
{2'b01, `W_AM5_ADDR}:
|
1172 |
|
|
begin
|
1173 |
|
|
r_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_am5[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1174 |
|
|
r_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1175 |
|
|
end
|
1176 |
|
|
{2'b01, `W_TA5_ADDR}:
|
1177 |
|
|
begin
|
1178 |
|
|
r_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_ta5[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1179 |
|
|
r_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1180 |
|
|
end
|
1181 |
|
|
{2'b01, `W_ERR_CS_ADDR}: r_conf_data_out = { wb_err_cs_bit31_24, /*13*/14'h0000, /*wb_err_cs_bit10,*/
|
1182 |
|
|
wb_err_cs_bit9, wb_err_cs_bit8, 7'h00, wb_err_cs_bit0 } ;
|
1183 |
|
|
{2'b01, `W_ERR_ADDR_ADDR}: r_conf_data_out = wb_err_addr ;
|
1184 |
|
|
{2'b01, `W_ERR_DATA_ADDR}: r_conf_data_out = wb_err_data ;
|
1185 |
77 |
mihad |
|
1186 |
140 |
mihad |
{2'b01, `CNF_ADDR_ADDR}: r_conf_data_out = { 8'h00, cnf_addr_bit23_2, 1'h0, cnf_addr_bit0 } ;
|
1187 |
77 |
mihad |
// `CNF_DATA_ADDR: implemented elsewhere !!!
|
1188 |
|
|
// `INT_ACK_ADDR : implemented elsewhere !!!
|
1189 |
140 |
mihad |
{2'b01, `ICR_ADDR}: r_conf_data_out = { icr_bit31, 26'h0000_000, icr_bit4_3, icr_bit2_0 } ;
|
1190 |
|
|
{2'b01, `ISR_ADDR}: r_conf_data_out = { 27'h0000_000, isr_bit4_3, isr_bit2_0 } ;
|
1191 |
77 |
mihad |
|
1192 |
140 |
mihad |
`ifdef PCI_SPOCI
|
1193 |
|
|
8'hff: r_conf_data_out = {spoci_cs_nack, 5'h0, spoci_cs_write, spoci_cs_read,
|
1194 |
|
|
5'h0, spoci_cs_adr[10:8],
|
1195 |
|
|
spoci_cs_adr[7:0],
|
1196 |
|
|
spoci_cs_dat[7:0]} ;
|
1197 |
|
|
`endif
|
1198 |
|
|
default : r_conf_data_out = 32'h0000_0000 ;
|
1199 |
77 |
mihad |
endcase
|
1200 |
|
|
end
|
1201 |
|
|
|
1202 |
|
|
`endif
|
1203 |
|
|
|
1204 |
140 |
mihad |
`ifdef PCI_SPOCI
|
1205 |
|
|
reg [ 7: 0] spoci_reg_num ;
|
1206 |
|
|
wire [11: 0] w_conf_address = init_complete ? w_conf_address_in : {2'b00, spoci_reg_num, 2'b00} ;
|
1207 |
|
|
`else
|
1208 |
|
|
wire [11: 0] w_conf_address = w_conf_address_in ;
|
1209 |
143 |
mihad |
wire [ 7: 0] spoci_reg_num = 'hff ;
|
1210 |
140 |
mihad |
`endif
|
1211 |
|
|
|
1212 |
|
|
always@(w_conf_address or
|
1213 |
132 |
mihad |
status_bit15_11 or status_bit8 or r_status_bit4 or command_bit8 or command_bit6 or command_bit2_0 or
|
1214 |
143 |
mihad |
latency_timer or cache_line_size_reg or r_vendor_id or r_device_id or r_revision_id or
|
1215 |
|
|
r_subsys_id or r_subsys_vendor_id or r_max_lat or r_min_gnt or
|
1216 |
148 |
mihad |
pci_ba0_bit31_8 or
|
1217 |
77 |
mihad |
pci_img_ctrl0_bit2_1 or pci_am0 or pci_ta0 or pci_ba0_bit0 or
|
1218 |
148 |
mihad |
pci_img_ctrl1_bit2_1 or pci_am1 or pci_ta1 or pci_ba1_bit31_8 or pci_ba1_bit0 or
|
1219 |
|
|
pci_img_ctrl2_bit2_1 or pci_am2 or pci_ta2 or pci_ba2_bit31_8 or pci_ba2_bit0 or
|
1220 |
|
|
pci_img_ctrl3_bit2_1 or pci_am3 or pci_ta3 or pci_ba3_bit31_8 or pci_ba3_bit0 or
|
1221 |
|
|
pci_img_ctrl4_bit2_1 or pci_am4 or pci_ta4 or pci_ba4_bit31_8 or pci_ba4_bit0 or
|
1222 |
|
|
pci_img_ctrl5_bit2_1 or pci_am5 or pci_ta5 or pci_ba5_bit31_8 or pci_ba5_bit0 or
|
1223 |
77 |
mihad |
interrupt_line or
|
1224 |
|
|
pci_err_cs_bit31_24 or pci_err_cs_bit10 or pci_err_cs_bit9 or pci_err_cs_bit8 or pci_err_cs_bit0 or
|
1225 |
|
|
pci_err_addr or pci_err_data or
|
1226 |
|
|
wb_ba0_bit31_12 or wb_ba0_bit0 or
|
1227 |
|
|
wb_img_ctrl1_bit2_0 or wb_ba1_bit31_12 or wb_ba1_bit0 or wb_am1 or wb_ta1 or
|
1228 |
|
|
wb_img_ctrl2_bit2_0 or wb_ba2_bit31_12 or wb_ba2_bit0 or wb_am2 or wb_ta2 or
|
1229 |
|
|
wb_img_ctrl3_bit2_0 or wb_ba3_bit31_12 or wb_ba3_bit0 or wb_am3 or wb_ta3 or
|
1230 |
|
|
wb_img_ctrl4_bit2_0 or wb_ba4_bit31_12 or wb_ba4_bit0 or wb_am4 or wb_ta4 or
|
1231 |
|
|
wb_img_ctrl5_bit2_0 or wb_ba5_bit31_12 or wb_ba5_bit0 or wb_am5 or wb_ta5 or
|
1232 |
|
|
wb_err_cs_bit31_24 or /*wb_err_cs_bit10 or*/ wb_err_cs_bit9 or wb_err_cs_bit8 or wb_err_cs_bit0 or
|
1233 |
|
|
wb_err_addr or wb_err_data or
|
1234 |
|
|
cnf_addr_bit23_2 or cnf_addr_bit0 or icr_bit31 or icr_bit4_3 or icr_bit2_0 or isr_bit4_3 or isr_bit2_0
|
1235 |
132 |
mihad |
|
1236 |
|
|
`ifdef PCI_CPCI_HS_IMPLEMENT
|
1237 |
|
|
or hs_ins or hs_ext or hs_pi or hs_loo or hs_eim or hs_cap_id
|
1238 |
|
|
`endif
|
1239 |
140 |
mihad |
|
1240 |
|
|
`ifdef PCI_SPOCI
|
1241 |
|
|
or spoci_cs_nack or spoci_cs_write or spoci_cs_read or spoci_cs_adr or spoci_cs_dat
|
1242 |
|
|
`endif
|
1243 |
77 |
mihad |
)
|
1244 |
|
|
begin
|
1245 |
140 |
mihad |
case (w_conf_address[9:2])
|
1246 |
|
|
8'h0:
|
1247 |
77 |
mihad |
begin
|
1248 |
140 |
mihad |
w_conf_data_out = { r_device_id, r_vendor_id } ;
|
1249 |
|
|
w_reg_select_dec = 57'h000_0000_0000_0000 ; // Read-Only register
|
1250 |
77 |
mihad |
end
|
1251 |
140 |
mihad |
8'h1: // w_reg_select_dec bit 0
|
1252 |
77 |
mihad |
begin
|
1253 |
140 |
mihad |
w_conf_data_out = { status_bit15_11, r_status_bit10_9, status_bit8, r_status_bit7, 1'h0, r_status_bit5, r_status_bit4,
|
1254 |
|
|
4'h0, 7'h00, command_bit8, 1'h0, command_bit6, 3'h0, command_bit2_0 } ;
|
1255 |
|
|
w_reg_select_dec = 57'h000_0000_0000_0001 ;
|
1256 |
|
|
end
|
1257 |
|
|
8'h2:
|
1258 |
|
|
begin
|
1259 |
|
|
w_conf_data_out = { r_class_code, r_revision_id } ;
|
1260 |
|
|
w_reg_select_dec = 57'h000_0000_0000_0000 ; // Read-Only register
|
1261 |
|
|
end
|
1262 |
|
|
8'h3: // w_reg_select_dec bit 1
|
1263 |
|
|
begin
|
1264 |
|
|
w_conf_data_out = { 8'h00, r_header_type, latency_timer, cache_line_size_reg } ;
|
1265 |
|
|
w_reg_select_dec = 57'h000_0000_0000_0002 ;
|
1266 |
|
|
end
|
1267 |
|
|
8'h4: // w_reg_select_dec bit 4
|
1268 |
|
|
begin
|
1269 |
148 |
mihad |
`ifdef HOST
|
1270 |
|
|
`ifdef NO_CNF_IMAGE
|
1271 |
|
|
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba0_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
1272 |
|
|
pci_am0[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1273 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1274 |
|
|
w_conf_data_out[0] = pci_ba0_bit0 & pci_am0[31];
|
1275 |
|
|
`else
|
1276 |
|
|
w_conf_data_out[31:12] = pci_ba0_bit31_8[31:12] ;
|
1277 |
|
|
w_conf_data_out[11: 0] = 12'h000 ;
|
1278 |
|
|
`endif
|
1279 |
|
|
`endif
|
1280 |
|
|
|
1281 |
|
|
`ifdef GUEST
|
1282 |
|
|
w_conf_data_out[31:12] = pci_ba0_bit31_8[31:12] ;
|
1283 |
|
|
w_conf_data_out[11: 0] = 12'h000 ;
|
1284 |
|
|
`endif
|
1285 |
140 |
mihad |
w_reg_select_dec = 57'h000_0000_0000_0010 ; // The same for another address
|
1286 |
|
|
end
|
1287 |
|
|
8'h5: // w_reg_select_dec bit 8
|
1288 |
|
|
begin
|
1289 |
148 |
mihad |
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba1_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
1290 |
140 |
mihad |
pci_am1[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1291 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1292 |
|
|
w_conf_data_out[0] = pci_ba1_bit0 & pci_am1[31];
|
1293 |
|
|
w_reg_select_dec = 57'h000_0000_0000_0100 ; // The same for another address
|
1294 |
|
|
end
|
1295 |
|
|
8'h6: // w_reg_select_dec bit 12
|
1296 |
|
|
begin
|
1297 |
148 |
mihad |
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba2_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
1298 |
140 |
mihad |
pci_am2[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1299 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1300 |
|
|
w_conf_data_out[0] = pci_ba2_bit0 & pci_am2[31];
|
1301 |
|
|
w_reg_select_dec = 57'h000_0000_0000_1000 ; // The same for another address
|
1302 |
|
|
end
|
1303 |
|
|
8'h7: // w_reg_select_dec bit 16
|
1304 |
|
|
begin
|
1305 |
148 |
mihad |
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba3_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
1306 |
140 |
mihad |
pci_am3[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1307 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1308 |
|
|
w_conf_data_out[0] = pci_ba3_bit0 & pci_am3[31];
|
1309 |
|
|
w_reg_select_dec = 57'h000_0000_0001_0000 ; // The same for another address
|
1310 |
|
|
end
|
1311 |
|
|
8'h8: // w_reg_select_dec bit 20
|
1312 |
|
|
begin
|
1313 |
148 |
mihad |
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba4_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
1314 |
140 |
mihad |
pci_am4[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1315 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1316 |
|
|
w_conf_data_out[0] = pci_ba4_bit0 & pci_am4[31];
|
1317 |
|
|
w_reg_select_dec = 57'h000_0000_0010_0000 ; // The same for another address
|
1318 |
|
|
end
|
1319 |
|
|
8'h9: // w_reg_select_dec bit 24
|
1320 |
|
|
begin
|
1321 |
148 |
mihad |
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba5_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
1322 |
140 |
mihad |
pci_am5[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1323 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1324 |
|
|
w_conf_data_out[0] = pci_ba5_bit0 & pci_am5[31];
|
1325 |
|
|
w_reg_select_dec = 57'h000_0000_0100_0000 ; // The same for another address
|
1326 |
|
|
end
|
1327 |
143 |
mihad |
8'hB:
|
1328 |
|
|
begin
|
1329 |
|
|
w_conf_data_out = {r_subsys_id, r_subsys_vendor_id} ;
|
1330 |
|
|
w_reg_select_dec = 57'h000_0000_0000_0000 ;
|
1331 |
|
|
end
|
1332 |
|
|
|
1333 |
140 |
mihad |
`ifdef PCI_CPCI_HS_IMPLEMENT
|
1334 |
|
|
8'hD:
|
1335 |
|
|
begin
|
1336 |
|
|
w_conf_data_out = {24'h0000_00, `PCI_CAP_PTR_VAL} ;
|
1337 |
|
|
w_reg_select_dec = 57'h000_0000_0000_0000 ; // Read-Only register
|
1338 |
|
|
end
|
1339 |
|
|
`endif
|
1340 |
|
|
8'hf: // w_reg_select_dec bit 2
|
1341 |
|
|
begin
|
1342 |
|
|
w_conf_data_out = { r_max_lat, r_min_gnt, r_interrupt_pin, interrupt_line } ;
|
1343 |
|
|
w_reg_select_dec = 57'h000_0000_0000_0004 ;
|
1344 |
|
|
end
|
1345 |
|
|
`ifdef PCI_CPCI_HS_IMPLEMENT
|
1346 |
|
|
(`PCI_CAP_PTR_VAL >> 2):
|
1347 |
|
|
begin
|
1348 |
|
|
w_reg_select_dec = 57'h100_0000_0000_0000 ;
|
1349 |
|
|
w_conf_data_out = {8'h00, hs_ins, hs_ext, hs_pi, hs_loo, 1'b0, hs_eim, 1'b0, 8'h00, hs_cap_id} ;
|
1350 |
|
|
end
|
1351 |
|
|
`endif
|
1352 |
|
|
{2'b01, `P_IMG_CTRL0_ADDR}: // w_reg_select_dec bit 3
|
1353 |
|
|
begin
|
1354 |
|
|
w_conf_data_out = { 29'h00000000, pci_img_ctrl0_bit2_1, 1'h0 } ;
|
1355 |
|
|
w_reg_select_dec = 57'h000_0000_0000_0008 ;
|
1356 |
|
|
end
|
1357 |
|
|
{2'b01, `P_BA0_ADDR}: // w_reg_select_dec bit 4
|
1358 |
|
|
begin
|
1359 |
148 |
mihad |
`ifdef HOST
|
1360 |
|
|
`ifdef NO_CNF_IMAGE
|
1361 |
|
|
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba0_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
1362 |
|
|
pci_am0[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1363 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1364 |
|
|
w_conf_data_out[0] = pci_ba0_bit0 & pci_am0[31];
|
1365 |
|
|
`else
|
1366 |
|
|
w_conf_data_out[31:12] = pci_ba0_bit31_8[31:12] ;
|
1367 |
|
|
w_conf_data_out[11: 0] = 12'h000 ;
|
1368 |
|
|
`endif
|
1369 |
|
|
`endif
|
1370 |
|
|
|
1371 |
|
|
`ifdef GUEST
|
1372 |
|
|
w_conf_data_out[31:12] = pci_ba0_bit31_8[31:12] ;
|
1373 |
|
|
w_conf_data_out[11: 0] = 12'h000 ;
|
1374 |
|
|
`endif
|
1375 |
140 |
mihad |
w_reg_select_dec = 57'h000_0000_0000_0010 ; // The same for another address
|
1376 |
|
|
end
|
1377 |
|
|
{2'b01, `P_AM0_ADDR}: // w_reg_select_dec bit 5
|
1378 |
|
|
begin
|
1379 |
148 |
mihad |
`ifdef HOST
|
1380 |
|
|
`ifdef NO_CNF_IMAGE
|
1381 |
|
|
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_am0[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1382 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1383 |
|
|
`else
|
1384 |
|
|
w_conf_data_out[31:12] = pci_am0[31:12] ;
|
1385 |
|
|
w_conf_data_out[11: 0] = 12'h000 ;
|
1386 |
|
|
`endif
|
1387 |
|
|
`endif
|
1388 |
|
|
|
1389 |
|
|
`ifdef GUEST
|
1390 |
|
|
w_conf_data_out[31:12] = pci_am0[31:12] ;
|
1391 |
|
|
w_conf_data_out[11: 0] = 12'h000 ;
|
1392 |
|
|
`endif
|
1393 |
140 |
mihad |
w_reg_select_dec = 57'h000_0000_0000_0020 ;
|
1394 |
|
|
end
|
1395 |
|
|
{2'b01, `P_TA0_ADDR}: // w_reg_select_dec bit 6
|
1396 |
|
|
begin
|
1397 |
|
|
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ta0[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1398 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1399 |
|
|
w_reg_select_dec = 57'h000_0000_0000_0040 ;
|
1400 |
|
|
end
|
1401 |
|
|
{2'b01, `P_IMG_CTRL1_ADDR}: // w_reg_select_dec bit 7
|
1402 |
|
|
begin
|
1403 |
|
|
w_conf_data_out = { 29'h00000000, pci_img_ctrl1_bit2_1, 1'h0 } ;
|
1404 |
|
|
w_reg_select_dec = 57'h000_0000_0000_0080 ;
|
1405 |
|
|
end
|
1406 |
|
|
{2'b01, `P_BA1_ADDR}: // w_reg_select_dec bit 8
|
1407 |
|
|
begin
|
1408 |
148 |
mihad |
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba1_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
1409 |
140 |
mihad |
pci_am1[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1410 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1411 |
|
|
w_conf_data_out[0] = pci_ba1_bit0 & pci_am1[31];
|
1412 |
|
|
w_reg_select_dec = 57'h000_0000_0000_0100 ; // The same for another address
|
1413 |
|
|
end
|
1414 |
|
|
{2'b01, `P_AM1_ADDR}: // w_reg_select_dec bit 9
|
1415 |
|
|
begin
|
1416 |
|
|
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_am1[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1417 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1418 |
|
|
w_reg_select_dec = 57'h000_0000_0000_0200 ;
|
1419 |
|
|
end
|
1420 |
|
|
{2'b01, `P_TA1_ADDR}: // w_reg_select_dec bit 10
|
1421 |
|
|
begin
|
1422 |
|
|
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ta1[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1423 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1424 |
|
|
w_reg_select_dec = 57'h000_0000_0000_0400 ;
|
1425 |
|
|
end
|
1426 |
|
|
{2'b01, `P_IMG_CTRL2_ADDR}: // w_reg_select_dec bit 11
|
1427 |
|
|
begin
|
1428 |
|
|
w_conf_data_out = { 29'h00000000, pci_img_ctrl2_bit2_1, 1'h0 } ;
|
1429 |
|
|
w_reg_select_dec = 57'h000_0000_0000_0800 ;
|
1430 |
|
|
end
|
1431 |
|
|
{2'b01, `P_BA2_ADDR}: // w_reg_select_dec bit 12
|
1432 |
|
|
begin
|
1433 |
148 |
mihad |
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba2_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
1434 |
140 |
mihad |
pci_am2[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1435 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1436 |
|
|
w_conf_data_out[0] = pci_ba2_bit0 & pci_am2[31];
|
1437 |
|
|
w_reg_select_dec = 57'h000_0000_0000_1000 ; // The same for another address
|
1438 |
|
|
end
|
1439 |
|
|
{2'b01, `P_AM2_ADDR}: // w_reg_select_dec bit 13
|
1440 |
|
|
begin
|
1441 |
|
|
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_am2[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1442 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1443 |
|
|
w_reg_select_dec = 57'h000_0000_0000_2000 ;
|
1444 |
|
|
end
|
1445 |
|
|
{2'b01, `P_TA2_ADDR}: // w_reg_select_dec bit 14
|
1446 |
|
|
begin
|
1447 |
|
|
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ta2[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1448 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1449 |
|
|
w_reg_select_dec = 57'h000_0000_0000_4000 ;
|
1450 |
|
|
end
|
1451 |
|
|
{2'b01, `P_IMG_CTRL3_ADDR}: // w_reg_select_dec bit 15
|
1452 |
|
|
begin
|
1453 |
|
|
w_conf_data_out = { 29'h00000000, pci_img_ctrl3_bit2_1, 1'h0 } ;
|
1454 |
|
|
w_reg_select_dec = 57'h000_0000_0000_8000 ;
|
1455 |
|
|
end
|
1456 |
|
|
{2'b01, `P_BA3_ADDR}: // w_reg_select_dec bit 16
|
1457 |
|
|
begin
|
1458 |
148 |
mihad |
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba3_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
1459 |
140 |
mihad |
pci_am3[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1460 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1461 |
|
|
w_conf_data_out[0] = pci_ba3_bit0 & pci_am3[31];
|
1462 |
|
|
w_reg_select_dec = 57'h000_0000_0001_0000 ; // The same for another address
|
1463 |
|
|
end
|
1464 |
|
|
{2'b01, `P_AM3_ADDR}: // w_reg_select_dec bit 17
|
1465 |
|
|
begin
|
1466 |
|
|
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_am3[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1467 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1468 |
|
|
w_reg_select_dec = 57'h000_0000_0002_0000 ;
|
1469 |
|
|
end
|
1470 |
|
|
{2'b01, `P_TA3_ADDR}: // w_reg_select_dec bit 18
|
1471 |
|
|
begin
|
1472 |
|
|
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ta3[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1473 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1474 |
|
|
w_reg_select_dec = 57'h000_0000_0004_0000 ;
|
1475 |
|
|
end
|
1476 |
|
|
{2'b01, `P_IMG_CTRL4_ADDR}: // w_reg_select_dec bit 19
|
1477 |
|
|
begin
|
1478 |
|
|
w_conf_data_out = { 29'h00000000, pci_img_ctrl4_bit2_1, 1'h0 } ;
|
1479 |
|
|
w_reg_select_dec = 57'h000_0000_0008_0000 ;
|
1480 |
|
|
end
|
1481 |
|
|
{2'b01, `P_BA4_ADDR}: // w_reg_select_dec bit 20
|
1482 |
|
|
begin
|
1483 |
148 |
mihad |
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba4_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
1484 |
140 |
mihad |
pci_am4[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1485 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1486 |
|
|
w_conf_data_out[0] = pci_ba4_bit0 & pci_am4[31];
|
1487 |
|
|
w_reg_select_dec = 57'h000_0000_0010_0000 ; // The same for another address
|
1488 |
|
|
end
|
1489 |
|
|
{2'b01, `P_AM4_ADDR}: // w_reg_select_dec bit 21
|
1490 |
|
|
begin
|
1491 |
|
|
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_am4[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1492 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1493 |
|
|
w_reg_select_dec = 57'h000_0000_0020_0000 ;
|
1494 |
|
|
end
|
1495 |
|
|
{2'b01, `P_TA4_ADDR}: // w_reg_select_dec bit 22
|
1496 |
|
|
begin
|
1497 |
|
|
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ta4[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1498 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1499 |
|
|
w_reg_select_dec = 57'h000_0000_0040_0000 ;
|
1500 |
|
|
end
|
1501 |
|
|
{2'b01, `P_IMG_CTRL5_ADDR}: // w_reg_select_dec bit 23
|
1502 |
|
|
begin
|
1503 |
|
|
w_conf_data_out = { 29'h00000000, pci_img_ctrl5_bit2_1, 1'h0 } ;
|
1504 |
|
|
w_reg_select_dec = 57'h000_0000_0080_0000 ;
|
1505 |
|
|
end
|
1506 |
|
|
{2'b01, `P_BA5_ADDR}: // w_reg_select_dec bit 24
|
1507 |
|
|
begin
|
1508 |
148 |
mihad |
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ba5_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] &
|
1509 |
140 |
mihad |
pci_am5[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1510 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1511 |
|
|
w_conf_data_out[0] = pci_ba5_bit0 & pci_am5[31];
|
1512 |
|
|
w_reg_select_dec = 57'h000_0000_0100_0000 ; // The same for another address
|
1513 |
|
|
end
|
1514 |
|
|
{2'b01, `P_AM5_ADDR}: // w_reg_select_dec bit 25
|
1515 |
|
|
begin
|
1516 |
|
|
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_am5[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1517 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1518 |
|
|
w_reg_select_dec = 57'h000_0000_0200_0000 ;
|
1519 |
|
|
end
|
1520 |
|
|
{2'b01, `P_TA5_ADDR}: // w_reg_select_dec bit 26
|
1521 |
|
|
begin
|
1522 |
|
|
w_conf_data_out[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = pci_ta5[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1523 |
|
|
w_conf_data_out[(31-`PCI_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1524 |
|
|
w_reg_select_dec = 57'h000_0000_0400_0000 ;
|
1525 |
|
|
end
|
1526 |
|
|
{2'b01, `P_ERR_CS_ADDR}: // w_reg_select_dec bit 27
|
1527 |
|
|
begin
|
1528 |
|
|
w_conf_data_out = { pci_err_cs_bit31_24, 13'h0000, pci_err_cs_bit10, pci_err_cs_bit9,
|
1529 |
|
|
pci_err_cs_bit8, 7'h00, pci_err_cs_bit0 } ;
|
1530 |
|
|
w_reg_select_dec = 57'h000_0000_0800_0000 ;
|
1531 |
|
|
end
|
1532 |
|
|
{2'b01, `P_ERR_ADDR_ADDR}: // w_reg_select_dec bit 28
|
1533 |
|
|
begin
|
1534 |
|
|
w_conf_data_out = pci_err_addr ;
|
1535 |
|
|
w_reg_select_dec = 57'h000_0000_0000_0000 ; // = 56'h00_0000_1000_0000 ;
|
1536 |
|
|
end
|
1537 |
|
|
{2'b01, `P_ERR_DATA_ADDR}: // w_reg_select_dec bit 29
|
1538 |
|
|
begin
|
1539 |
|
|
w_conf_data_out = pci_err_data ;
|
1540 |
|
|
w_reg_select_dec = 57'h000_0000_0000_0000 ; // = 56'h00_0000_2000_0000 ;
|
1541 |
|
|
end
|
1542 |
|
|
// WB slave - configuration space
|
1543 |
|
|
{2'b01, `WB_CONF_SPC_BAR_ADDR}:
|
1544 |
|
|
begin
|
1545 |
|
|
w_conf_data_out = { wb_ba0_bit31_12, 11'h000, wb_ba0_bit0 } ;
|
1546 |
|
|
w_reg_select_dec = 57'h000_0000_0000_0000 ; // Read-Only register
|
1547 |
|
|
end
|
1548 |
|
|
{2'b01, `W_IMG_CTRL1_ADDR}: // w_reg_select_dec bit 30
|
1549 |
|
|
begin
|
1550 |
|
|
w_conf_data_out = { 29'h00000000, wb_img_ctrl1_bit2_0 } ;
|
1551 |
|
|
w_reg_select_dec = 57'h000_0000_4000_0000 ;
|
1552 |
|
|
end
|
1553 |
|
|
{2'b01, `W_BA1_ADDR}: // w_reg_select_dec bit 31
|
1554 |
|
|
begin
|
1555 |
|
|
w_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_ba1_bit31_12[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] &
|
1556 |
|
|
wb_am1[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1557 |
|
|
w_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1558 |
|
|
w_conf_data_out[0] = wb_ba1_bit0 ;
|
1559 |
|
|
w_reg_select_dec = 57'h000_0000_8000_0000 ;
|
1560 |
|
|
end
|
1561 |
|
|
{2'b01, `W_AM1_ADDR}: // w_reg_select_dec bit 32
|
1562 |
|
|
begin
|
1563 |
|
|
w_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_am1[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1564 |
|
|
w_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1565 |
|
|
w_reg_select_dec = 57'h000_0001_0000_0000 ;
|
1566 |
|
|
end
|
1567 |
|
|
{2'b01, `W_TA1_ADDR}: // w_reg_select_dec bit 33
|
1568 |
|
|
begin
|
1569 |
|
|
w_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_ta1[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1570 |
|
|
w_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1571 |
|
|
w_reg_select_dec = 57'h000_0002_0000_0000 ;
|
1572 |
|
|
end
|
1573 |
|
|
{2'b01, `W_IMG_CTRL2_ADDR}: // w_reg_select_dec bit 34
|
1574 |
|
|
begin
|
1575 |
|
|
w_conf_data_out = { 29'h00000000, wb_img_ctrl2_bit2_0 } ;
|
1576 |
|
|
w_reg_select_dec = 57'h000_0004_0000_0000 ;
|
1577 |
|
|
end
|
1578 |
|
|
{2'b01, `W_BA2_ADDR}: // w_reg_select_dec bit 35
|
1579 |
|
|
begin
|
1580 |
|
|
w_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_ba2_bit31_12[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] &
|
1581 |
|
|
wb_am2[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1582 |
|
|
w_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1583 |
|
|
w_conf_data_out[0] = wb_ba2_bit0 ;
|
1584 |
|
|
w_reg_select_dec = 57'h000_0008_0000_0000 ;
|
1585 |
|
|
end
|
1586 |
|
|
{2'b01, `W_AM2_ADDR}: // w_reg_select_dec bit 36
|
1587 |
|
|
begin
|
1588 |
|
|
w_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_am2[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1589 |
|
|
w_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1590 |
|
|
w_reg_select_dec = 57'h000_0010_0000_0000 ;
|
1591 |
|
|
end
|
1592 |
|
|
{2'b01, `W_TA2_ADDR}: // w_reg_select_dec bit 37
|
1593 |
|
|
begin
|
1594 |
|
|
w_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_ta2[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1595 |
|
|
w_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1596 |
|
|
w_reg_select_dec = 57'h000_0020_0000_0000 ;
|
1597 |
|
|
end
|
1598 |
|
|
{2'b01, `W_IMG_CTRL3_ADDR}: // w_reg_select_dec bit 38
|
1599 |
|
|
begin
|
1600 |
|
|
w_conf_data_out = { 29'h00000000, wb_img_ctrl3_bit2_0 } ;
|
1601 |
|
|
w_reg_select_dec = 57'h000_0040_0000_0000 ;
|
1602 |
|
|
end
|
1603 |
|
|
{2'b01, `W_BA3_ADDR}: // w_reg_select_dec bit 39
|
1604 |
|
|
begin
|
1605 |
|
|
w_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_ba3_bit31_12[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] &
|
1606 |
|
|
wb_am3[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1607 |
|
|
w_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1608 |
|
|
w_conf_data_out[0] = wb_ba3_bit0 ;
|
1609 |
|
|
w_reg_select_dec = 57'h000_0080_0000_0000 ;
|
1610 |
|
|
end
|
1611 |
|
|
{2'b01, `W_AM3_ADDR}: // w_reg_select_dec bit 40
|
1612 |
|
|
begin
|
1613 |
|
|
w_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_am3[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1614 |
|
|
w_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1615 |
|
|
w_reg_select_dec = 57'h000_0100_0000_0000 ;
|
1616 |
|
|
end
|
1617 |
|
|
{2'b01, `W_TA3_ADDR}: // w_reg_select_dec bit 41
|
1618 |
|
|
begin
|
1619 |
|
|
w_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_ta3[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1620 |
|
|
w_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1621 |
|
|
w_reg_select_dec = 57'h000_0200_0000_0000 ;
|
1622 |
|
|
end
|
1623 |
|
|
{2'b01, `W_IMG_CTRL4_ADDR}: // w_reg_select_dec bit 42
|
1624 |
|
|
begin
|
1625 |
|
|
w_conf_data_out = { 29'h00000000, wb_img_ctrl4_bit2_0 } ;
|
1626 |
|
|
w_reg_select_dec = 57'h000_0400_0000_0000 ;
|
1627 |
|
|
end
|
1628 |
|
|
{2'b01, `W_BA4_ADDR}: // w_reg_select_dec bit 43
|
1629 |
|
|
begin
|
1630 |
|
|
w_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_ba4_bit31_12[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] &
|
1631 |
|
|
wb_am4[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1632 |
|
|
w_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1633 |
|
|
w_conf_data_out[0] = wb_ba4_bit0 ;
|
1634 |
|
|
w_reg_select_dec = 57'h000_0800_0000_0000 ;
|
1635 |
|
|
end
|
1636 |
|
|
{2'b01, `W_AM4_ADDR}: // w_reg_select_dec bit 44
|
1637 |
|
|
begin
|
1638 |
|
|
w_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_am4[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1639 |
|
|
w_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1640 |
|
|
w_reg_select_dec = 57'h000_1000_0000_0000 ;
|
1641 |
|
|
end
|
1642 |
|
|
{2'b01, `W_TA4_ADDR}: // w_reg_select_dec bit 45
|
1643 |
|
|
begin
|
1644 |
|
|
w_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_ta4[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1645 |
|
|
w_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1646 |
|
|
w_reg_select_dec = 57'h000_2000_0000_0000 ;
|
1647 |
|
|
end
|
1648 |
|
|
{2'b01, `W_IMG_CTRL5_ADDR}: // w_reg_select_dec bit 46
|
1649 |
|
|
begin
|
1650 |
|
|
w_conf_data_out = { 29'h00000000, wb_img_ctrl5_bit2_0 } ;
|
1651 |
|
|
w_reg_select_dec = 57'h000_4000_0000_0000 ;
|
1652 |
|
|
end
|
1653 |
|
|
{2'b01, `W_BA5_ADDR}: // w_reg_select_dec bit 47
|
1654 |
|
|
begin
|
1655 |
|
|
w_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_ba5_bit31_12[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] &
|
1656 |
|
|
wb_am5[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1657 |
|
|
w_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):1] = 0 ;
|
1658 |
|
|
w_conf_data_out[0] = wb_ba5_bit0 ;
|
1659 |
|
|
w_reg_select_dec = 57'h000_8000_0000_0000 ;
|
1660 |
|
|
end
|
1661 |
|
|
{2'b01, `W_AM5_ADDR}: // w_reg_select_dec bit 48
|
1662 |
|
|
begin
|
1663 |
|
|
w_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_am5[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1664 |
|
|
w_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1665 |
|
|
w_reg_select_dec = 57'h001_0000_0000_0000 ;
|
1666 |
|
|
end
|
1667 |
|
|
{2'b01, `W_TA5_ADDR}: // w_reg_select_dec bit 49
|
1668 |
|
|
begin
|
1669 |
|
|
w_conf_data_out[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = wb_ta5[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1670 |
|
|
w_conf_data_out[(31-`WB_NUM_OF_DEC_ADDR_LINES):0] = 0 ;
|
1671 |
|
|
w_reg_select_dec = 57'h002_0000_0000_0000 ;
|
1672 |
|
|
end
|
1673 |
|
|
{2'b01, `W_ERR_CS_ADDR}: // w_reg_select_dec bit 50
|
1674 |
|
|
begin
|
1675 |
|
|
w_conf_data_out = { wb_err_cs_bit31_24, /*13*/14'h0000, /*wb_err_cs_bit10,*/
|
1676 |
|
|
wb_err_cs_bit9, wb_err_cs_bit8, 7'h00, wb_err_cs_bit0 } ;
|
1677 |
|
|
w_reg_select_dec = 57'h004_0000_0000_0000 ;
|
1678 |
|
|
end
|
1679 |
|
|
{2'b01, `W_ERR_ADDR_ADDR}: // w_reg_select_dec bit 51
|
1680 |
|
|
begin
|
1681 |
|
|
w_conf_data_out = wb_err_addr ;
|
1682 |
|
|
w_reg_select_dec = 57'h008_0000_0000_0000 ;
|
1683 |
|
|
end
|
1684 |
|
|
{2'b01, `W_ERR_DATA_ADDR}: // w_reg_select_dec bit 52
|
1685 |
|
|
begin
|
1686 |
|
|
w_conf_data_out = wb_err_data ;
|
1687 |
|
|
w_reg_select_dec = 57'h010_0000_0000_0000 ;
|
1688 |
|
|
end
|
1689 |
|
|
{2'b01, `CNF_ADDR_ADDR}: // w_reg_select_dec bit 53
|
1690 |
|
|
begin
|
1691 |
|
|
w_conf_data_out = { 8'h00, cnf_addr_bit23_2, 1'h0, cnf_addr_bit0 } ;
|
1692 |
|
|
w_reg_select_dec = 57'h020_0000_0000_0000 ;
|
1693 |
|
|
end
|
1694 |
77 |
mihad |
// `CNF_DATA_ADDR: implemented elsewhere !!!
|
1695 |
|
|
// `INT_ACK_ADDR: implemented elsewhere !!!
|
1696 |
140 |
mihad |
{2'b01, `ICR_ADDR}: // w_reg_select_dec bit 54
|
1697 |
|
|
begin
|
1698 |
|
|
w_conf_data_out = { icr_bit31, 26'h0000_000, icr_bit4_3, icr_bit2_0 } ;
|
1699 |
|
|
w_reg_select_dec = 57'h040_0000_0000_0000 ;
|
1700 |
77 |
mihad |
end
|
1701 |
140 |
mihad |
{2'b01, `ISR_ADDR}: // w_reg_select_dec bit 55
|
1702 |
|
|
begin
|
1703 |
|
|
w_conf_data_out = { 27'h0000_000, isr_bit4_3, isr_bit2_0 } ;
|
1704 |
|
|
w_reg_select_dec = 57'h080_0000_0000_0000 ;
|
1705 |
|
|
end
|
1706 |
|
|
|
1707 |
|
|
`ifdef PCI_SPOCI
|
1708 |
|
|
8'hff:
|
1709 |
|
|
begin
|
1710 |
|
|
w_conf_data_out = {spoci_cs_nack, 5'h0, spoci_cs_write, spoci_cs_read,
|
1711 |
|
|
5'h0, spoci_cs_adr[10:8],
|
1712 |
|
|
spoci_cs_adr[7:0],
|
1713 |
|
|
spoci_cs_dat[7:0]} ;
|
1714 |
|
|
|
1715 |
|
|
// this register is implemented separate from other registers, because
|
1716 |
|
|
// it has special features implemented
|
1717 |
|
|
w_reg_select_dec = 57'h000_0000_0000_0000 ;
|
1718 |
|
|
end
|
1719 |
|
|
`endif
|
1720 |
|
|
|
1721 |
|
|
default:
|
1722 |
|
|
begin
|
1723 |
|
|
w_conf_data_out = 32'h0000_0000 ;
|
1724 |
|
|
w_reg_select_dec = 57'h000_0000_0000_0000 ;
|
1725 |
|
|
end
|
1726 |
77 |
mihad |
endcase
|
1727 |
|
|
end
|
1728 |
|
|
|
1729 |
140 |
mihad |
`ifdef PCI_SPOCI
|
1730 |
|
|
reg init_we ;
|
1731 |
|
|
reg init_cfg_done ;
|
1732 |
|
|
reg [31: 0] spoci_dat ;
|
1733 |
|
|
wire [31: 0] w_conf_data = init_cfg_done ? w_conf_data_in : spoci_dat ;
|
1734 |
|
|
wire [ 3: 0] w_byte_en = init_cfg_done ? w_byte_en_in : 4'b0000 ;
|
1735 |
|
|
`else
|
1736 |
|
|
wire init_we = 1'b0 ;
|
1737 |
|
|
wire init_cfg_done = 1'b1 ;
|
1738 |
|
|
wire [31: 0] w_conf_data = w_conf_data_in ;
|
1739 |
|
|
wire [ 3: 0] w_byte_en = w_byte_en_in ;
|
1740 |
143 |
mihad |
wire [31: 0] spoci_dat = 'h0000_0000 ;
|
1741 |
140 |
mihad |
`endif
|
1742 |
|
|
|
1743 |
77 |
mihad |
// Reduced write data for BASE, MASK and TRANSLATION registers of PCI and WB images
|
1744 |
140 |
mihad |
assign w_conf_pdata_reduced[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] = w_conf_data[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
1745 |
77 |
mihad |
assign w_conf_pdata_reduced[(31-`PCI_NUM_OF_DEC_ADDR_LINES): 0] = 0 ;
|
1746 |
140 |
mihad |
assign w_conf_wdata_reduced[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] = w_conf_data[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
1747 |
77 |
mihad |
assign w_conf_wdata_reduced[(31-`WB_NUM_OF_DEC_ADDR_LINES): 0] = 0 ;
|
1748 |
|
|
|
1749 |
140 |
mihad |
wire w_we = w_we_i | init_we ;
|
1750 |
136 |
fr2201 |
|
1751 |
77 |
mihad |
always@(posedge w_clock or posedge reset)
|
1752 |
|
|
begin
|
1753 |
|
|
// Here are implemented all registers that are reset with RESET signal otherwise they can be normaly written!!!
|
1754 |
|
|
// Registers that are commented are implemented after this alwasy statement, because they are e.g. reset with
|
1755 |
|
|
// RESET signal, set with some status signal and they are erased with writting '1' into them !!!
|
1756 |
|
|
if (reset)
|
1757 |
|
|
begin
|
1758 |
|
|
/*status_bit15_11 ; status_bit8 ;*/ command_bit8 <= 1'h0 ; command_bit6 <= 1'h0 ; command_bit2_0 <= 3'h0 ;
|
1759 |
|
|
latency_timer <= 8'h00 ; cache_line_size_reg <= 8'h00 ;
|
1760 |
|
|
// ALL pci_base address registers are the same as pci_baX registers !
|
1761 |
|
|
interrupt_line <= 8'h00 ;
|
1762 |
|
|
|
1763 |
|
|
`ifdef HOST
|
1764 |
|
|
`ifdef NO_CNF_IMAGE // if PCI bridge is HOST and IMAGE0 is assigned as general image space
|
1765 |
140 |
mihad |
`ifdef PCI_IMAGE0
|
1766 |
|
|
pci_img_ctrl0_bit2_1 <= {`PCI_AT_EN0, 1'b0} ;
|
1767 |
148 |
mihad |
pci_ba0_bit31_8 <= 24'h0000_00 ;
|
1768 |
77 |
mihad |
pci_ba0_bit0 <= `PCI_BA0_MEM_IO ;
|
1769 |
|
|
pci_am0 <= `PCI_AM0 ;
|
1770 |
136 |
fr2201 |
pci_ta0 <= `PCI_TA0 ;//fr2201 translation address
|
1771 |
77 |
mihad |
`endif
|
1772 |
|
|
`else
|
1773 |
148 |
mihad |
pci_ba0_bit31_8 <= 24'h0000_00 ;
|
1774 |
77 |
mihad |
`endif
|
1775 |
148 |
mihad |
`endif
|
1776 |
|
|
|
1777 |
|
|
`ifdef GUEST
|
1778 |
|
|
pci_ba0_bit31_8 <= 24'h0000_00 ;
|
1779 |
77 |
mihad |
`endif
|
1780 |
|
|
|
1781 |
140 |
mihad |
pci_img_ctrl1_bit2_1 <= {`PCI_AT_EN1, 1'b0} ;
|
1782 |
|
|
|
1783 |
148 |
mihad |
pci_ba1_bit31_8 <= 24'h0000_00 ;
|
1784 |
77 |
mihad |
`ifdef HOST
|
1785 |
|
|
pci_ba1_bit0 <= `PCI_BA1_MEM_IO ;
|
1786 |
|
|
`endif
|
1787 |
|
|
pci_am1 <= `PCI_AM1;
|
1788 |
136 |
fr2201 |
pci_ta1 <= `PCI_TA1 ;//FR2201 translation address ;
|
1789 |
77 |
mihad |
`ifdef PCI_IMAGE2
|
1790 |
140 |
mihad |
|
1791 |
|
|
pci_img_ctrl2_bit2_1 <= {`PCI_AT_EN2, 1'b0} ;
|
1792 |
|
|
|
1793 |
148 |
mihad |
pci_ba2_bit31_8 <= 24'h0000_00 ;
|
1794 |
77 |
mihad |
`ifdef HOST
|
1795 |
|
|
pci_ba2_bit0 <= `PCI_BA2_MEM_IO ;
|
1796 |
|
|
`endif
|
1797 |
|
|
pci_am2 <= `PCI_AM2;
|
1798 |
136 |
fr2201 |
pci_ta2 <= `PCI_TA2 ;//FR2201 translation address ;
|
1799 |
77 |
mihad |
`endif
|
1800 |
|
|
`ifdef PCI_IMAGE3
|
1801 |
140 |
mihad |
|
1802 |
|
|
pci_img_ctrl3_bit2_1 <= {`PCI_AT_EN3, 1'b0} ; //FR2201 when defined enabled
|
1803 |
|
|
|
1804 |
148 |
mihad |
pci_ba3_bit31_8 <= 24'h0000_00 ;
|
1805 |
77 |
mihad |
`ifdef HOST
|
1806 |
|
|
pci_ba3_bit0 <= `PCI_BA3_MEM_IO ;
|
1807 |
|
|
`endif
|
1808 |
|
|
pci_am3 <= `PCI_AM3;
|
1809 |
148 |
mihad |
pci_ta3 <= `PCI_TA3 ;//FR2201 translation address ;
|
1810 |
77 |
mihad |
`endif
|
1811 |
|
|
`ifdef PCI_IMAGE4
|
1812 |
140 |
mihad |
|
1813 |
|
|
pci_img_ctrl4_bit2_1 <= {`PCI_AT_EN4, 1'b0} ; //FR2201 when defined enabled
|
1814 |
|
|
|
1815 |
148 |
mihad |
pci_ba4_bit31_8 <= 24'h0000_00 ;
|
1816 |
77 |
mihad |
`ifdef HOST
|
1817 |
|
|
pci_ba4_bit0 <= `PCI_BA4_MEM_IO ;
|
1818 |
|
|
`endif
|
1819 |
|
|
pci_am4 <= `PCI_AM4;
|
1820 |
136 |
fr2201 |
pci_ta4 <= `PCI_TA4 ;//FR2201 translation address ;
|
1821 |
77 |
mihad |
`endif
|
1822 |
|
|
`ifdef PCI_IMAGE5
|
1823 |
140 |
mihad |
|
1824 |
|
|
pci_img_ctrl5_bit2_1 <= {`PCI_AT_EN5, 1'b0} ; //FR2201 when defined enabled
|
1825 |
|
|
|
1826 |
148 |
mihad |
pci_ba5_bit31_8 <= 24'h0000_00 ;
|
1827 |
77 |
mihad |
`ifdef HOST
|
1828 |
|
|
pci_ba5_bit0 <= `PCI_BA5_MEM_IO ;
|
1829 |
|
|
`endif
|
1830 |
136 |
fr2201 |
pci_am5 <= `PCI_AM5; //FR2201 pci_am0
|
1831 |
|
|
pci_ta5 <= `PCI_TA5 ;//FR2201 translation address ;
|
1832 |
77 |
mihad |
`endif
|
1833 |
|
|
/*pci_err_cs_bit31_24 ; pci_err_cs_bit10; pci_err_cs_bit9 ; pci_err_cs_bit8 ;*/ pci_err_cs_bit0 <= 1'h0 ;
|
1834 |
|
|
/*pci_err_addr ;*/
|
1835 |
|
|
/*pci_err_data ;*/
|
1836 |
|
|
//
|
1837 |
140 |
mihad |
wb_img_ctrl1_bit2_0 <= {`WB_AT_EN1, 2'b00} ;
|
1838 |
|
|
|
1839 |
136 |
fr2201 |
wb_ba1_bit31_12 <=`WB_BA1; //FR2201 Address bar
|
1840 |
|
|
wb_ba1_bit0 <=`WB_BA1_MEM_IO;//
|
1841 |
|
|
wb_am1 <= `WB_AM1 ;//FR2201 Address mask
|
1842 |
|
|
wb_ta1 <= `WB_TA1 ;//FR2201 20'h0000_0 ;
|
1843 |
77 |
mihad |
`ifdef WB_IMAGE2
|
1844 |
140 |
mihad |
wb_img_ctrl2_bit2_0 <= {`WB_AT_EN2, 2'b00} ;
|
1845 |
|
|
|
1846 |
136 |
fr2201 |
wb_ba2_bit31_12 <=`WB_BA2; //FR2201 Address bar
|
1847 |
|
|
wb_ba2_bit0 <=`WB_BA2_MEM_IO;//
|
1848 |
|
|
wb_am2 <=`WB_AM2 ;//FR2201 Address mask
|
1849 |
|
|
wb_ta2 <=`WB_TA2 ;//FR2201 translation address ;
|
1850 |
77 |
mihad |
`endif
|
1851 |
|
|
`ifdef WB_IMAGE3
|
1852 |
140 |
mihad |
wb_img_ctrl3_bit2_0 <= {`WB_AT_EN3, 2'b00} ;
|
1853 |
|
|
|
1854 |
136 |
fr2201 |
wb_ba3_bit31_12 <=`WB_BA3; //FR2201 Address bar
|
1855 |
|
|
wb_ba3_bit0 <=`WB_BA3_MEM_IO;//
|
1856 |
|
|
wb_am3 <=`WB_AM3 ;//FR2201 Address mask
|
1857 |
|
|
wb_ta3 <=`WB_TA3 ;//FR2201 translation address ;
|
1858 |
77 |
mihad |
`endif
|
1859 |
|
|
`ifdef WB_IMAGE4
|
1860 |
140 |
mihad |
wb_img_ctrl4_bit2_0 <= {`WB_AT_EN4, 2'b00} ;
|
1861 |
|
|
|
1862 |
136 |
fr2201 |
wb_ba4_bit31_12 <=`WB_BA4; //FR2201 Address bar
|
1863 |
|
|
wb_ba4_bit0 <=`WB_BA4_MEM_IO;//
|
1864 |
|
|
wb_am4 <=`WB_AM4 ;//FR2201 Address mask
|
1865 |
|
|
wb_ta4 <=`WB_TA4 ;//FR2201 translation address ;
|
1866 |
77 |
mihad |
`endif
|
1867 |
|
|
`ifdef WB_IMAGE5
|
1868 |
140 |
mihad |
wb_img_ctrl5_bit2_0 <= {`WB_AT_EN5, 2'b00} ;
|
1869 |
|
|
|
1870 |
136 |
fr2201 |
wb_ba5_bit31_12 <=`WB_BA5; //FR2201 Address bar ;
|
1871 |
|
|
wb_ba5_bit0 <=`WB_BA5_MEM_IO;//FR2201 1'h0 ;
|
1872 |
|
|
wb_am5 <=`WB_AM5 ;//FR2201 Address mask
|
1873 |
|
|
wb_ta5 <=`WB_TA5 ;//FR2201 translation address ;
|
1874 |
77 |
mihad |
`endif
|
1875 |
|
|
/*wb_err_cs_bit31_24 ; wb_err_cs_bit10 ; wb_err_cs_bit9 ; wb_err_cs_bit8 ;*/ wb_err_cs_bit0 <= 1'h0 ;
|
1876 |
|
|
/*wb_err_addr ;*/
|
1877 |
|
|
/*wb_err_data ;*/
|
1878 |
|
|
|
1879 |
|
|
`ifdef HOST
|
1880 |
|
|
cnf_addr_bit23_2 <= 22'h0000_00 ; cnf_addr_bit0 <= 1'h0 ;
|
1881 |
|
|
`endif
|
1882 |
|
|
|
1883 |
|
|
icr_bit31 <= 1'h0 ;
|
1884 |
|
|
`ifdef HOST
|
1885 |
|
|
icr_bit2_0 <= 3'h0 ;
|
1886 |
|
|
icr_bit4_3 <= 2'h0 ;
|
1887 |
|
|
`else
|
1888 |
|
|
icr_bit2_0[2:0] <= 3'h0 ;
|
1889 |
|
|
`endif
|
1890 |
|
|
/*isr_bit4_3 ; isr_bit2_0 ;*/
|
1891 |
132 |
mihad |
|
1892 |
|
|
// Not register bit; used only internally after reset!
|
1893 |
|
|
init_complete <= 1'b0 ;
|
1894 |
|
|
|
1895 |
|
|
`ifdef GUEST
|
1896 |
|
|
rst_inactive_sync <= 1'b0 ;
|
1897 |
|
|
rst_inactive <= 1'b0 ;
|
1898 |
|
|
`endif
|
1899 |
|
|
|
1900 |
|
|
`ifdef PCI_CPCI_HS_IMPLEMENT
|
1901 |
|
|
/*hs_ins hs_ext*/ hs_loo <= 1'b0; hs_eim <= 1'b0;
|
1902 |
|
|
// Not register bits; used only internally after reset!
|
1903 |
|
|
/*hs_ins_armed hs_ext_armed*/
|
1904 |
|
|
`endif
|
1905 |
77 |
mihad |
end
|
1906 |
|
|
/* -----------------------------------------------------------------------------------------------------------
|
1907 |
|
|
Following register bits should have asynchronous RESET & SET! That is why they are IMPLEMENTED separately
|
1908 |
|
|
after this ALWAYS block!!! (for every register bit, there are two D-FF implemented)
|
1909 |
|
|
status_bit15_11[15] <= 1'b1 ;
|
1910 |
|
|
status_bit15_11[14] <= 1'b1 ;
|
1911 |
|
|
status_bit15_11[13] <= 1'b1 ;
|
1912 |
|
|
status_bit15_11[12] <= 1'b1 ;
|
1913 |
|
|
status_bit15_11[11] <= 1'b1 ;
|
1914 |
|
|
status_bit8 <= 1'b1 ;
|
1915 |
|
|
pci_err_cs_bit10 <= 1'b1 ;
|
1916 |
|
|
pci_err_cs_bit9 <= 1'b1 ;
|
1917 |
|
|
pci_err_cs_bit8 <= 1'b1 ;
|
1918 |
|
|
pci_err_cs_bit31_24 <= { pci_error_be, pci_error_bc } ;
|
1919 |
|
|
pci_err_addr <= pci_error_addr ;
|
1920 |
|
|
pci_err_data <= pci_error_data ;
|
1921 |
|
|
wb_err_cs_bit10 <= 1'b1 ;
|
1922 |
|
|
wb_err_cs_bit9 <= 1'b1 ;
|
1923 |
|
|
wb_err_cs_bit8 <= 1'b1 ;
|
1924 |
|
|
wb_err_cs_bit31_24 <= { wb_error_be, wb_error_bc } ;
|
1925 |
|
|
wb_err_addr <= wb_error_addr ;
|
1926 |
|
|
wb_err_data <= wb_error_data ;
|
1927 |
|
|
isr_bit4_0[4] <= 1'b1 & icr_bit4_0[4] ;
|
1928 |
|
|
isr_bit4_0[3] <= 1'b1 & icr_bit4_0[3] ;
|
1929 |
|
|
isr_bit4_0[2] <= 1'b1 & icr_bit4_0[2] ;
|
1930 |
|
|
isr_bit4_0[1] <= 1'b1 & icr_bit4_0[1] ;
|
1931 |
|
|
isr_bit4_0[0] <= 1'b1 & icr_bit4_0[0] ;
|
1932 |
132 |
mihad |
|
1933 |
|
|
hs_ins; hs_ext;
|
1934 |
77 |
mihad |
-----------------------------------------------------------------------------------------------------------*/
|
1935 |
|
|
// Here follows normal writting to registers (only to their valid bits) !
|
1936 |
|
|
else
|
1937 |
|
|
begin
|
1938 |
|
|
if (w_we)
|
1939 |
|
|
begin
|
1940 |
|
|
// PCI header - configuration space
|
1941 |
140 |
mihad |
if (w_reg_select_dec[0]) // w_conf_address[5:2] = 4'h1:
|
1942 |
77 |
mihad |
begin
|
1943 |
|
|
if (~w_byte_en[1])
|
1944 |
140 |
mihad |
command_bit8 <= w_conf_data[8] ;
|
1945 |
77 |
mihad |
if (~w_byte_en[0])
|
1946 |
|
|
begin
|
1947 |
140 |
mihad |
command_bit6 <= w_conf_data[6] ;
|
1948 |
|
|
command_bit2_0 <= w_conf_data[2:0] ;
|
1949 |
77 |
mihad |
end
|
1950 |
|
|
end
|
1951 |
140 |
mihad |
if (w_reg_select_dec[1]) // w_conf_address[5:2] = 4'h3:
|
1952 |
77 |
mihad |
begin
|
1953 |
|
|
if (~w_byte_en[1])
|
1954 |
140 |
mihad |
latency_timer <= w_conf_data[15:8] ;
|
1955 |
77 |
mihad |
if (~w_byte_en[0])
|
1956 |
140 |
mihad |
cache_line_size_reg <= w_conf_data[7:0] ;
|
1957 |
77 |
mihad |
end
|
1958 |
140 |
mihad |
// if (w_reg_select_dec[4]) // w_conf_address[5:2] = 4'h4:
|
1959 |
77 |
mihad |
// Also used with IMAGE0
|
1960 |
|
|
|
1961 |
140 |
mihad |
// if (w_reg_select_dec[8]) // w_conf_address[5:2] = 4'h5:
|
1962 |
77 |
mihad |
// Also used with IMAGE1
|
1963 |
|
|
|
1964 |
140 |
mihad |
// if (w_reg_select_dec[12]) // w_conf_address[5:2] = 4'h6:
|
1965 |
77 |
mihad |
// Also used with IMAGE2
|
1966 |
|
|
|
1967 |
140 |
mihad |
// if (w_reg_select_dec[16]) // w_conf_address[5:2] = 4'h7:
|
1968 |
77 |
mihad |
// Also used with IMAGE3
|
1969 |
|
|
|
1970 |
140 |
mihad |
// if (w_reg_select_dec[20]) // w_conf_address[5:2] = 4'h8:
|
1971 |
77 |
mihad |
// Also used with IMAGE4
|
1972 |
|
|
|
1973 |
140 |
mihad |
// if (w_reg_select_dec[24]) // w_conf_address[5:2] = 4'h9:
|
1974 |
77 |
mihad |
// Also used with IMAGE5 and IMAGE6
|
1975 |
140 |
mihad |
if (w_reg_select_dec[2]) // w_conf_address[5:2] = 4'hf:
|
1976 |
77 |
mihad |
begin
|
1977 |
|
|
if (~w_byte_en[0])
|
1978 |
140 |
mihad |
interrupt_line <= w_conf_data[7:0] ;
|
1979 |
77 |
mihad |
end
|
1980 |
|
|
// PCI target - configuration space
|
1981 |
|
|
`ifdef HOST
|
1982 |
|
|
`ifdef NO_CNF_IMAGE
|
1983 |
|
|
`ifdef PCI_IMAGE0 // if PCI bridge is HOST and IMAGE0 is assigned as general image space
|
1984 |
140 |
mihad |
if (w_reg_select_dec[3]) // case (w_conf_address[7:2]) = `P_IMG_CTRL0_ADDR:
|
1985 |
77 |
mihad |
begin
|
1986 |
|
|
if (~w_byte_en[0])
|
1987 |
140 |
mihad |
pci_img_ctrl0_bit2_1 <= w_conf_data[2:1] ;
|
1988 |
77 |
mihad |
end
|
1989 |
140 |
mihad |
if (w_reg_select_dec[4]) // case (w_conf_address[7:2]) = `P_BA0_ADDR:
|
1990 |
77 |
mihad |
begin
|
1991 |
|
|
if (~w_byte_en[3])
|
1992 |
148 |
mihad |
pci_ba0_bit31_8[31:24] <= w_conf_pdata_reduced[31:24] ;
|
1993 |
77 |
mihad |
if (~w_byte_en[2])
|
1994 |
148 |
mihad |
pci_ba0_bit31_8[23:16] <= w_conf_pdata_reduced[23:16] ;
|
1995 |
77 |
mihad |
if (~w_byte_en[1])
|
1996 |
148 |
mihad |
pci_ba0_bit31_8[15: 8] <= w_conf_pdata_reduced[15: 8] ;
|
1997 |
77 |
mihad |
if (~w_byte_en[0])
|
1998 |
140 |
mihad |
pci_ba0_bit0 <= w_conf_data[0] ;
|
1999 |
77 |
mihad |
end
|
2000 |
140 |
mihad |
if (w_reg_select_dec[5]) // case (w_conf_address[7:2]) = `P_AM0_ADDR:
|
2001 |
77 |
mihad |
begin
|
2002 |
|
|
if (~w_byte_en[3])
|
2003 |
|
|
pci_am0[31:24] <= w_conf_pdata_reduced[31:24] ;
|
2004 |
|
|
if (~w_byte_en[2])
|
2005 |
|
|
pci_am0[23:16] <= w_conf_pdata_reduced[23:16] ;
|
2006 |
|
|
if (~w_byte_en[1])
|
2007 |
148 |
mihad |
pci_am0[15: 8] <= w_conf_pdata_reduced[15: 8] ;
|
2008 |
77 |
mihad |
end
|
2009 |
140 |
mihad |
if (w_reg_select_dec[6]) // case (w_conf_address[7:2]) = `P_TA0_ADDR:
|
2010 |
77 |
mihad |
begin
|
2011 |
|
|
if (~w_byte_en[3])
|
2012 |
|
|
pci_ta0[31:24] <= w_conf_pdata_reduced[31:24] ;
|
2013 |
|
|
if (~w_byte_en[2])
|
2014 |
|
|
pci_ta0[23:16] <= w_conf_pdata_reduced[23:16] ;
|
2015 |
|
|
if (~w_byte_en[1])
|
2016 |
148 |
mihad |
pci_ta0[15: 8] <= w_conf_pdata_reduced[15: 8] ;
|
2017 |
77 |
mihad |
end
|
2018 |
|
|
`endif
|
2019 |
|
|
`else
|
2020 |
140 |
mihad |
if (w_reg_select_dec[4]) // case (w_conf_address[7:2]) = `P_BA0_ADDR:
|
2021 |
77 |
mihad |
begin
|
2022 |
|
|
if (~w_byte_en[3])
|
2023 |
148 |
mihad |
pci_ba0_bit31_8[31:24] <= w_conf_data[31:24] ;
|
2024 |
77 |
mihad |
if (~w_byte_en[2])
|
2025 |
148 |
mihad |
pci_ba0_bit31_8[23:16] <= w_conf_data[23:16] ;
|
2026 |
77 |
mihad |
if (~w_byte_en[1])
|
2027 |
148 |
mihad |
pci_ba0_bit31_8[15:12] <= w_conf_data[15:12] ;
|
2028 |
77 |
mihad |
end
|
2029 |
|
|
`endif
|
2030 |
148 |
mihad |
`endif
|
2031 |
|
|
|
2032 |
|
|
`ifdef GUEST
|
2033 |
140 |
mihad |
if (w_reg_select_dec[4]) // case (w_conf_address[7:2]) = `P_BA0_ADDR:
|
2034 |
77 |
mihad |
begin
|
2035 |
|
|
if (~w_byte_en[3])
|
2036 |
148 |
mihad |
pci_ba0_bit31_8[31:24] <= w_conf_data[31:24] ;
|
2037 |
77 |
mihad |
if (~w_byte_en[2])
|
2038 |
148 |
mihad |
pci_ba0_bit31_8[23:16] <= w_conf_data[23:16] ;
|
2039 |
77 |
mihad |
if (~w_byte_en[1])
|
2040 |
148 |
mihad |
pci_ba0_bit31_8[15:12] <= w_conf_data[15:12] ;
|
2041 |
77 |
mihad |
end
|
2042 |
|
|
`endif
|
2043 |
140 |
mihad |
if (w_reg_select_dec[7]) // case (w_conf_address[7:2]) = `P_IMG_CTRL1_ADDR:
|
2044 |
77 |
mihad |
begin
|
2045 |
|
|
if (~w_byte_en[0])
|
2046 |
140 |
mihad |
pci_img_ctrl1_bit2_1 <= w_conf_data[2:1] ;
|
2047 |
77 |
mihad |
end
|
2048 |
140 |
mihad |
if (w_reg_select_dec[8]) // case (w_conf_address[7:2]) = `P_BA1_ADDR:
|
2049 |
77 |
mihad |
begin
|
2050 |
|
|
if (~w_byte_en[3])
|
2051 |
148 |
mihad |
pci_ba1_bit31_8[31:24] <= w_conf_pdata_reduced[31:24] ;
|
2052 |
77 |
mihad |
if (~w_byte_en[2])
|
2053 |
148 |
mihad |
pci_ba1_bit31_8[23:16] <= w_conf_pdata_reduced[23:16] ;
|
2054 |
77 |
mihad |
if (~w_byte_en[1])
|
2055 |
148 |
mihad |
pci_ba1_bit31_8[15: 8] <= w_conf_pdata_reduced[15: 8] ;
|
2056 |
77 |
mihad |
`ifdef HOST
|
2057 |
|
|
if (~w_byte_en[0])
|
2058 |
140 |
mihad |
pci_ba1_bit0 <= w_conf_data[0] ;
|
2059 |
77 |
mihad |
`endif
|
2060 |
|
|
end
|
2061 |
140 |
mihad |
if (w_reg_select_dec[9]) // case (w_conf_address[7:2]) = `P_AM1_ADDR:
|
2062 |
77 |
mihad |
begin
|
2063 |
|
|
if (~w_byte_en[3])
|
2064 |
|
|
pci_am1[31:24] <= w_conf_pdata_reduced[31:24] ;
|
2065 |
|
|
if (~w_byte_en[2])
|
2066 |
|
|
pci_am1[23:16] <= w_conf_pdata_reduced[23:16] ;
|
2067 |
|
|
if (~w_byte_en[1])
|
2068 |
148 |
mihad |
pci_am1[15: 8] <= w_conf_pdata_reduced[15: 8] ;
|
2069 |
77 |
mihad |
end
|
2070 |
140 |
mihad |
if (w_reg_select_dec[10]) // case (w_conf_address[7:2]) = `P_TA1_ADDR:
|
2071 |
77 |
mihad |
begin
|
2072 |
|
|
if (~w_byte_en[3])
|
2073 |
|
|
pci_ta1[31:24] <= w_conf_pdata_reduced[31:24] ;
|
2074 |
|
|
if (~w_byte_en[2])
|
2075 |
|
|
pci_ta1[23:16] <= w_conf_pdata_reduced[23:16] ;
|
2076 |
|
|
if (~w_byte_en[1])
|
2077 |
148 |
mihad |
pci_ta1[15: 8] <= w_conf_pdata_reduced[15: 8] ;
|
2078 |
77 |
mihad |
end
|
2079 |
|
|
`ifdef PCI_IMAGE2
|
2080 |
140 |
mihad |
if (w_reg_select_dec[11]) // case (w_conf_address[7:2]) = `P_IMG_CTRL2_ADDR:
|
2081 |
77 |
mihad |
begin
|
2082 |
|
|
if (~w_byte_en[0])
|
2083 |
140 |
mihad |
pci_img_ctrl2_bit2_1 <= w_conf_data[2:1] ;
|
2084 |
77 |
mihad |
end
|
2085 |
140 |
mihad |
if (w_reg_select_dec[12]) // case (w_conf_address[7:2]) = `P_BA2_ADDR:
|
2086 |
77 |
mihad |
begin
|
2087 |
|
|
if (~w_byte_en[3])
|
2088 |
148 |
mihad |
pci_ba2_bit31_8[31:24] <= w_conf_pdata_reduced[31:24] ;
|
2089 |
77 |
mihad |
if (~w_byte_en[2])
|
2090 |
148 |
mihad |
pci_ba2_bit31_8[23:16] <= w_conf_pdata_reduced[23:16] ;
|
2091 |
77 |
mihad |
if (~w_byte_en[1])
|
2092 |
148 |
mihad |
pci_ba2_bit31_8[15: 8] <= w_conf_pdata_reduced[15: 8] ;
|
2093 |
77 |
mihad |
`ifdef HOST
|
2094 |
|
|
if (~w_byte_en[0])
|
2095 |
140 |
mihad |
pci_ba2_bit0 <= w_conf_data[0] ;
|
2096 |
77 |
mihad |
`endif
|
2097 |
|
|
end
|
2098 |
140 |
mihad |
if (w_reg_select_dec[13]) // case (w_conf_address[7:2]) = `P_AM2_ADDR:
|
2099 |
77 |
mihad |
begin
|
2100 |
|
|
if (~w_byte_en[3])
|
2101 |
|
|
pci_am2[31:24] <= w_conf_pdata_reduced[31:24] ;
|
2102 |
|
|
if (~w_byte_en[2])
|
2103 |
|
|
pci_am2[23:16] <= w_conf_pdata_reduced[23:16] ;
|
2104 |
|
|
if (~w_byte_en[1])
|
2105 |
148 |
mihad |
pci_am2[15: 8] <= w_conf_pdata_reduced[15: 8] ;
|
2106 |
77 |
mihad |
end
|
2107 |
140 |
mihad |
if (w_reg_select_dec[14]) // case (w_conf_address[7:2]) = `P_TA2_ADDR:
|
2108 |
77 |
mihad |
begin
|
2109 |
|
|
if (~w_byte_en[3])
|
2110 |
|
|
pci_ta2[31:24] <= w_conf_pdata_reduced[31:24] ;
|
2111 |
|
|
if (~w_byte_en[2])
|
2112 |
|
|
pci_ta2[23:16] <= w_conf_pdata_reduced[23:16] ;
|
2113 |
|
|
if (~w_byte_en[1])
|
2114 |
148 |
mihad |
pci_ta2[15: 8] <= w_conf_pdata_reduced[15: 8] ;
|
2115 |
77 |
mihad |
end
|
2116 |
|
|
`endif
|
2117 |
|
|
`ifdef PCI_IMAGE3
|
2118 |
140 |
mihad |
if (w_reg_select_dec[15]) // case (w_conf_address[7:2]) = `P_IMG_CTRL3_ADDR:
|
2119 |
77 |
mihad |
begin
|
2120 |
|
|
if (~w_byte_en[0])
|
2121 |
140 |
mihad |
pci_img_ctrl3_bit2_1 <= w_conf_data[2:1] ;
|
2122 |
77 |
mihad |
end
|
2123 |
140 |
mihad |
if (w_reg_select_dec[16]) // case (w_conf_address[7:2]) = `P_BA3_ADDR:
|
2124 |
77 |
mihad |
begin
|
2125 |
|
|
if (~w_byte_en[3])
|
2126 |
148 |
mihad |
pci_ba3_bit31_8[31:24] <= w_conf_pdata_reduced[31:24] ;
|
2127 |
77 |
mihad |
if (~w_byte_en[2])
|
2128 |
148 |
mihad |
pci_ba3_bit31_8[23:16] <= w_conf_pdata_reduced[23:16] ;
|
2129 |
77 |
mihad |
if (~w_byte_en[1])
|
2130 |
148 |
mihad |
pci_ba3_bit31_8[15: 8] <= w_conf_pdata_reduced[15: 8] ;
|
2131 |
77 |
mihad |
`ifdef HOST
|
2132 |
|
|
if (~w_byte_en[0])
|
2133 |
140 |
mihad |
pci_ba3_bit0 <= w_conf_data[0] ;
|
2134 |
77 |
mihad |
`endif
|
2135 |
|
|
end
|
2136 |
140 |
mihad |
if (w_reg_select_dec[17]) // case (w_conf_address[7:2]) = `P_AM3_ADDR:
|
2137 |
77 |
mihad |
begin
|
2138 |
|
|
if (~w_byte_en[3])
|
2139 |
|
|
pci_am3[31:24] <= w_conf_pdata_reduced[31:24] ;
|
2140 |
|
|
if (~w_byte_en[2])
|
2141 |
|
|
pci_am3[23:16] <= w_conf_pdata_reduced[23:16] ;
|
2142 |
|
|
if (~w_byte_en[1])
|
2143 |
148 |
mihad |
pci_am3[15: 8] <= w_conf_pdata_reduced[15: 8] ;
|
2144 |
77 |
mihad |
end
|
2145 |
140 |
mihad |
if (w_reg_select_dec[18]) // case (w_conf_address[7:2]) = `P_TA3_ADDR:
|
2146 |
77 |
mihad |
begin
|
2147 |
|
|
if (~w_byte_en[3])
|
2148 |
|
|
pci_ta3[31:24] <= w_conf_pdata_reduced[31:24] ;
|
2149 |
|
|
if (~w_byte_en[2])
|
2150 |
|
|
pci_ta3[23:16] <= w_conf_pdata_reduced[23:16] ;
|
2151 |
|
|
if (~w_byte_en[1])
|
2152 |
148 |
mihad |
pci_ta3[15: 8] <= w_conf_pdata_reduced[15: 8] ;
|
2153 |
77 |
mihad |
end
|
2154 |
|
|
`endif
|
2155 |
|
|
`ifdef PCI_IMAGE4
|
2156 |
140 |
mihad |
if (w_reg_select_dec[19]) // case (w_conf_address[7:2]) = `P_IMG_CTRL4_ADDR:
|
2157 |
77 |
mihad |
begin
|
2158 |
|
|
if (~w_byte_en[0])
|
2159 |
140 |
mihad |
pci_img_ctrl4_bit2_1 <= w_conf_data[2:1] ;
|
2160 |
77 |
mihad |
end
|
2161 |
140 |
mihad |
if (w_reg_select_dec[20]) // case (w_conf_address[7:2]) = `P_BA4_ADDR:
|
2162 |
77 |
mihad |
begin
|
2163 |
|
|
if (~w_byte_en[3])
|
2164 |
148 |
mihad |
pci_ba4_bit31_8[31:24] <= w_conf_pdata_reduced[31:24] ;
|
2165 |
77 |
mihad |
if (~w_byte_en[2])
|
2166 |
148 |
mihad |
pci_ba4_bit31_8[23:16] <= w_conf_pdata_reduced[23:16] ;
|
2167 |
77 |
mihad |
if (~w_byte_en[1])
|
2168 |
148 |
mihad |
pci_ba4_bit31_8[15: 8] <= w_conf_pdata_reduced[15: 8] ;
|
2169 |
77 |
mihad |
`ifdef HOST
|
2170 |
|
|
if (~w_byte_en[0])
|
2171 |
140 |
mihad |
pci_ba4_bit0 <= w_conf_data[0] ;
|
2172 |
77 |
mihad |
`endif
|
2173 |
|
|
end
|
2174 |
140 |
mihad |
if (w_reg_select_dec[21]) // case (w_conf_address[7:2]) = `P_AM4_ADDR:
|
2175 |
77 |
mihad |
begin
|
2176 |
|
|
if (~w_byte_en[3])
|
2177 |
|
|
pci_am4[31:24] <= w_conf_pdata_reduced[31:24] ;
|
2178 |
|
|
if (~w_byte_en[2])
|
2179 |
|
|
pci_am4[23:16] <= w_conf_pdata_reduced[23:16] ;
|
2180 |
|
|
if (~w_byte_en[1])
|
2181 |
148 |
mihad |
pci_am4[15: 8] <= w_conf_pdata_reduced[15: 8] ;
|
2182 |
77 |
mihad |
end
|
2183 |
140 |
mihad |
if (w_reg_select_dec[22]) // case (w_conf_address[7:2]) = `P_TA4_ADDR:
|
2184 |
77 |
mihad |
begin
|
2185 |
|
|
if (~w_byte_en[3])
|
2186 |
|
|
pci_ta4[31:24] <= w_conf_pdata_reduced[31:24] ;
|
2187 |
|
|
if (~w_byte_en[2])
|
2188 |
|
|
pci_ta4[23:16] <= w_conf_pdata_reduced[23:16] ;
|
2189 |
|
|
if (~w_byte_en[1])
|
2190 |
148 |
mihad |
pci_ta4[15: 8] <= w_conf_pdata_reduced[15: 8] ;
|
2191 |
77 |
mihad |
end
|
2192 |
|
|
`endif
|
2193 |
|
|
`ifdef PCI_IMAGE5
|
2194 |
140 |
mihad |
if (w_reg_select_dec[23]) // case (w_conf_address[7:2]) = `P_IMG_CTRL5_ADDR:
|
2195 |
77 |
mihad |
begin
|
2196 |
|
|
if (~w_byte_en[0])
|
2197 |
140 |
mihad |
pci_img_ctrl5_bit2_1 <= w_conf_data[2:1] ;
|
2198 |
77 |
mihad |
end
|
2199 |
140 |
mihad |
if (w_reg_select_dec[24]) // case (w_conf_address[7:2]) = `P_BA5_ADDR:
|
2200 |
77 |
mihad |
begin
|
2201 |
|
|
if (~w_byte_en[3])
|
2202 |
148 |
mihad |
pci_ba5_bit31_8[31:24] <= w_conf_pdata_reduced[31:24] ;
|
2203 |
77 |
mihad |
if (~w_byte_en[2])
|
2204 |
148 |
mihad |
pci_ba5_bit31_8[23:16] <= w_conf_pdata_reduced[23:16] ;
|
2205 |
77 |
mihad |
if (~w_byte_en[1])
|
2206 |
148 |
mihad |
pci_ba5_bit31_8[15: 8] <= w_conf_pdata_reduced[15: 8] ;
|
2207 |
77 |
mihad |
`ifdef HOST
|
2208 |
|
|
if (~w_byte_en[0])
|
2209 |
140 |
mihad |
pci_ba5_bit0 <= w_conf_data[0] ;
|
2210 |
77 |
mihad |
`endif
|
2211 |
|
|
end
|
2212 |
140 |
mihad |
if (w_reg_select_dec[25]) // case (w_conf_address[7:2]) = `P_AM5_ADDR:
|
2213 |
77 |
mihad |
begin
|
2214 |
|
|
if (~w_byte_en[3])
|
2215 |
|
|
pci_am5[31:24] <= w_conf_pdata_reduced[31:24] ;
|
2216 |
|
|
if (~w_byte_en[2])
|
2217 |
|
|
pci_am5[23:16] <= w_conf_pdata_reduced[23:16] ;
|
2218 |
|
|
if (~w_byte_en[1])
|
2219 |
148 |
mihad |
pci_am5[15: 8] <= w_conf_pdata_reduced[15: 8] ;
|
2220 |
77 |
mihad |
end
|
2221 |
140 |
mihad |
if (w_reg_select_dec[26]) // case (w_conf_address[7:2]) = `P_TA5_ADDR:
|
2222 |
77 |
mihad |
begin
|
2223 |
|
|
if (~w_byte_en[3])
|
2224 |
|
|
pci_ta5[31:24] <= w_conf_pdata_reduced[31:24] ;
|
2225 |
|
|
if (~w_byte_en[2])
|
2226 |
|
|
pci_ta5[23:16] <= w_conf_pdata_reduced[23:16] ;
|
2227 |
|
|
if (~w_byte_en[1])
|
2228 |
148 |
mihad |
pci_ta5[15: 8] <= w_conf_pdata_reduced[15: 8] ;
|
2229 |
77 |
mihad |
end
|
2230 |
|
|
`endif
|
2231 |
140 |
mihad |
if (w_reg_select_dec[27]) // case (w_conf_address[7:2]) = `P_ERR_CS_ADDR:
|
2232 |
77 |
mihad |
begin
|
2233 |
|
|
if (~w_byte_en[0])
|
2234 |
140 |
mihad |
pci_err_cs_bit0 <= w_conf_data[0] ;
|
2235 |
77 |
mihad |
end
|
2236 |
|
|
// WB slave - configuration space
|
2237 |
140 |
mihad |
if (w_reg_select_dec[30]) // case (w_conf_address[7:2]) = `W_IMG_CTRL1_ADDR:
|
2238 |
77 |
mihad |
begin
|
2239 |
|
|
if (~w_byte_en[0])
|
2240 |
140 |
mihad |
wb_img_ctrl1_bit2_0 <= w_conf_data[2:0] ;
|
2241 |
77 |
mihad |
end
|
2242 |
140 |
mihad |
if (w_reg_select_dec[31]) // case (w_conf_address[7:2]) = `W_BA1_ADDR:
|
2243 |
77 |
mihad |
begin
|
2244 |
|
|
if (~w_byte_en[3])
|
2245 |
|
|
wb_ba1_bit31_12[31:24] <= w_conf_wdata_reduced[31:24] ;
|
2246 |
|
|
if (~w_byte_en[2])
|
2247 |
|
|
wb_ba1_bit31_12[23:16] <= w_conf_wdata_reduced[23:16] ;
|
2248 |
|
|
if (~w_byte_en[1])
|
2249 |
|
|
wb_ba1_bit31_12[15:12] <= w_conf_wdata_reduced[15:12] ;
|
2250 |
|
|
if (~w_byte_en[0])
|
2251 |
140 |
mihad |
wb_ba1_bit0 <= w_conf_data[0] ;
|
2252 |
77 |
mihad |
end
|
2253 |
140 |
mihad |
if (w_reg_select_dec[32]) // case (w_conf_address[7:2]) = `W_AM1_ADDR:
|
2254 |
77 |
mihad |
begin
|
2255 |
|
|
if (~w_byte_en[3])
|
2256 |
|
|
wb_am1[31:24] <= w_conf_wdata_reduced[31:24] ;
|
2257 |
|
|
if (~w_byte_en[2])
|
2258 |
|
|
wb_am1[23:16] <= w_conf_wdata_reduced[23:16] ;
|
2259 |
|
|
if (~w_byte_en[1])
|
2260 |
|
|
wb_am1[15:12] <= w_conf_wdata_reduced[15:12] ;
|
2261 |
|
|
end
|
2262 |
140 |
mihad |
if (w_reg_select_dec[33]) // case (w_conf_address[7:2]) = `W_TA1_ADDR:
|
2263 |
77 |
mihad |
begin
|
2264 |
|
|
if (~w_byte_en[3])
|
2265 |
|
|
wb_ta1[31:24] <= w_conf_wdata_reduced[31:24] ;
|
2266 |
|
|
if (~w_byte_en[2])
|
2267 |
|
|
wb_ta1[23:16] <= w_conf_wdata_reduced[23:16] ;
|
2268 |
|
|
if (~w_byte_en[1])
|
2269 |
|
|
wb_ta1[15:12] <= w_conf_wdata_reduced[15:12] ;
|
2270 |
|
|
end
|
2271 |
|
|
`ifdef WB_IMAGE2
|
2272 |
140 |
mihad |
if (w_reg_select_dec[34]) // case (w_conf_address[7:2]) = `W_IMG_CTRL2_ADDR:
|
2273 |
77 |
mihad |
begin
|
2274 |
|
|
if (~w_byte_en[0])
|
2275 |
140 |
mihad |
wb_img_ctrl2_bit2_0 <= w_conf_data[2:0] ;
|
2276 |
77 |
mihad |
end
|
2277 |
140 |
mihad |
if (w_reg_select_dec[35]) // case (w_conf_address[7:2]) = `W_BA2_ADDR:
|
2278 |
77 |
mihad |
begin
|
2279 |
|
|
if (~w_byte_en[3])
|
2280 |
|
|
wb_ba2_bit31_12[31:24] <= w_conf_wdata_reduced[31:24] ;
|
2281 |
|
|
if (~w_byte_en[2])
|
2282 |
|
|
wb_ba2_bit31_12[23:16] <= w_conf_wdata_reduced[23:16] ;
|
2283 |
|
|
if (~w_byte_en[1])
|
2284 |
|
|
wb_ba2_bit31_12[15:12] <= w_conf_wdata_reduced[15:12] ;
|
2285 |
|
|
if (~w_byte_en[0])
|
2286 |
140 |
mihad |
wb_ba2_bit0 <= w_conf_data[0] ;
|
2287 |
77 |
mihad |
end
|
2288 |
140 |
mihad |
if (w_reg_select_dec[36]) // case (w_conf_address[7:2]) = `W_AM2_ADDR:
|
2289 |
77 |
mihad |
begin
|
2290 |
|
|
if (~w_byte_en[3])
|
2291 |
|
|
wb_am2[31:24] <= w_conf_wdata_reduced[31:24] ;
|
2292 |
|
|
if (~w_byte_en[2])
|
2293 |
|
|
wb_am2[23:16] <= w_conf_wdata_reduced[23:16] ;
|
2294 |
|
|
if (~w_byte_en[1])
|
2295 |
|
|
wb_am2[15:12] <= w_conf_wdata_reduced[15:12] ;
|
2296 |
|
|
end
|
2297 |
140 |
mihad |
if (w_reg_select_dec[37]) // case (w_conf_address[7:2]) = `W_TA2_ADDR:
|
2298 |
77 |
mihad |
begin
|
2299 |
|
|
if (~w_byte_en[3])
|
2300 |
|
|
wb_ta2[31:24] <= w_conf_wdata_reduced[31:24] ;
|
2301 |
|
|
if (~w_byte_en[2])
|
2302 |
|
|
wb_ta2[23:16] <= w_conf_wdata_reduced[23:16] ;
|
2303 |
|
|
if (~w_byte_en[1])
|
2304 |
|
|
wb_ta2[15:12] <= w_conf_wdata_reduced[15:12] ;
|
2305 |
|
|
end
|
2306 |
|
|
`endif
|
2307 |
|
|
`ifdef WB_IMAGE3
|
2308 |
140 |
mihad |
if (w_reg_select_dec[38]) // case (w_conf_address[7:2]) = `W_IMG_CTRL3_ADDR:
|
2309 |
77 |
mihad |
begin
|
2310 |
|
|
if (~w_byte_en[0])
|
2311 |
140 |
mihad |
wb_img_ctrl3_bit2_0 <= w_conf_data[2:0] ;
|
2312 |
77 |
mihad |
end
|
2313 |
140 |
mihad |
if (w_reg_select_dec[39]) // case (w_conf_address[7:2]) = `W_BA3_ADDR:
|
2314 |
77 |
mihad |
begin
|
2315 |
|
|
if (~w_byte_en[3])
|
2316 |
|
|
wb_ba3_bit31_12[31:24] <= w_conf_wdata_reduced[31:24] ;
|
2317 |
|
|
if (~w_byte_en[2])
|
2318 |
|
|
wb_ba3_bit31_12[23:16] <= w_conf_wdata_reduced[23:16] ;
|
2319 |
|
|
if (~w_byte_en[1])
|
2320 |
|
|
wb_ba3_bit31_12[15:12] <= w_conf_wdata_reduced[15:12] ;
|
2321 |
|
|
if (~w_byte_en[0])
|
2322 |
140 |
mihad |
wb_ba3_bit0 <= w_conf_data[0] ;
|
2323 |
77 |
mihad |
end
|
2324 |
140 |
mihad |
if (w_reg_select_dec[40]) // case (w_conf_address[7:2]) = `W_AM3_ADDR:
|
2325 |
77 |
mihad |
begin
|
2326 |
|
|
if (~w_byte_en[3])
|
2327 |
|
|
wb_am3[31:24] <= w_conf_wdata_reduced[31:24] ;
|
2328 |
|
|
if (~w_byte_en[2])
|
2329 |
|
|
wb_am3[23:16] <= w_conf_wdata_reduced[23:16] ;
|
2330 |
|
|
if (~w_byte_en[1])
|
2331 |
|
|
wb_am3[15:12] <= w_conf_wdata_reduced[15:12] ;
|
2332 |
|
|
end
|
2333 |
140 |
mihad |
if (w_reg_select_dec[41]) // case (w_conf_address[7:2]) = `W_TA3_ADDR:
|
2334 |
77 |
mihad |
begin
|
2335 |
|
|
if (~w_byte_en[3])
|
2336 |
|
|
wb_ta3[31:24] <= w_conf_wdata_reduced[31:24] ;
|
2337 |
|
|
if (~w_byte_en[2])
|
2338 |
|
|
wb_ta3[23:16] <= w_conf_wdata_reduced[23:16] ;
|
2339 |
|
|
if (~w_byte_en[1])
|
2340 |
|
|
wb_ta3[15:12] <= w_conf_wdata_reduced[15:12] ;
|
2341 |
|
|
end
|
2342 |
|
|
`endif
|
2343 |
|
|
`ifdef WB_IMAGE4
|
2344 |
140 |
mihad |
if (w_reg_select_dec[42]) // case (w_conf_address[7:2]) = `W_IMG_CTRL4_ADDR:
|
2345 |
77 |
mihad |
begin
|
2346 |
|
|
if (~w_byte_en[0])
|
2347 |
140 |
mihad |
wb_img_ctrl4_bit2_0 <= w_conf_data[2:0] ;
|
2348 |
77 |
mihad |
end
|
2349 |
140 |
mihad |
if (w_reg_select_dec[43]) // case (w_conf_address[7:2]) = `W_BA4_ADDR:
|
2350 |
77 |
mihad |
begin
|
2351 |
|
|
if (~w_byte_en[3])
|
2352 |
|
|
wb_ba4_bit31_12[31:24] <= w_conf_wdata_reduced[31:24] ;
|
2353 |
|
|
if (~w_byte_en[2])
|
2354 |
|
|
wb_ba4_bit31_12[23:16] <= w_conf_wdata_reduced[23:16] ;
|
2355 |
|
|
if (~w_byte_en[1])
|
2356 |
|
|
wb_ba4_bit31_12[15:12] <= w_conf_wdata_reduced[15:12] ;
|
2357 |
|
|
if (~w_byte_en[0])
|
2358 |
140 |
mihad |
wb_ba4_bit0 <= w_conf_data[0] ;
|
2359 |
77 |
mihad |
end
|
2360 |
140 |
mihad |
if (w_reg_select_dec[44]) // case (w_conf_address[7:2]) = `W_AM4_ADDR:
|
2361 |
77 |
mihad |
begin
|
2362 |
|
|
if (~w_byte_en[3])
|
2363 |
|
|
wb_am4[31:24] <= w_conf_wdata_reduced[31:24] ;
|
2364 |
|
|
if (~w_byte_en[2])
|
2365 |
|
|
wb_am4[23:16] <= w_conf_wdata_reduced[23:16] ;
|
2366 |
|
|
if (~w_byte_en[1])
|
2367 |
|
|
wb_am4[15:12] <= w_conf_wdata_reduced[15:12] ;
|
2368 |
|
|
end
|
2369 |
140 |
mihad |
if (w_reg_select_dec[45]) // case (w_conf_address[7:2]) = `W_TA4_ADDR:
|
2370 |
77 |
mihad |
begin
|
2371 |
|
|
if (~w_byte_en[3])
|
2372 |
|
|
wb_ta4[31:24] <= w_conf_wdata_reduced[31:24] ;
|
2373 |
|
|
if (~w_byte_en[2])
|
2374 |
|
|
wb_ta4[23:16] <= w_conf_wdata_reduced[23:16] ;
|
2375 |
|
|
if (~w_byte_en[1])
|
2376 |
|
|
wb_ta4[15:12] <= w_conf_wdata_reduced[15:12] ;
|
2377 |
|
|
end
|
2378 |
|
|
`endif
|
2379 |
|
|
`ifdef WB_IMAGE5
|
2380 |
140 |
mihad |
if (w_reg_select_dec[46]) // case (w_conf_address[7:2]) = `W_IMG_CTRL5_ADDR:
|
2381 |
77 |
mihad |
begin
|
2382 |
|
|
if (~w_byte_en[0])
|
2383 |
140 |
mihad |
wb_img_ctrl5_bit2_0 <= w_conf_data[2:0] ;
|
2384 |
77 |
mihad |
end
|
2385 |
140 |
mihad |
if (w_reg_select_dec[47]) // case (w_conf_address[7:2]) = `W_BA5_ADDR:
|
2386 |
77 |
mihad |
begin
|
2387 |
|
|
if (~w_byte_en[3])
|
2388 |
|
|
wb_ba5_bit31_12[31:24] <= w_conf_wdata_reduced[31:24] ;
|
2389 |
|
|
if (~w_byte_en[2])
|
2390 |
|
|
wb_ba5_bit31_12[23:16] <= w_conf_wdata_reduced[23:16] ;
|
2391 |
|
|
if (~w_byte_en[1])
|
2392 |
|
|
wb_ba5_bit31_12[15:12] <= w_conf_wdata_reduced[15:12] ;
|
2393 |
|
|
if (~w_byte_en[0])
|
2394 |
140 |
mihad |
wb_ba5_bit0 <= w_conf_data[0] ;
|
2395 |
77 |
mihad |
end
|
2396 |
140 |
mihad |
if (w_reg_select_dec[48]) // case (w_conf_address[7:2]) = `W_AM5_ADDR:
|
2397 |
77 |
mihad |
begin
|
2398 |
|
|
if (~w_byte_en[3])
|
2399 |
|
|
wb_am5[31:24] <= w_conf_wdata_reduced[31:24] ;
|
2400 |
|
|
if (~w_byte_en[2])
|
2401 |
|
|
wb_am5[23:16] <= w_conf_wdata_reduced[23:16] ;
|
2402 |
|
|
if (~w_byte_en[1])
|
2403 |
|
|
wb_am5[15:12] <= w_conf_wdata_reduced[15:12] ;
|
2404 |
|
|
end
|
2405 |
140 |
mihad |
if (w_reg_select_dec[49]) // case (w_conf_address[7:2]) = `W_TA5_ADDR:
|
2406 |
77 |
mihad |
begin
|
2407 |
|
|
if (~w_byte_en[3])
|
2408 |
|
|
wb_ta5[31:24] <= w_conf_wdata_reduced[31:24] ;
|
2409 |
|
|
if (~w_byte_en[2])
|
2410 |
|
|
wb_ta5[23:16] <= w_conf_wdata_reduced[23:16] ;
|
2411 |
|
|
if (~w_byte_en[1])
|
2412 |
|
|
wb_ta5[15:12] <= w_conf_wdata_reduced[15:12] ;
|
2413 |
|
|
end
|
2414 |
|
|
`endif
|
2415 |
140 |
mihad |
if (w_reg_select_dec[50]) // case (w_conf_address[7:2]) = `W_ERR_CS_ADDR:
|
2416 |
77 |
mihad |
begin
|
2417 |
|
|
if (~w_byte_en[0])
|
2418 |
140 |
mihad |
wb_err_cs_bit0 <= w_conf_data[0] ;
|
2419 |
77 |
mihad |
end
|
2420 |
|
|
|
2421 |
|
|
`ifdef HOST
|
2422 |
140 |
mihad |
if (w_reg_select_dec[53]) // case (w_conf_address[7:2]) = `CNF_ADDR_ADDR:
|
2423 |
77 |
mihad |
begin
|
2424 |
|
|
if (~w_byte_en[2])
|
2425 |
140 |
mihad |
cnf_addr_bit23_2[23:16] <= w_conf_data[23:16] ;
|
2426 |
77 |
mihad |
if (~w_byte_en[1])
|
2427 |
140 |
mihad |
cnf_addr_bit23_2[15:8] <= w_conf_data[15:8] ;
|
2428 |
77 |
mihad |
if (~w_byte_en[0])
|
2429 |
|
|
begin
|
2430 |
140 |
mihad |
cnf_addr_bit23_2[7:2] <= w_conf_data[7:2] ;
|
2431 |
|
|
cnf_addr_bit0 <= w_conf_data[0] ;
|
2432 |
77 |
mihad |
end
|
2433 |
|
|
end
|
2434 |
|
|
`endif
|
2435 |
|
|
// `CNF_DATA_ADDR: implemented elsewhere !!!
|
2436 |
|
|
// `INT_ACK_ADDR : implemented elsewhere !!!
|
2437 |
140 |
mihad |
if (w_reg_select_dec[54]) // case (w_conf_address[7:2]) = `ICR_ADDR:
|
2438 |
77 |
mihad |
begin
|
2439 |
|
|
if (~w_byte_en[3])
|
2440 |
140 |
mihad |
icr_bit31 <= w_conf_data[31] ;
|
2441 |
132 |
mihad |
|
2442 |
77 |
mihad |
if (~w_byte_en[0])
|
2443 |
132 |
mihad |
begin
|
2444 |
77 |
mihad |
`ifdef HOST
|
2445 |
140 |
mihad |
icr_bit4_3 <= w_conf_data[4:3] ;
|
2446 |
|
|
icr_bit2_0 <= w_conf_data[2:0] ;
|
2447 |
77 |
mihad |
`else
|
2448 |
140 |
mihad |
icr_bit2_0[2:0] <= w_conf_data[2:0] ;
|
2449 |
77 |
mihad |
`endif
|
2450 |
132 |
mihad |
end
|
2451 |
|
|
end
|
2452 |
|
|
|
2453 |
|
|
`ifdef PCI_CPCI_HS_IMPLEMENT
|
2454 |
|
|
if (w_reg_select_dec[56])
|
2455 |
|
|
begin
|
2456 |
|
|
if (~w_byte_en[2])
|
2457 |
|
|
begin
|
2458 |
140 |
mihad |
hs_loo <= w_conf_data[19];
|
2459 |
|
|
hs_eim <= w_conf_data[17];
|
2460 |
132 |
mihad |
end
|
2461 |
|
|
end
|
2462 |
|
|
`endif
|
2463 |
|
|
end // end of we
|
2464 |
|
|
|
2465 |
|
|
// Not register bits; used only internally after reset!
|
2466 |
|
|
`ifdef GUEST
|
2467 |
|
|
rst_inactive_sync <= 1'b1 ;
|
2468 |
|
|
rst_inactive <= rst_inactive_sync ;
|
2469 |
|
|
`endif
|
2470 |
|
|
|
2471 |
140 |
mihad |
if (rst_inactive & ~init_complete & init_cfg_done)
|
2472 |
132 |
mihad |
init_complete <= 1'b1 ;
|
2473 |
77 |
mihad |
end
|
2474 |
|
|
end
|
2475 |
|
|
|
2476 |
143 |
mihad |
// implementation of read only device identification registers
|
2477 |
|
|
always@(posedge w_clock or posedge reset)
|
2478 |
|
|
begin
|
2479 |
|
|
if (reset)
|
2480 |
|
|
begin
|
2481 |
|
|
r_vendor_id <= `HEADER_VENDOR_ID ;
|
2482 |
|
|
r_device_id <= `HEADER_DEVICE_ID ;
|
2483 |
|
|
r_revision_id <= `HEADER_REVISION_ID ;
|
2484 |
|
|
r_subsys_vendor_id <= `HEADER_SUBSYS_VENDOR_ID ;
|
2485 |
|
|
r_subsys_id <= `HEADER_SUBSYS_ID ;
|
2486 |
|
|
r_max_lat <= `HEADER_MAX_LAT ;
|
2487 |
|
|
r_min_gnt <= `HEADER_MIN_GNT ;
|
2488 |
|
|
end else
|
2489 |
|
|
begin
|
2490 |
|
|
if (init_we)
|
2491 |
|
|
begin
|
2492 |
|
|
if (spoci_reg_num == 'h0)
|
2493 |
|
|
begin
|
2494 |
|
|
r_vendor_id <= spoci_dat[15: 0] ;
|
2495 |
|
|
r_device_id <= spoci_dat[31:16] ;
|
2496 |
|
|
end
|
2497 |
|
|
|
2498 |
|
|
if (spoci_reg_num == 'hB)
|
2499 |
|
|
begin
|
2500 |
|
|
r_subsys_vendor_id <= spoci_dat[15: 0] ;
|
2501 |
|
|
r_subsys_id <= spoci_dat[31:16] ;
|
2502 |
|
|
end
|
2503 |
|
|
|
2504 |
|
|
if (spoci_reg_num == 'h2)
|
2505 |
|
|
begin
|
2506 |
|
|
r_revision_id <= spoci_dat[ 7: 0] ;
|
2507 |
|
|
end
|
2508 |
|
|
|
2509 |
|
|
if (spoci_reg_num == 'hF)
|
2510 |
|
|
begin
|
2511 |
|
|
r_max_lat <= spoci_dat[31:24] ;
|
2512 |
|
|
r_min_gnt <= spoci_dat[23:16] ;
|
2513 |
|
|
end
|
2514 |
|
|
end
|
2515 |
|
|
end
|
2516 |
|
|
end
|
2517 |
|
|
|
2518 |
77 |
mihad |
// This signals are synchronous resets for registers, whic occures when asynchronous RESET is '1' or
|
2519 |
|
|
// data '1' is synchronously written into them!
|
2520 |
|
|
reg delete_status_bit15 ;
|
2521 |
|
|
reg delete_status_bit14 ;
|
2522 |
|
|
reg delete_status_bit13 ;
|
2523 |
|
|
reg delete_status_bit12 ;
|
2524 |
|
|
reg delete_status_bit11 ;
|
2525 |
|
|
reg delete_status_bit8 ;
|
2526 |
|
|
reg delete_pci_err_cs_bit8 ;
|
2527 |
|
|
reg delete_wb_err_cs_bit8 ;
|
2528 |
|
|
reg delete_isr_bit4 ;
|
2529 |
|
|
reg delete_isr_bit3 ;
|
2530 |
|
|
reg delete_isr_bit2 ;
|
2531 |
|
|
reg delete_isr_bit1 ;
|
2532 |
|
|
|
2533 |
|
|
// This are aditional register bits, which are resets when their value is '1' !!!
|
2534 |
140 |
mihad |
always@(w_we or w_reg_select_dec or w_conf_data or w_byte_en)
|
2535 |
77 |
mihad |
begin
|
2536 |
132 |
mihad |
// I' is written into, then it also sets signals to '1'
|
2537 |
140 |
mihad |
delete_status_bit15 = w_conf_data[31] & !w_byte_en[3] & w_we & w_reg_select_dec[0] ;
|
2538 |
|
|
delete_status_bit14 = w_conf_data[30] & !w_byte_en[3] & w_we & w_reg_select_dec[0] ;
|
2539 |
|
|
delete_status_bit13 = w_conf_data[29] & !w_byte_en[3] & w_we & w_reg_select_dec[0] ;
|
2540 |
|
|
delete_status_bit12 = w_conf_data[28] & !w_byte_en[3] & w_we & w_reg_select_dec[0] ;
|
2541 |
|
|
delete_status_bit11 = w_conf_data[27] & !w_byte_en[3] & w_we & w_reg_select_dec[0] ;
|
2542 |
|
|
delete_status_bit8 = w_conf_data[24] & !w_byte_en[3] & w_we & w_reg_select_dec[0] ;
|
2543 |
|
|
delete_pci_err_cs_bit8 = w_conf_data[8] & !w_byte_en[1] & w_we & w_reg_select_dec[27] ;
|
2544 |
|
|
delete_wb_err_cs_bit8 = w_conf_data[8] & !w_byte_en[1] & w_we & w_reg_select_dec[50] ;
|
2545 |
|
|
delete_isr_bit4 = w_conf_data[4] & !w_byte_en[0] & w_we & w_reg_select_dec[55] ;
|
2546 |
|
|
delete_isr_bit3 = w_conf_data[3] & !w_byte_en[0] & w_we & w_reg_select_dec[55] ;
|
2547 |
|
|
delete_isr_bit2 = w_conf_data[2] & !w_byte_en[0] & w_we & w_reg_select_dec[55] ;
|
2548 |
|
|
delete_isr_bit1 = w_conf_data[1] & !w_byte_en[0] & w_we & w_reg_select_dec[55] ;
|
2549 |
77 |
mihad |
end
|
2550 |
|
|
|
2551 |
|
|
// STATUS BITS of PCI Header status register
|
2552 |
|
|
`ifdef SYNCHRONEOUS_CLOCK_DOMAINS
|
2553 |
|
|
// Set and clear FF
|
2554 |
|
|
always@(posedge pci_clk or posedge reset)
|
2555 |
|
|
begin
|
2556 |
|
|
if (reset) // Asynchronous reset
|
2557 |
|
|
status_bit15_11[15] <= 1'b0 ;
|
2558 |
|
|
else
|
2559 |
|
|
begin
|
2560 |
|
|
if (perr_in) // Synchronous set
|
2561 |
|
|
status_bit15_11[15] <= 1'b1 ;
|
2562 |
|
|
else if (delete_status_bit15) // Synchronous reset
|
2563 |
|
|
status_bit15_11[15] <= 1'b0 ;
|
2564 |
|
|
end
|
2565 |
|
|
end
|
2566 |
|
|
// Set and clear FF
|
2567 |
|
|
always@(posedge pci_clk or posedge reset)
|
2568 |
|
|
begin
|
2569 |
|
|
if (reset) // Asynchronous reset
|
2570 |
|
|
status_bit15_11[14] <= 1'b0 ;
|
2571 |
|
|
else
|
2572 |
|
|
begin
|
2573 |
|
|
if (serr_in) // Synchronous set
|
2574 |
|
|
status_bit15_11[14] <= 1'b1 ;
|
2575 |
|
|
else if (delete_status_bit14) // Synchronous reset
|
2576 |
|
|
status_bit15_11[14] <= 1'b0 ;
|
2577 |
|
|
end
|
2578 |
|
|
end
|
2579 |
|
|
// Set and clear FF
|
2580 |
|
|
always@(posedge pci_clk or posedge reset)
|
2581 |
|
|
begin
|
2582 |
|
|
if (reset) // Asynchronous reset
|
2583 |
|
|
status_bit15_11[13] <= 1'b0 ;
|
2584 |
|
|
else
|
2585 |
|
|
begin
|
2586 |
|
|
if (master_abort_recv) // Synchronous set
|
2587 |
|
|
status_bit15_11[13] <= 1'b1 ;
|
2588 |
|
|
else if (delete_status_bit13) // Synchronous reset
|
2589 |
|
|
status_bit15_11[13] <= 1'b0 ;
|
2590 |
|
|
end
|
2591 |
|
|
end
|
2592 |
|
|
// Set and clear FF
|
2593 |
|
|
always@(posedge pci_clk or posedge reset)
|
2594 |
|
|
begin
|
2595 |
|
|
if (reset) // Asynchronous reset
|
2596 |
|
|
status_bit15_11[12] <= 1'b0 ;
|
2597 |
|
|
else
|
2598 |
|
|
begin
|
2599 |
|
|
if (target_abort_recv) // Synchronous set
|
2600 |
|
|
status_bit15_11[12] <= 1'b1 ;
|
2601 |
|
|
else if (delete_status_bit12) // Synchronous reset
|
2602 |
|
|
status_bit15_11[12] <= 1'b0 ;
|
2603 |
|
|
end
|
2604 |
|
|
end
|
2605 |
|
|
// Set and clear FF
|
2606 |
|
|
always@(posedge pci_clk or posedge reset)
|
2607 |
|
|
begin
|
2608 |
|
|
if (reset) // Asynchronous reset
|
2609 |
|
|
status_bit15_11[11] <= 1'b0 ;
|
2610 |
|
|
else
|
2611 |
|
|
begin
|
2612 |
|
|
if (target_abort_set) // Synchronous set
|
2613 |
|
|
status_bit15_11[11] <= 1'b1 ;
|
2614 |
|
|
else if (delete_status_bit11) // Synchronous reset
|
2615 |
|
|
status_bit15_11[11] <= 1'b0 ;
|
2616 |
|
|
end
|
2617 |
|
|
end
|
2618 |
|
|
// Set and clear FF
|
2619 |
|
|
always@(posedge pci_clk or posedge reset)
|
2620 |
|
|
begin
|
2621 |
|
|
if (reset) // Asynchronous reset
|
2622 |
|
|
status_bit8 <= 1'b0 ;
|
2623 |
|
|
else
|
2624 |
|
|
begin
|
2625 |
|
|
if (master_data_par_err) // Synchronous set
|
2626 |
|
|
status_bit8 <= 1'b1 ;
|
2627 |
|
|
else if (delete_status_bit8) // Synchronous reset
|
2628 |
|
|
status_bit8 <= 1'b0 ;
|
2629 |
|
|
end
|
2630 |
|
|
end
|
2631 |
|
|
`else // not SYNCHRONEOUS_CLOCK_DOMAINS
|
2632 |
|
|
`ifdef HOST
|
2633 |
|
|
reg [15:11] set_status_bit15_11;
|
2634 |
|
|
reg set_status_bit8;
|
2635 |
|
|
wire delete_set_status_bit15;
|
2636 |
|
|
wire delete_set_status_bit14;
|
2637 |
|
|
wire delete_set_status_bit13;
|
2638 |
|
|
wire delete_set_status_bit12;
|
2639 |
|
|
wire delete_set_status_bit11;
|
2640 |
|
|
wire delete_set_status_bit8;
|
2641 |
|
|
wire block_set_status_bit15;
|
2642 |
|
|
wire block_set_status_bit14;
|
2643 |
|
|
wire block_set_status_bit13;
|
2644 |
|
|
wire block_set_status_bit12;
|
2645 |
|
|
wire block_set_status_bit11;
|
2646 |
|
|
wire block_set_status_bit8;
|
2647 |
|
|
// Synchronization module for clearing FF between two clock domains
|
2648 |
|
|
pci_sync_module sync_status_15
|
2649 |
|
|
(
|
2650 |
|
|
.set_clk_in (pci_clk),
|
2651 |
|
|
.delete_clk_in (wb_clk),
|
2652 |
|
|
.reset_in (reset),
|
2653 |
|
|
.delete_set_out (delete_set_status_bit15),
|
2654 |
|
|
.block_set_out (block_set_status_bit15),
|
2655 |
|
|
.delete_in (delete_status_bit15)
|
2656 |
|
|
);
|
2657 |
|
|
// Setting FF
|
2658 |
|
|
always@(posedge pci_clk or posedge reset)
|
2659 |
|
|
begin
|
2660 |
|
|
if (reset) // Asynchronous reset
|
2661 |
|
|
set_status_bit15_11[15] <= 1'b0 ;
|
2662 |
|
|
else
|
2663 |
|
|
begin
|
2664 |
|
|
if (perr_in) // Synchronous set
|
2665 |
|
|
set_status_bit15_11[15] <= 1'b1 ;
|
2666 |
|
|
else if (delete_set_status_bit15) // Synchronous reset
|
2667 |
|
|
set_status_bit15_11[15] <= 1'b0 ;
|
2668 |
|
|
end
|
2669 |
|
|
end
|
2670 |
|
|
// Synchronization module for clearing FF between two clock domains
|
2671 |
|
|
pci_sync_module sync_status_14
|
2672 |
|
|
(
|
2673 |
|
|
.set_clk_in (pci_clk),
|
2674 |
|
|
.delete_clk_in (wb_clk),
|
2675 |
|
|
.reset_in (reset),
|
2676 |
|
|
.delete_set_out (delete_set_status_bit14),
|
2677 |
|
|
.block_set_out (block_set_status_bit14),
|
2678 |
|
|
.delete_in (delete_status_bit14)
|
2679 |
|
|
);
|
2680 |
|
|
// Setting FF
|
2681 |
|
|
always@(posedge pci_clk or posedge reset)
|
2682 |
|
|
begin
|
2683 |
|
|
if (reset) // Asynchronous reset
|
2684 |
|
|
set_status_bit15_11[14] <= 1'b0 ;
|
2685 |
|
|
else
|
2686 |
|
|
begin
|
2687 |
|
|
if (serr_in) // Synchronous set
|
2688 |
|
|
set_status_bit15_11[14] <= 1'b1 ;
|
2689 |
|
|
else if (delete_set_status_bit14) // Synchronous reset
|
2690 |
|
|
set_status_bit15_11[14] <= 1'b0 ;
|
2691 |
|
|
end
|
2692 |
|
|
end
|
2693 |
|
|
// Synchronization module for clearing FF between two clock domains
|
2694 |
|
|
pci_sync_module sync_status_13
|
2695 |
|
|
(
|
2696 |
|
|
.set_clk_in (pci_clk),
|
2697 |
|
|
.delete_clk_in (wb_clk),
|
2698 |
|
|
.reset_in (reset),
|
2699 |
|
|
.delete_set_out (delete_set_status_bit13),
|
2700 |
|
|
.block_set_out (block_set_status_bit13),
|
2701 |
|
|
.delete_in (delete_status_bit13)
|
2702 |
|
|
);
|
2703 |
|
|
// Setting FF
|
2704 |
|
|
always@(posedge pci_clk or posedge reset)
|
2705 |
|
|
begin
|
2706 |
|
|
if (reset) // Asynchronous reset
|
2707 |
|
|
set_status_bit15_11[13] <= 1'b0 ;
|
2708 |
|
|
else
|
2709 |
|
|
begin
|
2710 |
|
|
if (master_abort_recv) // Synchronous set
|
2711 |
|
|
set_status_bit15_11[13] <= 1'b1 ;
|
2712 |
|
|
else if (delete_set_status_bit13) // Synchronous reset
|
2713 |
|
|
set_status_bit15_11[13] <= 1'b0 ;
|
2714 |
|
|
end
|
2715 |
|
|
end
|
2716 |
|
|
// Synchronization module for clearing FF between two clock domains
|
2717 |
|
|
pci_sync_module sync_status_12
|
2718 |
|
|
(
|
2719 |
|
|
.set_clk_in (pci_clk),
|
2720 |
|
|
.delete_clk_in (wb_clk),
|
2721 |
|
|
.reset_in (reset),
|
2722 |
|
|
.delete_set_out (delete_set_status_bit12),
|
2723 |
|
|
.block_set_out (block_set_status_bit12),
|
2724 |
|
|
.delete_in (delete_status_bit12)
|
2725 |
|
|
);
|
2726 |
|
|
// Setting FF
|
2727 |
|
|
always@(posedge pci_clk or posedge reset)
|
2728 |
|
|
begin
|
2729 |
|
|
if (reset) // Asynchronous reset
|
2730 |
|
|
set_status_bit15_11[12] <= 1'b0 ;
|
2731 |
|
|
else
|
2732 |
|
|
begin
|
2733 |
|
|
if (target_abort_recv) // Synchronous set
|
2734 |
|
|
set_status_bit15_11[12] <= 1'b1 ;
|
2735 |
|
|
else if (delete_set_status_bit12) // Synchronous reset
|
2736 |
|
|
set_status_bit15_11[12] <= 1'b0 ;
|
2737 |
|
|
end
|
2738 |
|
|
end
|
2739 |
|
|
// Synchronization module for clearing FF between two clock domains
|
2740 |
|
|
pci_sync_module sync_status_11
|
2741 |
|
|
(
|
2742 |
|
|
.set_clk_in (pci_clk),
|
2743 |
|
|
.delete_clk_in (wb_clk),
|
2744 |
|
|
.reset_in (reset),
|
2745 |
|
|
.delete_set_out (delete_set_status_bit11),
|
2746 |
|
|
.block_set_out (block_set_status_bit11),
|
2747 |
|
|
.delete_in (delete_status_bit11)
|
2748 |
|
|
);
|
2749 |
|
|
// Setting FF
|
2750 |
|
|
always@(posedge pci_clk or posedge reset)
|
2751 |
|
|
begin
|
2752 |
|
|
if (reset) // Asynchronous reset
|
2753 |
|
|
set_status_bit15_11[11] <= 1'b0 ;
|
2754 |
|
|
else
|
2755 |
|
|
begin
|
2756 |
|
|
if (target_abort_set) // Synchronous set
|
2757 |
|
|
set_status_bit15_11[11] <= 1'b1 ;
|
2758 |
|
|
else if (delete_set_status_bit11) // Synchronous reset
|
2759 |
|
|
set_status_bit15_11[11] <= 1'b0 ;
|
2760 |
|
|
end
|
2761 |
|
|
end
|
2762 |
|
|
// Synchronization module for clearing FF between two clock domains
|
2763 |
|
|
pci_sync_module sync_status_8
|
2764 |
|
|
(
|
2765 |
|
|
.set_clk_in (pci_clk),
|
2766 |
|
|
.delete_clk_in (wb_clk),
|
2767 |
|
|
.reset_in (reset),
|
2768 |
|
|
.delete_set_out (delete_set_status_bit8),
|
2769 |
|
|
.block_set_out (block_set_status_bit8),
|
2770 |
|
|
.delete_in (delete_status_bit8)
|
2771 |
|
|
);
|
2772 |
|
|
// Setting FF
|
2773 |
|
|
always@(posedge pci_clk or posedge reset)
|
2774 |
|
|
begin
|
2775 |
|
|
if (reset) // Asynchronous reset
|
2776 |
|
|
set_status_bit8 <= 1'b0 ;
|
2777 |
|
|
else
|
2778 |
|
|
begin
|
2779 |
|
|
if (master_data_par_err) // Synchronous set
|
2780 |
|
|
set_status_bit8 <= 1'b1 ;
|
2781 |
|
|
else if (delete_set_status_bit8) // Synchronous reset
|
2782 |
|
|
set_status_bit8 <= 1'b0 ;
|
2783 |
|
|
end
|
2784 |
|
|
end
|
2785 |
|
|
wire [5:0] status_bits = {set_status_bit15_11[15] && !block_set_status_bit15,
|
2786 |
|
|
set_status_bit15_11[14] && !block_set_status_bit14,
|
2787 |
|
|
set_status_bit15_11[13] && !block_set_status_bit13,
|
2788 |
|
|
set_status_bit15_11[12] && !block_set_status_bit12,
|
2789 |
|
|
set_status_bit15_11[11] && !block_set_status_bit11,
|
2790 |
|
|
set_status_bit8 && !block_set_status_bit8 } ;
|
2791 |
|
|
wire [5:0] meta_status_bits ;
|
2792 |
|
|
// interemediate stage to clk synchronization flip - flops - this ones are prone to metastability
|
2793 |
111 |
simons |
pci_synchronizer_flop #(6, 0) status_bits_sync
|
2794 |
77 |
mihad |
(
|
2795 |
|
|
.data_in (status_bits),
|
2796 |
|
|
.clk_out (wb_clk),
|
2797 |
|
|
.sync_data_out (meta_status_bits),
|
2798 |
|
|
.async_reset (reset)
|
2799 |
|
|
) ;
|
2800 |
|
|
always@(posedge wb_clk or posedge reset)
|
2801 |
|
|
begin
|
2802 |
|
|
if (reset)
|
2803 |
|
|
begin
|
2804 |
|
|
status_bit15_11[15:11] <= 5'b0 ;
|
2805 |
|
|
status_bit8 <= 1'b0 ;
|
2806 |
|
|
end
|
2807 |
|
|
else
|
2808 |
|
|
begin
|
2809 |
|
|
status_bit15_11[15:11] <= meta_status_bits[5:1] ;
|
2810 |
|
|
status_bit8 <= meta_status_bits[0] ;
|
2811 |
|
|
end
|
2812 |
|
|
end
|
2813 |
|
|
`else // GUEST
|
2814 |
|
|
// Set and clear FF
|
2815 |
|
|
always@(posedge pci_clk or posedge reset)
|
2816 |
|
|
begin
|
2817 |
|
|
if (reset) // Asynchronous reset
|
2818 |
|
|
status_bit15_11[15] <= 1'b0 ;
|
2819 |
|
|
else
|
2820 |
|
|
begin
|
2821 |
|
|
if (perr_in) // Synchronous set
|
2822 |
|
|
status_bit15_11[15] <= 1'b1 ;
|
2823 |
|
|
else if (delete_status_bit15) // Synchronous reset
|
2824 |
|
|
status_bit15_11[15] <= 1'b0 ;
|
2825 |
|
|
end
|
2826 |
|
|
end
|
2827 |
|
|
// Set and clear FF
|
2828 |
|
|
always@(posedge pci_clk or posedge reset)
|
2829 |
|
|
begin
|
2830 |
|
|
if (reset) // Asynchronous reset
|
2831 |
|
|
status_bit15_11[14] <= 1'b0 ;
|
2832 |
|
|
else
|
2833 |
|
|
begin
|
2834 |
|
|
if (serr_in) // Synchronous set
|
2835 |
|
|
status_bit15_11[14] <= 1'b1 ;
|
2836 |
|
|
else if (delete_status_bit14) // Synchronous reset
|
2837 |
|
|
status_bit15_11[14] <= 1'b0 ;
|
2838 |
|
|
end
|
2839 |
|
|
end
|
2840 |
|
|
// Set and clear FF
|
2841 |
|
|
always@(posedge pci_clk or posedge reset)
|
2842 |
|
|
begin
|
2843 |
|
|
if (reset) // Asynchronous reset
|
2844 |
|
|
status_bit15_11[13] <= 1'b0 ;
|
2845 |
|
|
else
|
2846 |
|
|
begin
|
2847 |
|
|
if (master_abort_recv) // Synchronous set
|
2848 |
|
|
status_bit15_11[13] <= 1'b1 ;
|
2849 |
|
|
else if (delete_status_bit13) // Synchronous reset
|
2850 |
|
|
status_bit15_11[13] <= 1'b0 ;
|
2851 |
|
|
end
|
2852 |
|
|
end
|
2853 |
|
|
// Set and clear FF
|
2854 |
|
|
always@(posedge pci_clk or posedge reset)
|
2855 |
|
|
begin
|
2856 |
|
|
if (reset) // Asynchronous reset
|
2857 |
|
|
status_bit15_11[12] <= 1'b0 ;
|
2858 |
|
|
else
|
2859 |
|
|
begin
|
2860 |
|
|
if (target_abort_recv) // Synchronous set
|
2861 |
|
|
status_bit15_11[12] <= 1'b1 ;
|
2862 |
|
|
else if (delete_status_bit12) // Synchronous reset
|
2863 |
|
|
status_bit15_11[12] <= 1'b0 ;
|
2864 |
|
|
end
|
2865 |
|
|
end
|
2866 |
|
|
// Set and clear FF
|
2867 |
|
|
always@(posedge pci_clk or posedge reset)
|
2868 |
|
|
begin
|
2869 |
|
|
if (reset) // Asynchronous reset
|
2870 |
|
|
status_bit15_11[11] <= 1'b0 ;
|
2871 |
|
|
else
|
2872 |
|
|
begin
|
2873 |
|
|
if (target_abort_set) // Synchronous set
|
2874 |
|
|
status_bit15_11[11] <= 1'b1 ;
|
2875 |
|
|
else if (delete_status_bit11) // Synchronous reset
|
2876 |
|
|
status_bit15_11[11] <= 1'b0 ;
|
2877 |
|
|
end
|
2878 |
|
|
end
|
2879 |
|
|
// Set and clear FF
|
2880 |
|
|
always@(posedge pci_clk or posedge reset)
|
2881 |
|
|
begin
|
2882 |
|
|
if (reset) // Asynchronous reset
|
2883 |
|
|
status_bit8 <= 1'b0 ;
|
2884 |
|
|
else
|
2885 |
|
|
begin
|
2886 |
|
|
if (master_data_par_err) // Synchronous set
|
2887 |
|
|
status_bit8 <= 1'b1 ;
|
2888 |
|
|
else if (delete_status_bit8) // Synchronous reset
|
2889 |
|
|
status_bit8 <= 1'b0 ;
|
2890 |
|
|
end
|
2891 |
|
|
end
|
2892 |
|
|
`endif
|
2893 |
|
|
`endif
|
2894 |
|
|
|
2895 |
|
|
// STATUS BITS of P_ERR_CS - PCI error control and status register
|
2896 |
|
|
`ifdef SYNCHRONEOUS_CLOCK_DOMAINS
|
2897 |
|
|
// Set and clear FF
|
2898 |
|
|
always@(posedge pci_clk or posedge reset)
|
2899 |
|
|
begin
|
2900 |
|
|
if (reset) // Asynchronous reset
|
2901 |
|
|
pci_err_cs_bit8 <= 1'b0 ;
|
2902 |
|
|
else
|
2903 |
|
|
begin
|
2904 |
|
|
if (pci_error_sig && pci_err_cs_bit0) // Synchronous set
|
2905 |
|
|
pci_err_cs_bit8 <= 1'b1 ;
|
2906 |
|
|
else if (delete_pci_err_cs_bit8) // Synchronous reset
|
2907 |
|
|
pci_err_cs_bit8 <= 1'b0 ;
|
2908 |
|
|
end
|
2909 |
|
|
end
|
2910 |
|
|
`else // not SYNCHRONEOUS_CLOCK_DOMAINS
|
2911 |
|
|
`ifdef HOST
|
2912 |
|
|
// Set and clear FF
|
2913 |
|
|
always@(posedge wb_clk or posedge reset)
|
2914 |
|
|
begin
|
2915 |
|
|
if (reset) // Asynchronous reset
|
2916 |
|
|
pci_err_cs_bit8 <= 1'b0 ;
|
2917 |
|
|
else
|
2918 |
|
|
begin
|
2919 |
|
|
if (pci_error_sig && pci_err_cs_bit0) // Synchronous set
|
2920 |
|
|
pci_err_cs_bit8 <= 1'b1 ;
|
2921 |
|
|
else if (delete_pci_err_cs_bit8) // Synchronous reset
|
2922 |
|
|
pci_err_cs_bit8 <= 1'b0 ;
|
2923 |
|
|
end
|
2924 |
|
|
end
|
2925 |
|
|
`else // GUEST
|
2926 |
|
|
reg set_pci_err_cs_bit8;
|
2927 |
|
|
wire delete_set_pci_err_cs_bit8;
|
2928 |
|
|
wire block_set_pci_err_cs_bit8;
|
2929 |
|
|
// Synchronization module for clearing FF between two clock domains
|
2930 |
|
|
pci_sync_module sync_pci_err_cs_8
|
2931 |
|
|
(
|
2932 |
|
|
.set_clk_in (wb_clk),
|
2933 |
|
|
.delete_clk_in (pci_clk),
|
2934 |
|
|
.reset_in (reset),
|
2935 |
|
|
.delete_set_out (delete_set_pci_err_cs_bit8),
|
2936 |
|
|
.block_set_out (block_set_pci_err_cs_bit8),
|
2937 |
|
|
.delete_in (delete_pci_err_cs_bit8)
|
2938 |
|
|
);
|
2939 |
|
|
// Setting FF
|
2940 |
|
|
always@(posedge wb_clk or posedge reset)
|
2941 |
|
|
begin
|
2942 |
|
|
if (reset) // Asynchronous reset
|
2943 |
|
|
set_pci_err_cs_bit8 <= 1'b0 ;
|
2944 |
|
|
else
|
2945 |
|
|
begin
|
2946 |
|
|
if (pci_error_sig && pci_err_cs_bit0) // Synchronous set
|
2947 |
|
|
set_pci_err_cs_bit8 <= 1'b1 ;
|
2948 |
|
|
else if (delete_set_pci_err_cs_bit8) // Synchronous reset
|
2949 |
|
|
set_pci_err_cs_bit8 <= 1'b0 ;
|
2950 |
|
|
end
|
2951 |
|
|
end
|
2952 |
|
|
wire pci_err_cs_bits = set_pci_err_cs_bit8 && !block_set_pci_err_cs_bit8 ;
|
2953 |
|
|
wire meta_pci_err_cs_bits ;
|
2954 |
|
|
// interemediate stage to clk synchronization flip - flops - this ones are prone to metastability
|
2955 |
111 |
simons |
pci_synchronizer_flop #(1,0) pci_err_cs_bits_sync
|
2956 |
77 |
mihad |
(
|
2957 |
|
|
.data_in (pci_err_cs_bits),
|
2958 |
|
|
.clk_out (pci_clk),
|
2959 |
|
|
.sync_data_out (meta_pci_err_cs_bits),
|
2960 |
|
|
.async_reset (reset)
|
2961 |
|
|
) ;
|
2962 |
|
|
always@(posedge pci_clk or posedge reset)
|
2963 |
|
|
begin
|
2964 |
|
|
if (reset)
|
2965 |
|
|
pci_err_cs_bit8 <= 1'b0 ;
|
2966 |
|
|
else
|
2967 |
|
|
pci_err_cs_bit8 <= meta_pci_err_cs_bits ;
|
2968 |
|
|
end
|
2969 |
|
|
`endif
|
2970 |
|
|
`endif
|
2971 |
|
|
// Set and clear FF
|
2972 |
|
|
always@(posedge wb_clk or posedge reset)
|
2973 |
|
|
begin
|
2974 |
|
|
if (reset) // Asynchronous reset
|
2975 |
|
|
pci_err_cs_bit10 <= 1'b0 ;
|
2976 |
|
|
else
|
2977 |
|
|
begin
|
2978 |
|
|
if (pci_error_sig) // Synchronous report
|
2979 |
|
|
pci_err_cs_bit10 <= pci_error_rty_exp ;
|
2980 |
|
|
end
|
2981 |
|
|
end
|
2982 |
|
|
// Set and clear FF
|
2983 |
|
|
always@(posedge wb_clk or posedge reset)
|
2984 |
|
|
begin
|
2985 |
|
|
if (reset) // Asynchronous reset
|
2986 |
|
|
pci_err_cs_bit9 <= 1'b0 ;
|
2987 |
|
|
else
|
2988 |
|
|
begin
|
2989 |
|
|
if (pci_error_sig) // Synchronous report
|
2990 |
|
|
pci_err_cs_bit9 <= pci_error_es ;
|
2991 |
|
|
end
|
2992 |
|
|
end
|
2993 |
|
|
// Set and clear FF
|
2994 |
|
|
always@(posedge wb_clk or posedge reset)
|
2995 |
|
|
begin
|
2996 |
|
|
if (reset) // Asynchronous reset
|
2997 |
|
|
begin
|
2998 |
|
|
pci_err_cs_bit31_24 <= 8'h00 ;
|
2999 |
|
|
pci_err_addr <= 32'h0000_0000 ;
|
3000 |
|
|
pci_err_data <= 32'h0000_0000 ;
|
3001 |
|
|
end
|
3002 |
|
|
else
|
3003 |
|
|
if (pci_error_sig) // Synchronous report
|
3004 |
|
|
begin
|
3005 |
|
|
pci_err_cs_bit31_24 <= { pci_error_be, pci_error_bc } ;
|
3006 |
|
|
pci_err_addr <= pci_error_addr ;
|
3007 |
|
|
pci_err_data <= pci_error_data ;
|
3008 |
|
|
end
|
3009 |
|
|
end
|
3010 |
|
|
|
3011 |
|
|
// STATUS BITS of W_ERR_CS - WB error control and status register
|
3012 |
|
|
`ifdef SYNCHRONEOUS_CLOCK_DOMAINS
|
3013 |
|
|
// Set and clear FF
|
3014 |
|
|
always@(posedge pci_clk or posedge reset)
|
3015 |
|
|
begin
|
3016 |
|
|
if (reset) // Asynchronous reset
|
3017 |
|
|
wb_err_cs_bit8 <= 1'b0 ;
|
3018 |
|
|
else
|
3019 |
|
|
begin
|
3020 |
|
|
if (wb_error_sig && wb_err_cs_bit0) // Synchronous set
|
3021 |
|
|
wb_err_cs_bit8 <= 1'b1 ;
|
3022 |
|
|
else if (delete_wb_err_cs_bit8) // Synchronous reset
|
3023 |
|
|
wb_err_cs_bit8 <= 1'b0 ;
|
3024 |
|
|
end
|
3025 |
|
|
end
|
3026 |
|
|
`else // not SYNCHRONEOUS_CLOCK_DOMAINS
|
3027 |
|
|
`ifdef HOST
|
3028 |
|
|
reg set_wb_err_cs_bit8;
|
3029 |
|
|
wire delete_set_wb_err_cs_bit8;
|
3030 |
|
|
wire block_set_wb_err_cs_bit8;
|
3031 |
|
|
// Synchronization module for clearing FF between two clock domains
|
3032 |
|
|
pci_sync_module sync_wb_err_cs_8
|
3033 |
|
|
(
|
3034 |
|
|
.set_clk_in (pci_clk),
|
3035 |
|
|
.delete_clk_in (wb_clk),
|
3036 |
|
|
.reset_in (reset),
|
3037 |
|
|
.delete_set_out (delete_set_wb_err_cs_bit8),
|
3038 |
|
|
.block_set_out (block_set_wb_err_cs_bit8),
|
3039 |
|
|
.delete_in (delete_wb_err_cs_bit8)
|
3040 |
|
|
);
|
3041 |
|
|
// Setting FF
|
3042 |
|
|
always@(posedge pci_clk or posedge reset)
|
3043 |
|
|
begin
|
3044 |
|
|
if (reset) // Asynchronous reset
|
3045 |
|
|
set_wb_err_cs_bit8 <= 1'b0 ;
|
3046 |
|
|
else
|
3047 |
|
|
begin
|
3048 |
|
|
if (wb_error_sig && wb_err_cs_bit0) // Synchronous set
|
3049 |
|
|
set_wb_err_cs_bit8 <= 1'b1 ;
|
3050 |
|
|
else if (delete_set_wb_err_cs_bit8) // Synchronous reset
|
3051 |
|
|
set_wb_err_cs_bit8 <= 1'b0 ;
|
3052 |
|
|
end
|
3053 |
|
|
end
|
3054 |
|
|
wire wb_err_cs_bits = set_wb_err_cs_bit8 && !block_set_wb_err_cs_bit8 ;
|
3055 |
|
|
wire meta_wb_err_cs_bits ;
|
3056 |
|
|
// interemediate stage to clk synchronization flip - flops - this ones are prone to metastability
|
3057 |
111 |
simons |
pci_synchronizer_flop #(1,0) wb_err_cs_bits_sync
|
3058 |
77 |
mihad |
(
|
3059 |
|
|
.data_in (wb_err_cs_bits),
|
3060 |
|
|
.clk_out (wb_clk),
|
3061 |
|
|
.sync_data_out (meta_wb_err_cs_bits),
|
3062 |
|
|
.async_reset (reset)
|
3063 |
|
|
) ;
|
3064 |
|
|
always@(posedge wb_clk or posedge reset)
|
3065 |
|
|
begin
|
3066 |
|
|
if (reset)
|
3067 |
|
|
wb_err_cs_bit8 <= 1'b0 ;
|
3068 |
|
|
else
|
3069 |
|
|
wb_err_cs_bit8 <= meta_wb_err_cs_bits ;
|
3070 |
|
|
end
|
3071 |
|
|
`else // GUEST
|
3072 |
|
|
// Set and clear FF
|
3073 |
|
|
always@(posedge pci_clk or posedge reset)
|
3074 |
|
|
begin
|
3075 |
|
|
if (reset) // Asynchronous reset
|
3076 |
|
|
wb_err_cs_bit8 <= 1'b0 ;
|
3077 |
|
|
else
|
3078 |
|
|
begin
|
3079 |
|
|
if (wb_error_sig && wb_err_cs_bit0) // Synchronous set
|
3080 |
|
|
wb_err_cs_bit8 <= 1'b1 ;
|
3081 |
|
|
else if (delete_wb_err_cs_bit8) // Synchronous reset
|
3082 |
|
|
wb_err_cs_bit8 <= 1'b0 ;
|
3083 |
|
|
end
|
3084 |
|
|
end
|
3085 |
|
|
`endif
|
3086 |
|
|
`endif
|
3087 |
|
|
/* // Set and clear FF
|
3088 |
|
|
always@(posedge pci_clk or posedge reset)
|
3089 |
|
|
begin
|
3090 |
|
|
if (reset) // Asynchronous reset
|
3091 |
|
|
wb_err_cs_bit10 <= 1'b0 ;
|
3092 |
|
|
else
|
3093 |
|
|
begin
|
3094 |
|
|
if (wb_error_sig) // Synchronous report
|
3095 |
|
|
wb_err_cs_bit10 <= wb_error_rty_exp ;
|
3096 |
|
|
end
|
3097 |
|
|
end */
|
3098 |
|
|
// Set and clear FF
|
3099 |
|
|
always@(posedge pci_clk or posedge reset)
|
3100 |
|
|
begin
|
3101 |
|
|
if (reset) // Asynchronous reset
|
3102 |
|
|
wb_err_cs_bit9 <= 1'b0 ;
|
3103 |
|
|
else
|
3104 |
|
|
begin
|
3105 |
|
|
if (wb_error_sig) // Synchronous report
|
3106 |
|
|
wb_err_cs_bit9 <= wb_error_es ;
|
3107 |
|
|
end
|
3108 |
|
|
end
|
3109 |
|
|
// Set and clear FF
|
3110 |
|
|
always@(posedge pci_clk or posedge reset)
|
3111 |
|
|
begin
|
3112 |
|
|
if (reset) // Asynchronous reset
|
3113 |
|
|
begin
|
3114 |
|
|
wb_err_cs_bit31_24 <= 8'h00 ;
|
3115 |
|
|
wb_err_addr <= 32'h0000_0000 ;
|
3116 |
|
|
wb_err_data <= 32'h0000_0000 ;
|
3117 |
|
|
end
|
3118 |
|
|
else
|
3119 |
|
|
if (wb_error_sig)
|
3120 |
|
|
begin
|
3121 |
|
|
wb_err_cs_bit31_24 <= { wb_error_be, wb_error_bc } ;
|
3122 |
|
|
wb_err_addr <= wb_error_addr ;
|
3123 |
|
|
wb_err_data <= wb_error_data ;
|
3124 |
|
|
end
|
3125 |
|
|
end
|
3126 |
|
|
|
3127 |
|
|
// SERR_INT and PERR_INT STATUS BITS of ISR - interrupt status register
|
3128 |
|
|
`ifdef SYNCHRONEOUS_CLOCK_DOMAINS
|
3129 |
|
|
`ifdef HOST
|
3130 |
|
|
// Set and clear FF
|
3131 |
|
|
always@(posedge pci_clk or posedge reset)
|
3132 |
|
|
begin
|
3133 |
|
|
if (reset) // Asynchronous reset
|
3134 |
|
|
isr_bit4_3[4] <= 1'b0 ;
|
3135 |
|
|
else
|
3136 |
|
|
begin
|
3137 |
|
|
if (isr_sys_err_int && icr_bit4_3[4]) // Synchronous set
|
3138 |
|
|
isr_bit4_3[4] <= 1'b1 ;
|
3139 |
|
|
else if (delete_isr_bit4) // Synchronous reset
|
3140 |
|
|
isr_bit4_3[4] <= 1'b0 ;
|
3141 |
|
|
end
|
3142 |
|
|
end
|
3143 |
|
|
// Set and clear FF
|
3144 |
|
|
always@(posedge pci_clk or posedge reset)
|
3145 |
|
|
begin
|
3146 |
|
|
if (reset) // Asynchronous reset
|
3147 |
|
|
isr_bit4_3[3] <= 1'b0 ;
|
3148 |
|
|
else
|
3149 |
|
|
begin
|
3150 |
|
|
if (isr_par_err_int && icr_bit4_3[3]) // Synchronous set
|
3151 |
|
|
isr_bit4_3[3] <= 1'b1 ;
|
3152 |
|
|
else if (delete_isr_bit3) // Synchronous reset
|
3153 |
|
|
isr_bit4_3[3] <= 1'b0 ;
|
3154 |
|
|
end
|
3155 |
|
|
end
|
3156 |
|
|
`endif
|
3157 |
|
|
`else // not SYNCHRONEOUS_CLOCK_DOMAINS
|
3158 |
|
|
`ifdef HOST
|
3159 |
|
|
reg [4:3] set_isr_bit4_3;
|
3160 |
|
|
wire delete_set_isr_bit4;
|
3161 |
|
|
wire delete_set_isr_bit3;
|
3162 |
|
|
wire block_set_isr_bit4;
|
3163 |
|
|
wire block_set_isr_bit3;
|
3164 |
|
|
// Synchronization module for clearing FF between two clock domains
|
3165 |
|
|
pci_sync_module sync_isr_4
|
3166 |
|
|
(
|
3167 |
|
|
.set_clk_in (pci_clk),
|
3168 |
|
|
.delete_clk_in (wb_clk),
|
3169 |
|
|
.reset_in (reset),
|
3170 |
|
|
.delete_set_out (delete_set_isr_bit4),
|
3171 |
|
|
.block_set_out (block_set_isr_bit4),
|
3172 |
|
|
.delete_in (delete_isr_bit4)
|
3173 |
|
|
);
|
3174 |
|
|
// Setting FF
|
3175 |
|
|
always@(posedge pci_clk or posedge reset)
|
3176 |
|
|
begin
|
3177 |
|
|
if (reset) // Asynchronous reset
|
3178 |
|
|
set_isr_bit4_3[4] <= 1'b0 ;
|
3179 |
|
|
else
|
3180 |
|
|
begin
|
3181 |
|
|
if (isr_sys_err_int && icr_bit4_3[4]) // Synchronous set
|
3182 |
|
|
set_isr_bit4_3[4] <= 1'b1 ;
|
3183 |
|
|
else if (delete_set_isr_bit4) // Synchronous reset
|
3184 |
|
|
set_isr_bit4_3[4] <= 1'b0 ;
|
3185 |
|
|
end
|
3186 |
|
|
end
|
3187 |
|
|
// Synchronization module for clearing FF between two clock domains
|
3188 |
|
|
pci_sync_module sync_isr_3
|
3189 |
|
|
(
|
3190 |
|
|
.set_clk_in (pci_clk),
|
3191 |
|
|
.delete_clk_in (wb_clk),
|
3192 |
|
|
.reset_in (reset),
|
3193 |
|
|
.delete_set_out (delete_set_isr_bit3),
|
3194 |
|
|
.block_set_out (block_set_isr_bit3),
|
3195 |
|
|
.delete_in (delete_isr_bit3)
|
3196 |
|
|
);
|
3197 |
|
|
// Setting FF
|
3198 |
|
|
always@(posedge pci_clk or posedge reset)
|
3199 |
|
|
begin
|
3200 |
|
|
if (reset) // Asynchronous reset
|
3201 |
|
|
set_isr_bit4_3[3] <= 1'b0 ;
|
3202 |
|
|
else
|
3203 |
|
|
begin
|
3204 |
|
|
if (isr_par_err_int && icr_bit4_3[3]) // Synchronous set
|
3205 |
|
|
set_isr_bit4_3[3] <= 1'b1 ;
|
3206 |
|
|
else if (delete_set_isr_bit3) // Synchronous reset
|
3207 |
|
|
set_isr_bit4_3[3] <= 1'b0 ;
|
3208 |
|
|
end
|
3209 |
|
|
end
|
3210 |
|
|
wire [4:3] isr_bits4_3 = {set_isr_bit4_3[4] && !block_set_isr_bit4,
|
3211 |
|
|
set_isr_bit4_3[3] && !block_set_isr_bit3 } ;
|
3212 |
|
|
wire [4:3] meta_isr_bits4_3 ;
|
3213 |
|
|
// interemediate stage to clk synchronization flip - flops - this ones are prone to metastability
|
3214 |
111 |
simons |
pci_synchronizer_flop #(2, 0) isr_bits_sync
|
3215 |
77 |
mihad |
(
|
3216 |
|
|
.data_in (isr_bits4_3),
|
3217 |
|
|
.clk_out (wb_clk),
|
3218 |
|
|
.sync_data_out (meta_isr_bits4_3),
|
3219 |
|
|
.async_reset (reset)
|
3220 |
|
|
) ;
|
3221 |
|
|
always@(posedge wb_clk or posedge reset)
|
3222 |
|
|
begin
|
3223 |
|
|
if (reset)
|
3224 |
|
|
isr_bit4_3[4:3] <= 2'b0 ;
|
3225 |
|
|
else
|
3226 |
|
|
isr_bit4_3[4:3] <= meta_isr_bits4_3[4:3] ;
|
3227 |
|
|
end
|
3228 |
|
|
`endif
|
3229 |
|
|
`endif
|
3230 |
|
|
|
3231 |
|
|
// PCI_EINT and WB_EINT STATUS BITS of ISR - interrupt status register
|
3232 |
|
|
`ifdef SYNCHRONEOUS_CLOCK_DOMAINS
|
3233 |
|
|
// WB_EINT STATUS BIT
|
3234 |
|
|
// Set and clear FF
|
3235 |
|
|
always@(posedge pci_clk or posedge reset)
|
3236 |
|
|
begin
|
3237 |
|
|
if (reset) // Asynchronous reset
|
3238 |
|
|
isr_bit2_0[1] <= 1'b0 ;
|
3239 |
|
|
else
|
3240 |
|
|
begin
|
3241 |
|
|
if (wb_error_sig && icr_bit2_0[1] && wb_err_cs_bit0) // Synchronous set
|
3242 |
|
|
isr_bit2_0[1] <= 1'b1 ;
|
3243 |
|
|
else if (delete_isr_bit1) // Synchronous reset
|
3244 |
|
|
isr_bit2_0[1] <= 1'b0 ;
|
3245 |
|
|
end
|
3246 |
|
|
end
|
3247 |
|
|
// PCI_EINT STATUS BIT
|
3248 |
|
|
// Set and clear FF
|
3249 |
|
|
always@(posedge pci_clk or posedge reset)
|
3250 |
|
|
begin
|
3251 |
|
|
if (reset) // Asynchronous reset
|
3252 |
|
|
isr_bit2_0[2] <= 1'b0 ;
|
3253 |
|
|
else
|
3254 |
|
|
begin
|
3255 |
|
|
if (pci_error_sig && icr_bit2_0[2] && pci_err_cs_bit0) // Synchronous set
|
3256 |
|
|
isr_bit2_0[2] <= 1'b1 ;
|
3257 |
|
|
else if (delete_isr_bit2) // Synchronous reset
|
3258 |
|
|
isr_bit2_0[2] <= 1'b0 ;
|
3259 |
|
|
end
|
3260 |
|
|
end
|
3261 |
|
|
`else // not SYNCHRONEOUS_CLOCK_DOMAINS
|
3262 |
|
|
`ifdef HOST
|
3263 |
|
|
// WB_EINT STATUS BIT
|
3264 |
|
|
reg set_isr_bit1;
|
3265 |
|
|
wire delete_set_isr_bit1;
|
3266 |
|
|
wire block_set_isr_bit1;
|
3267 |
|
|
// Synchronization module for clearing FF between two clock domains
|
3268 |
|
|
pci_sync_module sync_isr_1
|
3269 |
|
|
(
|
3270 |
|
|
.set_clk_in (pci_clk),
|
3271 |
|
|
.delete_clk_in (wb_clk),
|
3272 |
|
|
.reset_in (reset),
|
3273 |
|
|
.delete_set_out (delete_set_isr_bit1),
|
3274 |
|
|
.block_set_out (block_set_isr_bit1),
|
3275 |
|
|
.delete_in (delete_isr_bit1)
|
3276 |
|
|
);
|
3277 |
|
|
// Setting FF
|
3278 |
|
|
always@(posedge pci_clk or posedge reset)
|
3279 |
|
|
begin
|
3280 |
|
|
if (reset) // Asynchronous reset
|
3281 |
|
|
set_isr_bit1 <= 1'b0 ;
|
3282 |
|
|
else
|
3283 |
|
|
begin
|
3284 |
|
|
if (wb_error_sig && icr_bit2_0[1] && wb_err_cs_bit0) // Synchronous set
|
3285 |
|
|
set_isr_bit1 <= 1'b1 ;
|
3286 |
|
|
else if (delete_set_isr_bit1) // Synchronous reset
|
3287 |
|
|
set_isr_bit1 <= 1'b0 ;
|
3288 |
|
|
end
|
3289 |
|
|
end
|
3290 |
|
|
wire isr_bit1 = set_isr_bit1 && !block_set_isr_bit1 ;
|
3291 |
|
|
wire meta_isr_bit1 ;
|
3292 |
|
|
// interemediate stage to clk synchronization flip - flops - this ones are prone to metastability
|
3293 |
111 |
simons |
pci_synchronizer_flop #(1, 0) isr_bit1_sync
|
3294 |
77 |
mihad |
(
|
3295 |
|
|
.data_in (isr_bit1),
|
3296 |
|
|
.clk_out (wb_clk),
|
3297 |
|
|
.sync_data_out (meta_isr_bit1),
|
3298 |
|
|
.async_reset (reset)
|
3299 |
|
|
) ;
|
3300 |
|
|
always@(posedge wb_clk or posedge reset)
|
3301 |
|
|
begin
|
3302 |
|
|
if (reset)
|
3303 |
|
|
isr_bit2_0[1] <= 1'b0 ;
|
3304 |
|
|
else
|
3305 |
|
|
isr_bit2_0[1] <= meta_isr_bit1 ;
|
3306 |
|
|
end
|
3307 |
|
|
// PCI_EINT STATUS BIT
|
3308 |
|
|
// Set and clear FF
|
3309 |
|
|
always@(posedge wb_clk or posedge reset)
|
3310 |
|
|
begin
|
3311 |
|
|
if (reset) // Asynchronous reset
|
3312 |
|
|
isr_bit2_0[2] <= 1'b0 ;
|
3313 |
|
|
else
|
3314 |
|
|
begin
|
3315 |
|
|
if (pci_error_sig && icr_bit2_0[2] && pci_err_cs_bit0) // Synchronous set
|
3316 |
|
|
isr_bit2_0[2] <= 1'b1 ;
|
3317 |
|
|
else if (delete_isr_bit2) // Synchronous reset
|
3318 |
|
|
isr_bit2_0[2] <= 1'b0 ;
|
3319 |
|
|
end
|
3320 |
|
|
end
|
3321 |
|
|
`else // GUEST
|
3322 |
|
|
// WB_EINT STATUS BIT
|
3323 |
|
|
// Set and clear FF
|
3324 |
|
|
always@(posedge pci_clk or posedge reset)
|
3325 |
|
|
begin
|
3326 |
|
|
if (reset) // Asynchronous reset
|
3327 |
|
|
isr_bit2_0[1] <= 1'b0 ;
|
3328 |
|
|
else
|
3329 |
|
|
begin
|
3330 |
|
|
if (wb_error_sig && icr_bit2_0[1] && wb_err_cs_bit0) // Synchronous set
|
3331 |
|
|
isr_bit2_0[1] <= 1'b1 ;
|
3332 |
|
|
else if (delete_isr_bit1) // Synchronous reset
|
3333 |
|
|
isr_bit2_0[1] <= 1'b0 ;
|
3334 |
|
|
end
|
3335 |
|
|
end
|
3336 |
|
|
// PCI_EINT STATUS BIT
|
3337 |
|
|
reg set_isr_bit2;
|
3338 |
|
|
wire delete_set_isr_bit2;
|
3339 |
|
|
wire block_set_isr_bit2;
|
3340 |
|
|
// Synchronization module for clearing FF between two clock domains
|
3341 |
|
|
pci_sync_module sync_isr_2
|
3342 |
|
|
(
|
3343 |
|
|
.set_clk_in (wb_clk),
|
3344 |
|
|
.delete_clk_in (pci_clk),
|
3345 |
|
|
.reset_in (reset),
|
3346 |
|
|
.delete_set_out (delete_set_isr_bit2),
|
3347 |
|
|
.block_set_out (block_set_isr_bit2),
|
3348 |
|
|
.delete_in (delete_isr_bit2)
|
3349 |
|
|
);
|
3350 |
|
|
// Setting FF
|
3351 |
|
|
always@(posedge wb_clk or posedge reset)
|
3352 |
|
|
begin
|
3353 |
|
|
if (reset) // Asynchronous reset
|
3354 |
|
|
set_isr_bit2 <= 1'b0 ;
|
3355 |
|
|
else
|
3356 |
|
|
begin
|
3357 |
|
|
if (pci_error_sig && icr_bit2_0[2] && pci_err_cs_bit0) // Synchronous set
|
3358 |
|
|
set_isr_bit2 <= 1'b1 ;
|
3359 |
|
|
else if (delete_set_isr_bit2) // Synchronous reset
|
3360 |
|
|
set_isr_bit2 <= 1'b0 ;
|
3361 |
|
|
end
|
3362 |
|
|
end
|
3363 |
|
|
wire isr_bit2 = set_isr_bit2 && !block_set_isr_bit2 ;
|
3364 |
|
|
wire meta_isr_bit2 ;
|
3365 |
|
|
// interemediate stage to clk synchronization flip - flops - this ones are prone to metastability
|
3366 |
111 |
simons |
pci_synchronizer_flop #(1, 0) isr_bit2_sync
|
3367 |
77 |
mihad |
(
|
3368 |
|
|
.data_in (isr_bit2),
|
3369 |
|
|
.clk_out (pci_clk),
|
3370 |
|
|
.sync_data_out (meta_isr_bit2),
|
3371 |
|
|
.async_reset (reset)
|
3372 |
|
|
) ;
|
3373 |
|
|
always@(posedge pci_clk or posedge reset)
|
3374 |
|
|
begin
|
3375 |
|
|
if (reset)
|
3376 |
|
|
isr_bit2_0[2] <= 1'b0 ;
|
3377 |
|
|
else
|
3378 |
|
|
isr_bit2_0[2] <= meta_isr_bit2 ;
|
3379 |
|
|
end
|
3380 |
|
|
`endif
|
3381 |
|
|
`endif
|
3382 |
|
|
|
3383 |
|
|
// INT BIT of ISR - interrupt status register
|
3384 |
|
|
`ifdef HOST
|
3385 |
|
|
wire isr_int_prop_bit = isr_int_prop && icr_bit2_0[0] ;
|
3386 |
|
|
wire meta_isr_int_prop_bit ;
|
3387 |
|
|
// interemediate stage to clk synchronization flip - flops - this ones are prone to metastability
|
3388 |
111 |
simons |
pci_synchronizer_flop #(1, 0) isr_bit0_sync
|
3389 |
77 |
mihad |
(
|
3390 |
|
|
.data_in (isr_int_prop_bit),
|
3391 |
|
|
.clk_out (wb_clk),
|
3392 |
|
|
.sync_data_out (meta_isr_int_prop_bit),
|
3393 |
|
|
.async_reset (reset)
|
3394 |
|
|
) ;
|
3395 |
|
|
always@(posedge wb_clk or posedge reset)
|
3396 |
|
|
begin
|
3397 |
|
|
if (reset)
|
3398 |
|
|
isr_bit2_0[0] <= 1'b0 ;
|
3399 |
|
|
else
|
3400 |
|
|
isr_bit2_0[0] <= meta_isr_int_prop_bit ;
|
3401 |
|
|
end
|
3402 |
|
|
`else // GUEST
|
3403 |
|
|
`ifdef SYNCHRONEOUS_CLOCK_DOMAINS
|
3404 |
|
|
wire isr_int_prop_bit = isr_int_prop && icr_bit2_0[0] ;
|
3405 |
|
|
always@(posedge pci_clk or posedge reset)
|
3406 |
|
|
begin
|
3407 |
|
|
if (reset)
|
3408 |
|
|
isr_bit2_0[0] <= 1'b0 ;
|
3409 |
|
|
else
|
3410 |
|
|
isr_bit2_0[0] <= isr_int_prop_bit ;
|
3411 |
|
|
end
|
3412 |
|
|
`else // not SYNCHRONEOUS_CLOCK_DOMAINS
|
3413 |
|
|
wire isr_int_prop_bit = isr_int_prop && icr_bit2_0[0] ;
|
3414 |
|
|
wire meta_isr_int_prop_bit ;
|
3415 |
|
|
// interemediate stage to clk synchronization flip - flops - this ones are prone to metastability
|
3416 |
111 |
simons |
pci_synchronizer_flop #(1, 0) isr_bit0_sync
|
3417 |
77 |
mihad |
(
|
3418 |
|
|
.data_in (isr_int_prop_bit),
|
3419 |
|
|
.clk_out (pci_clk),
|
3420 |
|
|
.sync_data_out (meta_isr_int_prop_bit),
|
3421 |
|
|
.async_reset (reset)
|
3422 |
|
|
) ;
|
3423 |
|
|
always@(posedge pci_clk or posedge reset)
|
3424 |
|
|
begin
|
3425 |
|
|
if (reset)
|
3426 |
|
|
isr_bit2_0[0] <= 1'b0 ;
|
3427 |
|
|
else
|
3428 |
|
|
isr_bit2_0[0] <= meta_isr_int_prop_bit ;
|
3429 |
|
|
end
|
3430 |
|
|
`endif
|
3431 |
|
|
`endif
|
3432 |
|
|
|
3433 |
|
|
// INT PIN
|
3434 |
|
|
wire int_in;
|
3435 |
|
|
wire int_meta;
|
3436 |
|
|
reg interrupt_out;
|
3437 |
|
|
`ifdef HOST
|
3438 |
|
|
`ifdef SYNCHRONEOUS_CLOCK_DOMAINS
|
3439 |
|
|
assign int_in = isr_int_prop_bit || isr_bit2_0[1] || isr_bit2_0[2] || isr_bit4_3[3] || isr_bit4_3[4];
|
3440 |
|
|
`else // not SYNCHRONEOUS_CLOCK_DOMAINS
|
3441 |
|
|
assign int_in = isr_int_prop_bit || isr_bit1 || isr_bit2_0[2] || isr_bits4_3[3] || isr_bits4_3[4];
|
3442 |
|
|
`endif
|
3443 |
|
|
// interemediate stage to clk synchronization flip - flops - this ones are prone to metastability
|
3444 |
111 |
simons |
pci_synchronizer_flop #(1, 0) int_pin_sync
|
3445 |
77 |
mihad |
(
|
3446 |
|
|
.data_in (int_in),
|
3447 |
|
|
.clk_out (wb_clk),
|
3448 |
|
|
.sync_data_out (int_meta),
|
3449 |
|
|
.async_reset (reset)
|
3450 |
|
|
) ;
|
3451 |
|
|
always@(posedge wb_clk or posedge reset)
|
3452 |
|
|
begin
|
3453 |
|
|
if (reset)
|
3454 |
|
|
interrupt_out <= 1'b0 ;
|
3455 |
|
|
else
|
3456 |
|
|
interrupt_out <= int_meta ;
|
3457 |
|
|
end
|
3458 |
|
|
`else // GUEST
|
3459 |
|
|
`ifdef SYNCHRONEOUS_CLOCK_DOMAINS
|
3460 |
|
|
assign int_in = isr_int_prop_bit || isr_bit2_0[1] || isr_bit2_0[2];
|
3461 |
|
|
`else // not SYNCHRONEOUS_CLOCK_DOMAINS
|
3462 |
|
|
assign int_in = isr_int_prop_bit || isr_bit2_0[1] || isr_bit2;
|
3463 |
|
|
`endif
|
3464 |
|
|
// interemediate stage to clk synchronization flip - flops - this ones are prone to metastability
|
3465 |
111 |
simons |
pci_synchronizer_flop #(1, 0) int_pin_sync
|
3466 |
77 |
mihad |
(
|
3467 |
|
|
.data_in (int_in),
|
3468 |
|
|
.clk_out (pci_clk),
|
3469 |
|
|
.sync_data_out (int_meta),
|
3470 |
|
|
.async_reset (reset)
|
3471 |
|
|
) ;
|
3472 |
|
|
always@(posedge pci_clk or posedge reset)
|
3473 |
|
|
begin
|
3474 |
|
|
if (reset)
|
3475 |
|
|
interrupt_out <= 1'b0 ;
|
3476 |
|
|
else
|
3477 |
|
|
interrupt_out <= int_meta ;
|
3478 |
|
|
end
|
3479 |
|
|
`endif
|
3480 |
|
|
|
3481 |
132 |
mihad |
|
3482 |
|
|
`ifdef PCI_CPCI_HS_IMPLEMENT
|
3483 |
|
|
reg [hs_es_cnt_width - 1:0] hs_es_cnt ; // debounce counter
|
3484 |
|
|
reg hs_es_in_state, // current state of ejector switch input - synchronized
|
3485 |
|
|
hs_es_sync, // synchronization flop for ejector switch input
|
3486 |
|
|
hs_es_cur_state ; // current valid state of ejector switch
|
3487 |
|
|
|
3488 |
|
|
`ifdef ACTIVE_HIGH_OE
|
3489 |
|
|
wire oe_active_val = 1'b1 ;
|
3490 |
|
|
`endif
|
3491 |
|
|
|
3492 |
|
|
`ifdef ACTIVE_LOW_OE
|
3493 |
|
|
wire oe_active_val = 1'b0 ;
|
3494 |
|
|
`endif
|
3495 |
|
|
|
3496 |
|
|
always@(posedge pci_clk or posedge reset)
|
3497 |
|
|
begin
|
3498 |
|
|
if (reset)
|
3499 |
|
|
begin
|
3500 |
|
|
hs_ins <= 1'b0 ;
|
3501 |
|
|
hs_ins_armed <= 1'b1 ;
|
3502 |
|
|
hs_ext <= 1'b0 ;
|
3503 |
|
|
hs_ext_armed <= 1'b0 ;
|
3504 |
|
|
hs_es_in_state <= 1'b0 ;
|
3505 |
|
|
hs_es_sync <= 1'b0 ;
|
3506 |
|
|
hs_es_cur_state <= 1'b0 ;
|
3507 |
|
|
hs_es_cnt <= 'h0 ;
|
3508 |
|
|
|
3509 |
|
|
`ifdef ACTIVE_LOW_OE
|
3510 |
|
|
pci_cpci_hs_enum_oe_o <= 1'b1 ;
|
3511 |
|
|
pci_cpci_hs_led_oe_o <= 1'b0 ;
|
3512 |
|
|
`endif
|
3513 |
|
|
|
3514 |
|
|
`ifdef ACTIVE_HIGH_OE
|
3515 |
|
|
pci_cpci_hs_enum_oe_o <= 1'b0 ;
|
3516 |
|
|
pci_cpci_hs_led_oe_o <= 1'b1 ;
|
3517 |
|
|
`endif
|
3518 |
|
|
|
3519 |
|
|
end
|
3520 |
|
|
else
|
3521 |
|
|
begin
|
3522 |
|
|
// INS
|
3523 |
|
|
if (hs_ins)
|
3524 |
|
|
begin
|
3525 |
140 |
mihad |
if (w_conf_data[23] & ~w_byte_en[2] & w_we & w_reg_select_dec[56]) // clear
|
3526 |
132 |
mihad |
hs_ins <= 1'b0 ;
|
3527 |
|
|
end
|
3528 |
|
|
else if (hs_ins_armed) // set
|
3529 |
|
|
hs_ins <= init_complete & (hs_es_cur_state == 1'b1) ;
|
3530 |
|
|
|
3531 |
|
|
// INS armed
|
3532 |
|
|
if (~hs_ins & hs_ins_armed & init_complete & (hs_es_cur_state == 1'b1)) // clear
|
3533 |
|
|
hs_ins_armed <= 1'b0 ;
|
3534 |
|
|
else if (hs_ext) // set
|
3535 |
140 |
mihad |
hs_ins_armed <= w_conf_data[22] & ~w_byte_en[2] & w_we & w_reg_select_dec[56] ;
|
3536 |
132 |
mihad |
|
3537 |
|
|
// EXT
|
3538 |
|
|
if (hs_ext) // clear
|
3539 |
|
|
begin
|
3540 |
140 |
mihad |
if (w_conf_data[22] & ~w_byte_en[2] & w_we & w_reg_select_dec[56])
|
3541 |
132 |
mihad |
hs_ext <= 1'b0 ;
|
3542 |
|
|
end
|
3543 |
|
|
else if (hs_ext_armed) // set
|
3544 |
|
|
hs_ext <= (hs_es_cur_state == 1'b0) ;
|
3545 |
|
|
|
3546 |
|
|
// EXT armed
|
3547 |
|
|
if (~hs_ext & hs_ext_armed & (hs_es_cur_state == 1'b0)) // clear
|
3548 |
|
|
hs_ext_armed <= 1'b0 ;
|
3549 |
|
|
else if (hs_ins) // set
|
3550 |
140 |
mihad |
hs_ext_armed <= w_conf_data[23] & !w_byte_en[2] & w_we & w_reg_select_dec[56] ;
|
3551 |
132 |
mihad |
|
3552 |
|
|
// ejector switch debounce counter logic
|
3553 |
|
|
hs_es_sync <= pci_cpci_hs_es_i ;
|
3554 |
|
|
hs_es_in_state <= hs_es_sync ;
|
3555 |
|
|
|
3556 |
|
|
if (hs_es_in_state == hs_es_cur_state)
|
3557 |
|
|
hs_es_cnt <= 'h0 ;
|
3558 |
|
|
else
|
3559 |
|
|
hs_es_cnt <= hs_es_cnt + 1'b1 ;
|
3560 |
|
|
|
3561 |
|
|
if (hs_es_cnt == {hs_es_cnt_width{1'b1}})
|
3562 |
|
|
hs_es_cur_state <= hs_es_in_state ;
|
3563 |
|
|
|
3564 |
|
|
if ((hs_ins | hs_ext) & ~hs_eim)
|
3565 |
|
|
pci_cpci_hs_enum_oe_o <= oe_active_val ;
|
3566 |
|
|
else
|
3567 |
|
|
pci_cpci_hs_enum_oe_o <= ~oe_active_val ;
|
3568 |
|
|
|
3569 |
|
|
if (~init_complete | hs_loo)
|
3570 |
|
|
pci_cpci_hs_led_oe_o <= oe_active_val ;
|
3571 |
|
|
else
|
3572 |
|
|
pci_cpci_hs_led_oe_o <= ~oe_active_val ;
|
3573 |
|
|
end
|
3574 |
|
|
end
|
3575 |
|
|
`endif
|
3576 |
|
|
|
3577 |
140 |
mihad |
`ifdef PCI_SPOCI
|
3578 |
132 |
mihad |
|
3579 |
140 |
mihad |
wire spoci_write_done,
|
3580 |
|
|
spoci_dat_rdy ,
|
3581 |
|
|
spoci_no_ack ;
|
3582 |
|
|
|
3583 |
|
|
wire [ 7: 0] spoci_wdat ;
|
3584 |
|
|
wire [ 7: 0] spoci_rdat ;
|
3585 |
|
|
|
3586 |
|
|
// power on configuration control and status register
|
3587 |
|
|
always@(posedge pci_clk or posedge reset)
|
3588 |
|
|
begin
|
3589 |
|
|
if (reset)
|
3590 |
|
|
begin
|
3591 |
|
|
spoci_cs_nack <= 1'b0 ;
|
3592 |
|
|
spoci_cs_write <= 1'b0 ;
|
3593 |
|
|
spoci_cs_read <= 1'b0 ;
|
3594 |
|
|
spoci_cs_adr <= 'h0 ;
|
3595 |
|
|
spoci_cs_dat <= 'h0 ;
|
3596 |
|
|
end
|
3597 |
|
|
else
|
3598 |
|
|
begin
|
3599 |
|
|
if (spoci_cs_write)
|
3600 |
|
|
begin
|
3601 |
|
|
if (spoci_write_done | spoci_no_ack)
|
3602 |
|
|
spoci_cs_write <= 1'b0 ;
|
3603 |
|
|
end
|
3604 |
|
|
else if ( w_we & (w_conf_address[9:2] == 8'hFF) & ~w_byte_en[3])
|
3605 |
|
|
spoci_cs_write <= w_conf_data[25] ;
|
3606 |
|
|
|
3607 |
|
|
if (spoci_cs_read)
|
3608 |
|
|
begin
|
3609 |
|
|
if (spoci_dat_rdy | spoci_no_ack)
|
3610 |
|
|
spoci_cs_read <= 1'b0 ;
|
3611 |
|
|
end
|
3612 |
|
|
else if ( w_we & (w_conf_address[9:2] == 8'hFF) & ~w_byte_en[3] )
|
3613 |
|
|
spoci_cs_read <= w_conf_data[24] ;
|
3614 |
|
|
|
3615 |
|
|
if (spoci_cs_nack)
|
3616 |
|
|
begin
|
3617 |
|
|
if ( w_we & (w_conf_address[9:2] == 8'hFF) & ~w_byte_en[3] & w_conf_data[31] )
|
3618 |
|
|
spoci_cs_nack <= 1'b0 ;
|
3619 |
|
|
end
|
3620 |
|
|
else if (spoci_cs_write | spoci_cs_read | ~init_cfg_done)
|
3621 |
|
|
begin
|
3622 |
|
|
spoci_cs_nack <= spoci_no_ack ;
|
3623 |
|
|
end
|
3624 |
|
|
|
3625 |
|
|
if ( w_we & (w_conf_address[9:2] == 8'hFF) )
|
3626 |
|
|
begin
|
3627 |
|
|
if (~w_byte_en[2])
|
3628 |
|
|
spoci_cs_adr[10: 8] <= w_conf_data[18:16] ;
|
3629 |
|
|
|
3630 |
|
|
if (~w_byte_en[1])
|
3631 |
|
|
spoci_cs_adr[ 7: 0] <= w_conf_data[15: 8] ;
|
3632 |
|
|
end
|
3633 |
|
|
|
3634 |
|
|
if ( w_we & (w_conf_address[9:2] == 8'hFF) & ~w_byte_en[0] )
|
3635 |
|
|
spoci_cs_dat <= w_conf_data[ 7: 0] ;
|
3636 |
|
|
else if (spoci_cs_read & spoci_dat_rdy)
|
3637 |
|
|
spoci_cs_dat <= spoci_rdat ;
|
3638 |
|
|
|
3639 |
|
|
end
|
3640 |
|
|
end
|
3641 |
|
|
|
3642 |
|
|
reg [ 2 : 0] bytes_received ;
|
3643 |
|
|
|
3644 |
|
|
always@(posedge pci_clk or posedge reset)
|
3645 |
|
|
begin
|
3646 |
|
|
if (reset)
|
3647 |
|
|
begin
|
3648 |
|
|
init_we <= 1'b0 ;
|
3649 |
|
|
init_cfg_done <= 1'b0 ;
|
3650 |
|
|
bytes_received <= 1'b0 ;
|
3651 |
|
|
spoci_dat <= 'h0 ;
|
3652 |
|
|
spoci_reg_num <= 'h0 ;
|
3653 |
|
|
end
|
3654 |
|
|
else if (~init_cfg_done)
|
3655 |
|
|
begin
|
3656 |
|
|
if (spoci_dat_rdy)
|
3657 |
|
|
begin
|
3658 |
|
|
case (bytes_received)
|
3659 |
|
|
'h0:spoci_reg_num <= spoci_rdat ;
|
3660 |
|
|
'h1:spoci_dat[ 7: 0] <= spoci_rdat ;
|
3661 |
|
|
'h2:spoci_dat[15: 8] <= spoci_rdat ;
|
3662 |
|
|
'h3:spoci_dat[23:16] <= spoci_rdat ;
|
3663 |
|
|
'h4:spoci_dat[31:24] <= spoci_rdat ;
|
3664 |
|
|
default:
|
3665 |
|
|
begin
|
3666 |
|
|
spoci_dat <= 32'hxxxx_xxxx ;
|
3667 |
|
|
spoci_reg_num <= 'hxx ;
|
3668 |
|
|
end
|
3669 |
|
|
endcase
|
3670 |
|
|
end
|
3671 |
|
|
|
3672 |
|
|
if (init_we)
|
3673 |
|
|
bytes_received <= 'h0 ;
|
3674 |
|
|
else if (spoci_dat_rdy)
|
3675 |
|
|
bytes_received <= bytes_received + 1'b1 ;
|
3676 |
|
|
|
3677 |
|
|
if (init_we)
|
3678 |
|
|
init_we <= 1'b0 ;
|
3679 |
|
|
else if (bytes_received == 'h5)
|
3680 |
|
|
init_we <= 1'b1 ;
|
3681 |
|
|
|
3682 |
|
|
if (spoci_no_ack | ((bytes_received == 'h1) & (spoci_reg_num == 'hff)) )
|
3683 |
|
|
init_cfg_done <= 1'b1 ;
|
3684 |
|
|
end
|
3685 |
|
|
end
|
3686 |
|
|
|
3687 |
|
|
assign spoci_wdat = spoci_cs_dat ;
|
3688 |
|
|
|
3689 |
|
|
pci_spoci_ctrl i_pci_spoci_ctrl
|
3690 |
|
|
(
|
3691 |
|
|
.reset_i (reset ),
|
3692 |
|
|
.clk_i (pci_clk ),
|
3693 |
|
|
|
3694 |
|
|
.do_rnd_read_i (spoci_cs_read ),
|
3695 |
|
|
.do_seq_read_i (rst_inactive & ~init_cfg_done ),
|
3696 |
|
|
.do_write_i (spoci_cs_write ),
|
3697 |
|
|
|
3698 |
|
|
.write_done_o (spoci_write_done ),
|
3699 |
|
|
.dat_rdy_o (spoci_dat_rdy ),
|
3700 |
|
|
.no_ack_o (spoci_no_ack ),
|
3701 |
|
|
|
3702 |
|
|
.adr_i (spoci_cs_adr ),
|
3703 |
|
|
.dat_i (spoci_wdat ),
|
3704 |
|
|
.dat_o (spoci_rdat ),
|
3705 |
|
|
|
3706 |
|
|
.pci_spoci_sda_i (spoci_sda_i ),
|
3707 |
|
|
.pci_spoci_sda_oe_o (spoci_sda_oe_o ),
|
3708 |
|
|
.pci_spoci_scl_oe_o (spoci_scl_oe_o )
|
3709 |
|
|
);
|
3710 |
|
|
`endif
|
3711 |
|
|
|
3712 |
77 |
mihad |
/*-----------------------------------------------------------------------------------------------------------
|
3713 |
|
|
OUTPUTs from registers !!!
|
3714 |
|
|
-----------------------------------------------------------------------------------------------------------*/
|
3715 |
|
|
|
3716 |
|
|
// if bridge is HOST then write clock is equal to WB clock, and synchronization of outputs has to be done
|
3717 |
|
|
`ifdef HOST
|
3718 |
|
|
wire [3:0] command_bits = {command_bit8, command_bit6, command_bit2_0[1:0]} ;
|
3719 |
|
|
wire [3:0] meta_command_bits ;
|
3720 |
|
|
reg [3:0] sync_command_bits ;
|
3721 |
111 |
simons |
pci_synchronizer_flop #(4, 0) command_bits_sync
|
3722 |
77 |
mihad |
(
|
3723 |
|
|
.data_in (command_bits),
|
3724 |
|
|
.clk_out (pci_clk),
|
3725 |
|
|
.sync_data_out (meta_command_bits),
|
3726 |
|
|
.async_reset (reset)
|
3727 |
|
|
) ;
|
3728 |
|
|
always@(posedge pci_clk or posedge reset)
|
3729 |
|
|
begin
|
3730 |
|
|
if (reset)
|
3731 |
|
|
sync_command_bits <= 4'b0 ;
|
3732 |
|
|
else
|
3733 |
|
|
sync_command_bits <= meta_command_bits ;
|
3734 |
|
|
end
|
3735 |
|
|
wire sync_command_bit8 = sync_command_bits[3] ;
|
3736 |
|
|
wire sync_command_bit6 = sync_command_bits[2] ;
|
3737 |
|
|
wire sync_command_bit1 = sync_command_bits[1] ;
|
3738 |
|
|
wire sync_command_bit0 = sync_command_bits[0] ;
|
3739 |
|
|
wire sync_command_bit2 = command_bit2_0[2] ;
|
3740 |
|
|
`else // GUEST
|
3741 |
|
|
wire command_bit = command_bit2_0[2] ;
|
3742 |
|
|
wire meta_command_bit ;
|
3743 |
|
|
reg sync_command_bit ;
|
3744 |
111 |
simons |
pci_synchronizer_flop #(1, 0) command_bit_sync
|
3745 |
77 |
mihad |
(
|
3746 |
|
|
.data_in (command_bit),
|
3747 |
|
|
.clk_out (pci_clk),
|
3748 |
|
|
.sync_data_out (meta_command_bit),
|
3749 |
|
|
.async_reset (reset)
|
3750 |
|
|
) ;
|
3751 |
|
|
always@(posedge pci_clk or posedge reset)
|
3752 |
|
|
begin
|
3753 |
|
|
if (reset)
|
3754 |
|
|
sync_command_bit <= 1'b0 ;
|
3755 |
|
|
else
|
3756 |
|
|
sync_command_bit <= meta_command_bit ;
|
3757 |
|
|
end
|
3758 |
|
|
wire sync_command_bit8 = command_bit8 ;
|
3759 |
|
|
wire sync_command_bit6 = command_bit6 ;
|
3760 |
|
|
wire sync_command_bit1 = command_bit2_0[1] ;
|
3761 |
|
|
wire sync_command_bit0 = command_bit2_0[0] ;
|
3762 |
|
|
wire sync_command_bit2 = sync_command_bit ;
|
3763 |
|
|
`endif
|
3764 |
|
|
// PCI header outputs from command register
|
3765 |
140 |
mihad |
assign serr_enable = sync_command_bit8 & pci_init_complete_out ; // to PCI clock
|
3766 |
|
|
assign perr_response = sync_command_bit6 & pci_init_complete_out ; // to PCI clock
|
3767 |
|
|
assign pci_master_enable = sync_command_bit2 & wb_init_complete_out ; // to WB clock
|
3768 |
|
|
assign memory_space_enable = sync_command_bit1 & pci_init_complete_out ; // to PCI clock
|
3769 |
|
|
assign io_space_enable = sync_command_bit0 & pci_init_complete_out ; // to PCI clock
|
3770 |
77 |
mihad |
|
3771 |
|
|
// if bridge is HOST then write clock is equal to WB clock, and synchronization of outputs has to be done
|
3772 |
|
|
// We don't support cache line sizes smaller that 4 and it must have last two bits zero!!!
|
3773 |
|
|
wire cache_lsize_not_zero = ((cache_line_size_reg[7] || cache_line_size_reg[6] || cache_line_size_reg[5] ||
|
3774 |
|
|
cache_line_size_reg[4] || cache_line_size_reg[3] || cache_line_size_reg[2]) &&
|
3775 |
|
|
(!cache_line_size_reg[1] && !cache_line_size_reg[0]) );
|
3776 |
|
|
`ifdef HOST
|
3777 |
|
|
wire [7:2] cache_lsize_to_pci_bits = { cache_line_size_reg[7:2] } ;
|
3778 |
|
|
wire [7:2] meta_cache_lsize_to_pci_bits ;
|
3779 |
|
|
reg [7:2] sync_cache_lsize_to_pci_bits ;
|
3780 |
111 |
simons |
pci_synchronizer_flop #(6, 0) cache_lsize_to_pci_bits_sync
|
3781 |
77 |
mihad |
(
|
3782 |
|
|
.data_in (cache_lsize_to_pci_bits),
|
3783 |
|
|
.clk_out (pci_clk),
|
3784 |
|
|
.sync_data_out (meta_cache_lsize_to_pci_bits),
|
3785 |
|
|
.async_reset (reset)
|
3786 |
|
|
) ;
|
3787 |
|
|
always@(posedge pci_clk or posedge reset)
|
3788 |
|
|
begin
|
3789 |
|
|
if (reset)
|
3790 |
|
|
sync_cache_lsize_to_pci_bits <= 6'b0 ;
|
3791 |
|
|
else
|
3792 |
|
|
sync_cache_lsize_to_pci_bits <= meta_cache_lsize_to_pci_bits ;
|
3793 |
|
|
end
|
3794 |
|
|
wire [7:2] sync_cache_line_size_to_pci_reg = sync_cache_lsize_to_pci_bits[7:2] ;
|
3795 |
|
|
wire [7:2] sync_cache_line_size_to_wb_reg = cache_line_size_reg[7:2] ;
|
3796 |
|
|
wire sync_cache_lsize_not_zero_to_wb = cache_lsize_not_zero ;
|
3797 |
|
|
// Latency timer is sinchronized only to PCI clock when bridge implementation is HOST
|
3798 |
|
|
wire [7:0] latency_timer_bits = latency_timer ;
|
3799 |
|
|
wire [7:0] meta_latency_timer_bits ;
|
3800 |
|
|
reg [7:0] sync_latency_timer_bits ;
|
3801 |
111 |
simons |
pci_synchronizer_flop #(8, 0) latency_timer_bits_sync
|
3802 |
77 |
mihad |
(
|
3803 |
|
|
.data_in (latency_timer_bits),
|
3804 |
|
|
.clk_out (pci_clk),
|
3805 |
|
|
.sync_data_out (meta_latency_timer_bits),
|
3806 |
|
|
.async_reset (reset)
|
3807 |
|
|
) ;
|
3808 |
|
|
always@(posedge pci_clk or posedge reset)
|
3809 |
|
|
begin
|
3810 |
|
|
if (reset)
|
3811 |
|
|
sync_latency_timer_bits <= 8'b0 ;
|
3812 |
|
|
else
|
3813 |
|
|
sync_latency_timer_bits <= meta_latency_timer_bits ;
|
3814 |
|
|
end
|
3815 |
|
|
wire [7:0] sync_latency_timer = sync_latency_timer_bits ;
|
3816 |
|
|
`else // GUEST
|
3817 |
|
|
wire [8:2] cache_lsize_to_wb_bits = { cache_lsize_not_zero, cache_line_size_reg[7:2] } ;
|
3818 |
|
|
wire [8:2] meta_cache_lsize_to_wb_bits ;
|
3819 |
|
|
reg [8:2] sync_cache_lsize_to_wb_bits ;
|
3820 |
111 |
simons |
pci_synchronizer_flop #(7, 0) cache_lsize_to_wb_bits_sync
|
3821 |
77 |
mihad |
(
|
3822 |
|
|
.data_in (cache_lsize_to_wb_bits),
|
3823 |
|
|
.clk_out (wb_clk),
|
3824 |
|
|
.sync_data_out (meta_cache_lsize_to_wb_bits),
|
3825 |
|
|
.async_reset (reset)
|
3826 |
|
|
) ;
|
3827 |
|
|
always@(posedge wb_clk or posedge reset)
|
3828 |
|
|
begin
|
3829 |
|
|
if (reset)
|
3830 |
|
|
sync_cache_lsize_to_wb_bits <= 7'b0 ;
|
3831 |
|
|
else
|
3832 |
|
|
sync_cache_lsize_to_wb_bits <= meta_cache_lsize_to_wb_bits ;
|
3833 |
|
|
end
|
3834 |
|
|
wire [7:2] sync_cache_line_size_to_pci_reg = cache_line_size_reg[7:2] ;
|
3835 |
|
|
wire [7:2] sync_cache_line_size_to_wb_reg = sync_cache_lsize_to_wb_bits[7:2] ;
|
3836 |
|
|
wire sync_cache_lsize_not_zero_to_wb = sync_cache_lsize_to_wb_bits[8] ;
|
3837 |
|
|
// Latency timer
|
3838 |
|
|
wire [7:0] sync_latency_timer = latency_timer ;
|
3839 |
|
|
`endif
|
3840 |
|
|
// PCI header output from cache_line_size, latency timer and interrupt pin
|
3841 |
|
|
assign cache_line_size_to_pci = {sync_cache_line_size_to_pci_reg, 2'h0} ; // [7 : 0] to PCI clock
|
3842 |
|
|
assign cache_line_size_to_wb = {sync_cache_line_size_to_wb_reg, 2'h0} ; // [7 : 0] to WB clock
|
3843 |
|
|
assign cache_lsize_not_zero_to_wb = sync_cache_lsize_not_zero_to_wb ;
|
3844 |
|
|
|
3845 |
|
|
assign latency_tim[7 : 0] = sync_latency_timer ; // to PCI clock
|
3846 |
|
|
//assign int_pin[2 : 0] = r_interrupt_pin ;
|
3847 |
|
|
assign int_out = interrupt_out ;
|
3848 |
|
|
// PCI output from image registers
|
3849 |
|
|
// base address, address mask, translation address and control registers are sinchronized in PCI_DECODER.V module
|
3850 |
148 |
mihad |
`ifdef HOST
|
3851 |
|
|
`ifdef NO_CNF_IMAGE
|
3852 |
|
|
assign pci_base_addr0 = pci_ba0_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
3853 |
|
|
`else
|
3854 |
|
|
assign pci_base_addr0 = pci_ba0_bit31_8[31:12] ;
|
3855 |
|
|
`endif
|
3856 |
|
|
`endif
|
3857 |
|
|
|
3858 |
|
|
`ifdef GUEST
|
3859 |
|
|
assign pci_base_addr0 = pci_ba0_bit31_8[31:12] ;
|
3860 |
|
|
`endif
|
3861 |
|
|
|
3862 |
|
|
assign pci_base_addr1 = pci_ba1_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
3863 |
|
|
assign pci_base_addr2 = pci_ba2_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
3864 |
|
|
assign pci_base_addr3 = pci_ba3_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
3865 |
|
|
assign pci_base_addr4 = pci_ba4_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
3866 |
|
|
assign pci_base_addr5 = pci_ba5_bit31_8[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
3867 |
77 |
mihad |
assign pci_memory_io0 = pci_ba0_bit0 ;
|
3868 |
|
|
assign pci_memory_io1 = pci_ba1_bit0 ;
|
3869 |
|
|
assign pci_memory_io2 = pci_ba2_bit0 ;
|
3870 |
|
|
assign pci_memory_io3 = pci_ba3_bit0 ;
|
3871 |
|
|
assign pci_memory_io4 = pci_ba4_bit0 ;
|
3872 |
|
|
assign pci_memory_io5 = pci_ba5_bit0 ;
|
3873 |
148 |
mihad |
|
3874 |
77 |
mihad |
assign pci_addr_mask0 = pci_am0[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
3875 |
|
|
assign pci_addr_mask1 = pci_am1[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
3876 |
|
|
assign pci_addr_mask2 = pci_am2[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
3877 |
|
|
assign pci_addr_mask3 = pci_am3[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
3878 |
|
|
assign pci_addr_mask4 = pci_am4[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
3879 |
|
|
assign pci_addr_mask5 = pci_am5[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
3880 |
|
|
assign pci_tran_addr0 = pci_ta0[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
3881 |
|
|
assign pci_tran_addr1 = pci_ta1[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
3882 |
|
|
assign pci_tran_addr2 = pci_ta2[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
3883 |
|
|
assign pci_tran_addr3 = pci_ta3[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
3884 |
|
|
assign pci_tran_addr4 = pci_ta4[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
3885 |
|
|
assign pci_tran_addr5 = pci_ta5[31:(32-`PCI_NUM_OF_DEC_ADDR_LINES)] ;
|
3886 |
|
|
assign pci_img_ctrl0[2 : 1] = pci_img_ctrl0_bit2_1 ;
|
3887 |
|
|
assign pci_img_ctrl1[2 : 1] = pci_img_ctrl1_bit2_1 ;
|
3888 |
|
|
assign pci_img_ctrl2[2 : 1] = pci_img_ctrl2_bit2_1 ;
|
3889 |
|
|
assign pci_img_ctrl3[2 : 1] = pci_img_ctrl3_bit2_1 ;
|
3890 |
|
|
assign pci_img_ctrl4[2 : 1] = pci_img_ctrl4_bit2_1 ;
|
3891 |
|
|
assign pci_img_ctrl5[2 : 1] = pci_img_ctrl5_bit2_1 ;
|
3892 |
|
|
// WISHBONE output from image registers
|
3893 |
|
|
// base address, address mask, translation address and control registers are sinchronized in DECODER.V module
|
3894 |
|
|
assign wb_base_addr0 = wb_ba0_bit31_12[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
3895 |
|
|
assign wb_base_addr1 = wb_ba1_bit31_12[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
3896 |
|
|
assign wb_base_addr2 = wb_ba2_bit31_12[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
3897 |
|
|
assign wb_base_addr3 = wb_ba3_bit31_12[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
3898 |
|
|
assign wb_base_addr4 = wb_ba4_bit31_12[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
3899 |
|
|
assign wb_base_addr5 = wb_ba5_bit31_12[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
3900 |
|
|
assign wb_memory_io0 = wb_ba0_bit0 ;
|
3901 |
|
|
assign wb_memory_io1 = wb_ba1_bit0 ;
|
3902 |
|
|
assign wb_memory_io2 = wb_ba2_bit0 ;
|
3903 |
|
|
assign wb_memory_io3 = wb_ba3_bit0 ;
|
3904 |
|
|
assign wb_memory_io4 = wb_ba4_bit0 ;
|
3905 |
|
|
assign wb_memory_io5 = wb_ba5_bit0 ;
|
3906 |
|
|
assign wb_addr_mask0 = wb_am0[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
3907 |
|
|
assign wb_addr_mask1 = wb_am1[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
3908 |
|
|
assign wb_addr_mask2 = wb_am2[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
3909 |
|
|
assign wb_addr_mask3 = wb_am3[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
3910 |
|
|
assign wb_addr_mask4 = wb_am4[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
3911 |
|
|
assign wb_addr_mask5 = wb_am5[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
3912 |
|
|
assign wb_tran_addr0 = wb_ta0[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
3913 |
|
|
assign wb_tran_addr1 = wb_ta1[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
3914 |
|
|
assign wb_tran_addr2 = wb_ta2[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
3915 |
|
|
assign wb_tran_addr3 = wb_ta3[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
3916 |
|
|
assign wb_tran_addr4 = wb_ta4[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
3917 |
|
|
assign wb_tran_addr5 = wb_ta5[31:(32-`WB_NUM_OF_DEC_ADDR_LINES)] ;
|
3918 |
|
|
assign wb_img_ctrl0[2 : 0] = wb_img_ctrl0_bit2_0 ;
|
3919 |
|
|
assign wb_img_ctrl1[2 : 0] = wb_img_ctrl1_bit2_0 ;
|
3920 |
|
|
assign wb_img_ctrl2[2 : 0] = wb_img_ctrl2_bit2_0 ;
|
3921 |
|
|
assign wb_img_ctrl3[2 : 0] = wb_img_ctrl3_bit2_0 ;
|
3922 |
|
|
assign wb_img_ctrl4[2 : 0] = wb_img_ctrl4_bit2_0 ;
|
3923 |
|
|
assign wb_img_ctrl5[2 : 0] = wb_img_ctrl5_bit2_0 ;
|
3924 |
|
|
// GENERAL output from conf. cycle generation register & int. control register
|
3925 |
|
|
assign config_addr[23 : 0] = { cnf_addr_bit23_2, 1'b0, cnf_addr_bit0 } ;
|
3926 |
|
|
assign icr_soft_res = icr_bit31 ;
|
3927 |
|
|
|
3928 |
|
|
endmodule
|
3929 |
|
|
|