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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [rtl/] [verilog/] [soc.v] - Blame information for rev 1587

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

Line No. Rev Author Line
1 1327 jcastillo
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  OR1200 over a RC203 platform top file                       ////
4
////                                                              ////
5
////                                                              ////
6
////  Description                                                 ////
7
////  This block connectes the RISC and peripheral controller     ////
8
////  cores together.                                             ////
9
////                                                              ////
10
////  To Do:                                                      ////
11
////   - nothing really                                           ////
12
////                                                              ////
13
////  Author(s):                                                  ////
14 1575 jcastillo
////      - Javier Castillo, javier.castillo@urjc.es              ////
15 1327 jcastillo
////                                                              ////
16
//////////////////////////////////////////////////////////////////////
17
////                                                              ////
18
//// Copyright (C) 2004 OpenCores                                 ////
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 1587 jcastillo
// Revision 1.3  2005/09/16 00:39:03  jcastillo
47
// no message
48
//
49 1575 jcastillo
// Revision 1.2  2005/05/26 12:25:01  jcastillo
50
// Added support for ethernet chip
51
//
52 1494 jcastillo
// Revision 1.1.1.1  2004/12/13 17:14:31  jcastillo
53
// Firt import of OR1200 over Celoxica RC203 platform
54
//
55 1327 jcastillo
 
56
// synopsys translate_off
57
`include "timescale.v"
58
// synopsys translate_on
59
 
60
`include "or1200_defines.v"
61
 
62
//
63
// Platform description
64
//
65
`define APP_INT_UART    2
66
`define APP_ADDR_DEC_W  8
67
`define APP_ADDR_SRAM   `APP_ADDR_DEC_W'h00
68
`define APP_ADDR_FLASH  `APP_ADDR_DEC_W'hf0
69
`define APP_ADDR_DECP_W  4
70
`define APP_ADDR_PERIP  `APP_ADDR_DEC_W'h9
71
`define APP_ADDR_VGA    `APP_ADDR_DEC_W'h97
72
`define APP_ADDR_ETH    `APP_ADDR_DEC_W'h92
73
`define APP_ADDR_AUDIO  `APP_ADDR_DEC_W'h9d
74
`define APP_ADDR_UART   `APP_ADDR_DEC_W'h90
75
`define APP_ADDR_PS2    `APP_ADDR_DEC_W'h94
76
`define APP_ADDR_RES1   `APP_ADDR_DEC_W'h9e
77
`define APP_ADDR_RES2   `APP_ADDR_DEC_W'h9f
78
`define APP_ADDR_FAKEMC 4'h6
79
 
80
 
81
module soc(
82
   clk,reset,
83
 
84
   //SRAM Ports
85 1587 jcastillo
   sram_nRW0,sram_clk0,sram_address0,
86
   sram_data0,sram_nBW0,sram_nCS0,
87 1327 jcastillo
 
88 1587 jcastillo
   sram_nRW1,sram_clk1,sram_address1,
89
   sram_data1,sram_nBW1,sram_nCS1,
90
 
91 1327 jcastillo
   //UART ports
92
   uart_stx,uart_srx,
93
 
94
   //JTAG ports
95
   jtag_tdi,jtag_tms,jtag_tck,
96 1494 jcastillo
   jtag_tdo,
97
 
98
   //Ethernet ports
99
   eth_nREAD,eth_nWRITE,
100
   eth_address,eth_data,
101
   eth_nBE,eth_reset
102 1327 jcastillo
 
103
   );
104
 
105
   parameter dw = `OR1200_OPERAND_WIDTH;
106
   parameter aw = `OR1200_OPERAND_WIDTH;
107
   parameter ppic_ints = `OR1200_PIC_INTS;
108
 
109
   input         clk /* synthesis xc_clockbuftype = "BUFGDLL" */;
110
   input         reset;
111
 
112 1587 jcastillo
   output        sram_nRW0;
113
   output [19:0] sram_address0;
114
   inout  [31:0] sram_data0;
115
   output [3:0]  sram_nBW0;
116
   output        sram_nCS0;
117
   output        sram_clk0;
118
 
119
   output        sram_nRW1;
120
   output [19:0] sram_address1;
121
   inout  [31:0] sram_data1;
122
   output [3:0]  sram_nBW1;
123
   output        sram_nCS1;
124
   output        sram_clk1;
125 1327 jcastillo
 
126
   output        uart_stx;
127
   input         uart_srx;
128
 
129
   input         jtag_tdi;
130
   input         jtag_tms;
131
   input         jtag_tck;
132
   output        jtag_tdo;
133
 
134 1494 jcastillo
   //
135
   // SMC91111 PINS
136
   //
137
   output        eth_nREAD;
138
   output        eth_nWRITE;
139
   output [2:0]  eth_address;
140
   inout  [15:0] eth_data;   //INOUT
141
   output [1:0]  eth_nBE;
142
   output        eth_reset;
143
 
144 1587 jcastillo
assign sram_clk0=clk;
145
assign sram_clk1=clk;
146 1327 jcastillo
 
147
//Declaring signals
148
wire    [1:0]             clmode;        // 00 WB=RISC, 01 WB=RISC/2, 10 N/A, 11 WB=RISC/4
149
wire    [ppic_ints-1:0]  pic_ints;
150
 
151
//
152
// Instruction WISHBONE interface
153
//
154
wire             iwb_ack;       // normal termination
155
wire             iwb_err;       // termination w/ error
156
wire             iwb_rty;       // termination w/ retry
157
wire  [dw-1:0]   iwb_dat_o;      // reg data bus
158
wire             iwb_cyc;       // cycle valid wire
159
wire  [aw-1:0]   iwb_adr;        // address bus wires
160
wire             iwb_stb;       // strobe wire
161
wire             iwb_we;        // indicates write transfer
162
wire  [3:0]      iwb_sel;        // byte select wires
163
wire  [dw-1:0]   iwb_dat_i;      // wire data bus
164
wire             iwb_cab;
165
`ifdef OR1200_WB_B3
166
wire  [2:0]      iwb_cti;        // cycle type identifier
167
wire  [1:0]      iwb_bte;        // burst type extension
168
`endif
169
 
170
//
171
// Data WISHBONE interface
172
//
173
wire               dwb_ack;     // normal termination
174
wire               dwb_err;     // termination w/ error
175
wire               dwb_rty;     // termination w/ retry
176
wire  [dw-1:0]     dwb_dat_i;    // data bus
177
wire               dwb_cyc;     // cycle valid wire
178
wire  [aw-1:0]     dwb_adr;      // address bus wires
179
wire               dwb_stb;     // strobe wire
180
wire               dwb_we;      // indicates write transfer
181
wire  [3:0]        dwb_sel;      // byte select wires
182
wire  [dw-1:0]     dwb_dat_o;    // wire data bus
183
wire               dwb_cab;
184
`ifdef OR1200_WB_B3
185
wire  [2:0]        dwb_cti;      // cycle type identifier
186
wire  [1:0]        dwb_bte;      // burst type extension
187
`endif
188
 
189
//
190
// Power Management
191
//
192
wire                       pm_cpustall;
193
//
194
//  ZBT SRAM Controller
195
//
196
wire  [31:0]  sram_wb_dat_i;
197
wire  [31:0]  sram_wb_dat_o;
198
wire  [31:0]  sram_wb_adr;
199
wire  [3:0]   sram_wb_sel;
200
wire          sram_wb_we;
201
wire          sram_wb_cyc;
202
wire          sram_wb_stb;
203
wire          sram_wb_ack;
204
 
205
//
206
//  ROM Controller
207
//
208
wire  [31:0]  rom_wb_dat_i;
209
wire  [31:0]  rom_wb_dat_o;
210
wire  [31:0]  rom_wb_adr;
211
wire  [3:0]   rom_wb_sel;
212
wire          rom_wb_we;
213
wire          rom_wb_cyc;
214
wire          rom_wb_stb;
215
wire          rom_wb_ack;
216
 
217
 
218
//
219
// UART16550 core slave i/f wires
220
//
221
wire  [31:0]  wb_us_dat_i;
222
wire  [31:0]  wb_us_dat_o;
223
wire  [31:0]  wb_us_adr_i;
224
wire  [3:0]   wb_us_sel_i;
225
wire          wb_us_we_i;
226
wire          wb_us_cyc_i;
227
wire          wb_us_stb_i;
228
wire          wb_us_ack_o;
229
wire          wb_us_err_o;
230
 
231
//
232
// Wires to internal ROM
233
//
234
wire [14:0]   rom_address;
235
wire [31:0]   rom_data;
236
 
237 1494 jcastillo
//
238
//  Ethernet Controller
239
//
240
wire  [31:0]  eth_wb_dat_i;
241
wire  [31:0]  eth_wb_dat_o;
242
wire  [31:0]  eth_wb_adr;
243
wire  [3:0]   eth_wb_sel;
244
wire          eth_wb_we;
245
wire          eth_wb_cyc;
246
wire          eth_wb_stb;
247
wire          eth_wb_ack;
248 1327 jcastillo
 
249
//
250
// Debug core master i/f wires
251
//
252
wire  [31:0]  wb_dm_adr_o;
253
wire  [31:0]  wb_dm_dat_i;
254
wire  [31:0]  wb_dm_dat_o;
255
wire  [3:0]   wb_dm_sel_o;
256
wire          wb_dm_we_o;
257
wire          wb_dm_stb_o;
258
wire          wb_dm_cyc_o;
259
wire          wb_dm_cab_o;
260
wire          wb_dm_ack_i;
261
wire          wb_dm_err_i;
262
 
263
//
264
// Debug <-> RISC wires
265
//
266
wire  [3:0]   dbg_lss;
267
wire  [1:0]   dbg_is;
268
wire  [10:0]  dbg_wp;
269
wire          dbg_bp;
270
wire  [31:0]  dbg_dat_dbg;
271
wire  [31:0]  dbg_dat_risc;
272
wire  [31:0]  dbg_adr;
273
wire          dbg_ewt;
274
wire          dbg_stall;
275
wire          dbg_we;
276
wire          dbg_stb;
277
wire          dbg_ack;
278
 
279
 
280
//
281
// RISC Instruction address for Flash
282
//
283
// Until first access to real Flash area,
284
// it is always prefixed with Flash area prefix.
285
// This way we have flash at base address 0x0
286
// during reset vector execution (boot). First
287
// access to real Flash area will automatically
288
// move SRAM to 0x0.
289
//
290
 
291
reg          prefix_flash;
292
wire  [31:0] iwb_fake_adr;
293
wire         dwb_ack_s;
294 1494 jcastillo
 
295 1327 jcastillo
//always @(posedge clk or posedge reset)
296
//      if (reset)
297
//      begin
298
//              prefix_flash <= #1 1'b1;
299
//      end     
300
//      else if (iwb_cyc && (iwb_adr[31:32-`APP_ADDR_DEC_W] == `APP_ADDR_FLASH))
301
//      begin
302
//              prefix_flash <= #1 1'b0;
303
//      end     
304
//assign iwb_fake_adr = prefix_flash ? {`APP_ADDR_FLASH, iwb_adr[31-`APP_ADDR_DEC_W:0]} : iwb_adr;
305
//assign dwb_ack = (dwb_adr[31:28] == `APP_ADDR_FAKEMC) && dwb_cyc && dwb_stb ? 1'b1 : dwb_ack_s;             
306
 
307
assign iwb_fake_adr = iwb_adr;
308
assign dwb_ack =  dwb_ack_s;
309
 
310
//
311
// Instantiation of the Traffic COP
312
//
313
tc_top #(`APP_ADDR_DEC_W,
314
         `APP_ADDR_SRAM,
315
         `APP_ADDR_DEC_W,
316
         `APP_ADDR_FLASH,
317
         `APP_ADDR_DECP_W,
318
         `APP_ADDR_PERIP,
319
         `APP_ADDR_DEC_W,
320
         `APP_ADDR_VGA,
321
         `APP_ADDR_ETH,
322
         `APP_ADDR_AUDIO,
323
         `APP_ADDR_UART,
324
         `APP_ADDR_PS2,
325
         `APP_ADDR_RES1,
326
         `APP_ADDR_RES2
327
        ) tc_top (
328
 
329
        // WISHBONE common
330
        .wb_clk_i  ( clk ),
331
        .wb_rst_i  ( reset ),
332
 
333
        // WISHBONE Initiator 0
334
        .i0_wb_cyc_i ( 1'b0 ),
335
        .i0_wb_stb_i ( 1'b0 ),
336
        .i0_wb_cab_i ( 1'b0 ),
337
        .i0_wb_adr_i ( 32'h0000_0000 ),
338
        .i0_wb_sel_i ( 4'b0000 ),
339
        .i0_wb_we_i  ( 1'b0 ),
340
        .i0_wb_dat_i ( 32'h0000_0000 ),
341
        .i0_wb_dat_o ( ),
342
        .i0_wb_ack_o ( ),
343
        .i0_wb_err_o ( ),
344
 
345
 
346
        // WISHBONE Initiator 1
347
        .i1_wb_cyc_i ( 1'b0 ),
348
        .i1_wb_stb_i ( 1'b0 ),
349
        .i1_wb_cab_i ( 1'b0 ),
350
        .i1_wb_adr_i ( 32'h0000_0000 ),
351
        .i1_wb_sel_i ( 4'b0000 ),
352
        .i1_wb_we_i  ( 1'b0 ),
353
        .i1_wb_dat_i ( 32'h0000_0000 ),
354
        .i1_wb_dat_o ( ),
355
        .i1_wb_ack_o ( ),
356
        .i1_wb_err_o ( ),
357
 
358
        // WISHBONE Initiator 2
359
        .i2_wb_cyc_i ( 1'b0 ),
360
        .i2_wb_stb_i ( 1'b0 ),
361
        .i2_wb_cab_i ( 1'b0 ),
362
        .i2_wb_adr_i ( 32'h0000_0000 ),
363
        .i2_wb_sel_i ( 4'b0000 ),
364
        .i2_wb_we_i  ( 1'b0 ),
365
        .i2_wb_dat_i ( 32'h0000_0000 ),
366
        .i2_wb_dat_o ( ),
367
        .i2_wb_ack_o ( ),
368
        .i2_wb_err_o ( ),
369
 
370
        // WISHBONE Initiator 3
371
        .i3_wb_cyc_i ( wb_dm_cyc_o ),
372
        .i3_wb_stb_i ( wb_dm_stb_o ),
373
        .i3_wb_cab_i ( wb_dm_cab_o ),
374
        .i3_wb_adr_i ( wb_dm_adr_o ),
375
        .i3_wb_sel_i ( wb_dm_sel_o ),
376
        .i3_wb_we_i  ( wb_dm_we_o  ),
377
        .i3_wb_dat_i ( wb_dm_dat_o ),
378
        .i3_wb_dat_o ( wb_dm_dat_i ),
379
        .i3_wb_ack_o ( wb_dm_ack_i ),
380
        .i3_wb_err_o ( ),
381
 
382
        // WISHBONE Initiator 4
383
        .i4_wb_cyc_i ( dwb_cyc ),
384
        .i4_wb_stb_i ( dwb_stb ),
385
        .i4_wb_cab_i ( dwb_cab ),
386
        .i4_wb_adr_i ( dwb_adr ),
387
        .i4_wb_sel_i ( dwb_sel ),
388
        .i4_wb_we_i  ( dwb_we  ),
389
        .i4_wb_dat_i ( dwb_dat_o),
390
        .i4_wb_dat_o ( dwb_dat_i ),
391
        .i4_wb_ack_o ( dwb_ack_s ),
392
        .i4_wb_err_o ( ),
393
 
394
        // WISHBONE Initiator 5
395
        .i5_wb_cyc_i ( iwb_cyc ),
396
        .i5_wb_stb_i ( iwb_stb ),
397
        .i5_wb_cab_i ( iwb_cab ),
398
        .i5_wb_adr_i ( iwb_fake_adr ),
399
        .i5_wb_sel_i ( iwb_sel ),
400
        .i5_wb_we_i  ( iwb_we  ),
401
        .i5_wb_dat_i ( iwb_dat_o ),
402
        .i5_wb_dat_o ( iwb_dat_i ),
403
        .i5_wb_ack_o ( iwb_ack ),
404
        .i5_wb_err_o ( ),
405
 
406
        // WISHBONE Initiator 6
407
        .i6_wb_cyc_i ( 1'b0 ),
408
        .i6_wb_stb_i ( 1'b0 ),
409
        .i6_wb_cab_i ( 1'b0 ),
410
        .i6_wb_adr_i ( 32'h0000_0000 ),
411
        .i6_wb_sel_i ( 4'b0000 ),
412
        .i6_wb_we_i  ( 1'b0 ),
413
        .i6_wb_dat_i ( 32'h0000_0000 ),
414
        .i6_wb_dat_o ( ),
415
        .i6_wb_ack_o ( ),
416
        .i6_wb_err_o ( ),
417
 
418
        // WISHBONE Initiator 7
419
        .i7_wb_cyc_i ( 1'b0 ),
420
        .i7_wb_stb_i ( 1'b0 ),
421
        .i7_wb_cab_i ( 1'b0 ),
422
        .i7_wb_adr_i ( 32'h0000_0000 ),
423
        .i7_wb_sel_i ( 4'b0000 ),
424
        .i7_wb_we_i  ( 1'b0 ),
425
        .i7_wb_dat_i ( 32'h0000_0000 ),
426
        .i7_wb_dat_o ( ),
427
        .i7_wb_ack_o ( ),
428
        .i7_wb_err_o ( ),
429
 
430
        // WISHBONE Target 0
431
        .t0_wb_cyc_o ( sram_wb_cyc ),
432
        .t0_wb_stb_o ( sram_wb_stb ),
433
        .t0_wb_cab_o ( sram_wb_cab ),
434
        .t0_wb_adr_o ( sram_wb_adr ),
435
        .t0_wb_sel_o ( sram_wb_sel ),
436
        .t0_wb_we_o  ( sram_wb_we  ),
437
        .t0_wb_dat_o ( sram_wb_dat_i ),
438
        .t0_wb_dat_i ( sram_wb_dat_o ),
439
        .t0_wb_ack_i ( sram_wb_ack ),
440
        .t0_wb_err_i ( 1'b0 ),
441
 
442
        // WISHBONE Target 1
443
        .t1_wb_cyc_o ( rom_wb_cyc ),
444
        .t1_wb_stb_o ( rom_wb_stb ),
445
        .t1_wb_cab_o ( rom_wb_cab ),
446
        .t1_wb_adr_o ( rom_wb_adr ),
447
        .t1_wb_sel_o ( rom_wb_sel ),
448
        .t1_wb_we_o  ( rom_wb_we  ),
449
        .t1_wb_dat_o ( rom_wb_dat_i ),
450
        .t1_wb_dat_i ( rom_wb_dat_o ),
451
        .t1_wb_ack_i ( rom_wb_ack ),
452
        .t1_wb_err_i ( 1'b0 ),
453
 
454
        // WISHBONE Target 2
455
        .t2_wb_cyc_o ( ),
456
        .t2_wb_stb_o ( ),
457
        .t2_wb_cab_o ( ),
458
        .t2_wb_adr_o ( ),
459
        .t2_wb_sel_o ( ),
460
        .t2_wb_we_o  ( ),
461
        .t2_wb_dat_o ( ),
462
        .t2_wb_dat_i ( 32'h0000_0000 ),
463
        .t2_wb_ack_i ( 1'b0 ),
464
        .t2_wb_err_i ( 1'b1 ),
465
 
466
        // WISHBONE Target 3
467 1494 jcastillo
        .t3_wb_cyc_o ( eth_wb_cyc ),
468
        .t3_wb_stb_o ( eth_wb_stb ),
469
        .t3_wb_cab_o ( eth_wb_cab ),
470
        .t3_wb_adr_o ( eth_wb_adr ),
471
        .t3_wb_sel_o ( eth_wb_sel ),
472
        .t3_wb_we_o  ( eth_wb_we  ),
473
        .t3_wb_dat_o ( eth_wb_dat_i ),
474
        .t3_wb_dat_i ( eth_wb_dat_o ),
475
        .t3_wb_ack_i ( eth_wb_ack ),
476
        .t3_wb_err_i ( 1'b0 ),
477
 
478 1327 jcastillo
        // WISHBONE Target 4
479
        .t4_wb_cyc_o ( ),
480
        .t4_wb_stb_o ( ),
481
        .t4_wb_cab_o ( ),
482
        .t4_wb_adr_o ( ),
483
        .t4_wb_sel_o ( ),
484
        .t4_wb_we_o  ( ),
485
        .t4_wb_dat_o ( ),
486
        .t4_wb_dat_i ( 32'h0000_0000 ),
487
        .t4_wb_ack_i ( 1'b0 ),
488
        .t4_wb_err_i ( 1'b1 ),
489
 
490
        // WISHBONE Target 5
491
        .t5_wb_cyc_o ( wb_us_cyc_i ),
492
        .t5_wb_stb_o ( wb_us_stb_i ),
493
        .t5_wb_cab_o ( wb_us_cab_i ),
494
        .t5_wb_adr_o ( wb_us_adr_i ),
495
        .t5_wb_sel_o ( wb_us_sel_i ),
496
        .t5_wb_we_o  ( wb_us_we_i  ),
497
        .t5_wb_dat_o ( wb_us_dat_i ),
498
        .t5_wb_dat_i ( wb_us_dat_o ),
499
        .t5_wb_ack_i ( wb_us_ack_o ),
500
        .t5_wb_err_i ( 1'b0 ),
501
 
502
        // WISHBONE Target 6
503
        .t6_wb_cyc_o ( ),
504
        .t6_wb_stb_o ( ),
505
        .t6_wb_cab_o ( ),
506
        .t6_wb_adr_o ( ),
507
        .t6_wb_sel_o ( ),
508
        .t6_wb_we_o  ( ),
509
        .t6_wb_dat_o ( ),
510
        .t6_wb_dat_i ( 32'h0000_0000 ),
511
        .t6_wb_ack_i ( 1'b0 ),
512
        .t6_wb_err_i ( 1'b1 ),
513
 
514
        // WISHBONE Target 7
515
        .t7_wb_cyc_o ( ),
516
        .t7_wb_stb_o ( ),
517
        .t7_wb_cab_o ( ),
518
        .t7_wb_adr_o ( ),
519
        .t7_wb_sel_o ( ),
520
        .t7_wb_we_o  ( ),
521
        .t7_wb_dat_o ( ),
522
        .t7_wb_dat_i ( 32'h0000_0000 ),
523
        .t7_wb_ack_i ( 1'b0 ),
524
        .t7_wb_err_i ( 1'b1 ),
525
 
526
        // WISHBONE Target 8
527
        .t8_wb_cyc_o ( ),
528
        .t8_wb_stb_o ( ),
529
        .t8_wb_cab_o ( ),
530
        .t8_wb_adr_o ( ),
531
        .t8_wb_sel_o ( ),
532
        .t8_wb_we_o  ( ),
533
        .t8_wb_dat_o ( ),
534
        .t8_wb_dat_i ( 32'h0000_0000 ),
535
        .t8_wb_ack_i ( 1'b0 ),
536
        .t8_wb_err_i ( 1'b1 )
537
);
538
 
539
 
540
//OpenRISC 1200 Instantiation
541
or1200_top or1200_top(
542
        // System
543
        .clk_i      ( clk ),
544
        .rst_i      ( reset ),
545
        .pic_ints_i ( pic_ints ),
546
        .clmode_i   ( clmode ),
547
 
548
        // Instruction WISHBONE INTERFACE
549
        .iwb_clk_i  ( clk ),
550
        .iwb_rst_i  ( reset ),
551
        .iwb_ack_i  ( iwb_ack ),
552
        .iwb_err_i  ( 1'b0 ),
553
        .iwb_rty_i  ( 1'b0 ),
554
        .iwb_dat_i  ( iwb_dat_i ),
555
        .iwb_cyc_o  ( iwb_cyc ),
556
        .iwb_adr_o  ( iwb_adr ),
557
        .iwb_stb_o  ( iwb_stb ),
558
        .iwb_we_o   ( iwb_we ),
559
        .iwb_sel_o  ( iwb_sel ),
560
        .iwb_dat_o  ( iwb_dat_o ),
561
`ifdef OR1200_WB_CAB
562
        .iwb_cab_o  ( iwb_cab ),
563
`endif
564
`ifdef OR1200_WB_B3
565
        .iwb_cti_o  ( iwb_cti ),
566
        .iwb_bte_o  ( iwb_bte ),
567
`endif
568
   //Data WISHBONE INTERFACE
569
        .dwb_clk_i  ( clk ),
570
        .dwb_rst_i  ( reset ),
571
        .dwb_ack_i  ( dwb_ack ),
572
        .dwb_err_i  ( 1'b0 ),
573
        .dwb_rty_i  ( 1'b0 ),
574
        .dwb_dat_i  ( dwb_dat_i ),
575
        .dwb_cyc_o  ( dwb_cyc ),
576
        .dwb_adr_o  ( dwb_adr ),
577
        .dwb_stb_o  ( dwb_stb ),
578
        .dwb_we_o   ( dwb_we ),
579
        .dwb_sel_o  ( dwb_sel ),
580
        .dwb_dat_o  ( dwb_dat_o ),
581
`ifdef OR1200_WB_CAB
582
        .dwb_cab_o  ( dwb_cab ),
583
`endif
584
`ifdef OR1200_WB_B3
585
        .dwb_cti_o  ( dwb_cti ),
586
        .dwb_bte_o  ( dwb_bte ),
587
`endif
588
 
589
        // Debug
590
        .dbg_stall_i ( dbg_stall ),
591
        .dbg_dat_i   ( dbg_dat_dbg ),
592
        .dbg_adr_i   ( dbg_adr ),
593
        .dbg_ewt_i   ( 1'b0 ),
594
        .dbg_lss_o   (  ),
595
        .dbg_is_o    (  ),
596
        .dbg_wp_o    (  ),
597
        .dbg_bp_o    ( dbg_bp ),
598
        .dbg_dat_o   ( dbg_dat_risc ),
599
        .dbg_ack_o   ( dbg_ack ),
600
        .dbg_stb_i   ( dbg_stb ),
601
        .dbg_we_i    ( dbg_we ),
602
 
603
        // Power Management
604
        .pm_cpustall_i(pm_cpustall),
605
        .pm_clksd_o( ),
606
        .pm_dc_gate_o( ),
607
        .pm_ic_gate_o( ),
608
        .pm_dmmu_gate_o( ),
609
        .pm_immu_gate_o( ),
610
        .pm_tt_gate_o( ),
611
        .pm_cpu_gate_o( ),
612
        .pm_wakeup_o( ),
613
        .pm_lvolt_o( )
614
);
615
 
616
 
617
//
618
// TAP<->dbg_interface
619
//      
620
wire debug_select;
621
wire debug_tdi;
622
wire debug_tdo;
623
wire shift_dr;
624
wire pause_dr;
625
wire update_dr;
626
 
627
//
628
// Instantiation of the development i/f
629
//
630
dbg_top dbg_top  (
631
 
632
        // JTAG pins
633
      .tck_i    ( jtag_tck ),
634
      .tdi_i    ( debug_tdi ),
635
      .tdo_o    ( debug_tdo ),
636
      .rst_i    ( reset ),
637
 
638
        // Boundary Scan signals
639
      .shift_dr_i  ( shift_dr ),
640
      .pause_dr_i  ( pause_dr ),
641
      .update_dr_i ( update_dr ),
642
 
643
      .debug_select_i( debug_select) ,
644
        // WISHBONE common
645
      .wb_clk_i   ( clk ),
646
 
647
      // WISHBONE master interface
648
      .wb_adr_o  ( wb_dm_adr_o ),
649
      .wb_dat_i  ( wb_dm_dat_i ),
650
      .wb_dat_o  ( wb_dm_dat_o ),
651
      .wb_sel_o  ( wb_dm_sel_o ),
652
      .wb_we_o   ( wb_dm_we_o  ),
653
      .wb_stb_o  ( wb_dm_stb_o ),
654
      .wb_cyc_o  ( wb_dm_cyc_o ),
655
      .wb_cab_o  ( wb_dm_cab_o ),
656
      .wb_ack_i  ( wb_dm_ack_i ),
657
      .wb_err_i  ( wb_dm_err_i ),
658
      .wb_cti_o  ( ),
659
      .wb_bte_o  ( ),
660
 
661
      // RISC signals
662
      .cpu0_clk_i  ( clk ),
663
      .cpu0_addr_o ( dbg_adr ),
664
      .cpu0_data_i ( dbg_dat_risc ),
665
      .cpu0_data_o ( dbg_dat_dbg ),
666
      .cpu0_bp_i   ( dbg_bp ),
667
      .cpu0_stall_o( dbg_stall ),
668
      .cpu0_stb_o  ( dbg_stb ),
669
      .cpu0_we_o   ( dbg_we ),
670
      .cpu0_ack_i  ( dbg_ack),
671
      .cpu0_rst_o  ( )
672
 
673
);
674
 
675
//
676
// JTAG TAP controller instantiation
677
//
678
tap_top tap_top(
679
 
680
   .tms_pad_i   ( jtag_tms ),
681
   .tck_pad_i   ( jtag_tck ),
682
   .trst_pad_i  ( reset ),
683
   .tdi_pad_i   ( jtag_tdi ),
684
   .tdo_pad_o   ( jtag_tdo ),
685
   .tdo_padoe_o   ( ),
686
 
687
 
688
   .shift_dr_o   ( shift_dr ),
689
   .pause_dr_o   ( pause_dr ),
690
   .update_dr_o  ( update_dr ),
691
   .capture_dr_o ( ),
692
 
693
   .extest_select_o        ( ),
694
   .sample_preload_select_o( ),
695
   .mbist_select_o         ( ),
696
   .debug_select_o         ( debug_select ),
697
 
698
   .tdo_o( debug_tdi ),
699
 
700
   .debug_tdi_i    ( debug_tdo ),   // from debug module
701
   .bs_chain_tdi_i ( 1'b0),        // from Boundary Scan Chain
702
   .mbist_tdi_i    ( 1'b0)         // from Mbist Chain
703
);
704
 
705
//
706
// Instantiation of the ZBT SRAM controller
707
//
708
 
709
wb_zbt_controller  wb_zbt_controller(
710
        .clk(clk),
711
        .reset(reset),
712
 
713
        .wb_stb_i ( sram_wb_stb ),
714
        .wb_dat_o ( sram_wb_dat_o ),
715
        .wb_dat_i ( sram_wb_dat_i ),
716
        .wb_ack_o ( sram_wb_ack ),
717
        .wb_adr_i ( sram_wb_adr ),
718
        .wb_we_i  ( sram_wb_we ),
719
        .wb_cyc_i ( sram_wb_cyc ),
720
        .wb_sel_i ( sram_wb_sel ),
721
 
722 1587 jcastillo
        .nRW0     ( sram_nRW0 ),
723
        .address0 ( sram_address0 ),
724
        .data0    ( sram_data0 ),
725
        .nBW0     ( sram_nBW0 ),
726
        .nCS0     ( sram_nCS0 ),
727
 
728
        .nRW1     ( sram_nRW1 ),
729
        .address1 ( sram_address1 ),
730
        .data1    ( sram_data1 ),
731
        .nBW1     ( sram_nBW1 ),
732
        .nCS1     ( sram_nCS1 )
733 1327 jcastillo
);
734
 
735
//
736
// Instantiation of the ROM controller
737
//                           
738
wb_rom_controller  wb_rom_controller(
739
        .clk(clk),
740
        .reset(reset),
741
 
742
        .wb_stb_i ( rom_wb_stb ),
743
        .wb_dat_o ( rom_wb_dat_o ),
744
        .wb_dat_i ( rom_wb_dat_i ),
745
        .wb_ack_o ( rom_wb_ack ),
746
        .wb_adr_i ( rom_wb_adr ),
747
        .wb_we_i  ( rom_wb_we ),
748
        .wb_cyc_i ( rom_wb_cyc ),
749
        .wb_sel_i ( rom_wb_sel ),
750
 
751
        .address  ( rom_address ),
752
        .data     ( rom_data )
753
);
754
 
755
//
756 1494 jcastillo
// Instantiation of the Ethernet SMC91111 Interface
757
//                           
758
wb_eth_controller  wb_eth_controller(
759
        .clk(clk),
760
        .reset(reset),
761
 
762
        .wb_stb_i ( eth_wb_stb ),
763
        .wb_dat_o ( eth_wb_dat_o ),
764
        .wb_dat_i ( eth_wb_dat_i ),
765
        .wb_ack_o ( eth_wb_ack ),
766
        .wb_adr_i ( eth_wb_adr ),
767
        .wb_we_i  ( eth_wb_we ),
768
        .wb_cyc_i ( eth_wb_cyc ),
769
        .wb_sel_i ( eth_wb_sel ),
770
 
771
        .eth_nREAD(eth_nREAD),
772
                .eth_nWRITE(eth_nWRITE),
773
                .eth_address(eth_address),
774
                .eth_data(eth_data),
775
                .eth_nBE(eth_nBE),
776
                .eth_reset(eth_reset)
777
);
778
 
779
//
780 1327 jcastillo
// Instantiation of the UART16550
781
//
782
uart_top uart_top (
783
 
784
        // WISHBONE common
785
        .wb_clk_i  ( clk ),
786
        .wb_rst_i  ( reset ),
787
 
788
        // WISHBONE slave
789
        .wb_adr_i  ( wb_us_adr_i[4:0] ),
790
        .wb_dat_i  ( wb_us_dat_i ),
791
        .wb_dat_o  ( wb_us_dat_o ),
792
        .wb_we_i   ( wb_us_we_i  ),
793
        .wb_stb_i  ( wb_us_stb_i ),
794
        .wb_cyc_i  ( wb_us_cyc_i ),
795
        .wb_ack_o  ( wb_us_ack_o ),
796
        .wb_sel_i  ( wb_us_sel_i ),
797
 
798
        // Interrupt request
799
        .int_o      ( pic_ints[`APP_INT_UART] ),
800
 
801
        // UART signals
802
        // serial input/output
803
        .stx_pad_o ( uart_stx ),
804
        .srx_pad_i ( uart_srx ),
805
 
806
        // modem signals
807
        .rts_pad_o ( ),
808
        .cts_pad_i ( 1'b0 ),
809
        .dtr_pad_o ( ),
810
        .dsr_pad_i ( 1'b0 ),
811
        .ri_pad_i  ( 1'b0 ),
812
        .dcd_pad_i ( 1'b0 )
813
);
814
 
815
//
816 1494 jcastillo
// ROM (if implemented)
817 1327 jcastillo
//
818
/*rom rom (
819
        .addr(rom_address),
820
        .clk(clk),
821
        .dout(rom_data)
822
);          */
823
 
824
 
825
 
826
//Constant input wires
827
   assign  clmode=0;
828
   assign  pm_cpustall=0;
829
   assign  rom_data=0;
830
 
831
 
832 1587 jcastillo
endmodule

powered by: WebSVN 2.1.0

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