Line 42... |
Line 42... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.9 2002/02/11 04:33:17 lampret
|
|
// Speed optimizations (removed duplicate _cyc_ and _stb_). Fixed D/IMMU cache-inhibit attr.
|
|
//
|
// Revision 1.8 2002/01/28 01:16:00 lampret
|
// Revision 1.8 2002/01/28 01:16:00 lampret
|
// Changed 'void' nop-ops instead of insn[0] to use insn[16]. Debug unit stalls the tick timer. Prepared new flag generation for add and and insns. Blocked DC/IC while they are turned off. Fixed I/D MMU SPRs layout except WAYs. TODO: smart IC invalidate, l.j 2 and TLB ways.
|
// Changed 'void' nop-ops instead of insn[0] to use insn[16]. Debug unit stalls the tick timer. Prepared new flag generation for add and and insns. Blocked DC/IC while they are turned off. Fixed I/D MMU SPRs layout except WAYs. TODO: smart IC invalidate, l.j 2 and TLB ways.
|
//
|
//
|
// Revision 1.7 2002/01/23 07:52:36 lampret
|
// Revision 1.7 2002/01/23 07:52:36 lampret
|
// Changed default reset values for SR and ESR to match or1ksim's. Fixed flop model in or1200_dpram_32x32 when OR1200_XILINX_RAM32X1D is defined.
|
// Changed default reset values for SR and ESR to match or1ksim's. Fixed flop model in or1200_dpram_32x32 when OR1200_XILINX_RAM32X1D is defined.
|
Line 128... |
Line 131... |
clk, rst,
|
clk, rst,
|
|
|
// Internal i/f
|
// Internal i/f
|
sig_ibuserr, sig_dbuserr, sig_illegal, sig_align, sig_range, sig_dtlbmiss, sig_dmmufault,
|
sig_ibuserr, sig_dbuserr, sig_illegal, sig_align, sig_range, sig_dtlbmiss, sig_dmmufault,
|
sig_int, sig_syscall, sig_trap, sig_itlbmiss, sig_immufault, sig_tick,
|
sig_int, sig_syscall, sig_trap, sig_itlbmiss, sig_immufault, sig_tick,
|
branch_taken, id_freeze, ex_freeze, wb_freeze, if_stall,
|
branch_taken, genpc_freeze, id_freeze, ex_freeze, wb_freeze, if_stall,
|
if_pc, lr_sav, flushpipe, extend_flush, except_type, except_start,
|
if_pc, lr_sav, flushpipe, extend_flush, except_type, except_start,
|
except_started, except_stop, ex_void,
|
except_started, except_stop, ex_void,
|
spr_dat_ppc, spr_dat_npc, datain, du_dsr, epcr_we, eear_we, esr_we, pc_we, epcr, eear,
|
spr_dat_ppc, spr_dat_npc, datain, du_dsr, epcr_we, eear_we, esr_we, pc_we, epcr, eear,
|
esr, sr, lsu_addr, abort_ex
|
esr, sr, lsu_addr, abort_ex, icpu_ack_i, icpu_err_i, dcpu_ack_i, dcpu_err_i
|
);
|
);
|
|
|
//
|
//
|
// I/O
|
// I/O
|
//
|
//
|
Line 154... |
Line 157... |
input sig_trap;
|
input sig_trap;
|
input sig_itlbmiss;
|
input sig_itlbmiss;
|
input sig_immufault;
|
input sig_immufault;
|
input sig_tick;
|
input sig_tick;
|
input branch_taken;
|
input branch_taken;
|
|
input genpc_freeze;
|
input id_freeze;
|
input id_freeze;
|
input ex_freeze;
|
input ex_freeze;
|
input wb_freeze;
|
input wb_freeze;
|
input if_stall;
|
input if_stall;
|
input [31:0] if_pc;
|
input [31:0] if_pc;
|
Line 181... |
Line 185... |
output [12:0] except_stop;
|
output [12:0] except_stop;
|
input ex_void;
|
input ex_void;
|
output [31:0] spr_dat_ppc;
|
output [31:0] spr_dat_ppc;
|
output [31:0] spr_dat_npc;
|
output [31:0] spr_dat_npc;
|
output abort_ex;
|
output abort_ex;
|
|
input icpu_ack_i;
|
|
input icpu_err_i;
|
|
input dcpu_ack_i;
|
|
input dcpu_err_i;
|
|
|
//
|
//
|
// Internal regs and wires
|
// Internal regs and wires
|
//
|
//
|
reg [`OR1200_EXCEPT_WIDTH-1:0] except_type;
|
reg [`OR1200_EXCEPT_WIDTH-1:0] except_type;
|
Line 500... |
Line 508... |
eear <= #1 datain;
|
eear <= #1 datain;
|
if (esr_we)
|
if (esr_we)
|
esr <= #1 {1'b1, datain[`OR1200_SR_WIDTH-2:0]};
|
esr <= #1 {1'b1, datain[`OR1200_SR_WIDTH-2:0]};
|
end
|
end
|
`OR1200_EXCEPTFSM_FLU1:
|
`OR1200_EXCEPTFSM_FLU1:
|
// if (!if_stall & !id_freeze)
|
if (icpu_ack_i | icpu_err_i | genpc_freeze)
|
|
// if (!if_stall | genpc_freeze)
|
state <= #1 `OR1200_EXCEPTFSM_FLU2;
|
state <= #1 `OR1200_EXCEPTFSM_FLU2;
|
`OR1200_EXCEPTFSM_FLU2:
|
`OR1200_EXCEPTFSM_FLU2:
|
if (except_type == `OR1200_EXCEPT_TRAP) begin
|
if (except_type == `OR1200_EXCEPT_TRAP) begin
|
state <= #1 `OR1200_EXCEPTFSM_IDLE;
|
state <= #1 `OR1200_EXCEPTFSM_IDLE;
|
extend_flush <= #1 1'b0;
|
extend_flush <= #1 1'b0;
|