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

Subversion Repositories pci

[/] [pci/] [tags/] [rel_8/] [rtl/] [verilog/] [top.v] - Blame information for rev 115

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

powered by: WebSVN 2.1.0

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