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

Subversion Repositories pci

[/] [pci/] [tags/] [rel_3/] [rtl/] [verilog/] [top.v] - Blame information for rev 2

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
//
46
 
47
// This top module is primarly used for testing plain PCI bridge core without any other cores attached.
48
// Other cores can be included in this top module and appropriate changes incorporated for overall design
49
 
50
module TOP
51
(
52
    CLK,
53
    AD,
54
    CBE,
55
    RST,
56
    INTA,
57
    REQ,
58
    GNT,
59
    FRAME,
60
    IRDY,
61
    IDSEL,
62
    DEVSEL,
63
    TRDY,
64
    STOP,
65
    PAR,
66
    PERR,
67
    SERR,
68
 
69
    CLK_I,
70
    RST_I,
71
    RST_O,
72
    INT_I,
73
    INT_O,
74
 
75
    // WISHBONE slave interface
76
    ADR_I,
77
    SDAT_I,
78
    SDAT_O,
79
    SEL_I,
80
    CYC_I,
81
    STB_I,
82
    WE_I,
83
    CAB_I,
84
    ACK_O,
85
    RTY_O,
86
    ERR_O,
87
 
88
    // WISHBONE master interface
89
    ADR_O,
90
    MDAT_I,
91
    MDAT_O,
92
    SEL_O,
93
    CYC_O,
94
    STB_O,
95
    WE_O,
96
    CAB_O,
97
    ACK_I,
98
    RTY_I,
99
    ERR_I
100
);
101
 
102
input           CLK ;
103
inout   [31:0]  AD ;
104
inout   [3:0]   CBE ;
105
inout           RST ;
106
inout           INTA ;
107
output          REQ ;
108
input           GNT ;
109
inout           FRAME ;
110
inout           IRDY ;
111
input           IDSEL ;
112
inout           DEVSEL ;
113
inout           TRDY ;
114
inout           STOP ;
115
inout           PAR ;
116
inout           PERR ;
117
output          SERR ;
118
 
119
// WISHBONE system signals
120
input   CLK_I ;
121
input   RST_I ;
122
output  RST_O ;
123
input   INT_I ;
124
output  INT_O ;
125
 
126
// WISHBONE slave interface
127
input   [31:0]  ADR_I ;
128
input   [31:0]  SDAT_I ;
129
output  [31:0]  SDAT_O ;
130
input   [3:0]   SEL_I ;
131
input           CYC_I ;
132
input           STB_I ;
133
input           WE_I  ;
134
input           CAB_I ;
135
output          ACK_O ;
136
output          RTY_O ;
137
output          ERR_O ;
138
 
139
// WISHBONE master interface
140
output  [31:0]  ADR_O ;
141
input   [31:0]  MDAT_I ;
142
output  [31:0]  MDAT_O ;
143
output  [3:0]   SEL_O ;
144
output          CYC_O ;
145
output          STB_O ;
146
output          WE_O  ;
147
output          CAB_O ;
148
input           ACK_I ;
149
input           RTY_I ;
150
input           ERR_I ;
151
 
152
 
153
wire    [31:0]  AD_out ;
154
wire    [31:0]  AD_en ;
155
 
156
 
157
wire    [31:0]  AD_in = AD ;
158
 
159
wire    [3:0]   CBE_in = CBE ;
160
wire    [3:0]   CBE_out ;
161
wire    [3:0]   CBE_en ;
162
 
163
 
164
 
165
wire            RST_in = RST ;
166
wire            RST_out ;
167
wire            RST_en ;
168
 
169
wire            INTA_in = INTA ;
170
wire            INTA_en ;
171
wire            INTA_out ;
172
 
173
wire            REQ_en ;
174
wire            REQ_out ;
175
 
176
wire            FRAME_in = FRAME ;
177
wire            FRAME_out ;
178
wire            FRAME_en ;
179
 
180
wire            IRDY_in = IRDY ;
181
wire            IRDY_out ;
182
wire            IRDY_en ;
183
 
184
wire            DEVSEL_in = DEVSEL ;
185
wire            DEVSEL_out ;
186
wire            DEVSEL_en ;
187
 
188
wire            TRDY_in = TRDY ;
189
wire            TRDY_out ;
190
wire            TRDY_en ;
191
 
192
wire            STOP_in = STOP ;
193
wire            STOP_out ;
194
wire            STOP_en ;
195
 
196
wire            PAR_in = PAR ;
197
wire            PAR_out ;
198
wire            PAR_en ;
199
 
200
wire            PERR_in = PERR ;
201
wire            PERR_out ;
202
wire            PERR_en ;
203
 
204
wire            SERR_out ;
205
wire            SERR_en ;
206
 
207
PCI_BRIDGE32 bridge
208
(
209
    // WISHBONE system signals
210
    .CLK_I(CLK_I),
211
    .RST_I(RST_I),
212
    .RST_O(RST_O),
213
    .INT_I(INT_I),
214
    .INT_O(INT_O),
215
 
216
    // WISHBONE slave interface
217
    .ADR_I(ADR_I),
218
    .SDAT_I(SDAT_I),
219
    .SDAT_O(SDAT_O),
220
    .SEL_I(SEL_I),
221
    .CYC_I(CYC_I),
222
    .STB_I(STB_I),
223
    .WE_I(WE_I),
224
    .CAB_I(CAB_I),
225
    .ACK_O(ACK_O),
226
    .RTY_O(RTY_O),
227
    .ERR_O(ERR_O),
228
 
229
    // WISHBONE master interface
230
    .ADR_O(ADR_O),
231
    .MDAT_I(MDAT_I),
232
    .MDAT_O(MDAT_O),
233
    .SEL_O(SEL_O),
234
    .CYC_O(CYC_O),
235
    .STB_O(STB_O),
236
    .WE_O(WE_O),
237
    .CAB_O(CAB_O),
238
    .ACK_I(ACK_I),
239
    .RTY_I(RTY_I),
240
    .ERR_I(ERR_I),
241
 
242
    // pci interface - system pins
243
    .PCI_CLK_IN (CLK),
244
    .PCI_RSTn_IN ( RST_in ),
245
    .PCI_RSTn_OUT ( RST_out ),
246
    .PCI_INTAn_IN ( INTA_in ),
247
    .PCI_INTAn_OUT( INTA_out),
248
    .PCI_RSTn_EN_OUT( RST_en),
249
    .PCI_INTAn_EN_OUT(INTA_en),
250
 
251
    // arbitration pins
252
    .PCI_REQn_OUT( REQ_out ),
253
    .PCI_REQn_EN_OUT ( REQ_en ),
254
 
255
    .PCI_GNTn_IN( GNT ),
256
 
257
    // protocol pins
258
    .PCI_FRAMEn_IN( FRAME_in),
259
    .PCI_FRAMEn_OUT( FRAME_out ),
260
 
261
    .PCI_FRAMEn_EN_OUT( FRAME_en ),
262
    .PCI_IRDYn_EN_OUT ( IRDY_en ),
263
    .PCI_DEVSELn_EN_OUT ( DEVSEL_en ),
264
    .PCI_TRDYn_EN_OUT ( TRDY_en ),
265
    .PCI_STOPn_EN_OUT ( STOP_en ),
266
    .PCI_AD_EN_OUT(AD_en),
267
    .PCI_CBEn_EN_OUT ( CBE_en) ,
268
 
269
    .PCI_IRDYn_IN ( IRDY_in ),
270
    .PCI_IRDYn_OUT ( IRDY_out ),
271
 
272
    .PCI_IDSEL_IN ( IDSEL ),
273
 
274
    .PCI_DEVSELn_IN( DEVSEL_in ),
275
    .PCI_DEVSELn_OUT ( DEVSEL_out ),
276
 
277
    .PCI_TRDYn_IN ( TRDY_in ),
278
    .PCI_TRDYn_OUT ( TRDY_out ),
279
 
280
    .PCI_STOPn_IN( STOP_in ),
281
    .PCI_STOPn_OUT ( STOP_out ),
282
 
283
    // data transfer pins   
284
    .PCI_AD_IN(AD_in),
285
    .PCI_AD_OUT (AD_out),
286
 
287
    .PCI_CBEn_IN( CBE_in ),
288
    .PCI_CBEn_OUT ( CBE_out ),
289
 
290
    // parity generation and checking pins
291
    .PCI_PAR_IN ( PAR_in ),
292
    .PCI_PAR_OUT ( PAR_out ),
293
    .PCI_PAR_EN_OUT ( PAR_en ),
294
 
295
    .PCI_PERRn_IN ( PERR_in ),
296
    .PCI_PERRn_OUT ( PERR_out ),
297
    .PCI_PERRn_EN_OUT ( PERR_en ),
298
 
299
    // system error pin
300
    .PCI_SERRn_OUT ( SERR_out ),
301
    .PCI_SERRn_EN_OUT ( SERR_en )
302
);
303
 
304
bufif0 AD_buf0   ( AD[0],  AD_out[0], AD_en[0]) ;
305
bufif0 AD_buf1   ( AD[1],  AD_out[1], AD_en[1]) ;
306
bufif0 AD_buf2   ( AD[2],  AD_out[2], AD_en[2]) ;
307
bufif0 AD_buf3   ( AD[3],  AD_out[3], AD_en[3]) ;
308
bufif0 AD_buf4   ( AD[4],  AD_out[4], AD_en[4]) ;
309
bufif0 AD_buf5   ( AD[5],  AD_out[5], AD_en[5]) ;
310
bufif0 AD_buf6   ( AD[6],  AD_out[6], AD_en[6]) ;
311
bufif0 AD_buf7   ( AD[7],  AD_out[7], AD_en[7]) ;
312
bufif0 AD_buf8   ( AD[8],  AD_out[8], AD_en[8]) ;
313
bufif0 AD_buf9   ( AD[9],  AD_out[9], AD_en[9]) ;
314
bufif0 AD_buf10  ( AD[10], AD_out[10],AD_en[10] ) ;
315
bufif0 AD_buf11  ( AD[11], AD_out[11],AD_en[11] ) ;
316
bufif0 AD_buf12  ( AD[12], AD_out[12],AD_en[12] ) ;
317
bufif0 AD_buf13  ( AD[13], AD_out[13],AD_en[13] ) ;
318
bufif0 AD_buf14  ( AD[14], AD_out[14],AD_en[14] ) ;
319
bufif0 AD_buf15  ( AD[15], AD_out[15],AD_en[15] ) ;
320
bufif0 AD_buf16  ( AD[16], AD_out[16],AD_en[16] ) ;
321
bufif0 AD_buf17  ( AD[17], AD_out[17],AD_en[17] ) ;
322
bufif0 AD_buf18  ( AD[18], AD_out[18],AD_en[18] ) ;
323
bufif0 AD_buf19  ( AD[19], AD_out[19],AD_en[19] ) ;
324
bufif0 AD_buf20  ( AD[20], AD_out[20],AD_en[20] ) ;
325
bufif0 AD_buf21  ( AD[21], AD_out[21],AD_en[21] ) ;
326
bufif0 AD_buf22  ( AD[22], AD_out[22],AD_en[22] ) ;
327
bufif0 AD_buf23  ( AD[23], AD_out[23],AD_en[23] ) ;
328
bufif0 AD_buf24  ( AD[24], AD_out[24],AD_en[24] ) ;
329
bufif0 AD_buf25  ( AD[25], AD_out[25],AD_en[25] ) ;
330
bufif0 AD_buf26  ( AD[26], AD_out[26],AD_en[26] ) ;
331
bufif0 AD_buf27  ( AD[27], AD_out[27],AD_en[27] ) ;
332
bufif0 AD_buf28  ( AD[28], AD_out[28],AD_en[28] ) ;
333
bufif0 AD_buf29  ( AD[29], AD_out[29],AD_en[29] ) ;
334
bufif0 AD_buf30  ( AD[30], AD_out[30],AD_en[30] ) ;
335
bufif0 AD_buf31  ( AD[31], AD_out[31],AD_en[31] ) ;
336
 
337
bufif0 CBE_buf0 ( CBE[0], CBE_out[0], CBE_en[0] ) ;
338
bufif0 CBE_buf1 ( CBE[1], CBE_out[1], CBE_en[1] ) ;
339
bufif0 CBE_buf2 ( CBE[2], CBE_out[2], CBE_en[2] ) ;
340
bufif0 CBE_buf3 ( CBE[3], CBE_out[3], CBE_en[3] ) ;
341
 
342
bufif0 FRAME_buf    ( FRAME, FRAME_out, FRAME_en ) ;
343
bufif0 IRDY_buf     ( IRDY, IRDY_out, IRDY_en ) ;
344
bufif0 DEVSEL_buf   ( DEVSEL, DEVSEL_out, DEVSEL_en ) ;
345
bufif0 TRDY_buf     ( TRDY, TRDY_out, TRDY_en ) ;
346
bufif0 STOP_buf     ( STOP, STOP_out, STOP_en ) ;
347
 
348
bufif0 RST_buf      ( RST, RST_out, RST_en ) ;
349
bufif0 INTA_buf     ( INTA, INTA_out, INTA_en) ;
350
bufif0 REQ_buf      ( REQ, REQ_out, REQ_en ) ;
351
bufif0 PAR_buf      ( PAR, PAR_out, PAR_en ) ;
352
bufif0 PERR_buf     ( PERR, PERR_out, PERR_en ) ;
353
bufif0 SERR_buf     ( SERR, SERR_out, SERR_en ) ;
354
 
355
endmodule

powered by: WebSVN 2.1.0

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