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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [or1200/] [rtl/] [verilog/] [or1200_top.v] - Blame information for rev 504

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 504 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.13  2001/11/23 08:38:51  lampret
48
// Changed DSR/DRR behavior and exception detection.
49
//
50
// Revision 1.12  2001/11/20 00:57:22  lampret
51
// Fixed width of du_except.
52
//
53
// Revision 1.11  2001/11/18 08:36:28  lampret
54
// For GDB changed single stepping and disabled trap exception.
55
//
56
// Revision 1.10  2001/10/21 17:57:16  lampret
57
// 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.
58
//
59
// Revision 1.9  2001/10/14 13:12:10  lampret
60
// MP3 version.
61
//
62
// Revision 1.1.1.1  2001/10/06 10:18:35  igorm
63
// no message
64
//
65
// Revision 1.4  2001/08/13 03:36:20  lampret
66
// Added cfg regs. Moved all defines into one defines.v file. More cleanup.
67
//
68
// Revision 1.3  2001/08/09 13:39:33  lampret
69
// Major clean-up.
70
//
71
// Revision 1.2  2001/07/22 03:31:54  lampret
72
// Fixed RAM's oen bug. Cache bypass under development.
73
//
74
// Revision 1.1  2001/07/20 00:46:21  lampret
75
// Development version of RTL. Libraries are missing.
76
//
77
//
78
 
79
// synopsys translate_off
80
`include "timescale.v"
81
// synopsys translate_on
82
`include "or1200_defines.v"
83
 
84
module or1200_top(
85
        // System
86
        clk_i, rst_i, pic_ints_i, clmode_i,
87
 
88
        // Instruction WISHBONE INTERFACE
89
        iwb_clk_i, iwb_rst_i, iwb_ack_i, iwb_err_i, iwb_rty_i, iwb_dat_i,
90
        iwb_cyc_o, iwb_adr_o, iwb_stb_o, iwb_we_o, iwb_sel_o, iwb_cab_o, iwb_dat_o,
91
 
92
        // Data WISHBONE INTERFACE
93
        dwb_clk_i, dwb_rst_i, dwb_ack_i, dwb_err_i, dwb_rty_i, dwb_dat_i,
94
        dwb_cyc_o, dwb_adr_o, dwb_stb_o, dwb_we_o, dwb_sel_o, dwb_cab_o, dwb_dat_o,
95
 
96
        // External Debug Interface
97
        dbg_stall_i, dbg_dat_i, dbg_adr_i, dbg_op_i, dbg_ewt_i,
98
        dbg_lss_o, dbg_is_o, dbg_wp_o, dbg_bp_o, dbg_dat_o,
99
 
100
        // Power Management
101
        pm_cpustall_i,
102
        pm_clksd_o, pm_dc_gate_o, pm_ic_gate_o, pm_dmmu_gate_o,
103
        pm_immu_gate_o, pm_tt_gate_o, pm_cpu_gate_o, pm_wakeup_o, pm_lvolt_o
104
 
105
);
106
 
107
parameter dw = `OR1200_OPERAND_WIDTH;
108
parameter aw = `OR1200_OPERAND_WIDTH;
109
parameter ppic_ints = `OR1200_PIC_INTS;
110
 
111
//
112
// I/O
113
//
114
 
115
//
116
// System
117
//
118
input                   clk_i;
119
input                   rst_i;
120
input   [1:0]            clmode_i;       // 00 WB=RISC, 01 WB=RISC/2, 10 N/A, 11 WB=RISC/4
121
input   [ppic_ints-1:0]  pic_ints_i;
122
 
123
//
124
// Instruction WISHBONE interface
125
//
126
input                   iwb_clk_i;      // clock input
127
input                   iwb_rst_i;      // reset input
128
input                   iwb_ack_i;      // normal termination
129
input                   iwb_err_i;      // termination w/ error
130
input                   iwb_rty_i;      // termination w/ retry
131
input   [dw-1:0] iwb_dat_i;      // input data bus
132
output                  iwb_cyc_o;      // cycle valid output
133
output  [aw-1:0] iwb_adr_o;      // address bus outputs
134
output                  iwb_stb_o;      // strobe output
135
output                  iwb_we_o;       // indicates write transfer
136
output  [3:0]            iwb_sel_o;      // byte select outputs
137
output                  iwb_cab_o;      // indicates consecutive address burst
138
output  [dw-1:0] iwb_dat_o;      // output data bus
139
 
140
//
141
// Data WISHBONE interface
142
//
143
input                   dwb_clk_i;      // clock input
144
input                   dwb_rst_i;      // reset input
145
input                   dwb_ack_i;      // normal termination
146
input                   dwb_err_i;      // termination w/ error
147
input                   dwb_rty_i;      // termination w/ retry
148
input   [dw-1:0] dwb_dat_i;      // input data bus
149
output                  dwb_cyc_o;      // cycle valid output
150
output  [aw-1:0] dwb_adr_o;      // address bus outputs
151
output                  dwb_stb_o;      // strobe output
152
output                  dwb_we_o;       // indicates write transfer
153
output  [3:0]            dwb_sel_o;      // byte select outputs
154
output                  dwb_cab_o;      // indicates consecutive address burst
155
output  [dw-1:0] dwb_dat_o;      // output data bus
156
 
157
//
158
// External Debug Interface
159
//
160
input                   dbg_stall_i;    // External Stall Input
161
input   [dw-1:0] dbg_dat_i;      // External Data Input
162
input   [aw-1:0] dbg_adr_i;      // External Address Input
163
input   [2:0]            dbg_op_i;       // External Operation Select Input
164
input                   dbg_ewt_i;      // External Watchpoint Trigger Input
165
output  [3:0]            dbg_lss_o;      // External Load/Store Unit Status
166
output  [1:0]            dbg_is_o;       // External Insn Fetch Status
167
output  [10:0]           dbg_wp_o;       // Watchpoints Outputs
168
output                  dbg_bp_o;       // Breakpoint Output
169
output  [dw-1:0] dbg_dat_o;      // External Data Output
170
 
171
//
172
// Power Management
173
//
174
input                   pm_cpustall_i;
175
output  [3:0]            pm_clksd_o;
176
output                  pm_dc_gate_o;
177
output                  pm_ic_gate_o;
178
output                  pm_dmmu_gate_o;
179
output                  pm_immu_gate_o;
180
output                  pm_tt_gate_o;
181
output                  pm_cpu_gate_o;
182
output                  pm_wakeup_o;
183
output                  pm_lvolt_o;
184
 
185
 
186
//
187
// Internal wires and regs
188
//
189
 
190
//
191
// DC to BIU
192
//
193
wire    [dw-1:0] dcbiu_dat_dc;
194
wire    [aw-1:0] dcbiu_adr_dc;
195
wire                    dcbiu_cyc_dc;
196
wire                    dcbiu_stb_dc;
197
wire                    dcbiu_we_dc;
198
wire    [3:0]            dcbiu_sel_dc;
199
wire    [3:0]            dcbiu_tag_dc;
200
wire    [dw-1:0] dcbiu_dat_biu;
201
wire                    dcbiu_ack_biu;
202
wire                    dcbiu_err_biu;
203
wire    [3:0]            dcbiu_tag_biu;
204
 
205
//
206
// IC to BIU
207
//
208
wire    [dw-1:0] icbiu_dat_ic;
209
wire    [aw-1:0] icbiu_adr_ic;
210
wire                    icbiu_cyc_ic;
211
wire                    icbiu_stb_ic;
212
wire                    icbiu_we_ic;
213
wire    [3:0]            icbiu_sel_ic;
214
wire    [3:0]            icbiu_tag_ic;
215
wire    [dw-1:0] icbiu_dat_biu;
216
wire                    icbiu_ack_biu;
217
wire                    icbiu_err_biu;
218
wire    [3:0]            icbiu_tag_biu;
219
 
220
//
221
// CPU's SPR access to various RISC units (shared wires)
222
//
223
wire                    supv;
224
wire    [aw-1:0] spr_addr;
225
wire    [dw-1:0] spr_dat_cpu;
226
wire    [31:0]           spr_cs;
227
wire                    spr_we;
228
 
229
//
230
// DMMU and CPU
231
//
232
wire                    dmmu_en;
233
wire    [31:0]           spr_dat_dmmu;
234
 
235
//
236
// DMMU and DC
237
//
238
wire                    dcdmmu_err_dc;
239
wire    [3:0]            dcdmmu_tag_dc;
240
wire    [aw-1:0] dcdmmu_adr_dmmu;
241
wire                    dcdmmu_cyc_dmmu;
242
wire                    dcdmmu_stb_dmmu;
243
wire                    dcdmmu_ci_dmmu;
244
 
245
//
246
// CPU and data memory subsystem
247
//
248
wire                    dc_en;
249
wire    [31:0]           dcpu_adr_cpu;
250
wire                    dcpu_we_cpu;
251
wire    [3:0]            dcpu_sel_cpu;
252
wire    [3:0]            dcpu_tag_cpu;
253
wire    [31:0]           dcpu_dat_cpu;
254
wire    [31:0]           dcpu_dat_dc;
255
wire                    dcpu_ack_dc;
256
wire                    dcpu_rty_dc;
257
wire                    dcpu_err_dmmu;
258
wire    [3:0]            dcpu_tag_dmmu;
259
 
260
//
261
// IMMU and CPU
262
//
263
wire                    immu_en;
264
wire    [31:0]           spr_dat_immu;
265
 
266
//
267
// CPU and insn memory subsystem
268
//
269
wire                    ic_en;
270
wire    [31:0]           icpu_adr_cpu;
271
wire                    icpu_cyc_cpu;
272
wire                    icpu_stb_cpu;
273
wire                    icpu_we_cpu;
274
wire    [3:0]            icpu_sel_cpu;
275
wire    [3:0]            icpu_tag_cpu;
276
wire    [31:0]           icpu_dat_ic;
277
wire                    icpu_ack_ic;
278
wire                    icpu_rty_ic;
279
wire    [31:0]           icpu_adr_immu;
280
wire                    icpu_err_immu;
281
wire    [3:0]            icpu_tag_immu;
282
 
283
//
284
// IMMU and IC
285
//
286
wire    [aw-1:0] icimmu_adr_immu;
287
wire                    icimmu_err_ic;
288
wire    [3:0]            icimmu_tag_ic;
289
wire                    icimmu_cyc_immu;
290
wire                    icimmu_stb_immu;
291
wire                    icimmu_ci_immu;
292
 
293
//
294
// Connection between CPU and PIC
295
//
296
wire    [dw-1:0] spr_dat_pic;
297
wire                    pic_wakeup;
298
wire                    int_low;
299
wire                    int_high;
300
wire                    int_high_tt;
301
 
302
//
303
// Connection between CPU and PM
304
//
305
wire    [dw-1:0] spr_dat_pm;
306
 
307
//
308
// CPU and TT
309
//
310
wire    [dw-1:0] spr_dat_tt;
311
wire                    tt_int;
312
 
313
//
314
// Debug port and caches/MMUs
315
//
316
wire    [dw-1:0] spr_dat_du;
317
wire                    du_stall;
318
wire    [dw-1:0] du_addr;
319
wire    [dw-1:0] du_dat_du;
320
wire                    du_read;
321
wire                    du_write;
322
wire    [12:0]           du_except;
323
wire    [`OR1200_DU_DSR_WIDTH-1:0]     du_dsr;
324
 
325
 
326
wire                    ex_freeze;
327
wire    [31:0]           ex_insn;
328
wire    [`OR1200_BRANCHOP_WIDTH-1:0]     branch_op;
329
 
330
//
331
// Assignments
332
//
333
assign int_high_tt = int_high | tt_int;
334
 
335
//
336
// Instantiation of Instruction WISHBONE BIU
337
//
338
or1200_wb_biu iwb_biu(
339
        // RISC clk, rst and clock control
340
        .clk(clk_i),
341
        .rst(rst_i),
342
        .clmode(clmode_i),
343
 
344
        // WISHBONE interface
345
        .wb_clk_i(iwb_clk_i),
346
        .wb_rst_i(iwb_rst_i),
347
        .wb_ack_i(iwb_ack_i),
348
        .wb_err_i(iwb_err_i),
349
        .wb_rty_i(iwb_rty_i),
350
        .wb_dat_i(iwb_dat_i),
351
        .wb_cyc_o(iwb_cyc_o),
352
        .wb_adr_o(iwb_adr_o),
353
        .wb_stb_o(iwb_stb_o),
354
        .wb_we_o(iwb_we_o),
355
        .wb_sel_o(iwb_sel_o),
356
        .wb_cab_o(iwb_cab_o),
357
        .wb_dat_o(iwb_dat_o),
358
 
359
        // Internal RISC bus
360
        .biu_dat_i(icbiu_dat_ic),
361
        .biu_adr_i(icbiu_adr_ic),
362
        .biu_cyc_i(icbiu_cyc_ic),
363
        .biu_stb_i(icbiu_stb_ic),
364
        .biu_we_i(icbiu_we_ic),
365
        .biu_sel_i(icbiu_sel_ic),
366
        .biu_cab_i(icbiu_cab_ic),
367
        .biu_dat_o(icbiu_dat_biu),
368
        .biu_ack_o(icbiu_ack_biu),
369
        .biu_err_o(icbiu_err_biu)
370
);
371
 
372
//
373
// Instantiation of Data WISHBONE BIU
374
//
375
or1200_wb_biu dwb_biu(
376
        // RISC clk, rst and clock control
377
        .clk(clk_i),
378
        .rst(rst_i),
379
        .clmode(clmode_i),
380
 
381
        // WISHBONE interface
382
        .wb_clk_i(dwb_clk_i),
383
        .wb_rst_i(dwb_rst_i),
384
        .wb_ack_i(dwb_ack_i),
385
        .wb_err_i(dwb_err_i),
386
        .wb_rty_i(dwb_rty_i),
387
        .wb_dat_i(dwb_dat_i),
388
        .wb_cyc_o(dwb_cyc_o),
389
        .wb_adr_o(dwb_adr_o),
390
        .wb_stb_o(dwb_stb_o),
391
        .wb_we_o(dwb_we_o),
392
        .wb_sel_o(dwb_sel_o),
393
        .wb_cab_o(dwb_cab_o),
394
        .wb_dat_o(dwb_dat_o),
395
 
396
        // Internal RISC bus
397
        .biu_dat_i(dcbiu_dat_dc),
398
        .biu_adr_i(dcbiu_adr_dc),
399
        .biu_cyc_i(dcbiu_cyc_dc),
400
        .biu_stb_i(dcbiu_stb_dc),
401
        .biu_we_i(dcbiu_we_dc),
402
        .biu_sel_i(dcbiu_sel_dc),
403
        .biu_cab_i(dcbiu_cab_dc),
404
        .biu_dat_o(dcbiu_dat_biu),
405
        .biu_ack_o(dcbiu_ack_biu),
406
        .biu_err_o(dcbiu_err_biu)
407
);
408
 
409
//
410
// Instantiation of IMMU
411
//
412
or1200_immu_top or1200_immu_top(
413
        // Rst and clk
414
        .clk(clk_i),
415
        .rst(rst_i),
416
 
417
        // CPU i/f
418
        .ic_en(ic_en),
419
        .immu_en(immu_en),
420
        .supv(supv),
421
        .icpu_adr_i(icpu_adr_cpu),
422
        .icpu_cyc_i(icpu_cyc_cpu),
423
        .icpu_stb_i(icpu_stb_cpu),
424
        .icpu_adr_o(icpu_adr_immu),
425
        .icpu_tag_o(icpu_tag_immu),
426
        .icpu_err_o(icpu_err_immu),
427
 
428
        // SPR access
429
        .spr_cs(spr_cs[`OR1200_SPR_GROUP_IMMU]),
430
        .spr_write(spr_we),
431
        .spr_addr(spr_addr),
432
        .spr_dat_i(spr_dat_cpu),
433
        .spr_dat_o(spr_dat_immu),
434
 
435
        // IC i/f
436
        .icimmu_err_i(icimmu_err_ic),
437
        .icimmu_tag_i(icimmu_tag_ic),
438
        .icimmu_adr_o(icimmu_adr_immu),
439
        .icimmu_cyc_o(icimmu_cyc_immu),
440
        .icimmu_stb_o(icimmu_stb_immu),
441
        .icimmu_ci_o(icimmu_ci_immu)
442
);
443
 
444
//
445
// Instantiation of Instruction Cache
446
//
447
or1200_ic_top or1200_ic_top(
448
        .clk(clk_i),
449
        .rst(rst_i),
450
 
451
        // IC and CPU/IMMU
452
        .ic_en(ic_en),
453
        .icimmu_adr_i(icimmu_adr_immu),
454
        .icimmu_cyc_i(icimmu_cyc_immu),
455
        .icimmu_stb_i(icimmu_stb_immu),
456
        .icimmu_ci_i(icimmu_ci_immu),
457
        .icpu_we_i(icpu_we_cpu),
458
        .icpu_sel_i(icpu_sel_cpu),
459
        .icpu_tag_i(icpu_tag_cpu),
460
        .icpu_dat_o(icpu_dat_ic),
461
        .icpu_ack_o(icpu_ack_ic),
462
        .icpu_rty_o(icpu_rty_ic),
463
        .icimmu_err_o(icimmu_err_ic),
464
        .icimmu_tag_o(icimmu_tag_ic),
465
 
466
        // SPR access
467
        .spr_cs(spr_cs[`OR1200_SPR_GROUP_IC]),
468
        .spr_write(spr_we),
469
        .spr_dat_i(spr_dat_cpu),
470
 
471
        // IC and BIU
472
        .icbiu_dat_o(icbiu_dat_ic),
473
        .icbiu_adr_o(icbiu_adr_ic),
474
        .icbiu_cyc_o(icbiu_cyc_ic),
475
        .icbiu_stb_o(icbiu_stb_ic),
476
        .icbiu_we_o(icbiu_we_ic),
477
        .icbiu_sel_o(icbiu_sel_ic),
478
        .icbiu_cab_o(icbiu_cab_ic),
479
        .icbiu_dat_i(icbiu_dat_biu),
480
        .icbiu_ack_i(icbiu_ack_biu),
481
        .icbiu_err_i(icbiu_err_biu)
482
);
483
 
484
//
485
// Instantiation of Instruction Cache
486
//
487
or1200_cpu or1200_cpu(
488
        .clk(clk_i),
489
        .rst(rst_i),
490
 
491
        // Connection IC and IFETCHER inside CPU
492
        .ic_en(ic_en),
493
        .icpu_adr_o(icpu_adr_cpu),
494
        .icpu_cyc_o(icpu_cyc_cpu),
495
        .icpu_stb_o(icpu_stb_cpu),
496
        .icpu_we_o(icpu_we_cpu),
497
        .icpu_sel_o(icpu_sel_cpu),
498
        .icpu_tag_o(icpu_tag_cpu),
499
        .icpu_dat_i(icpu_dat_ic),
500
        .icpu_ack_i(icpu_ack_ic),
501
        .icpu_rty_i(icpu_rty_ic),
502
        .icpu_adr_i(icpu_adr_immu),
503
        .icpu_err_i(icpu_err_immu),
504
        .icpu_tag_i(icpu_tag_immu),
505
 
506
        // Connection CPU to external Debug port
507
        .ex_freeze(ex_freeze),
508
        .ex_insn(ex_insn),
509
        .branch_op(branch_op),
510
        .du_stall(du_stall),
511
        .du_addr(du_addr),
512
        .du_dat_du(du_dat_du),
513
        .du_read(du_read),
514
        .du_write(du_write),
515
        .du_dsr(du_dsr),
516
        .du_except(du_except),
517
 
518
        // Connection IMMU and CPU internally
519
        .immu_en(immu_en),
520
 
521
        // Connection DC and CPU
522
        .dc_en(dc_en),
523
        .dcpu_adr_o(dcpu_adr_cpu),
524
        .dcpu_cyc_o(dcpu_cyc_cpu),
525
        .dcpu_stb_o(dcpu_stb_cpu),
526
        .dcpu_we_o(dcpu_we_cpu),
527
        .dcpu_sel_o(dcpu_sel_cpu),
528
        .dcpu_tag_o(dcpu_tag_cpu),
529
        .dcpu_dat_o(dcpu_dat_cpu),
530
        .dcpu_dat_i(dcpu_dat_dc),
531
        .dcpu_ack_i(dcpu_ack_dc),
532
        .dcpu_rty_i(dcpu_rty_dc),
533
        .dcpu_err_i(dcpu_err_dmmu),
534
        .dcpu_tag_i(dcpu_tag_dmmu),
535
 
536
        // Connection DMMU and CPU internally
537
        .dmmu_en(dmmu_en),
538
 
539
        // Connection PIC and CPU's EXCEPT
540
        .int_high(int_high_tt),
541
        .int_low(int_low),
542
 
543
        // SPRs
544
        .supv(supv),
545
        .spr_addr(spr_addr),
546
        .spr_dataout(spr_dat_cpu),
547
        .spr_dat_pic(spr_dat_pic),
548
        .spr_dat_tt(spr_dat_tt),
549
        .spr_dat_pm(spr_dat_pm),
550
        .spr_dat_dmmu(spr_dat_dmmu),
551
        .spr_dat_immu(spr_dat_immu),
552
        .spr_dat_du(spr_dat_du),
553
        .spr_cs(spr_cs),
554
        .spr_we(spr_we)
555
);
556
 
557
//
558
// Instantiation of DMMU
559
//
560
or1200_dmmu_top or1200_dmmu_top(
561
        // Rst and clk
562
        .clk(clk_i),
563
        .rst(rst_i),
564
 
565
        // CPU i/f
566
        .dc_en(dc_en),
567
        .dmmu_en(dmmu_en),
568
        .supv(supv),
569
        .dcpu_adr_i(dcpu_adr_cpu),
570
        .dcpu_cyc_i(dcpu_cyc_cpu),
571
        .dcpu_stb_i(dcpu_stb_cpu),
572
        .dcpu_we_i(dcpu_we_cpu),
573
        .dcpu_tag_o(dcpu_tag_dmmu),
574
        .dcpu_err_o(dcpu_err_dmmu),
575
 
576
        // SPR access
577
        .spr_cs(spr_cs[`OR1200_SPR_GROUP_DMMU]),
578
        .spr_write(spr_we),
579
        .spr_addr(spr_addr),
580
        .spr_dat_i(spr_dat_cpu),
581
        .spr_dat_o(spr_dat_dmmu),
582
 
583
        // DC i/f
584
        .dcdmmu_err_i(dcdmmu_err_dc),
585
        .dcdmmu_tag_i(dcdmmu_tag_dc),
586
        .dcdmmu_adr_o(dcdmmu_adr_dmmu),
587
        .dcdmmu_cyc_o(dcdmmu_cyc_dmmu),
588
        .dcdmmu_stb_o(dcdmmu_stb_dmmu),
589
        .dcdmmu_ci_o(dcdmmu_ci_dmmu)
590
);
591
 
592
//
593
// Instantiation of Data Cache
594
//
595
or1200_dc_top or1200_dc_top(
596
        .clk(clk_i),
597
        .rst(rst_i),
598
 
599
        // DC and CPU/DMMU
600
        .dc_en(dc_en),
601
        .dcdmmu_adr_i(dcdmmu_adr_dmmu),
602
        .dcdmmu_cyc_i(dcdmmu_cyc_dmmu),
603
        .dcdmmu_stb_i(dcdmmu_stb_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_cyc_i(dcpu_cyc_cpu),
641
        .dcpu_stb_i(dcpu_stb_cpu),
642
        .dcpu_we_i(dcpu_we_cpu),
643
        .icpu_cyc_i(icpu_cyc_cpu),
644
        .icpu_stb_i(icpu_stb_cpu),
645
        .ex_freeze(ex_freeze),
646
        .branch_op(branch_op),
647
        .ex_insn(ex_insn),
648
        .du_dsr(du_dsr),
649
 
650
        // DU's access to SPR unit
651
        .du_stall(du_stall),
652
        .du_addr(du_addr),
653
        .du_dat_i(spr_dat_cpu),
654
        .du_dat_o(du_dat_du),
655
        .du_read(du_read),
656
        .du_write(du_write),
657
        .du_except(du_except),
658
 
659
        // Access to DU's SPRs
660
        .spr_cs(spr_cs[`OR1200_SPR_GROUP_DU]),
661
        .spr_write(spr_we),
662
        .spr_addr(spr_addr),
663
        .spr_dat_i(spr_dat_cpu),
664
        .spr_dat_o(spr_dat_du),
665
 
666
        // External Debug Interface
667
        .dbg_stall_i(dbg_stall_i),
668
        .dbg_dat_i(dbg_dat_i),
669
        .dbg_adr_i(dbg_adr_i),
670
        .dbg_op_i(dbg_op_i),
671
        .dbg_ewt_i(dbg_ewt_i),
672
        .dbg_lss_o(dbg_lss_o),
673
        .dbg_is_o(dbg_is_o),
674
        .dbg_wp_o(dbg_wp_o),
675
        .dbg_bp_o(dbg_bp_o),
676
        .dbg_dat_o(dbg_dat_o)
677
);
678
 
679
//
680
// Programmable interrupt controller
681
//
682
or1200_pic or1200_pic(
683
        // RISC Internal Interface
684
        .clk(clk_i),
685
        .rst(rst_i),
686
        .spr_cs(spr_cs[`OR1200_SPR_GROUP_PIC]),
687
        .spr_write(spr_we),
688
        .spr_addr(spr_addr),
689
        .spr_dat_i(spr_dat_cpu),
690
        .spr_dat_o(spr_dat_pic),
691
        .pic_wakeup(pic_wakeup),
692
        .int_low(int_low),
693
        .int_high(int_high),
694
 
695
        // PIC Interface
696
        .pic_int(pic_ints_i)
697
);
698
 
699
//
700
// Instantiation of Tick timer
701
//
702
or1200_tt or1200_tt(
703
        // RISC Internal Interface
704
        .clk(clk_i),
705
        .rst(rst_i),
706
        .spr_cs(spr_cs[`OR1200_SPR_GROUP_TT]),
707
        .spr_write(spr_we),
708
        .spr_addr(spr_addr),
709
        .spr_dat_i(spr_dat_cpu),
710
        .spr_dat_o(spr_dat_tt),
711
        .int(tt_int)
712
);
713
 
714
//
715
// Instantiation of Power Management
716
//
717
or1200_pm or1200_pm(
718
        // RISC Internal Interface
719
        .clk(clk_i),
720
        .rst(rst_i),
721
        .pic_wakeup(pic_wakeup),
722
        .spr_write(spr_we),
723
        .spr_addr(spr_addr),
724
        .spr_dat_i(spr_dat_cpu),
725
        .spr_dat_o(spr_dat_pm),
726
 
727
        // Power Management Interface
728
        .pm_cpustall(pm_cpustall_i),
729
        .pm_clksd(pm_clksd_o),
730
        .pm_dc_gate(pm_dc_gate_o),
731
        .pm_ic_gate(pm_ic_gate_o),
732
        .pm_dmmu_gate(pm_dmmu_gate_o),
733
        .pm_immu_gate(pm_immu_gate_o),
734
        .pm_tt_gate(pm_tt_gate_o),
735
        .pm_cpu_gate(pm_cpu_gate_o),
736
        .pm_wakeup(pm_wakeup_o),
737
        .pm_lvolt(pm_lvolt_o)
738
);
739
 
740
 
741
endmodule

powered by: WebSVN 2.1.0

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