Line 42... |
Line 42... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.14 2002/09/03 22:28:21 lampret
|
|
// As per Taylor Su suggestion all case blocks are full case by default and optionally (OR1200_CASE_DEFAULT) can be disabled to increase clock frequncy.
|
|
//
|
// Revision 1.13 2002/08/28 01:44:25 lampret
|
// Revision 1.13 2002/08/28 01:44:25 lampret
|
// Removed some commented RTL. Fixed SR/ESR flag bug.
|
// Removed some commented RTL. Fixed SR/ESR flag bug.
|
//
|
//
|
// Revision 1.12 2002/08/22 02:16:45 lampret
|
// Revision 1.12 2002/08/22 02:16:45 lampret
|
// Fixed IMMU bug.
|
// Fixed IMMU bug.
|
Line 412... |
Line 415... |
if (except_flushpipe) begin
|
if (except_flushpipe) begin
|
state <= #1 `OR1200_EXCEPTFSM_FLU1;
|
state <= #1 `OR1200_EXCEPTFSM_FLU1;
|
extend_flush <= #1 1'b1;
|
extend_flush <= #1 1'b1;
|
esr <= #1 sr_we ? to_sr : sr;
|
esr <= #1 sr_we ? to_sr : sr;
|
casex (except_trig)
|
casex (except_trig)
|
|
`ifdef OR1200_EXCEPT_TICK
|
13'b1_xxxx_xxxx_xxxx: begin
|
13'b1_xxxx_xxxx_xxxx: begin
|
except_type <= #1 `OR1200_EXCEPT_TICK;
|
except_type <= #1 `OR1200_EXCEPT_TICK;
|
epcr <= #1 ex_dslot ? wb_pc : delayed1_ex_dslot ? id_pc : delayed2_ex_dslot ? id_pc : id_pc;
|
epcr <= #1 ex_dslot ? wb_pc : delayed1_ex_dslot ? id_pc : delayed2_ex_dslot ? id_pc : id_pc;
|
end
|
end
|
|
`endif
|
|
`ifdef OR1200_EXCEPT_INT
|
13'b0_1xxx_xxxx_xxxx: begin
|
13'b0_1xxx_xxxx_xxxx: begin
|
except_type <= #1 `OR1200_EXCEPT_INT;
|
except_type <= #1 `OR1200_EXCEPT_INT;
|
epcr <= #1 ex_dslot ? wb_pc : delayed1_ex_dslot ? id_pc : delayed2_ex_dslot ? id_pc : id_pc;
|
epcr <= #1 ex_dslot ? wb_pc : delayed1_ex_dslot ? id_pc : delayed2_ex_dslot ? id_pc : id_pc;
|
end
|
end
|
|
`endif
|
|
`ifdef OR1200_EXCEPT_ITLBMISS
|
13'b0_01xx_xxxx_xxxx: begin
|
13'b0_01xx_xxxx_xxxx: begin
|
except_type <= #1 `OR1200_EXCEPT_ITLBMISS;
|
except_type <= #1 `OR1200_EXCEPT_ITLBMISS;
|
//
|
//
|
// itlb miss exception and active ex_dslot caused wb_pc to put into eear instead of +4 address of ex_pc (or id_pc since it was equal to ex_pc?)
|
// itlb miss exception and active ex_dslot caused wb_pc to put into eear instead of +4 address of ex_pc (or id_pc since it was equal to ex_pc?)
|
// eear <= #1 ex_dslot ? wb_pc : delayed1_ex_dslot ? id_pc : delayed2_ex_dslot ? id_pc : id_pc;
|
// eear <= #1 ex_dslot ? wb_pc : delayed1_ex_dslot ? id_pc : delayed2_ex_dslot ? id_pc : id_pc;
|
Line 432... |
Line 440... |
eear <= #1 ex_dslot ? ex_pc : ex_pc;
|
eear <= #1 ex_dslot ? ex_pc : ex_pc;
|
epcr <= #1 ex_dslot ? wb_pc : ex_pc;
|
epcr <= #1 ex_dslot ? wb_pc : ex_pc;
|
// eear <= #1 ex_dslot ? ex_pc : delayed1_ex_dslot ? id_pc : delayed2_ex_dslot ? id_pc : id_pc;
|
// eear <= #1 ex_dslot ? ex_pc : delayed1_ex_dslot ? id_pc : delayed2_ex_dslot ? id_pc : id_pc;
|
// epcr <= #1 ex_dslot ? wb_pc : delayed1_ex_dslot ? id_pc : delayed2_ex_dslot ? id_pc : id_pc;
|
// epcr <= #1 ex_dslot ? wb_pc : delayed1_ex_dslot ? id_pc : delayed2_ex_dslot ? id_pc : id_pc;
|
end
|
end
|
|
`endif
|
|
`ifdef OR1200_EXCEPT_IPF
|
13'b0_001x_xxxx_xxxx: begin
|
13'b0_001x_xxxx_xxxx: begin
|
except_type <= #1 `OR1200_EXCEPT_IPF;
|
except_type <= #1 `OR1200_EXCEPT_IPF;
|
//
|
//
|
// ipf exception and active ex_dslot caused wb_pc to put into eear instead of +4 address of ex_pc (or id_pc since it was equal to ex_pc?)
|
// ipf exception and active ex_dslot caused wb_pc to put into eear instead of +4 address of ex_pc (or id_pc since it was equal to ex_pc?)
|
// eear <= #1 ex_dslot ? wb_pc : delayed1_ex_dslot ? id_pc : delayed2_ex_dslot ? id_pc : id_pc;
|
// eear <= #1 ex_dslot ? wb_pc : delayed1_ex_dslot ? id_pc : delayed2_ex_dslot ? id_pc : id_pc;
|
eear <= #1 ex_dslot ? ex_pc : delayed1_ex_dslot ? id_pc : delayed2_ex_dslot ? id_pc : id_pc;
|
eear <= #1 ex_dslot ? ex_pc : delayed1_ex_dslot ? id_pc : delayed2_ex_dslot ? id_pc : id_pc;
|
epcr <= #1 ex_dslot ? wb_pc : delayed1_ex_dslot ? id_pc : delayed2_ex_dslot ? id_pc : id_pc;
|
epcr <= #1 ex_dslot ? wb_pc : delayed1_ex_dslot ? id_pc : delayed2_ex_dslot ? id_pc : id_pc;
|
end
|
end
|
|
`endif
|
|
`ifdef OR1200_EXCEPT_BUSERR
|
13'b0_0001_xxxx_xxxx: begin
|
13'b0_0001_xxxx_xxxx: begin
|
except_type <= #1 `OR1200_EXCEPT_BUSERR;
|
except_type <= #1 `OR1200_EXCEPT_BUSERR;
|
eear <= #1 ex_dslot ? wb_pc : ex_pc;
|
eear <= #1 ex_dslot ? wb_pc : ex_pc;
|
epcr <= #1 ex_dslot ? wb_pc : ex_pc;
|
epcr <= #1 ex_dslot ? wb_pc : ex_pc;
|
end
|
end
|
|
`endif
|
|
`ifdef OR1200_EXCEPT_ILLEGAL
|
13'b0_0000_1xxx_xxxx: begin
|
13'b0_0000_1xxx_xxxx: begin
|
except_type <= #1 `OR1200_EXCEPT_ILLEGAL;
|
except_type <= #1 `OR1200_EXCEPT_ILLEGAL;
|
eear <= #1 ex_pc;
|
eear <= #1 ex_pc;
|
epcr <= #1 ex_dslot ? wb_pc : ex_pc;
|
epcr <= #1 ex_dslot ? wb_pc : ex_pc;
|
end
|
end
|
|
`endif
|
|
`ifdef OR1200_EXCEPT_ALIGN
|
13'b0_0000_01xx_xxxx: begin
|
13'b0_0000_01xx_xxxx: begin
|
except_type <= #1 `OR1200_EXCEPT_ALIGN;
|
except_type <= #1 `OR1200_EXCEPT_ALIGN;
|
eear <= #1 lsu_addr;
|
eear <= #1 lsu_addr;
|
epcr <= #1 ex_dslot ? wb_pc : ex_pc;
|
epcr <= #1 ex_dslot ? wb_pc : ex_pc;
|
end
|
end
|
|
`endif
|
|
`ifdef OR1200_EXCEPT_DTLBMISS
|
13'b0_0000_001x_xxxx: begin
|
13'b0_0000_001x_xxxx: begin
|
except_type <= #1 `OR1200_EXCEPT_DTLBMISS;
|
except_type <= #1 `OR1200_EXCEPT_DTLBMISS;
|
eear <= #1 lsu_addr;
|
eear <= #1 lsu_addr;
|
epcr <= #1 ex_dslot ? wb_pc : ex_pc;
|
epcr <= #1 ex_dslot ? wb_pc : ex_pc;
|
end
|
end
|
|
`endif
|
|
`ifdef OR1200_EXCEPT_DPF
|
13'b0_0000_0001_xxxx: begin
|
13'b0_0000_0001_xxxx: begin
|
except_type <= #1 `OR1200_EXCEPT_DPF;
|
except_type <= #1 `OR1200_EXCEPT_DPF;
|
eear <= #1 lsu_addr;
|
eear <= #1 lsu_addr;
|
epcr <= #1 ex_dslot ? wb_pc : ex_pc;
|
epcr <= #1 ex_dslot ? wb_pc : ex_pc;
|
end
|
end
|
|
`endif
|
|
`ifdef OR1200_EXCEPT_BUSERR
|
13'b0_0000_0000_1xxx: begin // Data Bus Error
|
13'b0_0000_0000_1xxx: begin // Data Bus Error
|
except_type <= #1 `OR1200_EXCEPT_BUSERR;
|
except_type <= #1 `OR1200_EXCEPT_BUSERR;
|
eear <= #1 lsu_addr;
|
eear <= #1 lsu_addr;
|
epcr <= #1 ex_dslot ? wb_pc : ex_pc;
|
epcr <= #1 ex_dslot ? wb_pc : ex_pc;
|
end
|
end
|
|
`endif
|
|
`ifdef OR1200_EXCEPT_RANGE
|
13'b0_0000_0000_01xx: begin
|
13'b0_0000_0000_01xx: begin
|
except_type <= #1 `OR1200_EXCEPT_RANGE;
|
except_type <= #1 `OR1200_EXCEPT_RANGE;
|
epcr <= #1 ex_dslot ? wb_pc : delayed1_ex_dslot ? id_pc : delayed2_ex_dslot ? id_pc : id_pc;
|
epcr <= #1 ex_dslot ? wb_pc : delayed1_ex_dslot ? id_pc : delayed2_ex_dslot ? id_pc : id_pc;
|
end
|
end
|
13'b0_0000_0000_001x: begin
|
`endif
|
|
`ifdef OR1200_EXCEPT_TRAP 13'b0_0000_0000_001x: begin
|
except_type <= #1 `OR1200_EXCEPT_TRAP;
|
except_type <= #1 `OR1200_EXCEPT_TRAP;
|
epcr <= #1 ex_dslot ? wb_pc : ex_pc;
|
epcr <= #1 ex_dslot ? wb_pc : ex_pc;
|
end
|
end
|
|
`endif
|
|
`ifdef OR1200_EXCEPT_SYSCALL
|
13'b0_0000_0000_0001: begin
|
13'b0_0000_0000_0001: begin
|
except_type <= #1 `OR1200_EXCEPT_SYSCALL;
|
except_type <= #1 `OR1200_EXCEPT_SYSCALL;
|
epcr <= #1 ex_dslot ? wb_pc : delayed1_ex_dslot ? id_pc : delayed2_ex_dslot ? id_pc : id_pc;
|
epcr <= #1 ex_dslot ? wb_pc : delayed1_ex_dslot ? id_pc : delayed2_ex_dslot ? id_pc : id_pc;
|
end
|
end
|
|
`endif
|
default:
|
default:
|
except_type <= #1 `OR1200_EXCEPT_NONE;
|
except_type <= #1 `OR1200_EXCEPT_NONE;
|
endcase
|
endcase
|
end
|
end
|
else if (pc_we) begin
|
else if (pc_we) begin
|
Line 502... |
Line 530... |
end
|
end
|
`OR1200_EXCEPTFSM_FLU1:
|
`OR1200_EXCEPTFSM_FLU1:
|
if (icpu_ack_i | icpu_err_i | genpc_freeze)
|
if (icpu_ack_i | icpu_err_i | genpc_freeze)
|
state <= #1 `OR1200_EXCEPTFSM_FLU2;
|
state <= #1 `OR1200_EXCEPTFSM_FLU2;
|
`OR1200_EXCEPTFSM_FLU2:
|
`OR1200_EXCEPTFSM_FLU2:
|
|
`ifdef OR1200_EXCEPT_TRAP
|
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;
|
extend_flush_last <= #1 1'b0;
|
extend_flush_last <= #1 1'b0;
|
except_type <= #1 `OR1200_EXCEPT_NONE;
|
except_type <= #1 `OR1200_EXCEPT_NONE;
|
end
|
end
|
else
|
else
|
|
`endif
|
state <= #1 `OR1200_EXCEPTFSM_FLU3;
|
state <= #1 `OR1200_EXCEPTFSM_FLU3;
|
`OR1200_EXCEPTFSM_FLU3:
|
`OR1200_EXCEPTFSM_FLU3:
|
begin
|
begin
|
state <= #1 `OR1200_EXCEPTFSM_FLU4;
|
state <= #1 `OR1200_EXCEPTFSM_FLU4;
|
end
|
end
|