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 1620

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

powered by: WebSVN 2.1.0

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