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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [rtl/] [verilog/] [soc.v] - Blame information for rev 1327

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

powered by: WebSVN 2.1.0

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