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

Subversion Repositories or1k

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 746 lampret
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  OR1200's CPU                                                ////
4
////                                                              ////
5
////  This file is part of the OpenRISC 1200 project              ////
6
////  http://www.opencores.org/cores/or1k/                        ////
7
////                                                              ////
8
////  Description                                                 ////
9
////  Instantiation of internal CPU blocks. IFETCH, SPRS, FRZ,    ////
10
////  ALU, EXCEPT, ID, WBMUX, OPERANDMUX, RF etc.                 ////
11
////                                                              ////
12
////  To Do:                                                      ////
13
////   - make it smaller and faster                               ////
14
////                                                              ////
15
////  Author(s):                                                  ////
16
////      - Damjan Lampret, lampret@opencores.org                 ////
17
////                                                              ////
18
//////////////////////////////////////////////////////////////////////
19
////                                                              ////
20
//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
21
////                                                              ////
22
//// This source file may be used and distributed without         ////
23
//// restriction provided that this copyright statement is not    ////
24
//// removed from the file and that any derivative work contains  ////
25
//// the original copyright notice and the associated disclaimer. ////
26
////                                                              ////
27
//// This source file is free software; you can redistribute it   ////
28
//// and/or modify it under the terms of the GNU Lesser General   ////
29
//// Public License as published by the Free Software Foundation; ////
30
//// either version 2.1 of the License, or (at your option) any   ////
31
//// later version.                                               ////
32
////                                                              ////
33
//// This source is distributed in the hope that it will be       ////
34
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
35
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
36
//// PURPOSE.  See the GNU Lesser General Public License for more ////
37
//// details.                                                     ////
38
////                                                              ////
39
//// You should have received a copy of the GNU Lesser General    ////
40
//// Public License along with this source; if not, download it   ////
41
//// from http://www.opencores.org/lgpl.shtml                     ////
42
////                                                              ////
43
//////////////////////////////////////////////////////////////////////
44
//
45
// CVS Revision History
46
//
47
// $Log: not supported by cvs2svn $
48
// Revision 1.7  2002/02/11 04:33:17  lampret
49
// Speed optimizations (removed duplicate _cyc_ and _stb_). Fixed D/IMMU cache-inhibit attr.
50
//
51
// Revision 1.6  2002/02/01 19:56:54  lampret
52
// Fixed combinational loops.
53
//
54
// Revision 1.5  2002/01/28 01:15:59  lampret
55
// 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.
56
//
57
// Revision 1.4  2002/01/18 14:21:43  lampret
58
// Fixed 'the NPC single-step fix'.
59
//
60
// Revision 1.3  2002/01/18 07:56:00  lampret
61
// No more low/high priority interrupts (PICPR removed). Added tick timer exception. Added exception prefix (SR[EPH]). Fixed single-step bug whenreading NPC.
62
//
63
// Revision 1.2  2002/01/14 06:18:22  lampret
64
// Fixed mem2reg bug in FAST implementation. Updated debug unit to work with new genpc/if.
65
//
66
// Revision 1.1  2002/01/03 08:16:15  lampret
67
// New prefixes for RTL files, prefixed module names. Updated cache controllers and MMUs.
68
//
69
// Revision 1.19  2001/11/30 18:59:47  simons
70
// *** empty log message ***
71
//
72
// Revision 1.18  2001/11/23 21:42:31  simons
73
// Program counter divided to PPC and NPC.
74
//
75
// Revision 1.17  2001/11/23 08:38:51  lampret
76
// Changed DSR/DRR behavior and exception detection.
77
//
78
// Revision 1.16  2001/11/20 00:57:22  lampret
79
// Fixed width of du_except.
80
//
81
// Revision 1.15  2001/11/18 09:58:28  lampret
82
// Fixed some l.trap typos.
83
//
84
// Revision 1.14  2001/11/18 08:36:28  lampret
85
// For GDB changed single stepping and disabled trap exception.
86
//
87
// Revision 1.13  2001/11/13 10:02:21  lampret
88
// Added 'setpc'. Renamed some signals (except_flushpipe into flushpipe etc)
89
//
90
// Revision 1.12  2001/11/12 01:45:40  lampret
91
// Moved flag bit into SR. Changed RF enable from constant enable to dynamic enable for read ports.
92
//
93
// Revision 1.11  2001/11/10 03:43:57  lampret
94
// Fixed exceptions.
95
//
96
// Revision 1.10  2001/10/21 17:57:16  lampret
97
// 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.
98
//
99
// Revision 1.9  2001/10/14 13:12:09  lampret
100
// MP3 version.
101
//
102
// Revision 1.1.1.1  2001/10/06 10:18:35  igorm
103
// no message
104
//
105
// Revision 1.4  2001/08/17 08:01:19  lampret
106
// IC enable/disable.
107
//
108
// Revision 1.3  2001/08/13 03:36:20  lampret
109
// Added cfg regs. Moved all defines into one defines.v file. More cleanup.
110
//
111
// Revision 1.2  2001/08/09 13:39:33  lampret
112
// Major clean-up.
113
//
114
// Revision 1.1  2001/07/20 00:46:03  lampret
115
// Development version of RTL. Libraries are missing.
116
//
117
//
118
 
119
// synopsys translate_off
120
`include "timescale.v"
121
// synopsys translate_on
122
`include "or1200_defines.v"
123
 
124
module or1200_cpu(
125
        // Clk & Rst
126
        clk, rst,
127
 
128
        // Insn interface
129
        ic_en,
130
        icpu_adr_o, icpu_cycstb_o, icpu_we_o, icpu_sel_o, icpu_tag_o,
131
        icpu_dat_i, icpu_ack_i, icpu_rty_i, icpu_err_i, icpu_adr_i, icpu_tag_i,
132
        immu_en,
133
 
134
        // Debug unit
135
        ex_insn, ex_freeze, branch_op,
136
        du_stall, du_addr, du_dat_du, du_read, du_write, du_dsr, du_except, du_dat_cpu,
137
 
138
        // Data interface
139
        dc_en,
140
        dcpu_adr_o, dcpu_cycstb_o, dcpu_we_o, dcpu_sel_o, dcpu_tag_o, dcpu_dat_o,
141
        dcpu_dat_i, dcpu_ack_i, dcpu_rty_i, dcpu_err_i, dcpu_tag_i,
142
        dmmu_en,
143
 
144
        // Interrupt & tick exceptions
145
        sig_int, sig_tick,
146
 
147
        // SPR interface
148
        supv, spr_addr, spr_dat_cpu, spr_dat_pic, spr_dat_tt, spr_dat_pm,
149
        spr_dat_dmmu, spr_dat_immu, spr_dat_du, spr_cs, spr_we
150
);
151
 
152
parameter dw = `OR1200_OPERAND_WIDTH;
153
parameter aw = `OR1200_REGFILE_ADDR_WIDTH;
154
 
155
//
156
// I/O ports
157
//
158
 
159
//
160
// Clk & Rst
161
//
162
input                           clk;
163
input                           rst;
164
 
165
//
166
// Insn (IC) interface
167
//
168
output                          ic_en;
169
output  [31:0]                   icpu_adr_o;
170
output                          icpu_cycstb_o;
171
output                          icpu_we_o;
172
output  [3:0]                    icpu_sel_o;
173
output  [3:0]                    icpu_tag_o;
174
input   [31:0]                   icpu_dat_i;
175
input                           icpu_ack_i;
176
input                           icpu_rty_i;
177
input                           icpu_err_i;
178
input   [31:0]                   icpu_adr_i;
179
input   [3:0]                    icpu_tag_i;
180
 
181
//
182
// Insn (IMMU) interface
183
//
184
output                          immu_en;
185
 
186
//
187
// Debug interface
188
//
189
output  [31:0]                   ex_insn;
190
output                          ex_freeze;
191
output  [`OR1200_BRANCHOP_WIDTH-1:0]     branch_op;
192
input                           du_stall;
193
input   [dw-1:0]         du_addr;
194
input   [dw-1:0]         du_dat_du;
195
input                           du_read;
196
input                           du_write;
197
input   [`OR1200_DU_DSR_WIDTH-1:0]       du_dsr;
198
output  [12:0]                   du_except;
199
output  [dw-1:0]         du_dat_cpu;
200
 
201
//
202
// Data (DC) interface
203
//
204
output  [31:0]                   dcpu_adr_o;
205
output                          dcpu_cycstb_o;
206
output                          dcpu_we_o;
207
output  [3:0]                    dcpu_sel_o;
208
output  [3:0]                    dcpu_tag_o;
209
output  [31:0]                   dcpu_dat_o;
210
input   [31:0]                   dcpu_dat_i;
211
input                           dcpu_ack_i;
212
input                           dcpu_rty_i;
213
input                           dcpu_err_i;
214
input   [3:0]                    dcpu_tag_i;
215
output                          dc_en;
216
 
217
//
218
// Data (DMMU) interface
219
//
220
output                          dmmu_en;
221
 
222
//
223
// SPR interface
224
//
225
output                          supv;
226
input   [dw-1:0]         spr_dat_pic;
227
input   [dw-1:0]         spr_dat_tt;
228
input   [dw-1:0]         spr_dat_pm;
229
input   [dw-1:0]         spr_dat_dmmu;
230
input   [dw-1:0]         spr_dat_immu;
231
input   [dw-1:0]         spr_dat_du;
232
output  [dw-1:0]         spr_addr;
233
output  [dw-1:0]         spr_dat_cpu;
234
output  [31:0]                   spr_cs;
235
output                          spr_we;
236
 
237
//
238
// Interrupt exceptions
239
//
240
input                           sig_int;
241
input                           sig_tick;
242
 
243
//
244
// Internal wires
245
//
246
wire    [31:0]                   if_insn;
247
wire    [31:0]                   if_pc;
248
wire    [31:2]                  lr_sav;
249
wire    [aw-1:0]         rf_addrw;
250
wire    [aw-1:0]                 rf_addra;
251
wire    [aw-1:0]                 rf_addrb;
252
wire                            rf_rda;
253
wire                            rf_rdb;
254
wire    [dw-1:0]         simm;
255
wire    [dw-1:2]                branch_addrofs;
256
wire    [`OR1200_ALUOP_WIDTH-1:0]        alu_op;
257
wire    [`OR1200_SHROTOP_WIDTH-1:0]      shrot_op;
258
wire    [`OR1200_COMPOP_WIDTH-1:0]       comp_op;
259
wire    [`OR1200_BRANCHOP_WIDTH-1:0]     branch_op;
260
wire    [`OR1200_LSUOP_WIDTH-1:0]        lsu_op;
261
wire                            genpc_freeze;
262
wire                            if_freeze;
263
wire                            id_freeze;
264
wire                            ex_freeze;
265
wire                            wb_freeze;
266
wire    [`OR1200_SEL_WIDTH-1:0]  sel_a;
267
wire    [`OR1200_SEL_WIDTH-1:0]  sel_b;
268
wire    [`OR1200_RFWBOP_WIDTH-1:0]       rfwb_op;
269
wire    [dw-1:0]         rf_dataw;
270
wire    [dw-1:0]         rf_dataa;
271
wire    [dw-1:0]         rf_datab;
272
wire    [dw-1:0]         muxed_b;
273
wire    [dw-1:0]         wb_forw;
274
wire                            wbforw_valid;
275
wire    [dw-1:0]         operand_a;
276
wire    [dw-1:0]         operand_b;
277
wire    [dw-1:0]         alu_dataout;
278
wire    [dw-1:0]         lsu_dataout;
279
wire    [dw-1:0]         sprs_dataout;
280
wire    [31:0]                   lsu_addrofs;
281
wire    [`OR1200_MULTICYCLE_WIDTH-1:0]   multicycle;
282
wire    [`OR1200_EXCEPT_WIDTH-1:0]       except_type;
283
wire                            flushpipe;
284
wire                            extend_flush;
285
wire                            branch_taken;
286
wire                            flag;
287
wire                            flagforw;
288
wire                            flag_we;
289
wire                            lsu_stall;
290
wire                            epcr_we;
291
wire                            eear_we;
292
wire                            esr_we;
293
wire                            pc_we;
294
wire    [31:0]                   epcr;
295
wire    [31:0]                   eear;
296
wire    [`OR1200_SR_WIDTH-1:0]           esr;
297
wire    [`OR1200_SR_WIDTH-1:0]           sr;
298
wire                            except_start;
299
wire                            except_started;
300
wire    [31:0]                   wb_insn;
301
wire    [15:0]                   spr_addrimm;
302
wire                            sig_syscall;
303
wire                            sig_trap;
304
wire    [31:0]                   spr_dat_cfgr;
305
wire    [31:0]                   spr_dat_rf;
306
wire    [31:0]                  spr_dat_npc;
307
wire    [31:0]                   spr_dat_ppc;
308
wire    [31:0]                   spr_dat_mac;
309
wire                            force_dslot_fetch;
310
wire                            no_more_dslot;
311
wire                            ex_void;
312
wire                            if_stall;
313
wire                            id_macrc_op;
314
wire                            ex_macrc_op;
315
wire    [`OR1200_MACOP_WIDTH-1:0] mac_op;
316
wire    [31:0]                   mult_mac_result;
317
wire                            mac_stall;
318
wire    [12:0]                   except_stop;
319
wire                            genpc_refetch;
320
wire                            rfe;
321
wire                            lsu_unstall;
322
wire                            except_align;
323
wire                            except_dtlbmiss;
324
wire                            except_dmmufault;
325
wire                            except_illegal;
326
wire                            except_itlbmiss;
327
wire                            except_immufault;
328
wire                            except_ibuserr;
329
wire                            except_dbuserr;
330
wire                            abort_ex;
331
 
332
//
333
// icpu_we_o
334
//
335
assign icpu_we_o = 1'b0;
336
 
337
//
338
// Send exceptions to Debug Unit
339
//
340
assign du_except = except_stop;
341
 
342
//
343
// Data cache enable
344
//
345
assign dc_en = sr[`OR1200_SR_DCE];
346
 
347
//
348
// Instruction cache enable
349
//
350
assign ic_en = sr[`OR1200_SR_ICE];
351
 
352
//
353
// DMMU enable
354
//
355
assign dmmu_en = sr[`OR1200_SR_DME];
356
 
357
//
358
// IMMU enable
359
//
360
assign immu_en = sr[`OR1200_SR_IME];
361
 
362
//
363
// SUPV bit
364
//
365
assign supv = sr[`OR1200_SR_SM];
366
 
367
//
368
// Instantiation of instruction fetch block
369
//
370
or1200_genpc or1200_genpc(
371
        .clk(clk),
372
        .rst(rst),
373
        .icpu_adr_o(icpu_adr_o),
374
        .icpu_cycstb_o(icpu_cycstb_o),
375
        .icpu_sel_o(icpu_sel_o),
376
        .icpu_tag_o(icpu_tag_o),
377
        .icpu_ack_i(icpu_ack_i),
378
        .icpu_rty_i(icpu_rty_i),
379
        .icpu_err_i(icpu_err_i),
380
        .icpu_adr_i(icpu_adr_i),
381
 
382
        .branch_op(branch_op),
383
        .except_type(except_type),
384
        .except_start(except_start),
385
        .except_prefix(sr[`OR1200_SR_EPH]),
386
        .branch_addrofs(branch_addrofs),
387
        .lr_restor(operand_b),
388
        .flag(flag),
389
        .taken(branch_taken),
390
        .binsn_addr(lr_sav),
391
        .epcr(epcr),
392
        .spr_dat_i(spr_dat_cpu),
393
        .spr_pc_we(pc_we),
394
        .genpc_refetch(genpc_refetch),
395
        .genpc_freeze(genpc_freeze),
396
        .flushpipe(flushpipe),
397
        .no_more_dslot(no_more_dslot)
398
);
399
 
400
//
401
// Instantiation of instruction fetch block
402
//
403
or1200_if or1200_if(
404
        .clk(clk),
405
        .rst(rst),
406
        .icpu_dat_i(icpu_dat_i),
407
        .icpu_ack_i(icpu_ack_i),
408
        .icpu_rty_i(icpu_rty_i),
409
        .icpu_err_i(icpu_err_i),
410
        .icpu_adr_i(icpu_adr_i),
411
        .icpu_tag_i(icpu_tag_i),
412
 
413
        .if_freeze(if_freeze),
414
        .if_insn(if_insn),
415
        .if_pc(if_pc),
416
        .flushpipe(flushpipe),
417
        .if_stall(if_stall),
418
        .no_more_dslot(no_more_dslot),
419
        .taken(branch_taken),
420
        .genpc_refetch(genpc_refetch),
421
        .rfe(rfe),
422
        .except_itlbmiss(except_itlbmiss),
423
        .except_immufault(except_immufault),
424
        .except_ibuserr(except_ibuserr)
425
);
426
 
427
//
428
// Instantiation of instruction decode/control logic
429
//
430
or1200_ctrl or1200_ctrl(
431
        .clk(clk),
432
        .rst(rst),
433
        .id_freeze(id_freeze),
434
        .ex_freeze(ex_freeze),
435
        .wb_freeze(wb_freeze),
436
        .flushpipe(flushpipe),
437
        .if_insn(if_insn),
438
        .ex_insn(ex_insn),
439
        .branch_op(branch_op),
440
        .branch_taken(branch_taken),
441
        .rf_addra(rf_addra),
442
        .rf_addrb(rf_addrb),
443
        .rf_rda(rf_rda),
444
        .rf_rdb(rf_rdb),
445
        .alu_op(alu_op),
446
        .mac_op(mac_op),
447
        .shrot_op(shrot_op),
448
        .comp_op(comp_op),
449
        .rf_addrw(rf_addrw),
450
        .rfwb_op(rfwb_op),
451
        .wb_insn(wb_insn),
452
        .simm(simm),
453
        .branch_addrofs(branch_addrofs),
454
        .lsu_addrofs(lsu_addrofs),
455
        .sel_a(sel_a),
456
        .sel_b(sel_b),
457
        .lsu_op(lsu_op),
458
        .multicycle(multicycle),
459
        .spr_addrimm(spr_addrimm),
460
        .wbforw_valid(wbforw_valid),
461
        .sig_syscall(sig_syscall),
462
        .sig_trap(sig_trap),
463
        .force_dslot_fetch(force_dslot_fetch),
464
        .no_more_dslot(no_more_dslot),
465
        .ex_void(ex_void),
466
        .id_macrc_op(id_macrc_op),
467
        .ex_macrc_op(ex_macrc_op),
468
        .rfe(rfe),
469
        .except_illegal(except_illegal)
470
);
471
 
472
//
473
// Instantiation of register file
474
//
475
or1200_rf or1200_rf(
476
        .clk(clk),
477
        .rst(rst),
478
        .supv(sr[`OR1200_SR_SM]),
479
        .wb_freeze(wb_freeze),
480
        .addrw(rf_addrw),
481
        .dataw(rf_dataw),
482
        .id_freeze(id_freeze),
483
        .we(rfwb_op[0]),
484
        .flushpipe(flushpipe),
485
        .addra(rf_addra),
486
        .rda(rf_rda),
487
        .dataa(rf_dataa),
488
        .addrb(rf_addrb),
489
        .rdb(rf_rdb),
490
        .datab(rf_datab),
491
        .spr_cs(spr_cs[`OR1200_SPR_GROUP_SYS]),
492
        .spr_write(spr_we),
493
        .spr_addr(spr_addr),
494
        .spr_dat_i(spr_dat_cpu),
495
        .spr_dat_o(spr_dat_rf)
496
);
497
 
498
//
499
// Instantiation of operand muxes
500
//
501
or1200_operandmuxes or1200_operandmuxes(
502
        .clk(clk),
503
        .rst(rst),
504
        .id_freeze(id_freeze),
505
        .ex_freeze(ex_freeze),
506
        .rf_dataa(rf_dataa),
507
        .rf_datab(rf_datab),
508
        .ex_forw(rf_dataw),
509
        .wb_forw(wb_forw),
510
        .simm(simm),
511
        .sel_a(sel_a),
512
        .sel_b(sel_b),
513
        .operand_a(operand_a),
514
        .operand_b(operand_b),
515
        .muxed_b(muxed_b)
516
);
517
 
518
//
519
// Instantiation of CPU's ALU
520
//
521
or1200_alu or1200_alu(
522
        .a(operand_a),
523
        .b(operand_b),
524
        .mult_mac_result(mult_mac_result),
525
        .macrc_op(ex_macrc_op),
526
        .alu_op(alu_op),
527
        .shrot_op(shrot_op),
528
        .comp_op(comp_op),
529
        .result(alu_dataout),
530
        .flagforw(flagforw),
531
        .flag_we(flag_we)
532
);
533
 
534
//
535
// Instantiation of CPU's ALU
536
//
537
or1200_mult_mac or1200_mult_mac(
538
        .clk(clk),
539
        .rst(rst),
540
        .ex_freeze(ex_freeze),
541
        .id_macrc_op(id_macrc_op),
542
        .macrc_op(ex_macrc_op),
543
        .a(operand_a),
544
        .b(operand_b),
545
        .mac_op(mac_op),
546
        .alu_op(alu_op),
547
        .result(mult_mac_result),
548
        .mac_stall_r(mac_stall),
549
        .spr_cs(spr_cs[`OR1200_SPR_GROUP_MAC]),
550
        .spr_write(spr_we),
551
        .spr_addr(spr_addr),
552
        .spr_dat_i(spr_dat_cpu),
553
        .spr_dat_o(spr_dat_mac)
554
);
555
 
556
//
557
// Instantiation of CPU's SPRS block
558
//
559
or1200_sprs or1200_sprs(
560
        .clk(clk),
561
        .rst(rst),
562
        .addrbase(operand_a),
563
        .addrofs(spr_addrimm),
564
        .dat_i(operand_b),
565
        .alu_op(alu_op),
566
        .flagforw(flagforw),
567
        .flag_we(flag_we),
568
        .flag(flag),
569
        .to_wbmux(sprs_dataout),
570
 
571
        .du_addr(du_addr),
572
        .du_dat_du(du_dat_du),
573
        .du_read(du_read),
574
        .du_write(du_write),
575
        .du_dat_cpu(du_dat_cpu),
576
 
577
        .spr_addr(spr_addr),
578
        .spr_dat_pic(spr_dat_pic),
579
        .spr_dat_tt(spr_dat_tt),
580
        .spr_dat_pm(spr_dat_pm),
581
        .spr_dat_cfgr(spr_dat_cfgr),
582
        .spr_dat_rf(spr_dat_rf),
583
        .spr_dat_npc(spr_dat_npc),
584
        .spr_dat_ppc(spr_dat_ppc),
585
        .spr_dat_mac(spr_dat_mac),
586
        .spr_dat_dmmu(spr_dat_dmmu),
587
        .spr_dat_immu(spr_dat_immu),
588
        .spr_dat_du(spr_dat_du),
589
        .spr_dat_o(spr_dat_cpu),
590
        .spr_cs(spr_cs),
591
        .spr_we(spr_we),
592
 
593
        .epcr_we(epcr_we),
594
        .eear_we(eear_we),
595
        .esr_we(esr_we),
596
        .pc_we(pc_we),
597
        .epcr(epcr),
598
        .eear(eear),
599
        .esr(esr),
600
        .except_start(except_start),
601
        .except_started(except_started),
602
 
603
        .sr(sr),
604
        .branch_op(branch_op)
605
);
606
 
607
//
608
// Instantiation of load/store unit
609
//
610
or1200_lsu or1200_lsu(
611
        .clk(clk),
612
        .rst(rst),
613
        .addrbase(operand_a),
614
        .addrofs(lsu_addrofs),
615
        .lsu_op(lsu_op),
616
        .lsu_datain(operand_b),
617
        .lsu_dataout(lsu_dataout),
618
        .lsu_stall(lsu_stall),
619
        .lsu_unstall(lsu_unstall),
620
        .du_stall(du_stall),
621
        .flushpipe(flushpipe),
622
        .except_align(except_align),
623
        .except_dtlbmiss(except_dtlbmiss),
624
        .except_dmmufault(except_dmmufault),
625
        .except_dbuserr(except_dbuserr),
626
 
627
        .dcpu_adr_o(dcpu_adr_o),
628
        .dcpu_cycstb_o(dcpu_cycstb_o),
629
        .dcpu_we_o(dcpu_we_o),
630
        .dcpu_sel_o(dcpu_sel_o),
631
        .dcpu_tag_o(dcpu_tag_o),
632
        .dcpu_dat_o(dcpu_dat_o),
633
        .dcpu_dat_i(dcpu_dat_i),
634
        .dcpu_ack_i(dcpu_ack_i),
635
        .dcpu_rty_i(dcpu_rty_i),
636
        .dcpu_err_i(dcpu_err_i),
637
        .dcpu_tag_i(dcpu_tag_i)
638
);
639
 
640
//
641
// Instantiation of write-back muxes
642
//
643
or1200_wbmux or1200_wbmux(
644
        .clk(clk),
645
        .rst(rst),
646
        .wb_freeze(wb_freeze),
647
        .rfwb_op(rfwb_op),
648
        .muxin_a(alu_dataout),
649
        .muxin_b(lsu_dataout),
650
        .muxin_c(sprs_dataout),
651
        .muxin_d({lr_sav, 2'b0}),
652
        .muxout(rf_dataw),
653
        .muxreg(wb_forw),
654
        .muxreg_valid(wbforw_valid)
655
);
656
 
657
//
658
// Instantiation of freeze logic
659
//
660
or1200_freeze or1200_freeze(
661
        .clk(clk),
662
        .rst(rst),
663
        .multicycle(multicycle),
664
        .flushpipe(flushpipe),
665
        .extend_flush(extend_flush),
666
        .lsu_stall(lsu_stall),
667
        .if_stall(if_stall),
668
        .lsu_unstall(lsu_unstall),
669
        .force_dslot_fetch(force_dslot_fetch),
670
        .abort_ex(abort_ex),
671
        .du_stall(du_stall),
672
        .mac_stall(mac_stall),
673
        .genpc_freeze(genpc_freeze),
674
        .if_freeze(if_freeze),
675
        .id_freeze(id_freeze),
676
        .ex_freeze(ex_freeze),
677
        .wb_freeze(wb_freeze)
678
);
679
 
680
//
681
// Instantiation of exception block
682
//
683
or1200_except or1200_except(
684
        .clk(clk),
685
        .rst(rst),
686
        .sig_ibuserr(except_ibuserr),
687
        .sig_dbuserr(except_dbuserr),
688
        .sig_illegal(except_illegal),
689
        .sig_align(except_align),
690
        .sig_range(1'b0),
691
        .sig_dtlbmiss(except_dtlbmiss),
692
        .sig_dmmufault(except_dmmufault),
693
        .sig_int(sig_int),
694
        .sig_syscall(sig_syscall),
695
        .sig_trap(sig_trap),
696
        .sig_itlbmiss(except_itlbmiss),
697
        .sig_immufault(except_immufault),
698
        .sig_tick(sig_tick),
699
        .branch_taken(branch_taken),
700
        .id_freeze(id_freeze),
701
        .ex_freeze(ex_freeze),
702
        .wb_freeze(wb_freeze),
703
        .if_stall(if_stall),
704
        .if_pc(if_pc),
705
        .lr_sav(lr_sav),
706
        .flushpipe(flushpipe),
707
        .extend_flush(extend_flush),
708
        .except_type(except_type),
709
        .except_start(except_start),
710
        .except_started(except_started),
711
        .except_stop(except_stop),
712
        .ex_void(ex_void),
713
        .spr_dat_ppc(spr_dat_ppc),
714
        .spr_dat_npc(spr_dat_npc),
715
 
716
        .datain(operand_b),
717
        .du_dsr(du_dsr),
718
        .epcr_we(epcr_we),
719
        .eear_we(eear_we),
720
        .esr_we(esr_we),
721
        .pc_we(pc_we),
722
        .epcr(epcr),
723
        .eear(eear),
724
        .esr(esr),
725
 
726
        .lsu_addr(dcpu_adr_o),
727
        .sr(sr),
728
        .abort_ex(abort_ex)
729
);
730
 
731
//
732
// Instantiation of configuration registers
733
//
734
or1200_cfgr or1200_cfgr(
735
        .clk(clk),
736
        .rst(clk),
737
        .spr_addr(spr_addr),
738
        .spr_dat_o(spr_dat_cfgr)
739
);
740
 
741
endmodule

powered by: WebSVN 2.1.0

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