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 1494

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

powered by: WebSVN 2.1.0

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