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

Subversion Repositories or1k

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

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

powered by: WebSVN 2.1.0

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