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

Subversion Repositories pci

[/] [pci/] [trunk/] [rtl/] [verilog/] [pci_bridge32.v] - Blame information for rev 108

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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