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

Subversion Repositories or1k

[/] [or1k/] [tags/] [first/] [orp/] [orp_soc/] [rtl/] [verilog/] [ssvga/] [top.v] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 746 lampret
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  File name "top.v"                                           ////
4
////                                                              ////
5
////  This file is part of the PCI bridge sample aplication       ////
6
////  project (CRT controller).                                   ////
7
////  http://www.opencores.org/cores/pci/                         ////
8
////                                                              ////
9
////  Author(s):                                                  ////
10
////      - Miha Dolenc (mihad@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
// Revision 1.2  2002/02/01 15:24:46  mihad
47
// Repaired a few bugs, updated specification, added test bench files and design document
48
//
49
// Revision 1.1.1.1  2001/10/02 15:33:33  mihad
50
// New project directory structure
51
//
52
//
53
 
54
// This top module is used for simulation and synthesys of CRT controller
55
// sample aplication.
56
 
57
module TOP
58
(
59
    CLK,
60
    AD,
61
    CBE,
62
    RST,
63
    INTA,
64
    REQ,
65
    GNT,
66
    FRAME,
67
    IRDY,
68
    IDSEL,
69
    DEVSEL,
70
    TRDY,
71
    STOP,
72
    PAR,
73
    PERR,
74
    SERR,
75
 
76
/*    CLK_I,
77
    RST_I,
78
    RST_O,
79
    INT_I,
80
    INT_O,
81
 
82
    // WISHBONE slave interface
83
    ADR_I,
84
    SDAT_I,
85
    SDAT_O,
86
    SEL_I,
87
    CYC_I,
88
    STB_I,
89
    WE_I,
90
    CAB_I,
91
    ACK_O,
92
    RTY_O,
93
    ERR_O,
94
 
95
    // WISHBONE master interface
96
    ADR_O,
97
    MDAT_I,
98
    MDAT_O,
99
    SEL_O,
100
    CYC_O,
101
    STB_O,
102
    WE_O,
103
    CAB_O,
104
    ACK_I,
105
    RTY_I,
106
    ERR_I    */
107
 
108
    CRT_CLK,
109
    HSYNC,
110
    VSYNC,
111
    RGB,
112
    LED
113
);
114
 
115
input           CLK ;
116
inout   [31:0]  AD ;
117
inout   [3:0]   CBE ;
118
inout           RST ;
119
inout           INTA ;
120
output          REQ ;
121
input           GNT ;
122
inout           FRAME ;
123
inout           IRDY ;
124
input           IDSEL ;
125
inout           DEVSEL ;
126
inout           TRDY ;
127
inout           STOP ;
128
inout           PAR ;
129
inout           PERR ;
130
output          SERR ;
131
 
132
input           CRT_CLK ;
133
// CRT outputs
134
output          HSYNC ;
135
output          VSYNC ;
136
output  [15:4]  RGB ;
137
output                  LED ;
138
 
139
// WISHBONE system signals
140
wire    RST_I = 1'b0 ;
141
wire    RST_O ;
142
wire    INT_I = 1'b0 ;
143
wire    INT_O ;
144
 
145
wire [15:0] rgb_int ;
146
// WISHBONE slave interface
147
wire    [31:0]  ADR_I ;
148
wire    [31:0]  SDAT_I ;
149
wire    [31:0]  SDAT_O ;
150
wire    [3:0]   SEL_I ;
151
wire            CYC_I ;
152
wire            STB_I ;
153
wire            WE_I  ;
154
wire            CAB_I ;
155
wire            ACK_O ;
156
wire            RTY_O ;
157
wire            ERR_O ;
158
 
159
// WISHBONE master interface
160
wire    [31:0]  ADR_O ;
161
wire    [31:0]  MDAT_I ;
162
wire    [31:0]  MDAT_O ;
163
wire    [3:0]   SEL_O ;
164
wire            CYC_O ;
165
wire            STB_O ;
166
wire            WE_O  ;
167
wire            CAB_O ;
168
wire            ACK_I ;
169
wire            RTY_I ;
170
wire            ERR_I ;
171
 
172
wire    [31:0]  AD_out ;
173
wire    [31:0]  AD_en ;
174
 
175
 
176
wire    [31:0]  AD_in = AD ;
177
 
178
wire    [3:0]   CBE_in = CBE ;
179
wire    [3:0]   CBE_out ;
180
wire    [3:0]   CBE_en ;
181
 
182
 
183
 
184
wire            RST_in = RST ;
185
wire            RST_out ;
186
wire            RST_en ;
187
 
188
wire            INTA_in = INTA ;
189
wire            INTA_en ;
190
wire            INTA_out ;
191
 
192
wire            REQ_en ;
193
wire            REQ_out ;
194
 
195
wire            FRAME_in = FRAME ;
196
wire            FRAME_out ;
197
wire            FRAME_en ;
198
 
199
wire            IRDY_in = IRDY ;
200
wire            IRDY_out ;
201
wire            IRDY_en ;
202
 
203
wire            DEVSEL_in = DEVSEL ;
204
wire            DEVSEL_out ;
205
wire            DEVSEL_en ;
206
 
207
wire            TRDY_in = TRDY ;
208
wire            TRDY_out ;
209
wire            TRDY_en ;
210
 
211
wire            STOP_in = STOP ;
212
wire            STOP_out ;
213
wire            STOP_en ;
214
 
215
wire            PAR_in = PAR ;
216
wire            PAR_out ;
217
wire            PAR_en ;
218
 
219
wire            PERR_in = PERR ;
220
wire            PERR_out ;
221
wire            PERR_en ;
222
 
223
wire            SERR_out ;
224
wire            SERR_en ;
225
 
226
PCI_BRIDGE32 bridge
227
(
228
    // WISHBONE system signals
229
    .CLK_I(CRT_CLK),
230
    .RST_I(RST_I),
231
    .RST_O(RST_O),
232
    .INT_I(INT_I),
233
    .INT_O(INT_O),
234
 
235
    // WISHBONE slave interface
236
    .ADR_I(ADR_I),
237
    .SDAT_I(SDAT_I),
238
    .SDAT_O(SDAT_O),
239
    .SEL_I(SEL_I),
240
    .CYC_I(CYC_I),
241
    .STB_I(STB_I),
242
    .WE_I(WE_I),
243
    .CAB_I(CAB_I),
244
    .ACK_O(ACK_O),
245
    .RTY_O(RTY_O),
246
    .ERR_O(ERR_O),
247
 
248
    // WISHBONE master interface
249
    .ADR_O(ADR_O),
250
    .MDAT_I(MDAT_I),
251
    .MDAT_O(MDAT_O),
252
    .SEL_O(SEL_O),
253
    .CYC_O(CYC_O),
254
    .STB_O(STB_O),
255
    .WE_O(WE_O),
256
    .CAB_O(CAB_O),
257
    .ACK_I(ACK_I),
258
    .RTY_I(RTY_I),
259
    .ERR_I(ERR_I),
260
 
261
    // pci interface - system pins
262
    .PCI_CLK_IN (CLK),
263
    .PCI_RSTn_IN ( RST_in ),
264
    .PCI_RSTn_OUT ( RST_out ),
265
    .PCI_INTAn_IN ( INTA_in ),
266
    .PCI_INTAn_OUT( INTA_out),
267
    .PCI_RSTn_EN_OUT( RST_en),
268
    .PCI_INTAn_EN_OUT(INTA_en),
269
 
270
    // arbitration pins
271
    .PCI_REQn_OUT( REQ_out ),
272
    .PCI_REQn_EN_OUT ( REQ_en ),
273
 
274
    .PCI_GNTn_IN( GNT ),
275
 
276
    // protocol pins
277
    .PCI_FRAMEn_IN( FRAME_in),
278
    .PCI_FRAMEn_OUT( FRAME_out ),
279
 
280
    .PCI_FRAMEn_EN_OUT( FRAME_en ),
281
    .PCI_IRDYn_EN_OUT ( IRDY_en ),
282
    .PCI_DEVSELn_EN_OUT ( DEVSEL_en ),
283
    .PCI_TRDYn_EN_OUT ( TRDY_en ),
284
    .PCI_STOPn_EN_OUT ( STOP_en ),
285
    .PCI_AD_EN_OUT(AD_en),
286
    .PCI_CBEn_EN_OUT ( CBE_en) ,
287
 
288
    .PCI_IRDYn_IN ( IRDY_in ),
289
    .PCI_IRDYn_OUT ( IRDY_out ),
290
 
291
    .PCI_IDSEL_IN ( IDSEL ),
292
 
293
    .PCI_DEVSELn_IN( DEVSEL_in ),
294
    .PCI_DEVSELn_OUT ( DEVSEL_out ),
295
 
296
    .PCI_TRDYn_IN ( TRDY_in ),
297
    .PCI_TRDYn_OUT ( TRDY_out ),
298
 
299
    .PCI_STOPn_IN( STOP_in ),
300
    .PCI_STOPn_OUT ( STOP_out ),
301
 
302
    // data transfer pins
303
    .PCI_AD_IN(AD_in),
304
    .PCI_AD_OUT (AD_out),
305
 
306
    .PCI_CBEn_IN( CBE_in ),
307
    .PCI_CBEn_OUT ( CBE_out ),
308
 
309
    // parity generation and checking pins
310
    .PCI_PAR_IN ( PAR_in ),
311
    .PCI_PAR_OUT ( PAR_out ),
312
    .PCI_PAR_EN_OUT ( PAR_en ),
313
 
314
    .PCI_PERRn_IN ( PERR_in ),
315
    .PCI_PERRn_OUT ( PERR_out ),
316
    .PCI_PERRn_EN_OUT ( PERR_en ),
317
 
318
    // system error pin
319
    .PCI_SERRn_OUT ( SERR_out ),
320
    .PCI_SERRn_EN_OUT ( SERR_en )
321
);
322
 
323
// PCI IO buffers instantiation
324
bufif0 AD_buf0   ( AD[0],  AD_out[0], AD_en[0]) ;
325
bufif0 AD_buf1   ( AD[1],  AD_out[1], AD_en[1]) ;
326
bufif0 AD_buf2   ( AD[2],  AD_out[2], AD_en[2]) ;
327
bufif0 AD_buf3   ( AD[3],  AD_out[3], AD_en[3]) ;
328
bufif0 AD_buf4   ( AD[4],  AD_out[4], AD_en[4]) ;
329
bufif0 AD_buf5   ( AD[5],  AD_out[5], AD_en[5]) ;
330
bufif0 AD_buf6   ( AD[6],  AD_out[6], AD_en[6]) ;
331
bufif0 AD_buf7   ( AD[7],  AD_out[7], AD_en[7]) ;
332
bufif0 AD_buf8   ( AD[8],  AD_out[8], AD_en[8]) ;
333
bufif0 AD_buf9   ( AD[9],  AD_out[9], AD_en[9]) ;
334
bufif0 AD_buf10  ( AD[10], AD_out[10],AD_en[10] ) ;
335
bufif0 AD_buf11  ( AD[11], AD_out[11],AD_en[11] ) ;
336
bufif0 AD_buf12  ( AD[12], AD_out[12],AD_en[12] ) ;
337
bufif0 AD_buf13  ( AD[13], AD_out[13],AD_en[13] ) ;
338
bufif0 AD_buf14  ( AD[14], AD_out[14],AD_en[14] ) ;
339
bufif0 AD_buf15  ( AD[15], AD_out[15],AD_en[15] ) ;
340
bufif0 AD_buf16  ( AD[16], AD_out[16],AD_en[16] ) ;
341
bufif0 AD_buf17  ( AD[17], AD_out[17],AD_en[17] ) ;
342
bufif0 AD_buf18  ( AD[18], AD_out[18],AD_en[18] ) ;
343
bufif0 AD_buf19  ( AD[19], AD_out[19],AD_en[19] ) ;
344
bufif0 AD_buf20  ( AD[20], AD_out[20],AD_en[20] ) ;
345
bufif0 AD_buf21  ( AD[21], AD_out[21],AD_en[21] ) ;
346
bufif0 AD_buf22  ( AD[22], AD_out[22],AD_en[22] ) ;
347
bufif0 AD_buf23  ( AD[23], AD_out[23],AD_en[23] ) ;
348
bufif0 AD_buf24  ( AD[24], AD_out[24],AD_en[24] ) ;
349
bufif0 AD_buf25  ( AD[25], AD_out[25],AD_en[25] ) ;
350
bufif0 AD_buf26  ( AD[26], AD_out[26],AD_en[26] ) ;
351
bufif0 AD_buf27  ( AD[27], AD_out[27],AD_en[27] ) ;
352
bufif0 AD_buf28  ( AD[28], AD_out[28],AD_en[28] ) ;
353
bufif0 AD_buf29  ( AD[29], AD_out[29],AD_en[29] ) ;
354
bufif0 AD_buf30  ( AD[30], AD_out[30],AD_en[30] ) ;
355
bufif0 AD_buf31  ( AD[31], AD_out[31],AD_en[31] ) ;
356
 
357
bufif0 CBE_buf0 ( CBE[0], CBE_out[0], CBE_en[0] ) ;
358
bufif0 CBE_buf1 ( CBE[1], CBE_out[1], CBE_en[1] ) ;
359
bufif0 CBE_buf2 ( CBE[2], CBE_out[2], CBE_en[2] ) ;
360
bufif0 CBE_buf3 ( CBE[3], CBE_out[3], CBE_en[3] ) ;
361
 
362
bufif0 FRAME_buf    ( FRAME, FRAME_out, FRAME_en ) ;
363
bufif0 IRDY_buf     ( IRDY, IRDY_out, IRDY_en ) ;
364
bufif0 DEVSEL_buf   ( DEVSEL, DEVSEL_out, DEVSEL_en ) ;
365
bufif0 TRDY_buf     ( TRDY, TRDY_out, TRDY_en ) ;
366
bufif0 STOP_buf     ( STOP, STOP_out, STOP_en ) ;
367
 
368
bufif0 RST_buf      ( RST, RST_out, RST_en ) ;
369
bufif0 INTA_buf     ( INTA, INTA_out, INTA_en) ;
370
bufif0 REQ_buf      ( REQ, REQ_out, REQ_en ) ;
371
bufif0 PAR_buf      ( PAR, PAR_out, PAR_en ) ;
372
bufif0 PERR_buf     ( PERR, PERR_out, PERR_en ) ;
373
bufif0 SERR_buf     ( SERR, SERR_out, SERR_en ) ;
374
 
375
wire crt_hsync ;
376
wire crt_vsync ;
377
 
378
// CRT controler instance
379
ssvga_top CRT
380
(
381
        // Clock and reset
382
        .wb_clk_i(CRT_CLK),
383
    .wb_rst_i(RST_O),
384
 
385
        // WISHBONE Master I/F
386
        .wbm_cyc_o  (CYC_I),
387
    .wbm_stb_o  (STB_I),
388
    .wbm_sel_o  (SEL_I),
389
    .wbm_we_o   (WE_I),
390
        .wbm_adr_o  (ADR_I),
391
    .wbm_dat_o  (SDAT_I),
392
    .wbm_cab_o  (CAB_I),
393
        .wbm_dat_i  (SDAT_O),
394
    .wbm_ack_i  (ACK_O),
395
    .wbm_err_i  (ERR_O),
396
    .wbm_rty_i  (RTY_O),
397
 
398
        // WISHBONE Slave I/F
399
        .wbs_cyc_i  (CYC_O),
400
    .wbs_stb_i  (STB_O),
401
    .wbs_sel_i  (SEL_O),
402
    .wbs_we_i   (WE_O),
403
        .wbs_adr_i  (ADR_O),
404
    .wbs_dat_i  (MDAT_O),
405
    .wbs_cab_i  (CAB_O),
406
        .wbs_dat_o  (MDAT_I),
407
    .wbs_ack_o  (ACK_I),
408
    .wbs_err_o  (ERR_I),
409
    .wbs_rty_o  (RTY_I),
410
 
411
        // Signals to VGA display
412
        .pad_hsync_o    (crt_hsync),
413
    .pad_vsync_o    (crt_vsync),
414
    .pad_rgb_o      (rgb_int),
415
    .led_o                      (LED)
416
);
417
 
418
CRTC_IOB crt_out_reg
419
(
420
    .reset_in(RST_O),
421
    .clk_in(CRT_CLK),
422
    .hsync_in(crt_hsync),
423
    .vsync_in(crt_vsync),
424
    .rgb_in(rgb_int[15:4]),
425
    .hsync_out(HSYNC),
426
    .vsync_out(VSYNC),
427
    .rgb_out(RGB)
428
) ;
429
 
430
endmodule

powered by: WebSVN 2.1.0

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