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

Subversion Repositories or1k

[/] [or1k/] [tags/] [rel_29/] [or1200/] [rtl/] [verilog/] [or1200_cpu.v] - Blame information for rev 589

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

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

powered by: WebSVN 2.1.0

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