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 1575

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

powered by: WebSVN 2.1.0

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