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

Subversion Repositories or1k

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

powered by: WebSVN 2.1.0

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