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

Subversion Repositories or1k

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

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

powered by: WebSVN 2.1.0

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