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

Subversion Repositories pci

[/] [pci/] [tags/] [rel_9/] [rtl/] [verilog/] [top.v] - Blame information for rev 122

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

Line No. Rev Author Line
1 2 mihad
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  File name "top.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
////                                                              ////
11
////  All additional information is avaliable in the README       ////
12
////  file.                                                       ////
13
////                                                              ////
14
////                                                              ////
15
//////////////////////////////////////////////////////////////////////
16
////                                                              ////
17
//// Copyright (C) 2001 Miha Dolenc, mihad@opencores.org          ////
18
////                                                              ////
19
//// This source file may be used and distributed without         ////
20
//// restriction provided that this copyright statement is not    ////
21
//// removed from the file and that any derivative work contains  ////
22
//// the original copyright notice and the associated disclaimer. ////
23
////                                                              ////
24
//// This source file is free software; you can redistribute it   ////
25
//// and/or modify it under the terms of the GNU Lesser General   ////
26
//// Public License as published by the Free Software Foundation; ////
27
//// either version 2.1 of the License, or (at your option) any   ////
28
//// later version.                                               ////
29
////                                                              ////
30
//// This source is distributed in the hope that it will be       ////
31
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
32
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
33
//// PURPOSE.  See the GNU Lesser General Public License for more ////
34
//// details.                                                     ////
35
////                                                              ////
36
//// You should have received a copy of the GNU Lesser General    ////
37
//// Public License along with this source; if not, download it   ////
38
//// from http://www.opencores.org/lgpl.shtml                     ////
39
////                                                              ////
40
//////////////////////////////////////////////////////////////////////
41
//
42
// CVS Revision History
43
//
44
// $Log: not supported by cvs2svn $
45 122 markom
// Revision 1.11  2003/08/21 20:49:03  tadejm
46
// Added signals for WB Master B3.
47
//
48 115 tadejm
// Revision 1.10  2003/08/03 18:05:06  mihad
49
// Added limited WISHBONE B3 support for WISHBONE Slave Unit.
50
// Doesn't support full speed bursts yet.
51
//
52 106 mihad
// Revision 1.9  2003/01/27 16:49:31  mihad
53
// Changed module and file names. Updated scripts accordingly. FIFO synchronizations changed.
54
//
55 77 mihad
// Revision 1.8  2002/10/18 03:36:37  tadejm
56 122 markom
// Changed wrong signal name mbist_sen into mbist_ctrl_i.
57 77 mihad
//
58 68 tadejm
// Revision 1.7  2002/10/17 22:49:22  tadejm
59
// Changed BIST signals for RAMs.
60
//
61 67 tadejm
// Revision 1.6  2002/10/11 10:09:01  mihad
62
// Added additional testcase and changed rst name in BIST to trst
63
//
64 63 mihad
// Revision 1.5  2002/10/08 17:17:06  mihad
65
// Added BIST signals for RAMs.
66
//
67 62 mihad
// Revision 1.4  2002/03/21 07:36:04  mihad
68
// Files updated with missing includes, resolved some race conditions in test bench
69
//
70 35 mihad
// Revision 1.3  2002/02/01 15:25:13  mihad
71
// Repaired a few bugs, updated specification, added test bench files and design document
72
//
73 21 mihad
// Revision 1.2  2001/10/05 08:14:30  mihad
74
// Updated all files with inclusion of timescale file for simulation purposes.
75
//
76 6 mihad
// Revision 1.1.1.1  2001/10/02 15:33:47  mihad
77
// New project directory structure
78 2 mihad
//
79 6 mihad
//
80 2 mihad
 
81
// This top module is primarly used for testing plain PCI bridge core without any other cores attached.
82
// Other cores can be included in this top module and appropriate changes incorporated for overall design
83 21 mihad
 
84
// synopsys translate_off
85 6 mihad
`include "timescale.v"
86 21 mihad
// synopsys translate_on
87 35 mihad
`include "pci_constants.v"
88 2 mihad
 
89
module TOP
90
(
91
    CLK,
92 21 mihad
    AD,
93
    CBE,
94
    RST,
95 2 mihad
    INTA,
96
    REQ,
97
    GNT,
98
    FRAME,
99
    IRDY,
100
    IDSEL,
101
    DEVSEL,
102
    TRDY,
103
    STOP,
104
    PAR,
105
    PERR,
106
    SERR,
107 21 mihad
 
108 2 mihad
    CLK_I,
109
    RST_I,
110
    RST_O,
111
    INT_I,
112
    INT_O,
113
 
114
    // WISHBONE slave interface
115
    ADR_I,
116
    SDAT_I,
117
    SDAT_O,
118
    SEL_I,
119
    CYC_I,
120
    STB_I,
121
    WE_I,
122
    CAB_I,
123 106 mihad
    CTI_I,
124
    BTE_I,
125 2 mihad
    ACK_O,
126
    RTY_O,
127
    ERR_O,
128
 
129
    // WISHBONE master interface
130
    ADR_O,
131
    MDAT_I,
132
    MDAT_O,
133
    SEL_O,
134
    CYC_O,
135
    STB_O,
136
    WE_O,
137 115 tadejm
    CTI_O,
138
    BTE_O,
139 2 mihad
    ACK_I,
140
    RTY_I,
141 21 mihad
    ERR_I
142 62 mihad
 
143
`ifdef PCI_BIST
144
    ,
145
    // debug chain signals
146 122 markom
    mbist_si_i,       // bist scan serial in
147
    mbist_so_o,       // bist scan serial out
148
    mbist_ctrl_i        // bist chain shift control
149 62 mihad
`endif
150 2 mihad
);
151
 
152
input           CLK ;
153
inout   [31:0]  AD ;
154
inout   [3:0]   CBE ;
155
inout           RST ;
156
inout           INTA ;
157
output          REQ ;
158
input           GNT ;
159
inout           FRAME ;
160
inout           IRDY ;
161
input           IDSEL ;
162
inout           DEVSEL ;
163
inout           TRDY ;
164
inout           STOP ;
165
inout           PAR ;
166
inout           PERR ;
167
output          SERR ;
168
 
169
// WISHBONE system signals
170
input   CLK_I ;
171
input   RST_I ;
172
output  RST_O ;
173
input   INT_I ;
174
output  INT_O ;
175
 
176
// WISHBONE slave interface
177
input   [31:0]  ADR_I ;
178
input   [31:0]  SDAT_I ;
179
output  [31:0]  SDAT_O ;
180
input   [3:0]   SEL_I ;
181
input           CYC_I ;
182
input           STB_I ;
183
input           WE_I  ;
184
input           CAB_I ;
185 106 mihad
input   [ 2:0]  CTI_I ;
186
input   [ 1:0]  BTE_I ;
187 2 mihad
output          ACK_O ;
188
output          RTY_O ;
189
output          ERR_O ;
190
 
191
// WISHBONE master interface
192
output  [31:0]  ADR_O ;
193
input   [31:0]  MDAT_I ;
194
output  [31:0]  MDAT_O ;
195
output  [3:0]   SEL_O ;
196
output          CYC_O ;
197
output          STB_O ;
198
output          WE_O  ;
199 115 tadejm
output  [2:0]   CTI_O ;
200
output  [1:0]   BTE_O ;
201 2 mihad
input           ACK_I ;
202
input           RTY_I ;
203
input           ERR_I ;
204
 
205 62 mihad
`ifdef PCI_BIST
206
/*-----------------------------------------------------
207
BIST debug chain port signals
208
-----------------------------------------------------*/
209 122 markom
input   mbist_si_i;       // bist scan serial in
210
output  mbist_so_o;       // bist scan serial out
211
input [`PCI_MBIST_CTRL_WIDTH - 1:0] mbist_ctrl_i;       // bist chain shift control
212 62 mihad
`endif
213
 
214 2 mihad
wire    [31:0]  AD_out ;
215
wire    [31:0]  AD_en ;
216
 
217
 
218
wire    [31:0]  AD_in = AD ;
219
 
220
wire    [3:0]   CBE_in = CBE ;
221
wire    [3:0]   CBE_out ;
222
wire    [3:0]   CBE_en ;
223
 
224
 
225
 
226
wire            RST_in = RST ;
227
wire            RST_out ;
228
wire            RST_en ;
229
 
230
wire            INTA_in = INTA ;
231
wire            INTA_en ;
232
wire            INTA_out ;
233
 
234
wire            REQ_en ;
235
wire            REQ_out ;
236
 
237
wire            FRAME_in = FRAME ;
238
wire            FRAME_out ;
239
wire            FRAME_en ;
240
 
241
wire            IRDY_in = IRDY ;
242
wire            IRDY_out ;
243
wire            IRDY_en ;
244
 
245
wire            DEVSEL_in = DEVSEL ;
246
wire            DEVSEL_out ;
247
wire            DEVSEL_en ;
248
 
249
wire            TRDY_in = TRDY ;
250
wire            TRDY_out ;
251
wire            TRDY_en ;
252
 
253
wire            STOP_in = STOP ;
254
wire            STOP_out ;
255
wire            STOP_en ;
256
 
257
wire            PAR_in = PAR ;
258
wire            PAR_out ;
259
wire            PAR_en ;
260
 
261
wire            PERR_in = PERR ;
262
wire            PERR_out ;
263
wire            PERR_en ;
264
 
265
wire            SERR_out ;
266
wire            SERR_en ;
267
 
268 77 mihad
pci_bridge32 bridge
269 2 mihad
(
270
    // WISHBONE system signals
271 77 mihad
    .wb_clk_i(CLK_I),
272
    .wb_rst_i(RST_I),
273
    .wb_rst_o(RST_O),
274
    .wb_int_i(INT_I),
275
    .wb_int_o(INT_O),
276 21 mihad
 
277 2 mihad
    // WISHBONE slave interface
278 77 mihad
    .wbs_adr_i(ADR_I),
279
    .wbs_dat_i(SDAT_I),
280
    .wbs_dat_o(SDAT_O),
281
    .wbs_sel_i(SEL_I),
282
    .wbs_cyc_i(CYC_I),
283
    .wbs_stb_i(STB_I),
284
    .wbs_we_i (WE_I),
285 106 mihad
 
286
`ifdef PCI_WB_REV_B3
287
 
288
    .wbs_cti_i(CTI_I),
289
    .wbs_bte_i(BTE_I),
290
 
291
`else
292
 
293 77 mihad
    .wbs_cab_i(CAB_I),
294 106 mihad
 
295
`endif
296
 
297 77 mihad
    .wbs_ack_o(ACK_O),
298
    .wbs_rty_o(RTY_O),
299
    .wbs_err_o(ERR_O),
300 21 mihad
 
301 2 mihad
    // WISHBONE master interface
302 77 mihad
    .wbm_adr_o(ADR_O),
303
    .wbm_dat_i(MDAT_I),
304
    .wbm_dat_o(MDAT_O),
305
    .wbm_sel_o(SEL_O),
306
    .wbm_cyc_o(CYC_O),
307
    .wbm_stb_o(STB_O),
308
    .wbm_we_o (WE_O),
309 115 tadejm
    .wbm_cti_o(CTI_O),
310
    .wbm_bte_o(BTE_O),
311 77 mihad
    .wbm_ack_i(ACK_I),
312
    .wbm_rty_i(RTY_I),
313
    .wbm_err_i(ERR_I),
314 21 mihad
 
315 2 mihad
    // pci interface - system pins
316 77 mihad
    .pci_clk_i    (CLK),
317
    .pci_rst_i    ( RST_in ),
318
    .pci_rst_o    ( RST_out ),
319
    .pci_inta_i   ( INTA_in ),
320
    .pci_inta_o   ( INTA_out),
321
    .pci_rst_oe_o ( RST_en),
322
    .pci_inta_oe_o(INTA_en),
323 21 mihad
 
324 2 mihad
    // arbitration pins
325 77 mihad
    .pci_req_o   ( REQ_out ),
326
    .pci_req_oe_o( REQ_en ),
327 21 mihad
 
328 77 mihad
    .pci_gnt_i   ( GNT ),
329 21 mihad
 
330 2 mihad
    // protocol pins
331 77 mihad
    .pci_frame_i   ( FRAME_in),
332
    .pci_frame_o   ( FRAME_out ),
333
 
334
    .pci_frame_oe_o( FRAME_en ),
335
    .pci_irdy_oe_o ( IRDY_en ),
336
    .pci_devsel_oe_o( DEVSEL_en ),
337
    .pci_trdy_oe_o ( TRDY_en ),
338
    .pci_stop_oe_o ( STOP_en ),
339
    .pci_ad_oe_o   (AD_en),
340
    .pci_cbe_oe_o  ( CBE_en) ,
341
 
342
    .pci_irdy_i    ( IRDY_in ),
343
    .pci_irdy_o    ( IRDY_out ),
344
 
345
    .pci_idsel_i   ( IDSEL ),
346
 
347
    .pci_devsel_i  ( DEVSEL_in ),
348
    .pci_devsel_o  ( DEVSEL_out ),
349
 
350
    .pci_trdy_i    ( TRDY_in ),
351
    .pci_trdy_o    ( TRDY_out ),
352
 
353
    .pci_stop_i    ( STOP_in ),
354
    .pci_stop_o    ( STOP_out ),
355 2 mihad
 
356 21 mihad
    // data transfer pins
357 77 mihad
    .pci_ad_i(AD_in),
358
    .pci_ad_o(AD_out),
359
 
360
    .pci_cbe_i( CBE_in ),
361
    .pci_cbe_o( CBE_out ),
362 21 mihad
 
363 2 mihad
    // parity generation and checking pins
364 77 mihad
    .pci_par_i    ( PAR_in ),
365
    .pci_par_o    ( PAR_out ),
366
    .pci_par_oe_o ( PAR_en ),
367
 
368
    .pci_perr_i   ( PERR_in ),
369
    .pci_perr_o   ( PERR_out ),
370
    .pci_perr_oe_o( PERR_en ),
371 21 mihad
 
372 2 mihad
    // system error pin
373 77 mihad
    .pci_serr_o   ( SERR_out ),
374
    .pci_serr_oe_o( SERR_en )
375 62 mihad
 
376
`ifdef PCI_BIST
377
    ,
378 122 markom
    .mbist_si_i       (mbist_si_i),
379
    .mbist_so_o       (mbist_so_o),
380
    .mbist_ctrl_i       (mbist_ctrl_i)
381 62 mihad
`endif
382 2 mihad
);
383 35 mihad
 
384
 
385 21 mihad
// PCI IO buffers instantiation
386
`ifdef ACTIVE_LOW_OE
387 35 mihad
 
388 2 mihad
bufif0 AD_buf0   ( AD[0],  AD_out[0], AD_en[0]) ;
389
bufif0 AD_buf1   ( AD[1],  AD_out[1], AD_en[1]) ;
390
bufif0 AD_buf2   ( AD[2],  AD_out[2], AD_en[2]) ;
391
bufif0 AD_buf3   ( AD[3],  AD_out[3], AD_en[3]) ;
392
bufif0 AD_buf4   ( AD[4],  AD_out[4], AD_en[4]) ;
393
bufif0 AD_buf5   ( AD[5],  AD_out[5], AD_en[5]) ;
394
bufif0 AD_buf6   ( AD[6],  AD_out[6], AD_en[6]) ;
395
bufif0 AD_buf7   ( AD[7],  AD_out[7], AD_en[7]) ;
396
bufif0 AD_buf8   ( AD[8],  AD_out[8], AD_en[8]) ;
397
bufif0 AD_buf9   ( AD[9],  AD_out[9], AD_en[9]) ;
398
bufif0 AD_buf10  ( AD[10], AD_out[10],AD_en[10] ) ;
399
bufif0 AD_buf11  ( AD[11], AD_out[11],AD_en[11] ) ;
400
bufif0 AD_buf12  ( AD[12], AD_out[12],AD_en[12] ) ;
401
bufif0 AD_buf13  ( AD[13], AD_out[13],AD_en[13] ) ;
402
bufif0 AD_buf14  ( AD[14], AD_out[14],AD_en[14] ) ;
403
bufif0 AD_buf15  ( AD[15], AD_out[15],AD_en[15] ) ;
404
bufif0 AD_buf16  ( AD[16], AD_out[16],AD_en[16] ) ;
405
bufif0 AD_buf17  ( AD[17], AD_out[17],AD_en[17] ) ;
406
bufif0 AD_buf18  ( AD[18], AD_out[18],AD_en[18] ) ;
407
bufif0 AD_buf19  ( AD[19], AD_out[19],AD_en[19] ) ;
408
bufif0 AD_buf20  ( AD[20], AD_out[20],AD_en[20] ) ;
409
bufif0 AD_buf21  ( AD[21], AD_out[21],AD_en[21] ) ;
410
bufif0 AD_buf22  ( AD[22], AD_out[22],AD_en[22] ) ;
411
bufif0 AD_buf23  ( AD[23], AD_out[23],AD_en[23] ) ;
412
bufif0 AD_buf24  ( AD[24], AD_out[24],AD_en[24] ) ;
413
bufif0 AD_buf25  ( AD[25], AD_out[25],AD_en[25] ) ;
414
bufif0 AD_buf26  ( AD[26], AD_out[26],AD_en[26] ) ;
415
bufif0 AD_buf27  ( AD[27], AD_out[27],AD_en[27] ) ;
416
bufif0 AD_buf28  ( AD[28], AD_out[28],AD_en[28] ) ;
417
bufif0 AD_buf29  ( AD[29], AD_out[29],AD_en[29] ) ;
418
bufif0 AD_buf30  ( AD[30], AD_out[30],AD_en[30] ) ;
419
bufif0 AD_buf31  ( AD[31], AD_out[31],AD_en[31] ) ;
420
 
421
bufif0 CBE_buf0 ( CBE[0], CBE_out[0], CBE_en[0] ) ;
422
bufif0 CBE_buf1 ( CBE[1], CBE_out[1], CBE_en[1] ) ;
423
bufif0 CBE_buf2 ( CBE[2], CBE_out[2], CBE_en[2] ) ;
424
bufif0 CBE_buf3 ( CBE[3], CBE_out[3], CBE_en[3] ) ;
425 21 mihad
 
426 2 mihad
bufif0 FRAME_buf    ( FRAME, FRAME_out, FRAME_en ) ;
427
bufif0 IRDY_buf     ( IRDY, IRDY_out, IRDY_en ) ;
428
bufif0 DEVSEL_buf   ( DEVSEL, DEVSEL_out, DEVSEL_en ) ;
429
bufif0 TRDY_buf     ( TRDY, TRDY_out, TRDY_en ) ;
430
bufif0 STOP_buf     ( STOP, STOP_out, STOP_en ) ;
431 21 mihad
 
432 2 mihad
bufif0 RST_buf      ( RST, RST_out, RST_en ) ;
433
bufif0 INTA_buf     ( INTA, INTA_out, INTA_en) ;
434
bufif0 REQ_buf      ( REQ, REQ_out, REQ_en ) ;
435
bufif0 PAR_buf      ( PAR, PAR_out, PAR_en ) ;
436
bufif0 PERR_buf     ( PERR, PERR_out, PERR_en ) ;
437
bufif0 SERR_buf     ( SERR, SERR_out, SERR_en ) ;
438
 
439 21 mihad
`else
440 35 mihad
 `ifdef ACTIVE_HIGH_OE
441
 
442 21 mihad
bufif1 AD_buf0   ( AD[0],  AD_out[0], AD_en[0]) ;
443
bufif1 AD_buf1   ( AD[1],  AD_out[1], AD_en[1]) ;
444
bufif1 AD_buf2   ( AD[2],  AD_out[2], AD_en[2]) ;
445
bufif1 AD_buf3   ( AD[3],  AD_out[3], AD_en[3]) ;
446
bufif1 AD_buf4   ( AD[4],  AD_out[4], AD_en[4]) ;
447
bufif1 AD_buf5   ( AD[5],  AD_out[5], AD_en[5]) ;
448
bufif1 AD_buf6   ( AD[6],  AD_out[6], AD_en[6]) ;
449
bufif1 AD_buf7   ( AD[7],  AD_out[7], AD_en[7]) ;
450
bufif1 AD_buf8   ( AD[8],  AD_out[8], AD_en[8]) ;
451
bufif1 AD_buf9   ( AD[9],  AD_out[9], AD_en[9]) ;
452
bufif1 AD_buf10  ( AD[10], AD_out[10],AD_en[10] ) ;
453
bufif1 AD_buf11  ( AD[11], AD_out[11],AD_en[11] ) ;
454
bufif1 AD_buf12  ( AD[12], AD_out[12],AD_en[12] ) ;
455
bufif1 AD_buf13  ( AD[13], AD_out[13],AD_en[13] ) ;
456
bufif1 AD_buf14  ( AD[14], AD_out[14],AD_en[14] ) ;
457
bufif1 AD_buf15  ( AD[15], AD_out[15],AD_en[15] ) ;
458
bufif1 AD_buf16  ( AD[16], AD_out[16],AD_en[16] ) ;
459
bufif1 AD_buf17  ( AD[17], AD_out[17],AD_en[17] ) ;
460
bufif1 AD_buf18  ( AD[18], AD_out[18],AD_en[18] ) ;
461
bufif1 AD_buf19  ( AD[19], AD_out[19],AD_en[19] ) ;
462
bufif1 AD_buf20  ( AD[20], AD_out[20],AD_en[20] ) ;
463
bufif1 AD_buf21  ( AD[21], AD_out[21],AD_en[21] ) ;
464
bufif1 AD_buf22  ( AD[22], AD_out[22],AD_en[22] ) ;
465
bufif1 AD_buf23  ( AD[23], AD_out[23],AD_en[23] ) ;
466
bufif1 AD_buf24  ( AD[24], AD_out[24],AD_en[24] ) ;
467
bufif1 AD_buf25  ( AD[25], AD_out[25],AD_en[25] ) ;
468
bufif1 AD_buf26  ( AD[26], AD_out[26],AD_en[26] ) ;
469
bufif1 AD_buf27  ( AD[27], AD_out[27],AD_en[27] ) ;
470
bufif1 AD_buf28  ( AD[28], AD_out[28],AD_en[28] ) ;
471
bufif1 AD_buf29  ( AD[29], AD_out[29],AD_en[29] ) ;
472
bufif1 AD_buf30  ( AD[30], AD_out[30],AD_en[30] ) ;
473
bufif1 AD_buf31  ( AD[31], AD_out[31],AD_en[31] ) ;
474
 
475
bufif1 CBE_buf0 ( CBE[0], CBE_out[0], CBE_en[0] ) ;
476
bufif1 CBE_buf1 ( CBE[1], CBE_out[1], CBE_en[1] ) ;
477
bufif1 CBE_buf2 ( CBE[2], CBE_out[2], CBE_en[2] ) ;
478
bufif1 CBE_buf3 ( CBE[3], CBE_out[3], CBE_en[3] ) ;
479
 
480
bufif1 FRAME_buf    ( FRAME, FRAME_out, FRAME_en ) ;
481
bufif1 IRDY_buf     ( IRDY, IRDY_out, IRDY_en ) ;
482
bufif1 DEVSEL_buf   ( DEVSEL, DEVSEL_out, DEVSEL_en ) ;
483
bufif1 TRDY_buf     ( TRDY, TRDY_out, TRDY_en ) ;
484
bufif1 STOP_buf     ( STOP, STOP_out, STOP_en ) ;
485
 
486
bufif1 RST_buf      ( RST, RST_out, RST_en ) ;
487
bufif1 INTA_buf     ( INTA, INTA_out, INTA_en) ;
488
bufif1 REQ_buf      ( REQ, REQ_out, REQ_en ) ;
489
bufif1 PAR_buf      ( PAR, PAR_out, PAR_en ) ;
490
bufif1 PERR_buf     ( PERR, PERR_out, PERR_en ) ;
491
bufif1 SERR_buf     ( SERR, SERR_out, SERR_en ) ;
492
`endif
493
`endif
494
 
495
 
496
endmodule

powered by: WebSVN 2.1.0

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