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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [mp3/] [rtl/] [verilog/] [xfpga_top.v] - Blame information for rev 1773

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

Line No. Rev Author Line
1 266 lampret
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  MP3 demo Top Level                                          ////
4
////                                                              ////
5
////  This file is part of the MP3 demo application               ////
6
////  http://www.opencores.org/cores/or1k/mp3/                    ////
7
////                                                              ////
8
////  Description                                                 ////
9
////  Top level instantiating all the blocks.                     ////
10
////                                                              ////
11
////  To Do:                                                      ////
12
////   - nothing really                                           ////
13
////                                                              ////
14
////  Author(s):                                                  ////
15
////      - Lior Shtram, lior.shtram@flextronicssemi.com          ////
16
////                                                              ////
17
//////////////////////////////////////////////////////////////////////
18
////                                                              ////
19
//// Copyright (C) 2001 Authors                                   ////
20
////                                                              ////
21
//// This source file may be used and distributed without         ////
22
//// restriction provided that this copyright statement is not    ////
23
//// removed from the file and that any derivative work contains  ////
24
//// the original copyright notice and the associated disclaimer. ////
25
////                                                              ////
26
//// This source file is free software; you can redistribute it   ////
27
//// and/or modify it under the terms of the GNU Lesser General   ////
28
//// Public License as published by the Free Software Foundation; ////
29
//// either version 2.1 of the License, or (at your option) any   ////
30
//// later version.                                               ////
31
////                                                              ////
32
//// This source is distributed in the hope that it will be       ////
33
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
34
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
35
//// PURPOSE.  See the GNU Lesser General Public License for more ////
36
//// details.                                                     ////
37
////                                                              ////
38
//// You should have received a copy of the GNU Lesser General    ////
39
//// Public License along with this source; if not, download it   ////
40
//// from http://www.opencores.org/lgpl.shtml                     ////
41
////                                                              ////
42
//////////////////////////////////////////////////////////////////////
43
//
44
// CVS Revision History
45
//
46
// $Log: not supported by cvs2svn $
47 562 lampret
// Revision 1.1.1.1  2001/11/04 19:00:08  lampret
48
// First import.
49
//
50 266 lampret
 
51
`define EXCLUDE_DBG
52
// `define EXCLUDE_VGA
53
// `define EXCLUDE_RISC
54
// `define VGA_RAMDAC
55
 
56
`include "xfpga_defines.v"
57
 
58
module xfpga_top (
59
 
60
// Global connections
61
        clk,
62 562 lampret
        clk2,
63 266 lampret
        rstn,
64
 
65
// Flash RAM
66
        flash_rstn,
67
        flash_cen,
68
        flash_oen,
69
        flash_wen,
70
        flash_rdy,
71
        flash_d,
72
        flash_a,
73
 
74
// SRAM Right
75
        sram_r_cen,
76
        sram_r_oen,
77
        sram_r0_wen,
78
        sram_r1_wen,
79
        sram_r_d,
80
        sram_r_a,
81
 
82
// SRAM Left
83
        sram_l_cen,
84
        sram_l_oen,
85
        sram_l0_wen,
86
        sram_l1_wen,
87
        sram_l_d,
88
        sram_l_a,
89
 
90
`ifdef VGA_RAMDAC
91
 
92
// VGA RAMDAC
93
        ramdac_pixclk,
94
        ramdac_hsyncn,
95
        ramdac_vsync,
96
        ramdac_blank,
97
        ramdac_p,
98
        ramdac_rdn,
99
        ramdac_wrn,
100
        ramdac_rs,
101
        ramdac_d,
102
 
103
`else
104
 
105
// VGA Direct
106
        vga_blank,
107
        vga_pclk,
108
        vga_hsyncn,
109
        vga_vsyncn,
110
        vga_r,
111
        vga_g,
112
        vga_b,
113
 
114
`endif
115
 
116
// Codec connections
117
        codec_mclk,
118
        codec_lrclk,
119
        codec_sclk,
120
        codec_sdin,
121
        codec_sdout,
122
 
123
// Ethernet
124
        eth_col,
125
        eth_crs,
126
        eth_trste,
127
        eth_tx_clk,
128
        eth_tx_en,
129
        eth_tx_er,
130
        eth_txd,
131
        eth_rx_clk,
132
        eth_rx_dv,
133
        eth_rx_er,
134
        eth_rxd,
135
        eth_fds_mdint,
136
        eth_mdc,
137
        eth_mdio,
138
 
139
// Switches
140
        sw,
141
 
142
// Used for tracing fifo activity (CODEC)
143
  USB_VPO,
144
  USB_VMO,
145
 
146
// PS2 port
147
        ps2_clk,
148
        ps2_data,
149
 
150
// GDB JTAG CPLD
151
/*
152
cpld_muxr,
153
        cpld_muxd,
154
*/
155
        cpld_tdo
156
 
157
);
158
 
159
 
160
// Global connections
161
 
162
input clk;
163 562 lampret
input clk2;
164 266 lampret
input rstn;
165
 
166
// Flash RAM
167
 
168
output          flash_rstn;
169
output          flash_cen;
170
output          flash_oen;
171
output          flash_wen;
172
input           flash_rdy;
173
inout [7:0]      flash_d;
174
inout [20:0]     flash_a;
175
 
176
// SRAM Right
177
 
178
output          sram_r_cen;
179
output          sram_r1_wen;
180
output          sram_r0_wen;
181
output          sram_r_oen;
182
output [18:0]    sram_r_a;
183
inout [15:0]     sram_r_d;
184
 
185
// SRAM Left
186
 
187
output          sram_l_cen;
188
output          sram_l0_wen;
189
output          sram_l1_wen;
190
output          sram_l_oen;
191
output [18:0]    sram_l_a;
192
inout [15:0]     sram_l_d;
193
 
194
`ifdef VGA_RAMDAC
195
 
196
output          ramdac_pixclk;
197
output          ramdac_hsyncn;
198
output          ramdac_vsync;
199
output          ramdac_blank;
200
output [7:0]     ramdac_p;
201
output          ramdac_rdn;
202
output          ramdac_wrn;
203
output [2:0]     ramdac_rs;
204
inout  [7:0]     ramdac_d;
205
 
206
`else
207
 
208
// VGA Direct
209
 
210
output          vga_pclk;
211
output          vga_blank;
212
output          vga_hsyncn;
213
output          vga_vsyncn;
214
output [3:0]     vga_r;
215
output [3:0]     vga_g;
216
output [3:0]     vga_b;
217
 
218
`endif
219
 
220
// Stereo Codec
221
 
222
output          codec_mclk;
223
output          codec_lrclk;
224
output          codec_sclk;
225
output          codec_sdin;
226
input           codec_sdout;
227
 
228
// Ethernet
229
 
230
output          eth_tx_er;
231
input           eth_tx_clk;
232
output          eth_tx_en;
233
output [4:0]     eth_txd;
234
input           eth_rx_er;
235
input           eth_rx_clk;
236
input           eth_rx_dv;
237
input [4:0]      eth_rxd;
238
input           eth_col;
239
input           eth_crs;
240
output          eth_trste;
241
input           eth_fds_mdint;
242
inout           eth_mdio;
243
output          eth_mdc;
244
 
245
// Switches
246
input [2:1]     sw;
247
 
248
// Used for tracing fifo activity (CODEC)
249
output USB_VPO;
250
output USB_VMO;
251
 
252
// PS2 port
253
inout           ps2_clk;
254
inout           ps2_data;
255
 
256
// GDB JTAG muxed from the CPLD
257
/*
258
input           cpld_muxr;
259
input           cpld_muxd;
260
*/
261
output          cpld_tdo;
262
 
263
/////////////////////////////////////////////////////////////////////////////////////
264
// And now for the insides
265
 
266
wire [31:0]      wb_vs_adr_i;
267
wire [31:0]      wb_vs_dat_i;
268
wire [31:0]      wb_vs_dat_o;
269
wire [3:0]       wb_vs_sel_i;
270
wire            wb_vs_we_i;
271
wire            wb_vs_stb_i;
272
wire            wb_vs_cyc_i;
273
wire            wb_vs_ack_o;
274
wire            wb_vs_err_o;
275
 
276
wire [31:0]      wb_vm_adr_o;
277
wire [31:0]      wb_vm_dat_i;
278
wire [3:0]       wb_vm_sel_o;
279
wire            wb_vm_we_o;
280
wire            wb_vm_stb_o;
281
wire            wb_vm_cyc_o;
282
wire            wb_vm_cab_o;
283
wire            wb_vm_ack_i;
284
wire            wb_vm_err_i;
285
 
286
wire [31:0]      wb_dm_adr_o;
287
wire [31:0]      wb_dm_dat_i;
288
wire [31:0]      wb_dm_dat_o;
289
wire [3:0]       wb_dm_sel_o;
290
wire            wb_dm_we_o;
291
wire            wb_dm_stb_o;
292
wire            wb_dm_cyc_o;
293
wire            wb_dm_cab_o;
294
wire            wb_dm_ack_i;
295
wire            wb_dm_err_i;
296
 
297
wire [31:0]      wb_ri_adr_o;
298
wire            wb_ri_cyc_o;
299
wire [31:0]      wb_ri_dat_i;
300
wire [31:0]      wb_ri_dat_o;
301
wire [3:0]       wb_ri_sel_o;
302
wire            wb_ri_ack_i;
303
wire            wb_ri_err_i;
304
wire            wb_ri_rty_i;
305
wire            wb_ri_we_o;
306
wire            wb_ri_stb_o;
307
 
308
wire [31:0]      wb_rd_adr_o;
309
wire            wb_rd_cyc_o;
310
wire [31:0]      wb_rd_dat_i;
311
wire [31:0]      wb_rd_dat_o;
312
wire [3:0]       wb_rd_sel_o;
313
wire            wb_rd_ack_i;
314
wire            wb_rd_err_i;
315
wire            wb_rd_rty_i;
316
wire            wb_rd_we_o;
317
wire            wb_rd_stb_o;
318
 
319
wire [31:0]      wb_sr_dat_i;
320
wire [31:0]      wb_sr_dat_o;
321
wire [31:0]      wb_sr_adr_i;
322
wire [3:0]       wb_sr_sel_i;
323
wire            wb_sr_we_i;
324
wire            wb_sr_cyc_i;
325
wire            wb_sr_stb_i;
326
wire            wb_sr_ack_o;
327
wire            wb_sr_err_o;
328
 
329
wire [31:0]      wb_fl_dat_i;
330
wire [31:0]      wb_fl_dat_o;
331
wire [31:0]      wb_fl_adr_i;
332
wire [3:0]       wb_fl_sel_i;
333
wire            wb_fl_we_i;
334
wire            wb_fl_cyc_i;
335
wire            wb_fl_stb_i;
336
wire            wb_fl_ack_o;
337
wire            wb_fl_err_o;
338
 
339
wire [31:0]      wb_au_dat_i;
340
wire [31:0]      wb_au_dat_o;
341
wire [31:0]      wb_au_adr_i;
342
wire [3:0]       wb_au_sel_i;
343
wire            wb_au_we_i;
344
wire            wb_au_cyc_i;
345
wire            wb_au_stb_i;
346
wire            wb_au_ack_o;
347
wire            wb_au_err_o;
348
 
349
wire            vga_int;
350
 
351
wire            audio_dreq;
352
 
353
reg my_int;
354
 
355
wire [3:0]       vga_r_int;
356
wire [3:0]       vga_g_int;
357
wire [3:0]       vga_b_int;
358
 
359
wire crt_hsync;
360
wire crt_vsync;
361
 
362
wire    [3:0]    dbg_lss;
363
wire    [1:0]    dbg_is;
364
wire    [10:0]   dbg_wp;
365
wire            dbg_bp;
366
wire    [31:0]   dbg_dat_dbg;
367
wire    [31:0]   dbg_dat_risc;
368
wire    [31:0]   dbg_adr;
369
wire            dbg_ewt;
370
wire            dbg_stall;
371
wire    [2:0]    dbg_op;
372
 
373
wire            jtag_tdi;
374
wire            jtag_tms;
375
wire            jtag_tck;
376
wire            jtag_trst;
377
wire            jtag_tdo;
378
 
379
wire    [20:0]   flash_a_int;
380
wire                    flash_a_oe;
381
 
382
wire simon = sw[1];
383
wire igor  = sw[2];
384
 
385
 
386
reg resetn_d;
387
reg resetn;
388
wire    wb_clk_i;
389
wire    clk_dll;
390
wire    clk_buf1;
391
 
392
`ifdef EXCLUDE_DBG
393
`else
394
reg sram_ra;
395
`endif
396
 
397
always @ (posedge wb_clk_i or negedge rstn)
398
begin
399
  if(~rstn)
400
    resetn_d <= 1'b0;
401
  else
402
    resetn_d <= #1 1'b1;
403
end
404
 
405
always @ (posedge wb_clk_i)
406
begin
407
  resetn <= #1 resetn_d;
408
end
409
 
410
`ifdef TARGET_VIRTEX
411
IBUFG IBUFG1(.O(wb_clk_i), .I(clk));
412
`else
413
assign wb_clk_i = clk;
414
`endif
415
 
416
/////////////////////////////////////////////////////////////////////////////////////
417
// GDB JTAG demultiplexer
418
`ifdef EXCLUDE_DBG
419
assign jtag_tms  = 1'b0;
420
assign jtag_tdi  = 1'b0;
421
assign jtag_trst = 1'b1;
422
assign jtag_tck  = 1'b0;
423
assign cpld_tdo  = 1'b0;
424
 
425
assign flash_a = flash_a_int;
426
`else
427
/* SIMON */
428
 
429
always @ (posedge clk or negedge rstn)
430
begin
431
  if(~rstn)
432
    sram_ra <= 1'b0;
433
  else if(wb_sr_cyc_i & wb_sr_stb_i & !wb_sr_we_i & !sram_ra)
434
    sram_ra <= #1 1'b1;
435
end
436
assign jtag_tms = ~sram_ra ? 1'b0 : flash_a[6];
437
assign jtag_tdi = ~sram_ra ? 1'b0 : flash_a[7];
438
assign jtag_trst = ~sram_ra ? 1'b1 : flash_a[8];
439
assign jtag_tck = ~sram_ra ? 1'b0 : flash_a[9];
440
assign cpld_tdo = ~sram_ra ? 1'b0 : jtag_tdo;
441
 
442
assign flash_a = ~sram_ra ? flash_a_int : 21'bz;
443
`endif
444
 
445
/////////////////////////////////////////////////////////////////////////////////////
446
// The VGA block
447
 
448
`ifdef EXCLUDE_VGA
449
   initial $display("Warning: exclude vga.");
450
   vga_dummy_top vga
451
   (
452
        .wb_clk_i( wb_clk_i ),
453
        .wb_rst_i( resetn ),
454
        .rst_nreset_i( resetn ),
455
        .wb_inta_o( vga_int ),
456
        .clk_pclk_i( vga_pclk ),
457
        .vga_hsync_pad_o( vga_hsyncn ),
458
        .vga_vsync_pad_o( vga_vsyncn ),
459
        .vga_csync_pad_o( ),
460
        .vga_blank_pad_o( vga_blank ),
461
        .vga_r_pad_o( vga_r[3:0] ),
462
        .vga_b_pad_o( vga_b[3:0] ),
463
        .vga_g_pad_o( vga_g[3:0] ),
464
 
465
        .wb_adr_i( wb_vs_adr_i ),
466
        .wb_sdat_i( wb_vs_dat_i ),
467
        .wb_sdat_o( wb_vs_dat_o ),
468
        .wb_sel_i( wb_vs_sel_i ),
469
        .wb_we_i( wb_vs_we_i ),
470
        .wb_vga_stb_i( wb_vs_stb_i ),
471
        .wb_clut_stb_i( wb_vs_stb_i ),
472
        .wb_cyc_i( wb_vs_cyc_i ),
473
        .wb_ack_o( wb_vs_ack_o ),
474
        .wb_err_o( wb_vs_err_o ),
475
 
476
        .wb_adr_o( wb_vm_adr_o ),
477
        .wb_mdat_i( wb_vm_dat_i ),
478
        .wb_sel_o( wb_vm_sel_o ),
479
        .wb_we_o( wb_vm_we_o ),
480
        .wb_stb_o( wb_vm_stb_o ),
481
        .wb_cyc_o( wb_vm_cyc_o ),
482
        .wb_cab_o( wb_vm_cab_o ),
483
        .wb_ack_i( wb_vm_ack_i ),
484
        .wb_err_i( wb_vm_err_i )
485
   );
486
`else
487
 
488
 
489
 
490
 
491
   // CRT controler instance
492
   ssvga_top CRT
493
   (
494
    // Clock and reset
495
    .wb_clk_i(wb_clk_i),
496
    .wb_rst_i(~resetn),
497
 
498
    // WISHBONE Master I/F
499
    .wbm_cyc_o  (wb_vm_cyc_o),
500
    .wbm_stb_o  (wb_vm_stb_o),
501
    .wbm_sel_o  (wb_vm_sel_o),
502
    .wbm_we_o   (wb_vm_we_o),
503
    .wbm_adr_o  (wb_vm_adr_o),
504
    .wbm_dat_o  (),
505
    .wbm_cab_o  (wb_vm_cab_o),
506
    .wbm_dat_i  (wb_vm_dat_i),
507
    .wbm_ack_i  (wb_vm_ack_i),
508
    .wbm_err_i  (wb_vm_err_i),
509
    .wbm_rty_i  (1'b0),
510
 
511
    // WISHBONE Slave I/F
512
    .wbs_cyc_i  (wb_vs_cyc_i),
513
    .wbs_stb_i  (wb_vs_stb_i),
514
    .wbs_sel_i  (wb_vs_sel_i),
515
    .wbs_we_i   (wb_vs_we_i),
516
    .wbs_adr_i  (wb_vs_adr_i),
517
    .wbs_dat_i  (wb_vs_dat_i),
518
    .wbs_cab_i  (1'b0),
519
    .wbs_dat_o  (wb_vs_dat_o),
520
    .wbs_ack_o  (wb_vs_ack_o),
521
    .wbs_err_o  (wb_vs_err_o),
522
    .wbs_rty_o  (),
523
 
524
    // Signals to VGA display
525
    .pad_hsync_o (crt_hsync),
526
    .pad_vsync_o (crt_vsync),
527
    .pad_rgb_o   ({vga_r_int, vga_g_int, vga_b_int}),
528
    .led_o       (),
529
        .pix_clk     (crt_out_reg_clk),
530
        .misc({11'b0, jtag_tdo, jtag_trst, jtag_tdi, jtag_tms, jtag_tck})
531
   );
532
 
533
   CRTC_IOB crt_out_reg
534
   (
535
    .reset_in     (~resetn),
536
    .clk_in       (crt_out_reg_clk),
537
    .hsync_in     (crt_hsync),
538
    .vsync_in     (crt_vsync),
539
    .rgb_in       ({vga_r_int, vga_g_int, vga_b_int}),
540
    .hsync_out    (vga_hsyncn),
541
    .vsync_out    (vga_vsyncn),
542
    .rgb_out      ({vga_r, vga_g, vga_b})
543
   ) ;
544
`endif
545
 
546
 
547
/////////////////////////////////////////////////////////////////////////////////////
548
// The Audio block
549
//
550
audio_top audio (
551
        .clk( wb_clk_i ),
552
        .rstn( resetn ),
553
        .wb_dat_i( wb_au_dat_i ),
554
        .wb_dat_o( wb_au_dat_o ),
555
        .wb_adr_i( wb_au_adr_i ),
556
        .wb_sel_i( wb_au_sel_i ),
557
        .wb_we_i(  wb_au_we_i  ),
558
        .wb_cyc_i( wb_au_cyc_i ),
559
        .wb_stb_i( wb_au_stb_i ),
560
        .wb_ack_o( wb_au_ack_o ),
561
        .wb_err_o( wb_au_err_o ),
562
        .mclk( codec_mclk ),
563
        .lrclk( codec_lrclk ),
564
        .sclk( codec_sclk ),
565
        .sdin( codec_sdin ),
566
        .sdout( codec_sdout ),
567
 
568
        .audio_dreq( audio_dreq ),
569
        .igor(simon),
570
        .simon(igor),
571
        .USB_VPO(USB_VPO),
572
  .USB_VMO(USB_VMO)
573
 
574
);
575
 
576
//////////////////////////////////////////////////////
577
// Development i/f
578 562 lampret
//`define DBG_IF_MODEL
579
`ifdef DBG_IF_MODEL
580
dbg_if_model dbg1  (
581
        .tms_pad_i(jtag_tms),
582
        .tck_pad_i(jtag_tck),
583
        .trst_pad_i(jtag_trst),
584
  .tdi_pad_i(jtag_tdi),
585
        .tdo_pad_o(jtag_tdo),
586
 
587
  .capture_dr_o(),
588
  .shift_dr_o(),
589
  .update_dr_o(),
590
  .extest_selected_o(),
591
  .bs_chain_i(1'b0),
592
 
593
        .wb_rst_i(~resetn),
594
        .risc_clk_i(wb_clk_i),
595
  .risc_data_i(dbg_dat_risc),
596
        .wp_i(dbg_wp),
597
        .bp_i(dbg_bp),
598
        .lsstatus_i(dbg_lss),
599
        .istatus_i(dbg_is),
600
 
601
        .risc_data_o(dbg_dat_dbg),
602
        .risc_addr_o(dbg_adr),
603
        .opselect_o(dbg_op),
604
        .risc_stall_o(dbg_stall),
605
        .reset_o(),
606
 
607
        .wb_clk_i(wb_clk_i),
608
        .wb_adr_o( wb_dm_adr_o ),
609
        .wb_dat_i( wb_dm_dat_i ),
610
        .wb_dat_o( wb_dm_dat_o ),
611
        .wb_sel_o( wb_dm_sel_o ),
612
        .wb_we_o(  wb_dm_we_o  ),
613
        .wb_stb_o( wb_dm_stb_o ),
614
        .wb_cyc_o( wb_dm_cyc_o ),
615
        .wb_cab_o( wb_dm_cab_o ),
616
        .wb_ack_i( wb_dm_ack_i ),
617
        .wb_err_i( wb_dm_err_i )
618
);
619
`else
620 266 lampret
dbg_top dbg1  (
621
/*
622
        .tms_pad_i(1'b0),
623
        .tck_pad_i(1'b0),
624
        .trst_pad_i(1'b1),
625
  .tdi_pad_i(1'b0),
626
        .tdo_pad_o(),
627
*/
628
        .tms_pad_i(jtag_tms),
629
        .tck_pad_i(jtag_tck),
630
        .trst_pad_i(jtag_trst),
631
  .tdi_pad_i(jtag_tdi),
632
        .tdo_pad_o(jtag_tdo),
633
 
634
  .capture_dr_o(),
635
  .shift_dr_o(),
636
  .update_dr_o(),
637
  .extest_selected_o(),
638
  .bs_chain_i(1'b0),
639
 
640
        .wb_rst_i(~resetn),
641
        .risc_clk_i(wb_clk_i),
642
  .risc_data_i(dbg_dat_risc),
643
        .wp_i(dbg_wp),
644
        .bp_i(dbg_bp),
645
        .lsstatus_i(dbg_lss),
646
        .istatus_i(dbg_is),
647
 
648
        .risc_data_o(dbg_dat_dbg),
649
        .risc_addr_o(dbg_adr),
650
        .opselect_o(dbg_op),
651
        .risc_stall_o(dbg_stall),
652
        .reset_o(),
653
 
654
        .wb_clk_i(wb_clk_i),
655
        .wb_adr_o( wb_dm_adr_o ),
656
        .wb_dat_i( wb_dm_dat_i ),
657
        .wb_dat_o( wb_dm_dat_o ),
658
        .wb_sel_o( wb_dm_sel_o ),
659
        .wb_we_o(  wb_dm_we_o  ),
660
        .wb_stb_o( wb_dm_stb_o ),
661
        .wb_cyc_o( wb_dm_cyc_o ),
662
        .wb_cab_o( wb_dm_cab_o ),
663
        .wb_ack_i( wb_dm_ack_i ),
664
        .wb_err_i( wb_dm_err_i )
665
);
666 562 lampret
`endif
667 266 lampret
 
668
/////////////////////////////////////////////////////////////////////////////////////
669
// The CPU block
670
`ifdef EXCLUDE_RISC
671
or1200_dummy risc (
672
`else
673 562 lampret
or1200_top risc (
674 266 lampret
`endif
675
        .iwb_clk_i( wb_clk_i ),
676
        .iwb_rst_i( ~resetn ),
677
        .iwb_cyc_o( wb_ri_cyc_o ),
678
        .iwb_adr_o( wb_ri_adr_o ),
679
        .iwb_dat_i( wb_ri_dat_i ),
680
        .iwb_dat_o( wb_ri_dat_o ),
681
        .iwb_sel_o( wb_ri_sel_o ),
682
        .iwb_ack_i( wb_ri_ack_i ),
683
        .iwb_err_i( wb_ri_err_i ),
684
        .iwb_rty_i( wb_ri_rty_i ),
685
        .iwb_we_o(  wb_ri_we_o  ),
686
        .iwb_stb_o( wb_ri_stb_o ),
687 562 lampret
        .iwb_cab_o(             ),
688 266 lampret
 
689
        .dwb_clk_i( wb_clk_i ),
690
        .dwb_rst_i( ~resetn ),
691
        .dwb_cyc_o( wb_rd_cyc_o ),
692
        .dwb_adr_o( wb_rd_adr_o ),
693
        .dwb_dat_i( wb_rd_dat_i ),
694
        .dwb_dat_o( wb_rd_dat_o ),
695
        .dwb_sel_o( wb_rd_sel_o ),
696
        .dwb_ack_i( wb_rd_ack_i ),
697
        .dwb_err_i( wb_rd_err_i ),
698
        .dwb_rty_i( wb_rd_rty_i ),
699
        .dwb_we_o(  wb_rd_we_o  ),
700
        .dwb_stb_o( wb_rd_stb_o ),
701
 
702 562 lampret
        .rst_i( ~resetn ),
703
        .clk_i( clk2 ),
704
`ifdef OR1200_CLMODE_1TO2
705
        .clmode_i( 2'b01 ),
706
`else
707
`ifdef OR1200_CLMODE_1TO4
708
        .clmode_i( 2'b11 ),
709
`else
710
        .clmode_i( 2'b00 ),
711
`endif
712
`endif
713 266 lampret
        .dbg_stall_i(dbg_stall),
714
        .dbg_dat_i(dbg_dat_dbg),
715
        .dbg_adr_i(dbg_adr),
716
        .dbg_op_i(dbg_op),
717
        .dbg_ewt_i(1'b0),
718
 
719
        .dbg_lss_o(dbg_lss),
720
        .dbg_is_o(dbg_is),
721
        .dbg_wp_o(dbg_wp),
722
        .dbg_bp_o(dbg_bp),
723
        .dbg_dat_o(dbg_dat_risc),
724
 
725 562 lampret
        .pm_clksd_o( ),
726
        .pm_cpustall_i( 1'b0 ),
727
        .pm_dc_gate_o( ),
728
        .pm_ic_gate_o( ),
729
        .pm_dmmu_gate_o( ),
730
        .pm_immu_gate_o( ),
731
        .pm_tt_gate_o( ),
732
        .pm_cpu_gate_o( ),
733
        .pm_wakeup_o( ),
734
        .pm_lvolt_o( ),
735
//      .pic_ints_i( { 19'b0, audio_dreq } )
736
        .pic_ints_i( { my_int, 19'b0} )
737 266 lampret
);
738
 
739
/////////////////////////////////////////////////////////////////////////////////////
740
// The Flash controller
741
flash_top flash (
742
        .clk( wb_clk_i ),
743
        .rstn( resetn ),
744
        .wb_dat_i( wb_fl_dat_i ),
745
        .wb_dat_o( wb_fl_dat_o ),
746
        .wb_adr_i( wb_fl_adr_i ),
747
        .wb_sel_i( wb_fl_sel_i ),
748
        .wb_we_i(  wb_fl_we_i  ),
749
        .wb_cyc_i( wb_fl_cyc_i ),
750
        .wb_stb_i( wb_fl_stb_i ),
751
        .wb_ack_o( wb_fl_ack_o ),
752
        .wb_err_o( wb_fl_err_o ),
753
        .flash_rstn( flash_rstn ),
754
        .cen( flash_cen ),
755
        .oen( flash_oen ),
756
        .wen( flash_wen ),
757
        .rdy( flash_rdy ),
758
        .d( flash_d ),
759
        .a( flash_a_int ),
760
        .a_oe( flash_a_oe )
761
);
762
 
763
/////////////////////////////////////////////////////////////////////////////////////
764
// The SRAM controller
765
sram_top sram (
766
        .clk( wb_clk_i ),
767
        .rstn( resetn ),
768
        .wb_dat_i( wb_sr_dat_i ),
769
        .wb_dat_o( wb_sr_dat_o ),
770
        .wb_adr_i( wb_sr_adr_i ),
771
        .wb_sel_i( wb_sr_sel_i ),
772
        .wb_we_i(  wb_sr_we_i  ),
773
        .wb_cyc_i( wb_sr_cyc_i ),
774
        .wb_stb_i( wb_sr_stb_i ),
775
        .wb_ack_o( wb_sr_ack_o ),
776
        .wb_err_o( wb_sr_err_o ),
777
        .r_cen( sram_r_cen ),
778
        .r0_wen( sram_r0_wen ),
779
        .r1_wen( sram_r1_wen ),
780
        .r_oen( sram_r_oen ),
781
        .r_a( sram_r_a ),
782
        .r_d( sram_r_d ),
783
        .l_cen( sram_l_cen ),
784
        .l0_wen( sram_l0_wen ),
785
        .l1_wen( sram_l1_wen ),
786
        .l_oen( sram_l_oen ),
787
        .l_a( sram_l_a ),
788
        .l_d( sram_l_d )
789
);
790
 
791
/////////////////////////////////////////////////////////////////////////////////////
792
// The Traffic COP
793
//
794
tcop_top tcop (
795
        .clk( wb_clk_i ),
796
        .rstn( resetn ),
797
 
798
// The VGA connections
799
        .wb_vs_adr_i( wb_vs_adr_i ),
800
        .wb_vs_dat_i( wb_vs_dat_i ),
801
        .wb_vs_dat_o( wb_vs_dat_o ),
802
        .wb_vs_sel_i( wb_vs_sel_i ),
803
        .wb_vs_we_i(  wb_vs_we_i  ),
804
        .wb_vs_stb_i( wb_vs_stb_i ),
805
        .wb_vs_cyc_i( wb_vs_cyc_i ),
806
        .wb_vs_ack_o( wb_vs_ack_o ),
807
        .wb_vs_err_o( wb_vs_err_o ),
808
 
809
        .wb_vm_adr_o( wb_vm_adr_o ),
810
        .wb_vm_dat_i( wb_vm_dat_i ),
811
        .wb_vm_sel_o( wb_vm_sel_o ),
812
        .wb_vm_we_o(  wb_vm_we_o  ),
813
        .wb_vm_stb_o( wb_vm_stb_o ),
814
        .wb_vm_cyc_o( wb_vm_cyc_o ),
815
        .wb_vm_cab_o( wb_vm_cab_o ),
816
        .wb_vm_ack_i( wb_vm_ack_i ),
817
        .wb_vm_err_i( wb_vm_err_i ),
818
 
819
// The Development I/F
820
 
821
        .wb_dm_adr_o( wb_dm_adr_o ),
822
        .wb_dm_dat_i( wb_dm_dat_i ),
823
        .wb_dm_dat_o( wb_dm_dat_o ),
824
        .wb_dm_sel_o( wb_dm_sel_o ),
825
        .wb_dm_we_o(  wb_dm_we_o  ),
826
        .wb_dm_stb_o( wb_dm_stb_o ),
827
        .wb_dm_cyc_o( wb_dm_cyc_o ),
828
        .wb_dm_cab_o( wb_dm_cab_o ),
829
        .wb_dm_ack_i( wb_dm_ack_i ),
830
        .wb_dm_err_i( wb_dm_err_i ),
831
 
832
// The RISC connections 
833
 
834
        .wb_ri_cyc_o( wb_ri_cyc_o ),
835
        .wb_ri_adr_o( wb_ri_adr_o ),
836
        .wb_ri_dat_i( wb_ri_dat_i ),
837
        .wb_ri_dat_o( wb_ri_dat_o ),
838
        .wb_ri_sel_o( wb_ri_sel_o ),
839
        .wb_ri_ack_i( wb_ri_ack_i ),
840
        .wb_ri_err_i( wb_ri_err_i ),
841
        .wb_ri_rty_i( wb_ri_rty_i ),
842
        .wb_ri_we_o(  wb_ri_we_o  ),
843
        .wb_ri_stb_o( wb_ri_stb_o ),
844
 
845
        .wb_rd_cyc_o( wb_rd_cyc_o ),
846
        .wb_rd_adr_o( wb_rd_adr_o ),
847
        .wb_rd_dat_i( wb_rd_dat_i ),
848
        .wb_rd_dat_o( wb_rd_dat_o ),
849
        .wb_rd_sel_o( wb_rd_sel_o ),
850
        .wb_rd_ack_i( wb_rd_ack_i ),
851
        .wb_rd_err_i( wb_rd_err_i ),
852
        .wb_rd_rty_i( wb_rd_rty_i ),
853
        .wb_rd_we_o(  wb_rd_we_o  ),
854
        .wb_rd_stb_o( wb_rd_stb_o ),
855
 
856
// The SRAM
857
 
858
        .wb_sr_dat_i( wb_sr_dat_i ),
859
        .wb_sr_dat_o( wb_sr_dat_o ),
860
        .wb_sr_adr_i( wb_sr_adr_i ),
861
        .wb_sr_sel_i( wb_sr_sel_i ),
862
        .wb_sr_we_i(  wb_sr_we_i  ),
863
        .wb_sr_cyc_i( wb_sr_cyc_i ),
864
        .wb_sr_stb_i( wb_sr_stb_i ),
865
        .wb_sr_ack_o( wb_sr_ack_o ),
866
        .wb_sr_err_o( wb_sr_err_o ),
867
 
868
// The Flash RAM connections
869
 
870
        .wb_fl_dat_i( wb_fl_dat_i ),
871
        .wb_fl_dat_o( wb_fl_dat_o ),
872
        .wb_fl_adr_i( wb_fl_adr_i ),
873
        .wb_fl_sel_i( wb_fl_sel_i ),
874
        .wb_fl_we_i(  wb_fl_we_i  ),
875
        .wb_fl_cyc_i( wb_fl_cyc_i ),
876
        .wb_fl_stb_i( wb_fl_stb_i ),
877
        .wb_fl_ack_o( wb_fl_ack_o ),
878
        .wb_fl_err_o( wb_fl_err_o ),
879
 
880
// The Audio connections
881
 
882
        .wb_au_dat_i( wb_au_dat_i ),
883
        .wb_au_dat_o( wb_au_dat_o ),
884
        .wb_au_adr_i( wb_au_adr_i ),
885
        .wb_au_sel_i( wb_au_sel_i ),
886
        .wb_au_we_i(  wb_au_we_i  ),
887
        .wb_au_cyc_i( wb_au_cyc_i ),
888
        .wb_au_stb_i( wb_au_stb_i ),
889
        .wb_au_ack_o( wb_au_ack_o ),
890
        .wb_au_err_o( wb_au_err_o )
891
);
892
 
893
 
894
// Connecting all the leftovers
895
// synplicity 
896
 
897
always @(posedge wb_clk_i)
898
//      my_int <= $random;
899
        my_int <= 1'b0;
900
endmodule
901
 

powered by: WebSVN 2.1.0

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