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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [orp/] [orp_soc/] [rtl/] [verilog/] [or1200.old/] [or1200_top.v] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 746 lampret
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  OR1200 Top Level                                            ////
4
////                                                              ////
5
////  This file is part of the OpenRISC 1200 project              ////
6
////  http://www.opencores.org/cores/or1k/                        ////
7
////                                                              ////
8
////  Description                                                 ////
9
////  OR1200 Top Level                                            ////
10
////                                                              ////
11
////  To Do:                                                      ////
12
////   - make it smaller and faster                               ////
13
////                                                              ////
14
////  Author(s):                                                  ////
15
////      - Damjan Lampret, lampret@opencores.org                 ////
16
////                                                              ////
17
//////////////////////////////////////////////////////////////////////
18
////                                                              ////
19
//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
20
////                                                              ////
21
//// This source file may be used and distributed without         ////
22
//// restriction provided that this copyright statement is not    ////
23
//// removed from the file and that any derivative work contains  ////
24
//// the original copyright notice and the associated disclaimer. ////
25
////                                                              ////
26
//// This source file is free software; you can redistribute it   ////
27
//// and/or modify it under the terms of the GNU Lesser General   ////
28
//// Public License as published by the Free Software Foundation; ////
29
//// either version 2.1 of the License, or (at your option) any   ////
30
//// later version.                                               ////
31
////                                                              ////
32
//// This source is distributed in the hope that it will be       ////
33
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
34
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
35
//// PURPOSE.  See the GNU Lesser General Public License for more ////
36
//// details.                                                     ////
37
////                                                              ////
38
//// You should have received a copy of the GNU Lesser General    ////
39
//// Public License along with this source; if not, download it   ////
40
//// from http://www.opencores.org/lgpl.shtml                     ////
41
////                                                              ////
42
//////////////////////////////////////////////////////////////////////
43
//
44
// CVS Revision History
45
//
46
// $Log: not supported by cvs2svn $
47
// Revision 1.5  2002/02/11 04:33:17  lampret
48
// Speed optimizations (removed duplicate _cyc_ and _stb_). Fixed D/IMMU cache-inhibit attr.
49
//
50
// Revision 1.4  2002/02/01 19:56:55  lampret
51
// Fixed combinational loops.
52
//
53
// Revision 1.3  2002/01/28 01:16:00  lampret
54
// Changed 'void' nop-ops instead of insn[0] to use insn[16]. Debug unit stalls the tick timer. Prepared new flag generation for add and and insns. Blocked DC/IC while they are turned off. Fixed I/D MMU SPRs layout except WAYs. TODO: smart IC invalidate, l.j 2 and TLB ways.
55
//
56
// Revision 1.2  2002/01/18 07:56:00  lampret
57
// No more low/high priority interrupts (PICPR removed). Added tick timer exception. Added exception prefix (SR[EPH]). Fixed single-step bug whenreading NPC.
58
//
59
// Revision 1.1  2002/01/03 08:16:15  lampret
60
// New prefixes for RTL files, prefixed module names. Updated cache controllers and MMUs.
61
//
62
// Revision 1.13  2001/11/23 08:38:51  lampret
63
// Changed DSR/DRR behavior and exception detection.
64
//
65
// Revision 1.12  2001/11/20 00:57:22  lampret
66
// Fixed width of du_except.
67
//
68
// Revision 1.11  2001/11/18 08:36:28  lampret
69
// For GDB changed single stepping and disabled trap exception.
70
//
71
// Revision 1.10  2001/10/21 17:57:16  lampret
72
// Removed params from generic_XX.v. Added translate_off/on in sprs.v and id.v. Removed spr_addr from dc.v and ic.v. Fixed CR+LF.
73
//
74
// Revision 1.9  2001/10/14 13:12:10  lampret
75
// MP3 version.
76
//
77
// Revision 1.1.1.1  2001/10/06 10:18:35  igorm
78
// no message
79
//
80
// Revision 1.4  2001/08/13 03:36:20  lampret
81
// Added cfg regs. Moved all defines into one defines.v file. More cleanup.
82
//
83
// Revision 1.3  2001/08/09 13:39:33  lampret
84
// Major clean-up.
85
//
86
// Revision 1.2  2001/07/22 03:31:54  lampret
87
// Fixed RAM's oen bug. Cache bypass under development.
88
//
89
// Revision 1.1  2001/07/20 00:46:21  lampret
90
// Development version of RTL. Libraries are missing.
91
//
92
//
93
 
94
// synopsys translate_off
95
`include "timescale.v"
96
// synopsys translate_on
97
`include "or1200_defines.v"
98
 
99
module or1200_top(
100
        // System
101
        clk_i, rst_i, pic_ints_i, clmode_i,
102
 
103
        // Instruction WISHBONE INTERFACE
104
        iwb_clk_i, iwb_rst_i, iwb_ack_i, iwb_err_i, iwb_rty_i, iwb_dat_i,
105
        iwb_cyc_o, iwb_adr_o, iwb_stb_o, iwb_we_o, iwb_sel_o, iwb_cab_o, iwb_dat_o,
106
 
107
        // Data WISHBONE INTERFACE
108
        dwb_clk_i, dwb_rst_i, dwb_ack_i, dwb_err_i, dwb_rty_i, dwb_dat_i,
109
        dwb_cyc_o, dwb_adr_o, dwb_stb_o, dwb_we_o, dwb_sel_o, dwb_cab_o, dwb_dat_o,
110
 
111
        // External Debug Interface
112
        dbg_stall_i, dbg_dat_i, dbg_adr_i, dbg_op_i, dbg_ewt_i,
113
        dbg_lss_o, dbg_is_o, dbg_wp_o, dbg_bp_o, dbg_dat_o,
114
 
115
        // Power Management
116
        pm_cpustall_i,
117
        pm_clksd_o, pm_dc_gate_o, pm_ic_gate_o, pm_dmmu_gate_o,
118
        pm_immu_gate_o, pm_tt_gate_o, pm_cpu_gate_o, pm_wakeup_o, pm_lvolt_o
119
 
120
);
121
 
122
parameter dw = `OR1200_OPERAND_WIDTH;
123
parameter aw = `OR1200_OPERAND_WIDTH;
124
parameter ppic_ints = `OR1200_PIC_INTS;
125
 
126
//
127
// I/O
128
//
129
 
130
//
131
// System
132
//
133
input                   clk_i;
134
input                   rst_i;
135
input   [1:0]            clmode_i;       // 00 WB=RISC, 01 WB=RISC/2, 10 N/A, 11 WB=RISC/4
136
input   [ppic_ints-1:0]  pic_ints_i;
137
 
138
//
139
// Instruction WISHBONE interface
140
//
141
input                   iwb_clk_i;      // clock input
142
input                   iwb_rst_i;      // reset input
143
input                   iwb_ack_i;      // normal termination
144
input                   iwb_err_i;      // termination w/ error
145
input                   iwb_rty_i;      // termination w/ retry
146
input   [dw-1:0] iwb_dat_i;      // input data bus
147
output                  iwb_cyc_o;      // cycle valid output
148
output  [aw-1:0] iwb_adr_o;      // address bus outputs
149
output                  iwb_stb_o;      // strobe output
150
output                  iwb_we_o;       // indicates write transfer
151
output  [3:0]            iwb_sel_o;      // byte select outputs
152
output                  iwb_cab_o;      // indicates consecutive address burst
153
output  [dw-1:0] iwb_dat_o;      // output data bus
154
 
155
//
156
// Data WISHBONE interface
157
//
158
input                   dwb_clk_i;      // clock input
159
input                   dwb_rst_i;      // reset input
160
input                   dwb_ack_i;      // normal termination
161
input                   dwb_err_i;      // termination w/ error
162
input                   dwb_rty_i;      // termination w/ retry
163
input   [dw-1:0] dwb_dat_i;      // input data bus
164
output                  dwb_cyc_o;      // cycle valid output
165
output  [aw-1:0] dwb_adr_o;      // address bus outputs
166
output                  dwb_stb_o;      // strobe output
167
output                  dwb_we_o;       // indicates write transfer
168
output  [3:0]            dwb_sel_o;      // byte select outputs
169
output                  dwb_cab_o;      // indicates consecutive address burst
170
output  [dw-1:0] dwb_dat_o;      // output data bus
171
 
172
//
173
// External Debug Interface
174
//
175
input                   dbg_stall_i;    // External Stall Input
176
input   [dw-1:0] dbg_dat_i;      // External Data Input
177
input   [aw-1:0] dbg_adr_i;      // External Address Input
178
input   [2:0]            dbg_op_i;       // External Operation Select Input
179
input                   dbg_ewt_i;      // External Watchpoint Trigger Input
180
output  [3:0]            dbg_lss_o;      // External Load/Store Unit Status
181
output  [1:0]            dbg_is_o;       // External Insn Fetch Status
182
output  [10:0]           dbg_wp_o;       // Watchpoints Outputs
183
output                  dbg_bp_o;       // Breakpoint Output
184
output  [dw-1:0] dbg_dat_o;      // External Data Output
185
 
186
//
187
// Power Management
188
//
189
input                   pm_cpustall_i;
190
output  [3:0]            pm_clksd_o;
191
output                  pm_dc_gate_o;
192
output                  pm_ic_gate_o;
193
output                  pm_dmmu_gate_o;
194
output                  pm_immu_gate_o;
195
output                  pm_tt_gate_o;
196
output                  pm_cpu_gate_o;
197
output                  pm_wakeup_o;
198
output                  pm_lvolt_o;
199
 
200
 
201
//
202
// Internal wires and regs
203
//
204
 
205
//
206
// DC to BIU
207
//
208
wire    [dw-1:0] dcbiu_dat_dc;
209
wire    [aw-1:0] dcbiu_adr_dc;
210
wire                    dcbiu_cyc_dc;
211
wire                    dcbiu_stb_dc;
212
wire                    dcbiu_we_dc;
213
wire    [3:0]            dcbiu_sel_dc;
214
wire    [3:0]            dcbiu_tag_dc;
215
wire    [dw-1:0] dcbiu_dat_biu;
216
wire                    dcbiu_ack_biu;
217
wire                    dcbiu_err_biu;
218
wire    [3:0]            dcbiu_tag_biu;
219
 
220
//
221
// IC to BIU
222
//
223
wire    [dw-1:0] icbiu_dat_ic;
224
wire    [aw-1:0] icbiu_adr_ic;
225
wire                    icbiu_cyc_ic;
226
wire                    icbiu_stb_ic;
227
wire                    icbiu_we_ic;
228
wire    [3:0]            icbiu_sel_ic;
229
wire    [3:0]            icbiu_tag_ic;
230
wire    [dw-1:0] icbiu_dat_biu;
231
wire                    icbiu_ack_biu;
232
wire                    icbiu_err_biu;
233
wire    [3:0]            icbiu_tag_biu;
234
 
235
//
236
// CPU's SPR access to various RISC units (shared wires)
237
//
238
wire                    supv;
239
wire    [aw-1:0] spr_addr;
240
wire    [dw-1:0] spr_dat_cpu;
241
wire    [31:0]           spr_cs;
242
wire                    spr_we;
243
 
244
//
245
// DMMU and CPU
246
//
247
wire                    dmmu_en;
248
wire    [31:0]           spr_dat_dmmu;
249
 
250
//
251
// DMMU and DC
252
//
253
wire                    dcdmmu_err_dc;
254
wire    [3:0]            dcdmmu_tag_dc;
255
wire    [aw-1:0] dcdmmu_adr_dmmu;
256
wire                    dcdmmu_cycstb_dmmu;
257
wire                    dcdmmu_ci_dmmu;
258
 
259
//
260
// CPU and data memory subsystem
261
//
262
wire                    dc_en;
263
wire    [31:0]           dcpu_adr_cpu;
264
wire                    dcpu_we_cpu;
265
wire    [3:0]            dcpu_sel_cpu;
266
wire    [3:0]            dcpu_tag_cpu;
267
wire    [31:0]           dcpu_dat_cpu;
268
wire    [31:0]           dcpu_dat_dc;
269
wire                    dcpu_ack_dc;
270
wire                    dcpu_rty_dc;
271
wire                    dcpu_err_dmmu;
272
wire    [3:0]            dcpu_tag_dmmu;
273
 
274
//
275
// IMMU and CPU
276
//
277
wire                    immu_en;
278
wire    [31:0]           spr_dat_immu;
279
 
280
//
281
// CPU and insn memory subsystem
282
//
283
wire                    ic_en;
284
wire    [31:0]           icpu_adr_cpu;
285
wire                    icpu_cycstb_cpu;
286
wire                    icpu_we_cpu;
287
wire    [3:0]            icpu_sel_cpu;
288
wire    [3:0]            icpu_tag_cpu;
289
wire    [31:0]           icpu_dat_ic;
290
wire                    icpu_ack_ic;
291
wire    [31:0]           icpu_adr_immu;
292
wire                    icpu_err_immu;
293
wire    [3:0]            icpu_tag_immu;
294
 
295
//
296
// IMMU and IC
297
//
298
wire    [aw-1:0] icimmu_adr_immu;
299
wire                    icimmu_rty_ic;
300
wire                    icimmu_err_ic;
301
wire    [3:0]            icimmu_tag_ic;
302
wire                    icimmu_cycstb_immu;
303
wire                    icimmu_ci_immu;
304
 
305
//
306
// Connection between CPU and PIC
307
//
308
wire    [dw-1:0] spr_dat_pic;
309
wire                    pic_wakeup;
310
wire                    sig_int;
311
 
312
//
313
// Connection between CPU and PM
314
//
315
wire    [dw-1:0] spr_dat_pm;
316
 
317
//
318
// CPU and TT
319
//
320
wire    [dw-1:0] spr_dat_tt;
321
wire                    sig_tick;
322
 
323
//
324
// Debug port and caches/MMUs
325
//
326
wire    [dw-1:0] spr_dat_du;
327
wire                    du_stall;
328
wire    [dw-1:0] du_addr;
329
wire    [dw-1:0] du_dat_du;
330
wire                    du_read;
331
wire                    du_write;
332
wire    [12:0]           du_except;
333
wire    [`OR1200_DU_DSR_WIDTH-1:0]     du_dsr;
334
wire    [dw-1:0] du_dat_cpu;
335
 
336
wire                    ex_freeze;
337
wire    [31:0]           ex_insn;
338
wire    [`OR1200_BRANCHOP_WIDTH-1:0]     branch_op;
339
 
340
//
341
// Instantiation of Instruction WISHBONE BIU
342
//
343
or1200_wb_biu iwb_biu(
344
        // RISC clk, rst and clock control
345
        .clk(clk_i),
346
        .rst(rst_i),
347
        .clmode(clmode_i),
348
 
349
        // WISHBONE interface
350
        .wb_clk_i(iwb_clk_i),
351
        .wb_rst_i(iwb_rst_i),
352
        .wb_ack_i(iwb_ack_i),
353
        .wb_err_i(iwb_err_i),
354
        .wb_rty_i(iwb_rty_i),
355
        .wb_dat_i(iwb_dat_i),
356
        .wb_cyc_o(iwb_cyc_o),
357
        .wb_adr_o(iwb_adr_o),
358
        .wb_stb_o(iwb_stb_o),
359
        .wb_we_o(iwb_we_o),
360
        .wb_sel_o(iwb_sel_o),
361
        .wb_cab_o(iwb_cab_o),
362
        .wb_dat_o(iwb_dat_o),
363
 
364
        // Internal RISC bus
365
        .biu_dat_i(icbiu_dat_ic),
366
        .biu_adr_i(icbiu_adr_ic),
367
        .biu_cyc_i(icbiu_cyc_ic),
368
        .biu_stb_i(icbiu_stb_ic),
369
        .biu_we_i(icbiu_we_ic),
370
        .biu_sel_i(icbiu_sel_ic),
371
        .biu_cab_i(icbiu_cab_ic),
372
        .biu_dat_o(icbiu_dat_biu),
373
        .biu_ack_o(icbiu_ack_biu),
374
        .biu_err_o(icbiu_err_biu)
375
);
376
 
377
//
378
// Instantiation of Data WISHBONE BIU
379
//
380
or1200_wb_biu dwb_biu(
381
        // RISC clk, rst and clock control
382
        .clk(clk_i),
383
        .rst(rst_i),
384
        .clmode(clmode_i),
385
 
386
        // WISHBONE interface
387
        .wb_clk_i(dwb_clk_i),
388
        .wb_rst_i(dwb_rst_i),
389
        .wb_ack_i(dwb_ack_i),
390
        .wb_err_i(dwb_err_i),
391
        .wb_rty_i(dwb_rty_i),
392
        .wb_dat_i(dwb_dat_i),
393
        .wb_cyc_o(dwb_cyc_o),
394
        .wb_adr_o(dwb_adr_o),
395
        .wb_stb_o(dwb_stb_o),
396
        .wb_we_o(dwb_we_o),
397
        .wb_sel_o(dwb_sel_o),
398
        .wb_cab_o(dwb_cab_o),
399
        .wb_dat_o(dwb_dat_o),
400
 
401
        // Internal RISC bus
402
        .biu_dat_i(dcbiu_dat_dc),
403
        .biu_adr_i(dcbiu_adr_dc),
404
        .biu_cyc_i(dcbiu_cyc_dc),
405
        .biu_stb_i(dcbiu_stb_dc),
406
        .biu_we_i(dcbiu_we_dc),
407
        .biu_sel_i(dcbiu_sel_dc),
408
        .biu_cab_i(dcbiu_cab_dc),
409
        .biu_dat_o(dcbiu_dat_biu),
410
        .biu_ack_o(dcbiu_ack_biu),
411
        .biu_err_o(dcbiu_err_biu)
412
);
413
 
414
//
415
// Instantiation of IMMU
416
//
417
or1200_immu_top or1200_immu_top(
418
        // Rst and clk
419
        .clk(clk_i),
420
        .rst(rst_i),
421
 
422
        // CPU i/f
423
        .ic_en(ic_en),
424
        .immu_en(immu_en),
425
        .supv(supv),
426
        .icpu_adr_i(icpu_adr_cpu),
427
        .icpu_cycstb_i(icpu_cycstb_cpu),
428
        .icpu_adr_o(icpu_adr_immu),
429
        .icpu_tag_o(icpu_tag_immu),
430
        .icpu_rty_o(icpu_rty_immu),
431
        .icpu_err_o(icpu_err_immu),
432
 
433
        // SPR access
434
        .spr_cs(spr_cs[`OR1200_SPR_GROUP_IMMU]),
435
        .spr_write(spr_we),
436
        .spr_addr(spr_addr),
437
        .spr_dat_i(spr_dat_cpu),
438
        .spr_dat_o(spr_dat_immu),
439
 
440
        // IC i/f
441
        .icimmu_rty_i(icimmu_rty_ic),
442
        .icimmu_err_i(icimmu_err_ic),
443
        .icimmu_tag_i(icimmu_tag_ic),
444
        .icimmu_adr_o(icimmu_adr_immu),
445
        .icimmu_cycstb_o(icimmu_cycstb_immu),
446
        .icimmu_ci_o(icimmu_ci_immu)
447
);
448
 
449
//
450
// Instantiation of Instruction Cache
451
//
452
or1200_ic_top or1200_ic_top(
453
        .clk(clk_i),
454
        .rst(rst_i),
455
 
456
        // IC and CPU/IMMU
457
        .ic_en(ic_en),
458
        .icimmu_adr_i(icimmu_adr_immu),
459
        .icimmu_cycstb_i(icimmu_cycstb_immu),
460
        .icimmu_ci_i(icimmu_ci_immu),
461
        .icpu_we_i(icpu_we_cpu),
462
        .icpu_sel_i(icpu_sel_cpu),
463
        .icpu_tag_i(icpu_tag_cpu),
464
        .icpu_dat_o(icpu_dat_ic),
465
        .icpu_ack_o(icpu_ack_ic),
466
        .icimmu_rty_o(icimmu_rty_ic),
467
        .icimmu_err_o(icimmu_err_ic),
468
        .icimmu_tag_o(icimmu_tag_ic),
469
 
470
        // SPR access
471
        .spr_cs(spr_cs[`OR1200_SPR_GROUP_IC]),
472
        .spr_write(spr_we),
473
        .spr_dat_i(spr_dat_cpu),
474
 
475
        // IC and BIU
476
        .icbiu_dat_o(icbiu_dat_ic),
477
        .icbiu_adr_o(icbiu_adr_ic),
478
        .icbiu_cyc_o(icbiu_cyc_ic),
479
        .icbiu_stb_o(icbiu_stb_ic),
480
        .icbiu_we_o(icbiu_we_ic),
481
        .icbiu_sel_o(icbiu_sel_ic),
482
        .icbiu_cab_o(icbiu_cab_ic),
483
        .icbiu_dat_i(icbiu_dat_biu),
484
        .icbiu_ack_i(icbiu_ack_biu),
485
        .icbiu_err_i(icbiu_err_biu)
486
);
487
 
488
//
489
// Instantiation of Instruction Cache
490
//
491
or1200_cpu or1200_cpu(
492
        .clk(clk_i),
493
        .rst(rst_i),
494
 
495
        // Connection IC and IFETCHER inside CPU
496
        .ic_en(ic_en),
497
        .icpu_adr_o(icpu_adr_cpu),
498
        .icpu_cycstb_o(icpu_cycstb_cpu),
499
        .icpu_we_o(icpu_we_cpu),
500
        .icpu_sel_o(icpu_sel_cpu),
501
        .icpu_tag_o(icpu_tag_cpu),
502
        .icpu_dat_i(icpu_dat_ic),
503
        .icpu_ack_i(icpu_ack_ic),
504
        .icpu_rty_i(icpu_rty_immu),
505
        .icpu_adr_i(icpu_adr_immu),
506
        .icpu_err_i(icpu_err_immu),
507
        .icpu_tag_i(icpu_tag_immu),
508
 
509
        // Connection CPU to external Debug port
510
        .ex_freeze(ex_freeze),
511
        .ex_insn(ex_insn),
512
        .branch_op(branch_op),
513
        .du_stall(du_stall),
514
        .du_addr(du_addr),
515
        .du_dat_du(du_dat_du),
516
        .du_read(du_read),
517
        .du_write(du_write),
518
        .du_dsr(du_dsr),
519
        .du_except(du_except),
520
        .du_dat_cpu(du_dat_cpu),
521
 
522
        // Connection IMMU and CPU internally
523
        .immu_en(immu_en),
524
 
525
        // Connection DC and CPU
526
        .dc_en(dc_en),
527
        .dcpu_adr_o(dcpu_adr_cpu),
528
        .dcpu_cycstb_o(dcpu_cycstb_cpu),
529
        .dcpu_we_o(dcpu_we_cpu),
530
        .dcpu_sel_o(dcpu_sel_cpu),
531
        .dcpu_tag_o(dcpu_tag_cpu),
532
        .dcpu_dat_o(dcpu_dat_cpu),
533
        .dcpu_dat_i(dcpu_dat_dc),
534
        .dcpu_ack_i(dcpu_ack_dc),
535
        .dcpu_rty_i(dcpu_rty_dc),
536
        .dcpu_err_i(dcpu_err_dmmu),
537
        .dcpu_tag_i(dcpu_tag_dmmu),
538
 
539
        // Connection DMMU and CPU internally
540
        .dmmu_en(dmmu_en),
541
 
542
        // Connection PIC and CPU's EXCEPT
543
        .sig_int(sig_int),
544
        .sig_tick(sig_tick),
545
 
546
        // SPRs
547
        .supv(supv),
548
        .spr_addr(spr_addr),
549
        .spr_dat_cpu(spr_dat_cpu),
550
        .spr_dat_pic(spr_dat_pic),
551
        .spr_dat_tt(spr_dat_tt),
552
        .spr_dat_pm(spr_dat_pm),
553
        .spr_dat_dmmu(spr_dat_dmmu),
554
        .spr_dat_immu(spr_dat_immu),
555
        .spr_dat_du(spr_dat_du),
556
        .spr_cs(spr_cs),
557
        .spr_we(spr_we)
558
);
559
 
560
//
561
// Instantiation of DMMU
562
//
563
or1200_dmmu_top or1200_dmmu_top(
564
        // Rst and clk
565
        .clk(clk_i),
566
        .rst(rst_i),
567
 
568
        // CPU i/f
569
        .dc_en(dc_en),
570
        .dmmu_en(dmmu_en),
571
        .supv(supv),
572
        .dcpu_adr_i(dcpu_adr_cpu),
573
        .dcpu_cycstb_i(dcpu_cycstb_cpu),
574
        .dcpu_we_i(dcpu_we_cpu),
575
        .dcpu_tag_o(dcpu_tag_dmmu),
576
        .dcpu_err_o(dcpu_err_dmmu),
577
 
578
        // SPR access
579
        .spr_cs(spr_cs[`OR1200_SPR_GROUP_DMMU]),
580
        .spr_write(spr_we),
581
        .spr_addr(spr_addr),
582
        .spr_dat_i(spr_dat_cpu),
583
        .spr_dat_o(spr_dat_dmmu),
584
 
585
        // DC i/f
586
        .dcdmmu_err_i(dcdmmu_err_dc),
587
        .dcdmmu_tag_i(dcdmmu_tag_dc),
588
        .dcdmmu_adr_o(dcdmmu_adr_dmmu),
589
        .dcdmmu_cycstb_o(dcdmmu_cycstb_dmmu),
590
        .dcdmmu_ci_o(dcdmmu_ci_dmmu)
591
);
592
 
593
//
594
// Instantiation of Data Cache
595
//
596
or1200_dc_top or1200_dc_top(
597
        .clk(clk_i),
598
        .rst(rst_i),
599
 
600
        // DC and CPU/DMMU
601
        .dc_en(dc_en),
602
        .dcdmmu_adr_i(dcdmmu_adr_dmmu),
603
        .dcdmmu_cycstb_i(dcdmmu_cycstb_dmmu),
604
        .dcdmmu_ci_i(dcdmmu_ci_dmmu),
605
        .dcpu_we_i(dcpu_we_cpu),
606
        .dcpu_sel_i(dcpu_sel_cpu),
607
        .dcpu_tag_i(dcpu_tag_cpu),
608
        .dcpu_dat_i(dcpu_dat_cpu),
609
        .dcpu_dat_o(dcpu_dat_dc),
610
        .dcpu_ack_o(dcpu_ack_dc),
611
        .dcpu_rty_o(dcpu_rty_dc),
612
        .dcdmmu_err_o(dcdmmu_err_dc),
613
        .dcdmmu_tag_o(dcdmmu_tag_dc),
614
 
615
        // SPR access
616
        .spr_cs(spr_cs[`OR1200_SPR_GROUP_DC]),
617
        .spr_write(spr_we),
618
        .spr_dat_i(spr_dat_cpu),
619
 
620
        // DC and BIU
621
        .dcbiu_dat_o(dcbiu_dat_dc),
622
        .dcbiu_adr_o(dcbiu_adr_dc),
623
        .dcbiu_cyc_o(dcbiu_cyc_dc),
624
        .dcbiu_stb_o(dcbiu_stb_dc),
625
        .dcbiu_we_o(dcbiu_we_dc),
626
        .dcbiu_sel_o(dcbiu_sel_dc),
627
        .dcbiu_cab_o(dcbiu_cab_dc),
628
        .dcbiu_dat_i(dcbiu_dat_biu),
629
        .dcbiu_ack_i(dcbiu_ack_biu),
630
        .dcbiu_err_i(dcbiu_err_biu)
631
);
632
 
633
//
634
// Instantiation of Debug Unit
635
//
636
or1200_du or1200_du(
637
        // RISC Internal Interface
638
        .clk(clk_i),
639
        .rst(rst_i),
640
        .dcpu_cycstb_i(dcpu_cycstb_cpu),
641
        .dcpu_we_i(dcpu_we_cpu),
642
        .icpu_cycstb_i(icpu_cycstb_cpu),
643
        .ex_freeze(ex_freeze),
644
        .branch_op(branch_op),
645
        .ex_insn(ex_insn),
646
        .du_dsr(du_dsr),
647
 
648
        // DU's access to SPR unit
649
        .du_stall(du_stall),
650
        .du_addr(du_addr),
651
        .du_dat_i(du_dat_cpu),
652
        .du_dat_o(du_dat_du),
653
        .du_read(du_read),
654
        .du_write(du_write),
655
        .du_except(du_except),
656
 
657
        // Access to DU's SPRs
658
        .spr_cs(spr_cs[`OR1200_SPR_GROUP_DU]),
659
        .spr_write(spr_we),
660
        .spr_addr(spr_addr),
661
        .spr_dat_i(spr_dat_cpu),
662
        .spr_dat_o(spr_dat_du),
663
 
664
        // External Debug Interface
665
        .dbg_stall_i(dbg_stall_i),
666
        .dbg_dat_i(dbg_dat_i),
667
        .dbg_adr_i(dbg_adr_i),
668
        .dbg_op_i(dbg_op_i),
669
        .dbg_ewt_i(dbg_ewt_i),
670
        .dbg_lss_o(dbg_lss_o),
671
        .dbg_is_o(dbg_is_o),
672
        .dbg_wp_o(dbg_wp_o),
673
        .dbg_bp_o(dbg_bp_o),
674
        .dbg_dat_o(dbg_dat_o)
675
);
676
 
677
//
678
// Programmable interrupt controller
679
//
680
or1200_pic or1200_pic(
681
        // RISC Internal Interface
682
        .clk(clk_i),
683
        .rst(rst_i),
684
        .spr_cs(spr_cs[`OR1200_SPR_GROUP_PIC]),
685
        .spr_write(spr_we),
686
        .spr_addr(spr_addr),
687
        .spr_dat_i(spr_dat_cpu),
688
        .spr_dat_o(spr_dat_pic),
689
        .pic_wakeup(pic_wakeup),
690
        .int(sig_int),
691
 
692
        // PIC Interface
693
        .pic_int(pic_ints_i)
694
);
695
 
696
//
697
// Instantiation of Tick timer
698
//
699
or1200_tt or1200_tt(
700
        // RISC Internal Interface
701
        .clk(clk_i),
702
        .rst(rst_i),
703
        .du_stall(du_stall),
704
        .spr_cs(spr_cs[`OR1200_SPR_GROUP_TT]),
705
        .spr_write(spr_we),
706
        .spr_addr(spr_addr),
707
        .spr_dat_i(spr_dat_cpu),
708
        .spr_dat_o(spr_dat_tt),
709
        .int(sig_tick)
710
);
711
 
712
//
713
// Instantiation of Power Management
714
//
715
or1200_pm or1200_pm(
716
        // RISC Internal Interface
717
        .clk(clk_i),
718
        .rst(rst_i),
719
        .pic_wakeup(pic_wakeup),
720
        .spr_write(spr_we),
721
        .spr_addr(spr_addr),
722
        .spr_dat_i(spr_dat_cpu),
723
        .spr_dat_o(spr_dat_pm),
724
 
725
        // Power Management Interface
726
        .pm_cpustall(pm_cpustall_i),
727
        .pm_clksd(pm_clksd_o),
728
        .pm_dc_gate(pm_dc_gate_o),
729
        .pm_ic_gate(pm_ic_gate_o),
730
        .pm_dmmu_gate(pm_dmmu_gate_o),
731
        .pm_immu_gate(pm_immu_gate_o),
732
        .pm_tt_gate(pm_tt_gate_o),
733
        .pm_cpu_gate(pm_cpu_gate_o),
734
        .pm_wakeup(pm_wakeup_o),
735
        .pm_lvolt(pm_lvolt_o)
736
);
737
 
738
 
739
endmodule

powered by: WebSVN 2.1.0

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