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

Subversion Repositories pci

[/] [pci/] [tags/] [rel_7/] [rtl/] [verilog/] [top.v] - Blame information for rev 154

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

powered by: WebSVN 2.1.0

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