]> cvs.zerfleddert.de Git - raggedstone/blame_incremental - ethernet/source/pci/pci_bridge32.v
watch inta
[raggedstone] / ethernet / source / pci / pci_bridge32.v
... / ...
CommitLineData
1//////////////////////////////////////////////////////////////////////
2//// ////
3//// File name "pci_bridge32.v" ////
4//// ////
5//// This file is part of the "PCI bridge" project ////
6//// http://www.opencores.org/cores/pci/ ////
7//// ////
8//// Author(s): ////
9//// - Miha Dolenc (mihad@opencores.org) ////
10//// - Tadej Markovic (tadej@opencores.org) ////
11//// ////
12//// All additional information is avaliable in the README ////
13//// file. ////
14//// ////
15//// ////
16//////////////////////////////////////////////////////////////////////
17//// ////
18//// Copyright (C) 2001 Miha Dolenc, mihad@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: pci_bridge32.v,v $
46// Revision 1.1 2007-03-20 17:50:56 sithglan
47// add shit
48//
49// Revision 1.19 2004/09/23 13:48:53 mihad
50// The control inputs from PCI are now muxed with control outputs
51// using output enable state for given signal.
52//
53// Revision 1.18 2004/08/19 15:27:34 mihad
54// Changed minimum pci image size to 256 bytes because
55// of some PC system problems with size of IO images.
56//
57// Revision 1.17 2004/01/24 11:54:18 mihad
58// Update! SPOCI Implemented!
59//
60// Revision 1.16 2003/12/19 11:11:30 mihad
61// Compact PCI Hot Swap support added.
62// New testcases added.
63// Specification updated.
64// Test application changed to support WB B3 cycles.
65//
66// Revision 1.15 2003/12/10 12:02:54 mihad
67// The wbs B3 to B2 translation logic had wrong reset wire connected!
68//
69// Revision 1.14 2003/12/09 09:33:57 simons
70// Some warning cleanup.
71//
72// Revision 1.13 2003/10/17 09:11:52 markom
73// mbist signals updated according to newest convention
74//
75// Revision 1.12 2003/08/21 20:49:03 tadejm
76// Added signals for WB Master B3.
77//
78// Revision 1.11 2003/08/08 16:36:33 tadejm
79// Added 'three_left_out' to pci_pciw_fifo signaling three locations before full. Added comparison between current registered cbe and next unregistered cbe to signal wb_master whether it is allowed to performe burst or not. Due to this, I needed 'three_left_out' so that writing to pci_pciw_fifo can be registered, otherwise timing problems would occure.
80//
81// Revision 1.10 2003/08/03 18:05:06 mihad
82// Added limited WISHBONE B3 support for WISHBONE Slave Unit.
83// Doesn't support full speed bursts yet.
84//
85// Revision 1.9 2003/01/27 16:49:31 mihad
86// Changed module and file names. Updated scripts accordingly. FIFO synchronizations changed.
87//
88// Revision 1.8 2002/10/21 13:04:33 mihad
89// Changed BIST signal names etc..
90//
91// Revision 1.7 2002/10/18 03:36:37 tadejm
92// Changed wrong signal name mbist_sen into mbist_ctrl_i.
93//
94// Revision 1.6 2002/10/17 22:51:50 tadejm
95// Changed BIST signals for RAMs.
96//
97// Revision 1.5 2002/10/11 10:09:01 mihad
98// Added additional testcase and changed rst name in BIST to trst
99//
100// Revision 1.4 2002/10/08 17:17:05 mihad
101// Added BIST signals for RAMs.
102//
103// Revision 1.3 2002/02/01 15:25:12 mihad
104// Repaired a few bugs, updated specification, added test bench files and design document
105//
106// Revision 1.2 2001/10/05 08:14:28 mihad
107// Updated all files with inclusion of timescale file for simulation purposes.
108//
109// Revision 1.1.1.1 2001/10/02 15:33:46 mihad
110// New project directory structure
111//
112//
113
114`include "pci_constants.v"
115
116// synopsys translate_off
117`include "timescale.v"
118// synopsys translate_on
119
120// this is top level module of pci bridge core
121// it instantiates and connects other lower level modules
122// check polarity of PCI output enables in file out_reg.v and change it according to IO interface specification
123
124module pci_bridge32
125(
126 // WISHBONE system signals
127 wb_clk_i,
128 wb_rst_i,
129 wb_rst_o,
130 wb_int_i,
131 wb_int_o,
132
133 // WISHBONE slave interface
134 wbs_adr_i,
135 wbs_dat_i,
136 wbs_dat_o,
137 wbs_sel_i,
138 wbs_cyc_i,
139 wbs_stb_i,
140 wbs_we_i,
141
142`ifdef PCI_WB_REV_B3
143
144 wbs_cti_i,
145 wbs_bte_i,
146
147`else
148
149 wbs_cab_i,
150
151`endif
152
153 wbs_ack_o,
154 wbs_rty_o,
155 wbs_err_o,
156
157 // WISHBONE master interface
158 wbm_adr_o,
159 wbm_dat_i,
160 wbm_dat_o,
161 wbm_sel_o,
162 wbm_cyc_o,
163 wbm_stb_o,
164 wbm_we_o,
165 wbm_cti_o,
166 wbm_bte_o,
167 wbm_ack_i,
168 wbm_rty_i,
169 wbm_err_i,
170
171 // pci interface - system pins
172 pci_clk_i,
173 pci_rst_i,
174 pci_rst_o,
175 pci_inta_i,
176 pci_inta_o,
177 pci_rst_oe_o,
178 pci_inta_oe_o,
179
180 // arbitration pins
181 pci_req_o,
182 pci_req_oe_o,
183
184 pci_gnt_i,
185
186 // protocol pins
187 pci_frame_i,
188 pci_frame_o,
189
190 pci_frame_oe_o,
191 pci_irdy_oe_o,
192 pci_devsel_oe_o,
193 pci_trdy_oe_o,
194 pci_stop_oe_o,
195 pci_ad_oe_o,
196 pci_cbe_oe_o,
197
198 pci_irdy_i,
199 pci_irdy_o,
200
201 pci_idsel_i,
202
203 pci_devsel_i,
204 pci_devsel_o,
205
206 pci_trdy_i,
207 pci_trdy_o,
208
209 pci_stop_i,
210 pci_stop_o ,
211
212 // data transfer pins
213 pci_ad_i,
214 pci_ad_o,
215
216 pci_cbe_i,
217 pci_cbe_o,
218
219 // parity generation and checking pins
220 pci_par_i,
221 pci_par_o,
222 pci_par_oe_o,
223
224 pci_perr_i,
225 pci_perr_o,
226 pci_perr_oe_o,
227
228 // system error pin
229 pci_serr_o,
230 pci_serr_oe_o
231
232`ifdef PCI_BIST
233 ,
234 // debug chain signals
235 mbist_si_i, // bist scan serial in
236 mbist_so_o, // bist scan serial out
237 mbist_ctrl_i // bist chain shift control
238`endif
239
240`ifdef PCI_CPCI_HS_IMPLEMENT
241 ,
242 // Compact PCI Hot Swap signals
243 pci_cpci_hs_enum_o , // ENUM# output with output enable (open drain)
244 pci_cpci_hs_enum_oe_o , // ENUM# enum output enable
245 pci_cpci_hs_led_o , // LED output with output enable (open drain)
246 pci_cpci_hs_led_oe_o , // LED output enable
247 pci_cpci_hs_es_i // ejector switch state indicator input
248`endif
249
250`ifdef PCI_SPOCI
251 ,
252 // Serial power on configuration interface
253 spoci_scl_o ,
254 spoci_scl_oe_o ,
255 spoci_sda_i ,
256 spoci_sda_o ,
257 spoci_sda_oe_o
258`endif
259
260);
261
262`ifdef HOST
263 `ifdef NO_CNF_IMAGE
264 parameter pci_ba0_width = `PCI_NUM_OF_DEC_ADDR_LINES ;
265 `else
266 parameter pci_ba0_width = 20 ;
267 `endif
268`endif
269
270`ifdef GUEST
271 parameter pci_ba0_width = 20 ;
272`endif
273
274parameter pci_ba1_5_width = `PCI_NUM_OF_DEC_ADDR_LINES ;
275
276// WISHBONE system signals
277input wb_clk_i ;
278input wb_rst_i ;
279output wb_rst_o ;
280input wb_int_i ;
281output wb_int_o ;
282
283// WISHBONE slave interface
284input [31:0] wbs_adr_i ;
285input [31:0] wbs_dat_i ;
286output [31:0] wbs_dat_o ;
287input [3:0] wbs_sel_i ;
288input wbs_cyc_i ;
289input wbs_stb_i ;
290input wbs_we_i ;
291
292`ifdef PCI_WB_REV_B3
293
294input [2:0] wbs_cti_i ;
295input [1:0] wbs_bte_i ;
296
297`else
298
299input wbs_cab_i ;
300
301`endif
302
303output wbs_ack_o ;
304output wbs_rty_o ;
305output wbs_err_o ;
306
307// WISHBONE master interface
308output [31:0] wbm_adr_o ;
309input [31:0] wbm_dat_i ;
310output [31:0] wbm_dat_o ;
311output [3:0] wbm_sel_o ;
312output wbm_cyc_o ;
313output wbm_stb_o ;
314output wbm_we_o ;
315output [2:0] wbm_cti_o ;
316output [1:0] wbm_bte_o ;
317input wbm_ack_i ;
318input wbm_rty_i ;
319input wbm_err_i ;
320
321// pci interface - system pins
322input pci_clk_i ;
323input pci_rst_i ;
324output pci_rst_o ;
325output pci_rst_oe_o ;
326
327input pci_inta_i ;
328output pci_inta_o ;
329output pci_inta_oe_o ;
330
331// arbitration pins
332output pci_req_o ;
333output pci_req_oe_o ;
334
335input pci_gnt_i ;
336
337// protocol pins
338input pci_frame_i ;
339output pci_frame_o ;
340output pci_frame_oe_o ;
341output pci_irdy_oe_o ;
342output pci_devsel_oe_o ;
343output pci_trdy_oe_o ;
344output pci_stop_oe_o ;
345output [31:0] pci_ad_oe_o ;
346output [3:0] pci_cbe_oe_o ;
347
348input pci_irdy_i ;
349output pci_irdy_o ;
350
351input pci_idsel_i ;
352
353input pci_devsel_i ;
354output pci_devsel_o ;
355
356input pci_trdy_i ;
357output pci_trdy_o ;
358
359input pci_stop_i ;
360output pci_stop_o ;
361
362// data transfer pins
363input [31:0] pci_ad_i ;
364output [31:0] pci_ad_o ;
365
366input [3:0] pci_cbe_i ;
367output [3:0] pci_cbe_o ;
368
369// parity generation and checking pins
370input pci_par_i ;
371output pci_par_o ;
372output pci_par_oe_o ;
373
374input pci_perr_i ;
375output pci_perr_o ;
376output pci_perr_oe_o ;
377
378// system error pin
379output pci_serr_o ;
380output pci_serr_oe_o ;
381
382`ifdef PCI_BIST
383/*-----------------------------------------------------
384BIST debug chain port signals
385-----------------------------------------------------*/
386input mbist_si_i; // bist scan serial in
387output mbist_so_o; // bist scan serial out
388input [`PCI_MBIST_CTRL_WIDTH - 1:0] mbist_ctrl_i; // bist chain shift control
389`endif
390
391`ifdef PCI_CPCI_HS_IMPLEMENT
392 // Compact PCI Hot Swap signals
393output pci_cpci_hs_enum_o ; // ENUM# output with output enable (open drain)
394output pci_cpci_hs_enum_oe_o ; // ENUM# enum output enable
395output pci_cpci_hs_led_o ; // LED output with output enable (open drain)
396output pci_cpci_hs_led_oe_o ; // LED output enable
397input pci_cpci_hs_es_i ; // ejector switch state indicator input
398
399assign pci_cpci_hs_enum_o = 1'b0 ;
400assign pci_cpci_hs_led_o = 1'b0 ;
401`endif
402
403`ifdef PCI_SPOCI
404output spoci_scl_o ;
405output spoci_scl_oe_o ;
406input spoci_sda_i ;
407output spoci_sda_o ;
408output spoci_sda_oe_o ;
409
410assign spoci_scl_o = 1'b0 ;
411assign spoci_sda_o = 1'b0 ;
412`endif
413
414// declare clock and reset wires
415wire pci_clk = pci_clk_i ;
416wire wb_clk = wb_clk_i ;
417wire reset ; // assigned at pci bridge reset and interrupt logic
418
419/*=========================================================================================================
420First comes definition of all modules' outputs, so they can be assigned to any other module's input later
421 in the file, when module is instantiated
422=========================================================================================================*/
423// PCI BRIDGE RESET AND INTERRUPT LOGIC OUTPUTS
424wire pci_reso_reset ;
425wire pci_reso_pci_rstn_out ;
426wire pci_reso_pci_rstn_en_out ;
427wire pci_reso_rst_o ;
428wire pci_into_pci_intan_out ;
429wire pci_into_pci_intan_en_out ;
430wire pci_into_int_o ;
431wire pci_into_conf_isr_int_prop_out ;
432
433// assign pci bridge reset interrupt logic outputs to top outputs where possible
434assign reset = pci_reso_reset ;
435assign pci_rst_o = pci_reso_pci_rstn_out ;
436assign pci_rst_oe_o = pci_reso_pci_rstn_en_out ;
437assign wb_rst_o = pci_reso_rst_o ;
438assign pci_inta_o = pci_into_pci_intan_out ;
439assign pci_inta_oe_o = pci_into_pci_intan_en_out ;
440assign wb_int_o = pci_into_int_o ;
441
442// WISHBONE SLAVE UNIT OUTPUTS
443wire [31:0] wbu_sdata_out ;
444wire wbu_ack_out ;
445wire wbu_rty_out ;
446wire wbu_err_out ;
447wire wbu_pciif_req_out ;
448wire wbu_pciif_frame_out ;
449wire wbu_pciif_frame_en_out ;
450wire wbu_pciif_irdy_out ;
451wire wbu_pciif_irdy_en_out ;
452wire [31:0] wbu_pciif_ad_out ;
453wire wbu_pciif_ad_en_out ;
454wire [3:0] wbu_pciif_cbe_out ;
455wire wbu_pciif_cbe_en_out ;
456wire [31:0] wbu_err_addr_out ;
457wire [3:0] wbu_err_bc_out ;
458wire wbu_err_signal_out ;
459wire wbu_err_source_out ;
460wire wbu_err_rty_exp_out ;
461wire wbu_tabort_rec_out ;
462wire wbu_mabort_rec_out ;
463wire [11:0] wbu_conf_offset_out ;
464wire wbu_conf_renable_out ;
465wire wbu_conf_wenable_out ;
466wire [3:0] wbu_conf_be_out ;
467wire [31:0] wbu_conf_data_out ;
468wire wbu_del_read_comp_pending_out ;
469wire wbu_wbw_fifo_empty_out ;
470wire wbu_ad_load_out ;
471wire wbu_ad_load_on_transfer_out ;
472wire wbu_pciif_frame_load_out ;
473
474// PCI TARGET UNIT OUTPUTS
475wire [31:0] pciu_adr_out ;
476wire [31:0] pciu_mdata_out ;
477wire pciu_cyc_out ;
478wire pciu_stb_out ;
479wire pciu_we_out ;
480wire [2:0] pciu_cti_out ;
481wire [1:0] pciu_bte_out ;
482wire [3:0] pciu_sel_out ;
483wire pciu_pciif_trdy_out ;
484wire pciu_pciif_stop_out ;
485wire pciu_pciif_devsel_out ;
486wire pciu_pciif_trdy_en_out ;
487wire pciu_pciif_stop_en_out ;
488wire pciu_pciif_devsel_en_out ;
489wire pciu_ad_load_out ;
490wire pciu_ad_load_on_transfer_out ;
491wire [31:0] pciu_pciif_ad_out ;
492wire pciu_pciif_ad_en_out ;
493wire pciu_pciif_tabort_set_out ;
494wire [31:0] pciu_err_addr_out ;
495wire [3:0] pciu_err_bc_out ;
496wire [31:0] pciu_err_data_out ;
497wire [3:0] pciu_err_be_out ;
498wire pciu_err_signal_out ;
499wire pciu_err_source_out ;
500wire pciu_err_rty_exp_out ;
501wire [11:0] pciu_conf_offset_out ;
502wire pciu_conf_renable_out ;
503wire pciu_conf_wenable_out ;
504wire [3:0] pciu_conf_be_out ;
505wire [31:0] pciu_conf_data_out ;
506wire pciu_pci_drcomp_pending_out ;
507wire pciu_pciw_fifo_empty_out ;
508
509// assign pci target unit's outputs to top outputs where possible
510assign wbm_adr_o = pciu_adr_out ;
511assign wbm_dat_o = pciu_mdata_out ;
512assign wbm_cyc_o = pciu_cyc_out ;
513assign wbm_stb_o = pciu_stb_out ;
514assign wbm_we_o = pciu_we_out ;
515assign wbm_cti_o = pciu_cti_out ;
516assign wbm_bte_o = pciu_bte_out ;
517assign wbm_sel_o = pciu_sel_out ;
518
519// CONFIGURATION SPACE OUTPUTS
520wire [31:0] conf_w_data_out ;
521wire [31:0] conf_r_data_out ;
522wire conf_serr_enable_out ;
523wire conf_perr_response_out ;
524wire conf_pci_master_enable_out ;
525wire conf_mem_space_enable_out ;
526wire conf_io_space_enable_out ;
527wire [7:0] conf_cache_line_size_to_pci_out ;
528wire [7:0] conf_cache_line_size_to_wb_out ;
529wire conf_cache_lsize_not_zero_to_wb_out ;
530wire [7:0] conf_latency_tim_out ;
531
532wire [pci_ba0_width - 1:0] conf_pci_ba0_out ;
533wire [pci_ba1_5_width - 1:0] conf_pci_ba1_out ;
534wire [pci_ba1_5_width - 1:0] conf_pci_ba2_out ;
535wire [pci_ba1_5_width - 1:0] conf_pci_ba3_out ;
536wire [pci_ba1_5_width - 1:0] conf_pci_ba4_out ;
537wire [pci_ba1_5_width - 1:0] conf_pci_ba5_out ;
538wire [pci_ba1_5_width - 1:0] conf_pci_ta0_out ;
539wire [pci_ba1_5_width - 1:0] conf_pci_ta1_out ;
540wire [pci_ba1_5_width - 1:0] conf_pci_ta2_out ;
541wire [pci_ba1_5_width - 1:0] conf_pci_ta3_out ;
542wire [pci_ba1_5_width - 1:0] conf_pci_ta4_out ;
543wire [pci_ba1_5_width - 1:0] conf_pci_ta5_out ;
544wire [pci_ba1_5_width - 1:0] conf_pci_am0_out ;
545wire [pci_ba1_5_width - 1:0] conf_pci_am1_out ;
546wire [pci_ba1_5_width - 1:0] conf_pci_am2_out ;
547wire [pci_ba1_5_width - 1:0] conf_pci_am3_out ;
548wire [pci_ba1_5_width - 1:0] conf_pci_am4_out ;
549wire [pci_ba1_5_width - 1:0] conf_pci_am5_out ;
550
551wire conf_pci_mem_io0_out ;
552wire conf_pci_mem_io1_out ;
553wire conf_pci_mem_io2_out ;
554wire conf_pci_mem_io3_out ;
555wire conf_pci_mem_io4_out ;
556wire conf_pci_mem_io5_out ;
557
558wire [1:0] conf_pci_img_ctrl0_out ;
559wire [1:0] conf_pci_img_ctrl1_out ;
560wire [1:0] conf_pci_img_ctrl2_out ;
561wire [1:0] conf_pci_img_ctrl3_out ;
562wire [1:0] conf_pci_img_ctrl4_out ;
563wire [1:0] conf_pci_img_ctrl5_out ;
564
565wire [19:(20 - `WB_NUM_OF_DEC_ADDR_LINES)] conf_wb_ba0_out ;
566wire [19:(20 - `WB_NUM_OF_DEC_ADDR_LINES)] conf_wb_ba1_out ;
567wire [19:(20 - `WB_NUM_OF_DEC_ADDR_LINES)] conf_wb_ba2_out ;
568wire [19:(20 - `WB_NUM_OF_DEC_ADDR_LINES)] conf_wb_ba3_out ;
569wire [19:(20 - `WB_NUM_OF_DEC_ADDR_LINES)] conf_wb_ba4_out ;
570wire [19:(20 - `WB_NUM_OF_DEC_ADDR_LINES)] conf_wb_ba5_out ;
571
572wire conf_wb_mem_io0_out ;
573wire conf_wb_mem_io1_out ;
574wire conf_wb_mem_io2_out ;
575wire conf_wb_mem_io3_out ;
576wire conf_wb_mem_io4_out ;
577wire conf_wb_mem_io5_out ;
578
579wire [19:(20 - `WB_NUM_OF_DEC_ADDR_LINES)] conf_wb_am0_out ;
580wire [19:(20 - `WB_NUM_OF_DEC_ADDR_LINES)] conf_wb_am1_out ;
581wire [19:(20 - `WB_NUM_OF_DEC_ADDR_LINES)] conf_wb_am2_out ;
582wire [19:(20 - `WB_NUM_OF_DEC_ADDR_LINES)] conf_wb_am3_out ;
583wire [19:(20 - `WB_NUM_OF_DEC_ADDR_LINES)] conf_wb_am4_out ;
584wire [19:(20 - `WB_NUM_OF_DEC_ADDR_LINES)] conf_wb_am5_out ;
585wire [19:(20 - `WB_NUM_OF_DEC_ADDR_LINES)] conf_wb_ta0_out ;
586wire [19:(20 - `WB_NUM_OF_DEC_ADDR_LINES)] conf_wb_ta1_out ;
587wire [19:(20 - `WB_NUM_OF_DEC_ADDR_LINES)] conf_wb_ta2_out ;
588wire [19:(20 - `WB_NUM_OF_DEC_ADDR_LINES)] conf_wb_ta3_out ;
589wire [19:(20 - `WB_NUM_OF_DEC_ADDR_LINES)] conf_wb_ta4_out ;
590wire [19:(20 - `WB_NUM_OF_DEC_ADDR_LINES)] conf_wb_ta5_out ;
591wire [2:0] conf_wb_img_ctrl0_out ;
592wire [2:0] conf_wb_img_ctrl1_out ;
593wire [2:0] conf_wb_img_ctrl2_out ;
594wire [2:0] conf_wb_img_ctrl3_out ;
595wire [2:0] conf_wb_img_ctrl4_out ;
596wire [2:0] conf_wb_img_ctrl5_out ;
597wire [23:0] conf_ccyc_addr_out ;
598wire conf_soft_res_out ;
599wire conf_int_out ;
600wire conf_wb_init_complete_out ;
601wire conf_pci_init_complete_out ;
602
603// PCI IO MUX OUTPUTS
604wire pci_mux_frame_out ;
605wire pci_mux_irdy_out ;
606wire pci_mux_devsel_out ;
607wire pci_mux_trdy_out ;
608wire pci_mux_stop_out ;
609wire [3:0] pci_mux_cbe_out ;
610wire [31:0] pci_mux_ad_out ;
611wire pci_mux_ad_load_out ;
612
613wire [31:0] pci_mux_ad_en_out ;
614wire pci_mux_ad_en_unregistered_out ;
615wire pci_mux_frame_en_out ;
616wire pci_mux_irdy_en_out ;
617wire pci_mux_devsel_en_out ;
618wire pci_mux_trdy_en_out ;
619wire pci_mux_stop_en_out ;
620wire [3:0] pci_mux_cbe_en_out ;
621
622wire pci_mux_par_out ;
623wire pci_mux_par_en_out ;
624wire pci_mux_perr_out ;
625wire pci_mux_perr_en_out ;
626wire pci_mux_serr_out ;
627wire pci_mux_serr_en_out ;
628
629wire pci_mux_req_out ;
630wire pci_mux_req_en_out ;
631
632// assign outputs to top level outputs
633
634assign pci_ad_oe_o = pci_mux_ad_en_out ;
635assign pci_frame_oe_o = pci_mux_frame_en_out ;
636assign pci_irdy_oe_o = pci_mux_irdy_en_out ;
637assign pci_cbe_oe_o = pci_mux_cbe_en_out ;
638
639assign pci_par_o = pci_mux_par_out ;
640assign pci_par_oe_o = pci_mux_par_en_out ;
641assign pci_perr_o = pci_mux_perr_out ;
642assign pci_perr_oe_o = pci_mux_perr_en_out ;
643assign pci_serr_o = pci_mux_serr_out ;
644assign pci_serr_oe_o = pci_mux_serr_en_out ;
645
646assign pci_req_o = pci_mux_req_out ;
647assign pci_req_oe_o = pci_mux_req_en_out ;
648
649assign pci_trdy_oe_o = pci_mux_trdy_en_out ;
650assign pci_devsel_oe_o = pci_mux_devsel_en_out ;
651assign pci_stop_oe_o = pci_mux_stop_en_out ;
652assign pci_trdy_o = pci_mux_trdy_out ;
653assign pci_devsel_o = pci_mux_devsel_out ;
654assign pci_stop_o = pci_mux_stop_out ;
655
656assign pci_ad_o = pci_mux_ad_out ;
657assign pci_frame_o = pci_mux_frame_out ;
658assign pci_irdy_o = pci_mux_irdy_out ;
659assign pci_cbe_o = pci_mux_cbe_out ;
660
661// duplicate output register's outputs
662wire out_bckp_frame_out ;
663wire out_bckp_irdy_out ;
664wire out_bckp_devsel_out ;
665wire out_bckp_trdy_out ;
666wire out_bckp_stop_out ;
667wire [3:0] out_bckp_cbe_out ;
668wire out_bckp_cbe_en_out ;
669wire [31:0] out_bckp_ad_out ;
670wire out_bckp_ad_en_out ;
671wire out_bckp_irdy_en_out ;
672wire out_bckp_frame_en_out ;
673wire out_bckp_tar_ad_en_out ;
674wire out_bckp_mas_ad_en_out ;
675wire out_bckp_trdy_en_out ;
676
677wire out_bckp_par_out ;
678wire out_bckp_par_en_out ;
679wire out_bckp_perr_out ;
680wire out_bckp_perr_en_out ;
681wire out_bckp_serr_out ;
682wire out_bckp_serr_en_out ;
683
684wire int_pci_frame = out_bckp_frame_en_out ? out_bckp_frame_out : pci_frame_i ;
685wire int_pci_irdy = out_bckp_irdy_en_out ? out_bckp_irdy_out : pci_irdy_i ;
686wire int_pci_devsel = out_bckp_trdy_en_out ? out_bckp_devsel_out : pci_devsel_i ;
687wire int_pci_trdy = out_bckp_trdy_en_out ? out_bckp_trdy_out : pci_trdy_i ;
688wire int_pci_stop = out_bckp_trdy_en_out ? out_bckp_stop_out : pci_stop_i ;
689wire [ 3: 0] int_pci_cbe = out_bckp_cbe_en_out ? out_bckp_cbe_out : pci_cbe_i ;
690wire int_pci_par = out_bckp_par_en_out ? out_bckp_par_out : pci_par_i ;
691wire int_pci_perr = out_bckp_perr_en_out ? out_bckp_perr_out : pci_perr_i ;
692// PARITY CHECKER OUTPUTS
693wire parchk_pci_par_out ;
694wire parchk_pci_par_en_out ;
695wire parchk_pci_perr_out ;
696wire parchk_pci_perr_en_out ;
697wire parchk_pci_serr_out ;
698wire parchk_pci_serr_en_out ;
699wire parchk_par_err_detect_out ;
700wire parchk_perr_mas_detect_out ;
701wire parchk_sig_serr_out ;
702
703// input register outputs
704wire in_reg_gnt_out ;
705wire in_reg_frame_out ;
706wire in_reg_irdy_out ;
707wire in_reg_trdy_out ;
708wire in_reg_stop_out ;
709wire in_reg_devsel_out ;
710wire in_reg_idsel_out ;
711wire [31:0] in_reg_ad_out ;
712wire [3:0] in_reg_cbe_out ;
713
714/*=========================================================================================================
715Now comes definition of all modules' and their appropriate inputs
716=========================================================================================================*/
717// PCI BRIDGE RESET AND INTERRUPT LOGIC INPUTS
718wire pci_resi_rst_i = wb_rst_i ;
719wire pci_resi_pci_rstn_in = pci_rst_i ;
720wire pci_resi_conf_soft_res_in = conf_soft_res_out ;
721wire pci_inti_pci_intan_in = pci_inta_i ;
722wire pci_inti_conf_int_in = conf_int_out ;
723wire pci_inti_int_i = wb_int_i ;
724wire pci_into_init_complete_in = conf_pci_init_complete_out ;
725
726pci_rst_int pci_resets_and_interrupts
727(
728 .clk_in (pci_clk),
729 .rst_i (pci_resi_rst_i),
730 .pci_rstn_in (pci_resi_pci_rstn_in),
731 .conf_soft_res_in (pci_resi_conf_soft_res_in),
732 .reset (pci_reso_reset),
733 .pci_rstn_out (pci_reso_pci_rstn_out),
734 .pci_rstn_en_out (pci_reso_pci_rstn_en_out),
735 .rst_o (pci_reso_rst_o),
736 .pci_intan_in (pci_inti_pci_intan_in),
737 .conf_int_in (pci_inti_conf_int_in),
738 .int_i (pci_inti_int_i),
739 .pci_intan_out (pci_into_pci_intan_out),
740 .pci_intan_en_out (pci_into_pci_intan_en_out),
741 .int_o (pci_into_int_o),
742 .conf_isr_int_prop_out (pci_into_conf_isr_int_prop_out),
743 .init_complete_in (pci_into_init_complete_in)
744);
745
746
747`ifdef PCI_WB_REV_B3
748
749wire wbs_wbb3_2_wbb2_cyc_o ;
750wire wbs_wbb3_2_wbb2_stb_o ;
751wire [31:0] wbs_wbb3_2_wbb2_adr_o ;
752wire [31:0] wbs_wbb3_2_wbb2_dat_i_o ;
753wire [31:0] wbs_wbb3_2_wbb2_dat_o_o ;
754wire wbs_wbb3_2_wbb2_we_o ;
755wire [ 3:0] wbs_wbb3_2_wbb2_sel_o ;
756wire wbs_wbb3_2_wbb2_ack_o ;
757wire wbs_wbb3_2_wbb2_err_o ;
758wire wbs_wbb3_2_wbb2_rty_o ;
759wire wbs_wbb3_2_wbb2_cab_o ;
760
761// assign wishbone slave unit's outputs to top outputs where possible
762assign wbs_dat_o = wbs_wbb3_2_wbb2_dat_o_o ;
763assign wbs_ack_o = wbs_wbb3_2_wbb2_ack_o ;
764assign wbs_rty_o = wbs_wbb3_2_wbb2_rty_o ;
765assign wbs_err_o = wbs_wbb3_2_wbb2_err_o ;
766
767wire wbs_wbb3_2_wbb2_cyc_i = wbs_cyc_i ;
768wire wbs_wbb3_2_wbb2_stb_i = wbs_stb_i ;
769wire wbs_wbb3_2_wbb2_we_i = wbs_we_i ;
770wire wbs_wbb3_2_wbb2_ack_i = wbu_ack_out ;
771wire wbs_wbb3_2_wbb2_err_i = wbu_err_out ;
772wire wbs_wbb3_2_wbb2_rty_i = wbu_rty_out ;
773wire [31:0] wbs_wbb3_2_wbb2_adr_i = wbs_adr_i ;
774wire [ 3:0] wbs_wbb3_2_wbb2_sel_i = wbs_sel_i ;
775wire [31:0] wbs_wbb3_2_wbb2_dat_i_i = wbs_dat_i ;
776wire [31:0] wbs_wbb3_2_wbb2_dat_o_i = wbu_sdata_out ;
777wire [ 2:0] wbs_wbb3_2_wbb2_cti_i = wbs_cti_i ;
778wire [ 1:0] wbs_wbb3_2_wbb2_bte_i = wbs_bte_i ;
779
780pci_wbs_wbb3_2_wbb2 i_pci_wbs_wbb3_2_wbb2
781(
782 .wb_clk_i ( wb_clk_i ) ,
783 .wb_rst_i ( reset ) ,
784
785 .wbs_cyc_i ( wbs_wbb3_2_wbb2_cyc_i ) ,
786 .wbs_cyc_o ( wbs_wbb3_2_wbb2_cyc_o ) ,
787 .wbs_stb_i ( wbs_wbb3_2_wbb2_stb_i ) ,
788 .wbs_stb_o ( wbs_wbb3_2_wbb2_stb_o ) ,
789 .wbs_adr_i ( wbs_wbb3_2_wbb2_adr_i ) ,
790 .wbs_adr_o ( wbs_wbb3_2_wbb2_adr_o ) ,
791 .wbs_dat_i_i ( wbs_wbb3_2_wbb2_dat_i_i ) ,
792 .wbs_dat_i_o ( wbs_wbb3_2_wbb2_dat_i_o ) ,
793 .wbs_dat_o_i ( wbs_wbb3_2_wbb2_dat_o_i ) ,
794 .wbs_dat_o_o ( wbs_wbb3_2_wbb2_dat_o_o ) ,
795 .wbs_we_i ( wbs_wbb3_2_wbb2_we_i ) ,
796 .wbs_we_o ( wbs_wbb3_2_wbb2_we_o ) ,
797 .wbs_sel_i ( wbs_wbb3_2_wbb2_sel_i ) ,
798 .wbs_sel_o ( wbs_wbb3_2_wbb2_sel_o ) ,
799 .wbs_ack_i ( wbs_wbb3_2_wbb2_ack_i ) ,
800 .wbs_ack_o ( wbs_wbb3_2_wbb2_ack_o ) ,
801 .wbs_err_i ( wbs_wbb3_2_wbb2_err_i ) ,
802 .wbs_err_o ( wbs_wbb3_2_wbb2_err_o ) ,
803 .wbs_rty_i ( wbs_wbb3_2_wbb2_rty_i ) ,
804 .wbs_rty_o ( wbs_wbb3_2_wbb2_rty_o ) ,
805 .wbs_cti_i ( wbs_wbb3_2_wbb2_cti_i ) ,
806 .wbs_bte_i ( wbs_wbb3_2_wbb2_bte_i ) ,
807 .wbs_cab_o ( wbs_wbb3_2_wbb2_cab_o ) ,
808 .wb_init_complete_i ( conf_wb_init_complete_out )
809) ;
810
811// WISHBONE SLAVE UNIT INPUTS
812wire [31:0] wbu_addr_in = wbs_wbb3_2_wbb2_adr_o ;
813wire [31:0] wbu_sdata_in = wbs_wbb3_2_wbb2_dat_i_o ;
814wire wbu_cyc_in = wbs_wbb3_2_wbb2_cyc_o ;
815wire wbu_stb_in = wbs_wbb3_2_wbb2_stb_o ;
816wire wbu_we_in = wbs_wbb3_2_wbb2_we_o ;
817wire [3:0] wbu_sel_in = wbs_wbb3_2_wbb2_sel_o ;
818wire wbu_cab_in = wbs_wbb3_2_wbb2_cab_o ;
819
820`else
821
822// WISHBONE SLAVE UNIT INPUTS
823wire [31:0] wbu_addr_in = wbs_adr_i ;
824wire [31:0] wbu_sdata_in = wbs_dat_i ;
825wire wbu_cyc_in = wbs_cyc_i ;
826wire wbu_stb_in = wbs_stb_i ;
827wire wbu_we_in = wbs_we_i ;
828wire [3:0] wbu_sel_in = wbs_sel_i ;
829wire wbu_cab_in = wbs_cab_i ;
830
831// assign wishbone slave unit's outputs to top outputs where possible
832assign wbs_dat_o = wbu_sdata_out ;
833assign wbs_ack_o = wbu_ack_out ;
834assign wbs_rty_o = wbu_rty_out ;
835assign wbs_err_o = wbu_err_out ;
836
837`endif
838
839wire [5:0] wbu_map_in = {
840 conf_wb_mem_io5_out,
841 conf_wb_mem_io4_out,
842 conf_wb_mem_io3_out,
843 conf_wb_mem_io2_out,
844 conf_wb_mem_io1_out,
845 conf_wb_mem_io0_out
846 } ;
847
848wire [5:0] wbu_pref_en_in = {
849 conf_wb_img_ctrl5_out[1],
850 conf_wb_img_ctrl4_out[1],
851 conf_wb_img_ctrl3_out[1],
852 conf_wb_img_ctrl2_out[1],
853 conf_wb_img_ctrl1_out[1],
854 conf_wb_img_ctrl0_out[1]
855 };
856wire [5:0] wbu_mrl_en_in = {
857 conf_wb_img_ctrl5_out[0],
858 conf_wb_img_ctrl4_out[0],
859 conf_wb_img_ctrl3_out[0],
860 conf_wb_img_ctrl2_out[0],
861 conf_wb_img_ctrl1_out[0],
862 conf_wb_img_ctrl0_out[0]
863 };
864
865wire [5:0] wbu_at_en_in = {
866 conf_wb_img_ctrl5_out[2],
867 conf_wb_img_ctrl4_out[2],
868 conf_wb_img_ctrl3_out[2],
869 conf_wb_img_ctrl2_out[2],
870 conf_wb_img_ctrl1_out[2],
871 conf_wb_img_ctrl0_out[2]
872 } ;
873
874wire wbu_pci_drcomp_pending_in = pciu_pci_drcomp_pending_out ;
875wire wbu_pciw_empty_in = pciu_pciw_fifo_empty_out ;
876
877`ifdef HOST
878 wire [31:0] wbu_conf_data_in = conf_w_data_out ;
879`else
880`ifdef GUEST
881 wire [31:0] wbu_conf_data_in = conf_r_data_out ;
882`endif
883`endif
884
885wire [(`WB_NUM_OF_DEC_ADDR_LINES - 1):0] wbu_bar0_in = conf_wb_ba0_out ;
886wire [(`WB_NUM_OF_DEC_ADDR_LINES - 1):0] wbu_bar1_in = conf_wb_ba1_out ;
887wire [(`WB_NUM_OF_DEC_ADDR_LINES - 1):0] wbu_bar2_in = conf_wb_ba2_out ;
888wire [(`WB_NUM_OF_DEC_ADDR_LINES - 1):0] wbu_bar3_in = conf_wb_ba3_out ;
889wire [(`WB_NUM_OF_DEC_ADDR_LINES - 1):0] wbu_bar4_in = conf_wb_ba4_out ;
890wire [(`WB_NUM_OF_DEC_ADDR_LINES - 1):0] wbu_bar5_in = conf_wb_ba5_out ;
891wire [(`WB_NUM_OF_DEC_ADDR_LINES - 1):0] wbu_am0_in = conf_wb_am0_out ;
892wire [(`WB_NUM_OF_DEC_ADDR_LINES - 1):0] wbu_am1_in = conf_wb_am1_out ;
893wire [(`WB_NUM_OF_DEC_ADDR_LINES - 1):0] wbu_am2_in = conf_wb_am2_out ;
894wire [(`WB_NUM_OF_DEC_ADDR_LINES - 1):0] wbu_am3_in = conf_wb_am3_out ;
895wire [(`WB_NUM_OF_DEC_ADDR_LINES - 1):0] wbu_am4_in = conf_wb_am4_out ;
896wire [(`WB_NUM_OF_DEC_ADDR_LINES - 1):0] wbu_am5_in = conf_wb_am5_out ;
897wire [(`WB_NUM_OF_DEC_ADDR_LINES - 1):0] wbu_ta0_in = conf_wb_ta0_out ;
898wire [(`WB_NUM_OF_DEC_ADDR_LINES - 1):0] wbu_ta1_in = conf_wb_ta1_out ;
899wire [(`WB_NUM_OF_DEC_ADDR_LINES - 1):0] wbu_ta2_in = conf_wb_ta2_out ;
900wire [(`WB_NUM_OF_DEC_ADDR_LINES - 1):0] wbu_ta3_in = conf_wb_ta3_out ;
901wire [(`WB_NUM_OF_DEC_ADDR_LINES - 1):0] wbu_ta4_in = conf_wb_ta4_out ;
902wire [(`WB_NUM_OF_DEC_ADDR_LINES - 1):0] wbu_ta5_in = conf_wb_ta5_out ;
903
904wire [23:0] wbu_ccyc_addr_in = conf_ccyc_addr_out ;
905wire wbu_master_enable_in = conf_pci_master_enable_out ;
906wire wbu_cache_line_size_not_zero = conf_cache_lsize_not_zero_to_wb_out ;
907wire [7:0] wbu_cache_line_size_in = conf_cache_line_size_to_pci_out ;
908
909wire wbu_pciif_gnt_in = pci_gnt_i ;
910wire wbu_pciif_frame_in = in_reg_frame_out ;
911wire wbu_pciif_irdy_in = in_reg_irdy_out ;
912wire wbu_pciif_trdy_in = int_pci_trdy ;
913wire wbu_pciif_stop_in = int_pci_stop ;
914wire wbu_pciif_devsel_in = int_pci_devsel ;
915wire [31:0] wbu_pciif_ad_reg_in = in_reg_ad_out ;
916wire wbu_pciif_trdy_reg_in = in_reg_trdy_out ;
917wire wbu_pciif_stop_reg_in = in_reg_stop_out ;
918wire wbu_pciif_devsel_reg_in = in_reg_devsel_out ;
919
920
921wire [7:0] wbu_latency_tim_val_in = conf_latency_tim_out ;
922
923wire wbu_pciif_frame_en_in = out_bckp_frame_en_out ;
924wire wbu_pciif_frame_out_in = out_bckp_frame_out ;
925wire wbu_wb_init_complete_in = conf_wb_init_complete_out ;
926
927pci_wb_slave_unit wishbone_slave_unit
928(
929 .reset_in (reset),
930 .wb_clock_in (wb_clk),
931 .pci_clock_in (pci_clk),
932 .ADDR_I (wbu_addr_in),
933 .SDATA_I (wbu_sdata_in),
934 .SDATA_O (wbu_sdata_out),
935 .CYC_I (wbu_cyc_in),
936 .STB_I (wbu_stb_in),
937 .WE_I (wbu_we_in),
938 .SEL_I (wbu_sel_in),
939 .ACK_O (wbu_ack_out),
940 .RTY_O (wbu_rty_out),
941 .ERR_O (wbu_err_out),
942 .CAB_I (wbu_cab_in),
943 .wbu_map_in (wbu_map_in),
944 .wbu_pref_en_in (wbu_pref_en_in),
945 .wbu_mrl_en_in (wbu_mrl_en_in),
946 .wbu_pci_drcomp_pending_in (wbu_pci_drcomp_pending_in),
947 .wbu_conf_data_in (wbu_conf_data_in),
948 .wbu_pciw_empty_in (wbu_pciw_empty_in),
949 .wbu_bar0_in (wbu_bar0_in),
950 .wbu_bar1_in (wbu_bar1_in),
951 .wbu_bar2_in (wbu_bar2_in),
952 .wbu_bar3_in (wbu_bar3_in),
953 .wbu_bar4_in (wbu_bar4_in),
954 .wbu_bar5_in (wbu_bar5_in),
955 .wbu_am0_in (wbu_am0_in),
956 .wbu_am1_in (wbu_am1_in),
957 .wbu_am2_in (wbu_am2_in),
958 .wbu_am3_in (wbu_am3_in),
959 .wbu_am4_in (wbu_am4_in),
960 .wbu_am5_in (wbu_am5_in),
961 .wbu_ta0_in (wbu_ta0_in),
962 .wbu_ta1_in (wbu_ta1_in),
963 .wbu_ta2_in (wbu_ta2_in),
964 .wbu_ta3_in (wbu_ta3_in),
965 .wbu_ta4_in (wbu_ta4_in),
966 .wbu_ta5_in (wbu_ta5_in),
967 .wbu_at_en_in (wbu_at_en_in),
968 .wbu_ccyc_addr_in (wbu_ccyc_addr_in),
969 .wbu_master_enable_in (wbu_master_enable_in),
970 .wb_init_complete_in (wbu_wb_init_complete_in),
971 .wbu_cache_line_size_not_zero (wbu_cache_line_size_not_zero),
972 .wbu_cache_line_size_in (wbu_cache_line_size_in),
973 .wbu_pciif_gnt_in (wbu_pciif_gnt_in),
974 .wbu_pciif_frame_in (wbu_pciif_frame_in),
975 .wbu_pciif_frame_en_in (wbu_pciif_frame_en_in),
976 .wbu_pciif_frame_out_in (wbu_pciif_frame_out_in),
977 .wbu_pciif_irdy_in (wbu_pciif_irdy_in),
978 .wbu_pciif_trdy_in (wbu_pciif_trdy_in),
979 .wbu_pciif_stop_in (wbu_pciif_stop_in),
980 .wbu_pciif_devsel_in (wbu_pciif_devsel_in),
981 .wbu_pciif_ad_reg_in (wbu_pciif_ad_reg_in),
982 .wbu_pciif_req_out (wbu_pciif_req_out),
983 .wbu_pciif_frame_out (wbu_pciif_frame_out),
984 .wbu_pciif_frame_en_out (wbu_pciif_frame_en_out),
985 .wbu_pciif_frame_load_out (wbu_pciif_frame_load_out),
986 .wbu_pciif_irdy_out (wbu_pciif_irdy_out),
987 .wbu_pciif_irdy_en_out (wbu_pciif_irdy_en_out),
988 .wbu_pciif_ad_out (wbu_pciif_ad_out),
989 .wbu_pciif_ad_en_out (wbu_pciif_ad_en_out),
990 .wbu_pciif_cbe_out (wbu_pciif_cbe_out),
991 .wbu_pciif_cbe_en_out (wbu_pciif_cbe_en_out),
992 .wbu_err_addr_out (wbu_err_addr_out),
993 .wbu_err_bc_out (wbu_err_bc_out),
994 .wbu_err_signal_out (wbu_err_signal_out),
995 .wbu_err_source_out (wbu_err_source_out),
996 .wbu_err_rty_exp_out (wbu_err_rty_exp_out),
997 .wbu_tabort_rec_out (wbu_tabort_rec_out),
998 .wbu_mabort_rec_out (wbu_mabort_rec_out),
999 .wbu_conf_offset_out (wbu_conf_offset_out),
1000 .wbu_conf_renable_out (wbu_conf_renable_out),
1001 .wbu_conf_wenable_out (wbu_conf_wenable_out),
1002 .wbu_conf_be_out (wbu_conf_be_out),
1003 .wbu_conf_data_out (wbu_conf_data_out),
1004 .wbu_del_read_comp_pending_out (wbu_del_read_comp_pending_out),
1005 .wbu_wbw_fifo_empty_out (wbu_wbw_fifo_empty_out),
1006 .wbu_latency_tim_val_in (wbu_latency_tim_val_in),
1007 .wbu_ad_load_out (wbu_ad_load_out),
1008 .wbu_ad_load_on_transfer_out (wbu_ad_load_on_transfer_out),
1009 .wbu_pciif_trdy_reg_in (wbu_pciif_trdy_reg_in),
1010 .wbu_pciif_stop_reg_in (wbu_pciif_stop_reg_in),
1011 .wbu_pciif_devsel_reg_in (wbu_pciif_devsel_reg_in)
1012
1013`ifdef PCI_BIST
1014 ,
1015 .mbist_si_i (mbist_si_i),
1016 .mbist_so_o (mbist_so_o_internal),
1017 .mbist_ctrl_i (mbist_ctrl_i)
1018`endif
1019);
1020
1021// PCI TARGET UNIT INPUTS
1022wire [31:0] pciu_mdata_in = wbm_dat_i ;
1023wire pciu_ack_in = wbm_ack_i ;
1024wire pciu_rty_in = wbm_rty_i ;
1025wire pciu_err_in = wbm_err_i ;
1026
1027wire [5:0] pciu_map_in = {
1028 conf_pci_mem_io5_out,
1029 conf_pci_mem_io4_out,
1030 conf_pci_mem_io3_out,
1031 conf_pci_mem_io2_out,
1032 conf_pci_mem_io1_out,
1033 conf_pci_mem_io0_out
1034 } ;
1035
1036wire [5:0] pciu_pref_en_in = {
1037 conf_pci_img_ctrl5_out[0],
1038 conf_pci_img_ctrl4_out[0],
1039 conf_pci_img_ctrl3_out[0],
1040 conf_pci_img_ctrl2_out[0],
1041 conf_pci_img_ctrl1_out[0],
1042 conf_pci_img_ctrl0_out[0]
1043 };
1044
1045wire [5:0] pciu_at_en_in = {
1046 conf_pci_img_ctrl5_out[1],
1047 conf_pci_img_ctrl4_out[1],
1048 conf_pci_img_ctrl3_out[1],
1049 conf_pci_img_ctrl2_out[1],
1050 conf_pci_img_ctrl1_out[1],
1051 conf_pci_img_ctrl0_out[1]
1052 } ;
1053
1054wire pciu_mem_enable_in = conf_mem_space_enable_out ;
1055wire pciu_io_enable_in = conf_io_space_enable_out ;
1056
1057wire pciu_wbw_fifo_empty_in = wbu_wbw_fifo_empty_out ;
1058wire pciu_wbu_del_read_comp_pending_in = wbu_del_read_comp_pending_out ;
1059wire pciu_wbu_frame_en_in = out_bckp_frame_en_out ;
1060
1061`ifdef HOST
1062 wire [31:0] pciu_conf_data_in = conf_r_data_out ;
1063`else
1064`ifdef GUEST
1065 wire [31:0] pciu_conf_data_in = conf_w_data_out ;
1066`endif
1067`endif
1068
1069wire [pci_ba0_width - 1:0] pciu_bar0_in = conf_pci_ba0_out ;
1070wire [pci_ba1_5_width - 1:0] pciu_bar1_in = conf_pci_ba1_out ;
1071wire [pci_ba1_5_width - 1:0] pciu_bar2_in = conf_pci_ba2_out ;
1072wire [pci_ba1_5_width - 1:0] pciu_bar3_in = conf_pci_ba3_out ;
1073wire [pci_ba1_5_width - 1:0] pciu_bar4_in = conf_pci_ba4_out ;
1074wire [pci_ba1_5_width - 1:0] pciu_bar5_in = conf_pci_ba5_out ;
1075wire [pci_ba1_5_width - 1:0] pciu_am0_in = conf_pci_am0_out ;
1076wire [pci_ba1_5_width - 1:0] pciu_am1_in = conf_pci_am1_out ;
1077wire [pci_ba1_5_width - 1:0] pciu_am2_in = conf_pci_am2_out ;
1078wire [pci_ba1_5_width - 1:0] pciu_am3_in = conf_pci_am3_out ;
1079wire [pci_ba1_5_width - 1:0] pciu_am4_in = conf_pci_am4_out ;
1080wire [pci_ba1_5_width - 1:0] pciu_am5_in = conf_pci_am5_out ;
1081wire [pci_ba1_5_width - 1:0] pciu_ta0_in = conf_pci_ta0_out ;
1082wire [pci_ba1_5_width - 1:0] pciu_ta1_in = conf_pci_ta1_out ;
1083wire [pci_ba1_5_width - 1:0] pciu_ta2_in = conf_pci_ta2_out ;
1084wire [pci_ba1_5_width - 1:0] pciu_ta3_in = conf_pci_ta3_out ;
1085wire [pci_ba1_5_width - 1:0] pciu_ta4_in = conf_pci_ta4_out ;
1086wire [pci_ba1_5_width - 1:0] pciu_ta5_in = conf_pci_ta5_out ;
1087
1088wire [7:0] pciu_cache_line_size_in = conf_cache_line_size_to_wb_out ;
1089wire pciu_cache_lsize_not_zero_in = conf_cache_lsize_not_zero_to_wb_out ;
1090
1091wire pciu_pciif_frame_in = int_pci_frame ;
1092wire pciu_pciif_irdy_in = int_pci_irdy ;
1093wire pciu_pciif_idsel_in = pci_idsel_i ;
1094wire pciu_pciif_frame_reg_in = in_reg_frame_out ;
1095wire pciu_pciif_irdy_reg_in = in_reg_irdy_out ;
1096wire pciu_pciif_idsel_reg_in = in_reg_idsel_out ;
1097wire [31:0] pciu_pciif_ad_reg_in = in_reg_ad_out ;
1098wire [3:0] pciu_pciif_cbe_reg_in = in_reg_cbe_out ;
1099wire [3:0] pciu_pciif_cbe_in = int_pci_cbe ;
1100
1101wire pciu_pciif_bckp_trdy_en_in = out_bckp_trdy_en_out ;
1102wire pciu_pciif_bckp_devsel_in = out_bckp_devsel_out ;
1103wire pciu_pciif_bckp_trdy_in = out_bckp_trdy_out ;
1104wire pciu_pciif_bckp_stop_in = out_bckp_stop_out ;
1105wire pciu_pciif_trdy_reg_in = in_reg_trdy_out ;
1106wire pciu_pciif_stop_reg_in = in_reg_stop_out ;
1107
1108pci_target_unit pci_target_unit
1109(
1110 .reset_in (reset),
1111 .wb_clock_in (wb_clk),
1112 .pci_clock_in (pci_clk),
1113 .pciu_wbm_adr_o (pciu_adr_out),
1114 .pciu_wbm_dat_o (pciu_mdata_out),
1115 .pciu_wbm_dat_i (pciu_mdata_in),
1116 .pciu_wbm_cyc_o (pciu_cyc_out),
1117 .pciu_wbm_stb_o (pciu_stb_out),
1118 .pciu_wbm_we_o (pciu_we_out),
1119 .pciu_wbm_cti_o (pciu_cti_out),
1120 .pciu_wbm_bte_o (pciu_bte_out),
1121 .pciu_wbm_sel_o (pciu_sel_out),
1122 .pciu_wbm_ack_i (pciu_ack_in),
1123 .pciu_wbm_rty_i (pciu_rty_in),
1124 .pciu_wbm_err_i (pciu_err_in),
1125 .pciu_mem_enable_in (pciu_mem_enable_in),
1126 .pciu_io_enable_in (pciu_io_enable_in),
1127 .pciu_map_in (pciu_map_in),
1128 .pciu_pref_en_in (pciu_pref_en_in),
1129 .pciu_conf_data_in (pciu_conf_data_in),
1130 .pciu_wbw_fifo_empty_in (pciu_wbw_fifo_empty_in),
1131 .pciu_wbu_del_read_comp_pending_in (pciu_wbu_del_read_comp_pending_in),
1132 .pciu_wbu_frame_en_in (pciu_wbu_frame_en_in),
1133 .pciu_bar0_in (pciu_bar0_in),
1134 .pciu_bar1_in (pciu_bar1_in),
1135 .pciu_bar2_in (pciu_bar2_in),
1136 .pciu_bar3_in (pciu_bar3_in),
1137 .pciu_bar4_in (pciu_bar4_in),
1138 .pciu_bar5_in (pciu_bar5_in),
1139 .pciu_am0_in (pciu_am0_in),
1140 .pciu_am1_in (pciu_am1_in),
1141 .pciu_am2_in (pciu_am2_in),
1142 .pciu_am3_in (pciu_am3_in),
1143 .pciu_am4_in (pciu_am4_in),
1144 .pciu_am5_in (pciu_am5_in),
1145 .pciu_ta0_in (pciu_ta0_in),
1146 .pciu_ta1_in (pciu_ta1_in),
1147 .pciu_ta2_in (pciu_ta2_in),
1148 .pciu_ta3_in (pciu_ta3_in),
1149 .pciu_ta4_in (pciu_ta4_in),
1150 .pciu_ta5_in (pciu_ta5_in),
1151 .pciu_at_en_in (pciu_at_en_in),
1152 .pciu_cache_line_size_in (pciu_cache_line_size_in),
1153 .pciu_cache_lsize_not_zero_in (pciu_cache_lsize_not_zero_in),
1154 .pciu_pciif_frame_in (pciu_pciif_frame_in),
1155 .pciu_pciif_irdy_in (pciu_pciif_irdy_in),
1156 .pciu_pciif_idsel_in (pciu_pciif_idsel_in),
1157 .pciu_pciif_frame_reg_in (pciu_pciif_frame_reg_in),
1158 .pciu_pciif_irdy_reg_in (pciu_pciif_irdy_reg_in),
1159 .pciu_pciif_idsel_reg_in (pciu_pciif_idsel_reg_in),
1160 .pciu_pciif_ad_reg_in (pciu_pciif_ad_reg_in),
1161 .pciu_pciif_cbe_reg_in (pciu_pciif_cbe_reg_in),
1162 .pciu_pciif_cbe_in (pciu_pciif_cbe_in),
1163 .pciu_pciif_bckp_trdy_en_in (pciu_pciif_bckp_trdy_en_in),
1164 .pciu_pciif_bckp_devsel_in (pciu_pciif_bckp_devsel_in),
1165 .pciu_pciif_bckp_trdy_in (pciu_pciif_bckp_trdy_in),
1166 .pciu_pciif_bckp_stop_in (pciu_pciif_bckp_stop_in),
1167 .pciu_pciif_trdy_reg_in (pciu_pciif_trdy_reg_in),
1168 .pciu_pciif_stop_reg_in (pciu_pciif_stop_reg_in),
1169 .pciu_pciif_trdy_out (pciu_pciif_trdy_out),
1170 .pciu_pciif_stop_out (pciu_pciif_stop_out),
1171 .pciu_pciif_devsel_out (pciu_pciif_devsel_out),
1172 .pciu_pciif_trdy_en_out (pciu_pciif_trdy_en_out),
1173 .pciu_pciif_stop_en_out (pciu_pciif_stop_en_out),
1174 .pciu_pciif_devsel_en_out (pciu_pciif_devsel_en_out),
1175 .pciu_ad_load_out (pciu_ad_load_out),
1176 .pciu_ad_load_on_transfer_out (pciu_ad_load_on_transfer_out),
1177 .pciu_pciif_ad_out (pciu_pciif_ad_out),
1178 .pciu_pciif_ad_en_out (pciu_pciif_ad_en_out),
1179 .pciu_pciif_tabort_set_out (pciu_pciif_tabort_set_out),
1180 .pciu_err_addr_out (pciu_err_addr_out),
1181 .pciu_err_bc_out (pciu_err_bc_out),
1182 .pciu_err_data_out (pciu_err_data_out),
1183 .pciu_err_be_out (pciu_err_be_out),
1184 .pciu_err_signal_out (pciu_err_signal_out),
1185 .pciu_err_source_out (pciu_err_source_out),
1186 .pciu_err_rty_exp_out (pciu_err_rty_exp_out),
1187 .pciu_conf_offset_out (pciu_conf_offset_out),
1188 .pciu_conf_renable_out (pciu_conf_renable_out),
1189 .pciu_conf_wenable_out (pciu_conf_wenable_out),
1190 .pciu_conf_be_out (pciu_conf_be_out),
1191 .pciu_conf_data_out (pciu_conf_data_out),
1192 .pciu_pci_drcomp_pending_out (pciu_pci_drcomp_pending_out),
1193 .pciu_pciw_fifo_empty_out (pciu_pciw_fifo_empty_out)
1194
1195`ifdef PCI_BIST
1196 ,
1197 .mbist_si_i (mbist_so_o_internal),
1198 .mbist_so_o (mbist_so_o),
1199 .mbist_ctrl_i (mbist_ctrl_i)
1200`endif
1201);
1202
1203
1204// CONFIGURATION SPACE INPUTS
1205`ifdef HOST
1206
1207 wire [11:0] conf_w_addr_in = wbu_conf_offset_out ;
1208 wire [31:0] conf_w_data_in = wbu_conf_data_out ;
1209 wire conf_w_we_in = wbu_conf_wenable_out ;
1210 wire conf_w_re_in = wbu_conf_renable_out ;
1211 wire [3:0] conf_w_be_in = wbu_conf_be_out ;
1212 wire conf_w_clock = wb_clk ;
1213 wire [11:0] conf_r_addr_in = pciu_conf_offset_out ;
1214 wire conf_r_re_in = pciu_conf_renable_out ;
1215
1216`else
1217`ifdef GUEST
1218
1219 wire [11:0] conf_r_addr_in = wbu_conf_offset_out ;
1220 wire conf_r_re_in = wbu_conf_renable_out ;
1221 wire conf_w_clock = pci_clk ;
1222 wire [11:0] conf_w_addr_in = pciu_conf_offset_out ;
1223 wire [31:0] conf_w_data_in = pciu_conf_data_out ;
1224 wire conf_w_we_in = pciu_conf_wenable_out ;
1225 wire conf_w_re_in = pciu_conf_renable_out ;
1226 wire [3:0] conf_w_be_in = pciu_conf_be_out ;
1227
1228`endif
1229`endif
1230
1231
1232wire conf_perr_in = parchk_par_err_detect_out ;
1233wire conf_serr_in = parchk_sig_serr_out ;
1234wire conf_master_abort_recv_in = wbu_mabort_rec_out ;
1235wire conf_target_abort_recv_in = wbu_tabort_rec_out ;
1236wire conf_target_abort_set_in = pciu_pciif_tabort_set_out ;
1237
1238wire conf_master_data_par_err_in = parchk_perr_mas_detect_out ;
1239
1240wire [3:0] conf_pci_err_be_in = pciu_err_be_out ;
1241wire [3:0] conf_pci_err_bc_in = pciu_err_bc_out;
1242wire conf_pci_err_es_in = pciu_err_source_out ;
1243wire conf_pci_err_rty_exp_in = pciu_err_rty_exp_out ;
1244wire conf_pci_err_sig_in = pciu_err_signal_out ;
1245wire [31:0] conf_pci_err_addr_in = pciu_err_addr_out ;
1246wire [31:0] conf_pci_err_data_in = pciu_err_data_out ;
1247
1248wire [3:0] conf_wb_err_be_in = out_bckp_cbe_out ;
1249wire [3:0] conf_wb_err_bc_in = wbu_err_bc_out ;
1250wire conf_wb_err_rty_exp_in = wbu_err_rty_exp_out ;
1251wire conf_wb_err_es_in = wbu_err_source_out ;
1252wire conf_wb_err_sig_in = wbu_err_signal_out ;
1253wire [31:0] conf_wb_err_addr_in = wbu_err_addr_out ;
1254wire [31:0] conf_wb_err_data_in = out_bckp_ad_out ;
1255
1256wire conf_isr_int_prop_in = pci_into_conf_isr_int_prop_out ;
1257wire conf_par_err_int_in = parchk_perr_mas_detect_out ;
1258wire conf_sys_err_int_in = parchk_sig_serr_out ;
1259
1260pci_conf_space configuration(
1261 .reset (reset),
1262 .pci_clk (pci_clk),
1263 .wb_clk (wb_clk),
1264 .w_conf_address_in (conf_w_addr_in),
1265 .w_conf_data_in (conf_w_data_in),
1266 .w_conf_data_out (conf_w_data_out),
1267 .r_conf_address_in (conf_r_addr_in),
1268 .r_conf_data_out (conf_r_data_out),
1269 .w_we_i (conf_w_we_in),
1270 .w_re (conf_w_re_in),
1271 .r_re (conf_r_re_in),
1272 .w_byte_en_in (conf_w_be_in),
1273 .w_clock (conf_w_clock),
1274 .serr_enable (conf_serr_enable_out),
1275 .perr_response (conf_perr_response_out),
1276 .pci_master_enable (conf_pci_master_enable_out),
1277 .memory_space_enable (conf_mem_space_enable_out),
1278 .io_space_enable (conf_io_space_enable_out),
1279 .perr_in (conf_perr_in),
1280 .serr_in (conf_serr_in),
1281 .master_abort_recv (conf_master_abort_recv_in),
1282 .target_abort_recv (conf_target_abort_recv_in),
1283 .target_abort_set (conf_target_abort_set_in),
1284 .master_data_par_err (conf_master_data_par_err_in),
1285 .cache_line_size_to_pci (conf_cache_line_size_to_pci_out),
1286 .cache_line_size_to_wb (conf_cache_line_size_to_wb_out),
1287 .cache_lsize_not_zero_to_wb (conf_cache_lsize_not_zero_to_wb_out),
1288 .latency_tim (conf_latency_tim_out),
1289 .pci_base_addr0 (conf_pci_ba0_out),
1290 .pci_base_addr1 (conf_pci_ba1_out),
1291 .pci_base_addr2 (conf_pci_ba2_out),
1292 .pci_base_addr3 (conf_pci_ba3_out),
1293 .pci_base_addr4 (conf_pci_ba4_out),
1294 .pci_base_addr5 (conf_pci_ba5_out),
1295 .pci_memory_io0 (conf_pci_mem_io0_out),
1296 .pci_memory_io1 (conf_pci_mem_io1_out),
1297 .pci_memory_io2 (conf_pci_mem_io2_out),
1298 .pci_memory_io3 (conf_pci_mem_io3_out),
1299 .pci_memory_io4 (conf_pci_mem_io4_out),
1300 .pci_memory_io5 (conf_pci_mem_io5_out),
1301 .pci_addr_mask0 (conf_pci_am0_out),
1302 .pci_addr_mask1 (conf_pci_am1_out),
1303 .pci_addr_mask2 (conf_pci_am2_out),
1304 .pci_addr_mask3 (conf_pci_am3_out),
1305 .pci_addr_mask4 (conf_pci_am4_out),
1306 .pci_addr_mask5 (conf_pci_am5_out),
1307 .pci_tran_addr0 (conf_pci_ta0_out),
1308 .pci_tran_addr1 (conf_pci_ta1_out),
1309 .pci_tran_addr2 (conf_pci_ta2_out),
1310 .pci_tran_addr3 (conf_pci_ta3_out),
1311 .pci_tran_addr4 (conf_pci_ta4_out),
1312 .pci_tran_addr5 (conf_pci_ta5_out),
1313 .pci_img_ctrl0 (conf_pci_img_ctrl0_out),
1314 .pci_img_ctrl1 (conf_pci_img_ctrl1_out),
1315 .pci_img_ctrl2 (conf_pci_img_ctrl2_out),
1316 .pci_img_ctrl3 (conf_pci_img_ctrl3_out),
1317 .pci_img_ctrl4 (conf_pci_img_ctrl4_out),
1318 .pci_img_ctrl5 (conf_pci_img_ctrl5_out),
1319 .pci_error_be (conf_pci_err_be_in),
1320 .pci_error_bc (conf_pci_err_bc_in),
1321 .pci_error_rty_exp (conf_pci_err_rty_exp_in),
1322 .pci_error_es (conf_pci_err_es_in),
1323 .pci_error_sig (conf_pci_err_sig_in),
1324 .pci_error_addr (conf_pci_err_addr_in),
1325 .pci_error_data (conf_pci_err_data_in),
1326 .wb_base_addr0 (conf_wb_ba0_out),
1327 .wb_base_addr1 (conf_wb_ba1_out),
1328 .wb_base_addr2 (conf_wb_ba2_out),
1329 .wb_base_addr3 (conf_wb_ba3_out),
1330 .wb_base_addr4 (conf_wb_ba4_out),
1331 .wb_base_addr5 (conf_wb_ba5_out),
1332 .wb_memory_io0 (conf_wb_mem_io0_out),
1333 .wb_memory_io1 (conf_wb_mem_io1_out),
1334 .wb_memory_io2 (conf_wb_mem_io2_out),
1335 .wb_memory_io3 (conf_wb_mem_io3_out),
1336 .wb_memory_io4 (conf_wb_mem_io4_out),
1337 .wb_memory_io5 (conf_wb_mem_io5_out),
1338 .wb_addr_mask0 (conf_wb_am0_out),
1339 .wb_addr_mask1 (conf_wb_am1_out),
1340 .wb_addr_mask2 (conf_wb_am2_out),
1341 .wb_addr_mask3 (conf_wb_am3_out),
1342 .wb_addr_mask4 (conf_wb_am4_out),
1343 .wb_addr_mask5 (conf_wb_am5_out),
1344 .wb_tran_addr0 (conf_wb_ta0_out),
1345 .wb_tran_addr1 (conf_wb_ta1_out),
1346 .wb_tran_addr2 (conf_wb_ta2_out),
1347 .wb_tran_addr3 (conf_wb_ta3_out),
1348 .wb_tran_addr4 (conf_wb_ta4_out),
1349 .wb_tran_addr5 (conf_wb_ta5_out),
1350 .wb_img_ctrl0 (conf_wb_img_ctrl0_out),
1351 .wb_img_ctrl1 (conf_wb_img_ctrl1_out),
1352 .wb_img_ctrl2 (conf_wb_img_ctrl2_out),
1353 .wb_img_ctrl3 (conf_wb_img_ctrl3_out),
1354 .wb_img_ctrl4 (conf_wb_img_ctrl4_out),
1355 .wb_img_ctrl5 (conf_wb_img_ctrl5_out),
1356 .wb_error_be (conf_wb_err_be_in),
1357 .wb_error_bc (conf_wb_err_bc_in),
1358 .wb_error_rty_exp (conf_wb_err_rty_exp_in),
1359 .wb_error_es (conf_wb_err_es_in),
1360 .wb_error_sig (conf_wb_err_sig_in),
1361 .wb_error_addr (conf_wb_err_addr_in),
1362 .wb_error_data (conf_wb_err_data_in),
1363 .config_addr (conf_ccyc_addr_out),
1364 .icr_soft_res (conf_soft_res_out),
1365 .int_out (conf_int_out),
1366 .isr_int_prop (conf_isr_int_prop_in),
1367 .isr_par_err_int (conf_par_err_int_in),
1368 .isr_sys_err_int (conf_sys_err_int_in),
1369
1370 .pci_init_complete_out (conf_pci_init_complete_out),
1371 .wb_init_complete_out (conf_wb_init_complete_out)
1372
1373 `ifdef PCI_CPCI_HS_IMPLEMENT
1374 ,
1375 .pci_cpci_hs_enum_oe_o (pci_cpci_hs_enum_oe_o) ,
1376 .pci_cpci_hs_led_oe_o (pci_cpci_hs_led_oe_o ) ,
1377 .pci_cpci_hs_es_i (pci_cpci_hs_es_i)
1378 `endif
1379
1380 `ifdef PCI_SPOCI
1381 ,
1382 // Serial power on configuration interface
1383 .spoci_scl_oe_o (spoci_scl_oe_o ) ,
1384 .spoci_sda_i (spoci_sda_i ) ,
1385 .spoci_sda_oe_o (spoci_sda_oe_o )
1386 `endif
1387 ) ;
1388
1389// pci data io multiplexer inputs
1390wire pci_mux_tar_ad_en_in = pciu_pciif_ad_en_out ;
1391wire pci_mux_tar_ad_en_reg_in = out_bckp_tar_ad_en_out ;
1392wire [31:0] pci_mux_tar_ad_in = pciu_pciif_ad_out ;
1393wire pci_mux_devsel_in = pciu_pciif_devsel_out ;
1394wire pci_mux_devsel_en_in = pciu_pciif_devsel_en_out ;
1395wire pci_mux_trdy_in = pciu_pciif_trdy_out ;
1396wire pci_mux_trdy_en_in = pciu_pciif_trdy_en_out ;
1397wire pci_mux_stop_in = pciu_pciif_stop_out ;
1398wire pci_mux_stop_en_in = pciu_pciif_stop_en_out ;
1399wire pci_mux_tar_load_in = pciu_ad_load_out ;
1400wire pci_mux_tar_load_on_transfer_in = pciu_ad_load_on_transfer_out ;
1401
1402wire pci_mux_mas_ad_en_in = wbu_pciif_ad_en_out ;
1403wire [31:0] pci_mux_mas_ad_in = wbu_pciif_ad_out ;
1404
1405wire pci_mux_frame_in = wbu_pciif_frame_out ;
1406wire pci_mux_frame_en_in = wbu_pciif_frame_en_out ;
1407wire pci_mux_irdy_in = wbu_pciif_irdy_out;
1408wire pci_mux_irdy_en_in = wbu_pciif_irdy_en_out;
1409wire pci_mux_mas_load_in = wbu_ad_load_out ;
1410wire pci_mux_mas_load_on_transfer_in = wbu_ad_load_on_transfer_out ;
1411wire [3:0] pci_mux_cbe_in = wbu_pciif_cbe_out ;
1412wire pci_mux_cbe_en_in = wbu_pciif_cbe_en_out ;
1413
1414wire pci_mux_par_in = parchk_pci_par_out ;
1415wire pci_mux_par_en_in = parchk_pci_par_en_out ;
1416wire pci_mux_perr_in = parchk_pci_perr_out ;
1417wire pci_mux_perr_en_in = parchk_pci_perr_en_out ;
1418wire pci_mux_serr_in = parchk_pci_serr_out ;
1419wire pci_mux_serr_en_in = parchk_pci_serr_en_out;
1420
1421wire pci_mux_req_in = wbu_pciif_req_out ;
1422wire pci_mux_frame_load_in = wbu_pciif_frame_load_out ;
1423
1424wire pci_mux_pci_irdy_in = int_pci_irdy ;
1425wire pci_mux_pci_trdy_in = int_pci_trdy ;
1426wire pci_mux_pci_frame_in = int_pci_frame ;
1427wire pci_mux_pci_stop_in = int_pci_stop ;
1428
1429wire pci_mux_init_complete_in = conf_pci_init_complete_out ;
1430
1431pci_io_mux pci_io_mux
1432(
1433 .reset_in (reset),
1434 .clk_in (pci_clk),
1435 .frame_in (pci_mux_frame_in),
1436 .frame_en_in (pci_mux_frame_en_in),
1437 .frame_load_in (pci_mux_frame_load_in),
1438 .irdy_in (pci_mux_irdy_in),
1439 .irdy_en_in (pci_mux_irdy_en_in),
1440 .devsel_in (pci_mux_devsel_in),
1441 .devsel_en_in (pci_mux_devsel_en_in),
1442 .trdy_in (pci_mux_trdy_in),
1443 .trdy_en_in (pci_mux_trdy_en_in),
1444 .stop_in (pci_mux_stop_in),
1445 .stop_en_in (pci_mux_stop_en_in),
1446 .master_load_in (pci_mux_mas_load_in),
1447 .master_load_on_transfer_in (pci_mux_mas_load_on_transfer_in),
1448 .target_load_in (pci_mux_tar_load_in),
1449 .target_load_on_transfer_in (pci_mux_tar_load_on_transfer_in),
1450 .cbe_in (pci_mux_cbe_in),
1451 .cbe_en_in (pci_mux_cbe_en_in),
1452 .mas_ad_in (pci_mux_mas_ad_in),
1453 .tar_ad_in (pci_mux_tar_ad_in),
1454
1455 .mas_ad_en_in (pci_mux_mas_ad_en_in),
1456 .tar_ad_en_in (pci_mux_tar_ad_en_in),
1457 .tar_ad_en_reg_in (pci_mux_tar_ad_en_reg_in),
1458
1459 .par_in (pci_mux_par_in),
1460 .par_en_in (pci_mux_par_en_in),
1461 .perr_in (pci_mux_perr_in),
1462 .perr_en_in (pci_mux_perr_en_in),
1463 .serr_in (pci_mux_serr_in),
1464 .serr_en_in (pci_mux_serr_en_in),
1465
1466 .frame_en_out (pci_mux_frame_en_out),
1467 .irdy_en_out (pci_mux_irdy_en_out),
1468 .devsel_en_out (pci_mux_devsel_en_out),
1469 .trdy_en_out (pci_mux_trdy_en_out),
1470 .stop_en_out (pci_mux_stop_en_out),
1471 .cbe_en_out (pci_mux_cbe_en_out),
1472 .ad_en_out (pci_mux_ad_en_out),
1473
1474 .frame_out (pci_mux_frame_out),
1475 .irdy_out (pci_mux_irdy_out),
1476 .devsel_out (pci_mux_devsel_out),
1477 .trdy_out (pci_mux_trdy_out),
1478 .stop_out (pci_mux_stop_out),
1479 .cbe_out (pci_mux_cbe_out),
1480 .ad_out (pci_mux_ad_out),
1481 .ad_load_out (pci_mux_ad_load_out),
1482
1483 .par_out (pci_mux_par_out),
1484 .par_en_out (pci_mux_par_en_out),
1485 .perr_out (pci_mux_perr_out),
1486 .perr_en_out (pci_mux_perr_en_out),
1487 .serr_out (pci_mux_serr_out),
1488 .serr_en_out (pci_mux_serr_en_out),
1489 .req_in (pci_mux_req_in),
1490 .req_out (pci_mux_req_out),
1491 .req_en_out (pci_mux_req_en_out),
1492 .pci_irdy_in (pci_mux_pci_irdy_in),
1493 .pci_trdy_in (pci_mux_pci_trdy_in),
1494 .pci_frame_in (pci_mux_pci_frame_in),
1495 .pci_stop_in (pci_mux_pci_stop_in),
1496 .ad_en_unregistered_out (pci_mux_ad_en_unregistered_out),
1497
1498 .init_complete_in (pci_mux_init_complete_in)
1499);
1500
1501pci_cur_out_reg output_backup
1502(
1503 .reset_in (reset),
1504 .clk_in (pci_clk),
1505 .frame_in (pci_mux_frame_in),
1506 .frame_en_in (pci_mux_frame_en_in),
1507 .frame_load_in (pci_mux_frame_load_in),
1508 .irdy_in (pci_mux_irdy_in),
1509 .irdy_en_in (pci_mux_irdy_en_in),
1510 .devsel_in (pci_mux_devsel_in),
1511 .trdy_in (pci_mux_trdy_in),
1512 .trdy_en_in (pci_mux_trdy_en_in),
1513 .stop_in (pci_mux_stop_in),
1514 .ad_load_in (pci_mux_ad_load_out),
1515 .cbe_in (pci_mux_cbe_in),
1516 .cbe_en_in (pci_mux_cbe_en_in),
1517 .mas_ad_in (pci_mux_mas_ad_in),
1518 .tar_ad_in (pci_mux_tar_ad_in),
1519
1520 .mas_ad_en_in (pci_mux_mas_ad_en_in),
1521 .tar_ad_en_in (pci_mux_tar_ad_en_in),
1522 .ad_en_unregistered_in (pci_mux_ad_en_unregistered_out),
1523
1524 .par_in (pci_mux_par_in),
1525 .par_en_in (pci_mux_par_en_in),
1526 .perr_in (pci_mux_perr_in),
1527 .perr_en_in (pci_mux_perr_en_in),
1528 .serr_in (pci_mux_serr_in),
1529 .serr_en_in (pci_mux_serr_en_in),
1530
1531 .frame_out (out_bckp_frame_out),
1532 .frame_en_out (out_bckp_frame_en_out),
1533 .irdy_out (out_bckp_irdy_out),
1534 .irdy_en_out (out_bckp_irdy_en_out),
1535 .devsel_out (out_bckp_devsel_out),
1536 .trdy_out (out_bckp_trdy_out),
1537 .trdy_en_out (out_bckp_trdy_en_out),
1538 .stop_out (out_bckp_stop_out),
1539 .cbe_out (out_bckp_cbe_out),
1540 .ad_out (out_bckp_ad_out),
1541 .ad_en_out (out_bckp_ad_en_out),
1542 .cbe_en_out (out_bckp_cbe_en_out),
1543 .tar_ad_en_out (out_bckp_tar_ad_en_out),
1544 .mas_ad_en_out (out_bckp_mas_ad_en_out),
1545
1546 .par_out (out_bckp_par_out),
1547 .par_en_out (out_bckp_par_en_out),
1548 .perr_out (out_bckp_perr_out),
1549 .perr_en_out (out_bckp_perr_en_out),
1550 .serr_out (out_bckp_serr_out),
1551 .serr_en_out (out_bckp_serr_en_out)
1552) ;
1553
1554// PARITY CHECKER INPUTS
1555wire parchk_pci_par_in = int_pci_par ;
1556wire parchk_pci_perr_in = int_pci_perr ;
1557wire parchk_pci_frame_reg_in = in_reg_frame_out ;
1558wire parchk_pci_frame_en_in = out_bckp_frame_en_out ;
1559wire parchk_pci_irdy_en_in = out_bckp_irdy_en_out ;
1560wire parchk_pci_irdy_reg_in = in_reg_irdy_out ;
1561wire parchk_pci_trdy_reg_in = in_reg_trdy_out ;
1562
1563
1564wire parchk_pci_trdy_en_in = out_bckp_trdy_en_out ;
1565
1566
1567wire [31:0] parchk_pci_ad_out_in = out_bckp_ad_out ;
1568wire [31:0] parchk_pci_ad_reg_in = in_reg_ad_out ;
1569wire [3:0] parchk_pci_cbe_in_in = int_pci_cbe ;
1570wire [3:0] parchk_pci_cbe_reg_in = in_reg_cbe_out ;
1571wire [3:0] parchk_pci_cbe_out_in = out_bckp_cbe_out ;
1572wire parchk_pci_ad_en_in = out_bckp_ad_en_out ;
1573wire parchk_par_err_response_in = conf_perr_response_out ;
1574wire parchk_serr_enable_in = conf_serr_enable_out ;
1575
1576wire parchk_pci_perr_out_in = out_bckp_perr_out ;
1577wire parchk_pci_serr_en_in = out_bckp_serr_en_out ;
1578wire parchk_pci_serr_out_in = out_bckp_serr_out ;
1579wire parchk_pci_cbe_en_in = out_bckp_cbe_en_out ;
1580
1581wire parchk_pci_par_en_in = out_bckp_par_en_out ;
1582
1583pci_parity_check parity_checker
1584(
1585 .reset_in (reset),
1586 .clk_in (pci_clk),
1587 .pci_par_in (parchk_pci_par_in),
1588 .pci_par_out (parchk_pci_par_out),
1589 .pci_par_en_out (parchk_pci_par_en_out),
1590 .pci_par_en_in (parchk_pci_par_en_in),
1591 .pci_perr_in (parchk_pci_perr_in),
1592 .pci_perr_out (parchk_pci_perr_out),
1593 .pci_perr_en_out (parchk_pci_perr_en_out),
1594 .pci_perr_out_in (parchk_pci_perr_out_in),
1595 .pci_serr_out (parchk_pci_serr_out),
1596 .pci_serr_out_in (parchk_pci_serr_out_in),
1597 .pci_serr_en_out (parchk_pci_serr_en_out),
1598 .pci_serr_en_in (parchk_pci_serr_en_in),
1599 .pci_frame_reg_in (parchk_pci_frame_reg_in),
1600 .pci_frame_en_in (parchk_pci_frame_en_in),
1601 .pci_irdy_en_in (parchk_pci_irdy_en_in),
1602 .pci_irdy_reg_in (parchk_pci_irdy_reg_in),
1603 .pci_trdy_reg_in (parchk_pci_trdy_reg_in),
1604 .pci_trdy_en_in (parchk_pci_trdy_en_in),
1605 .pci_ad_out_in (parchk_pci_ad_out_in),
1606 .pci_ad_reg_in (parchk_pci_ad_reg_in),
1607 .pci_cbe_in_in (parchk_pci_cbe_in_in),
1608 .pci_cbe_reg_in (parchk_pci_cbe_reg_in),
1609 .pci_cbe_en_in (parchk_pci_cbe_en_in),
1610 .pci_cbe_out_in (parchk_pci_cbe_out_in),
1611 .pci_ad_en_in (parchk_pci_ad_en_in),
1612 .par_err_response_in (parchk_par_err_response_in),
1613 .par_err_detect_out (parchk_par_err_detect_out),
1614 .perr_mas_detect_out (parchk_perr_mas_detect_out),
1615 .serr_enable_in (parchk_serr_enable_in),
1616 .sig_serr_out (parchk_sig_serr_out)
1617);
1618
1619wire in_reg_gnt_in = pci_gnt_i ;
1620wire in_reg_frame_in = int_pci_frame ;
1621wire in_reg_irdy_in = int_pci_irdy ;
1622wire in_reg_trdy_in = int_pci_trdy ;
1623wire in_reg_stop_in = int_pci_stop ;
1624wire in_reg_devsel_in = int_pci_devsel ;
1625wire in_reg_idsel_in = pci_idsel_i ;
1626wire [31:0] in_reg_ad_in = pci_ad_i ;
1627wire [3:0] in_reg_cbe_in = int_pci_cbe ;
1628
1629pci_in_reg input_register
1630(
1631 .reset_in (reset),
1632 .clk_in (pci_clk),
1633 .init_complete_in (conf_pci_init_complete_out),
1634
1635 .pci_gnt_in (in_reg_gnt_in),
1636 .pci_frame_in (in_reg_frame_in),
1637 .pci_irdy_in (in_reg_irdy_in),
1638 .pci_trdy_in (in_reg_trdy_in),
1639 .pci_stop_in (in_reg_stop_in),
1640 .pci_devsel_in (in_reg_devsel_in),
1641 .pci_idsel_in (in_reg_idsel_in),
1642 .pci_ad_in (in_reg_ad_in),
1643 .pci_cbe_in (in_reg_cbe_in),
1644
1645 .pci_gnt_reg_out (in_reg_gnt_out),
1646 .pci_frame_reg_out (in_reg_frame_out),
1647 .pci_irdy_reg_out (in_reg_irdy_out),
1648 .pci_trdy_reg_out (in_reg_trdy_out),
1649 .pci_stop_reg_out (in_reg_stop_out),
1650 .pci_devsel_reg_out (in_reg_devsel_out),
1651 .pci_idsel_reg_out (in_reg_idsel_out),
1652 .pci_ad_reg_out (in_reg_ad_out),
1653 .pci_cbe_reg_out (in_reg_cbe_out)
1654);
1655
1656endmodule
Impressum, Datenschutz