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

Subversion Repositories or1k

[/] [or1k/] [branches/] [branch_qmem/] [or1200/] [rtl/] [verilog/] [or1200_cpu.v] - Blame information for rev 595

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

powered by: WebSVN 2.1.0

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