Line 42... |
Line 42... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.5 2002/02/01 19:56:54 lampret
|
|
// Fixed combinational loops.
|
|
//
|
// Revision 1.4 2002/01/28 01:15:59 lampret
|
// Revision 1.4 2002/01/28 01:15:59 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.3 2002/01/18 14:21:43 lampret
|
// Revision 1.3 2002/01/18 14:21:43 lampret
|
// Fixed 'the NPC single-step fix'.
|
// Fixed 'the NPC single-step fix'.
|
Line 262... |
Line 265... |
if (rst)
|
if (rst)
|
spr_addrimm <= #1 16'h0000;
|
spr_addrimm <= #1 16'h0000;
|
else if (!ex_freeze & id_freeze | flushpipe)
|
else if (!ex_freeze & id_freeze | flushpipe)
|
spr_addrimm <= #1 16'h0000;
|
spr_addrimm <= #1 16'h0000;
|
else if (!ex_freeze) begin
|
else if (!ex_freeze) begin
|
case (id_insn[31:26]) // synopsys full_case parallel_case
|
case (id_insn[31:26]) // synopsys parallel_case
|
// l.mfspr
|
// l.mfspr
|
`OR1200_OR32_MFSPR:
|
`OR1200_OR32_MFSPR:
|
spr_addrimm <= #1 id_insn[15:0];
|
spr_addrimm <= #1 id_insn[15:0];
|
// l.mtspr
|
// l.mtspr
|
default:
|
default:
|
Line 277... |
Line 280... |
|
|
//
|
//
|
// Decode of multicycle
|
// Decode of multicycle
|
//
|
//
|
always @(id_insn) begin
|
always @(id_insn) begin
|
case (id_insn[31:26]) // synopsys full_case parallel_case
|
case (id_insn[31:26]) // synopsys parallel_case
|
`ifdef UNUSED
|
`ifdef UNUSED
|
// l.lwz
|
// l.lwz
|
`OR1200_OR32_LWZ:
|
`OR1200_OR32_LWZ:
|
multicycle = `OR1200_TWO_CYCLES;
|
multicycle = `OR1200_TWO_CYCLES;
|
|
|
Line 328... |
Line 331... |
|
|
//
|
//
|
// Decode of imm_signextend
|
// Decode of imm_signextend
|
//
|
//
|
always @(id_insn) begin
|
always @(id_insn) begin
|
case (id_insn[31:26]) // synopsys full_case parallel_case
|
case (id_insn[31:26]) // synopsys parallel_case
|
|
|
// l.addi
|
// l.addi
|
`OR1200_OR32_ADDI:
|
`OR1200_OR32_ADDI:
|
imm_signextend = 1'b1;
|
imm_signextend = 1'b1;
|
|
|
Line 368... |
Line 371... |
//
|
//
|
// LSU addr offset
|
// LSU addr offset
|
//
|
//
|
always @(lsu_op or ex_insn) begin
|
always @(lsu_op or ex_insn) begin
|
lsu_addrofs[10:0] = ex_insn[10:0];
|
lsu_addrofs[10:0] = ex_insn[10:0];
|
case(lsu_op) // synopsys parallel_case full_case
|
case(lsu_op) // synopsys parallel_case
|
`OR1200_LSUOP_SW, `OR1200_LSUOP_SH, `OR1200_LSUOP_SB :
|
`OR1200_LSUOP_SW, `OR1200_LSUOP_SH, `OR1200_LSUOP_SB :
|
lsu_addrofs[31:11] = {{16{ex_insn[25]}}, ex_insn[25:21]};
|
lsu_addrofs[31:11] = {{16{ex_insn[25]}}, ex_insn[25:21]};
|
default :
|
default :
|
lsu_addrofs[31:11] = {{16{ex_insn[15]}}, ex_insn[15:11]};
|
lsu_addrofs[31:11] = {{16{ex_insn[15]}}, ex_insn[15:11]};
|
endcase
|
endcase
|
Line 385... |
Line 388... |
if (rst)
|
if (rst)
|
rf_addrw <= #1 5'd0;
|
rf_addrw <= #1 5'd0;
|
else if (!ex_freeze & id_freeze)
|
else if (!ex_freeze & id_freeze)
|
rf_addrw <= #1 5'd00;
|
rf_addrw <= #1 5'd00;
|
else if (!ex_freeze)
|
else if (!ex_freeze)
|
case (pre_branch_op) // synopsys parallel_case full_case
|
case (pre_branch_op) // synopsys parallel_case
|
`OR1200_BRANCHOP_JR, `OR1200_BRANCHOP_BAL:
|
`OR1200_BRANCHOP_JR, `OR1200_BRANCHOP_BAL:
|
rf_addrw <= #1 5'd09; // link register r9
|
rf_addrw <= #1 5'd09; // link register r9
|
default:
|
default:
|
rf_addrw <= #1 id_insn[25:21];
|
rf_addrw <= #1 id_insn[25:21];
|
endcase
|
endcase
|
Line 459... |
Line 462... |
//
|
//
|
always @(posedge clk or posedge rst) begin
|
always @(posedge clk or posedge rst) begin
|
if (rst)
|
if (rst)
|
sel_imm <= #1 1'b0;
|
sel_imm <= #1 1'b0;
|
else if (!id_freeze) begin
|
else if (!id_freeze) begin
|
case (if_insn[31:26]) // synopsys full_case parallel_case
|
case (if_insn[31:26]) // synopsys parallel_case
|
|
|
// j.jalr
|
// j.jalr
|
`OR1200_OR32_JALR:
|
`OR1200_OR32_JALR:
|
sel_imm <= #1 1'b0;
|
sel_imm <= #1 1'b0;
|
|
|
Line 532... |
Line 535... |
if (rst)
|
if (rst)
|
except_illegal <= #1 1'b0;
|
except_illegal <= #1 1'b0;
|
else if (!ex_freeze & id_freeze | flushpipe)
|
else if (!ex_freeze & id_freeze | flushpipe)
|
except_illegal <= #1 1'b0;
|
except_illegal <= #1 1'b0;
|
else if (!ex_freeze) begin
|
else if (!ex_freeze) begin
|
case (id_insn[31:26]) // synopsys full_case parallel_case
|
case (id_insn[31:26]) // synopsys parallel_case
|
|
|
`OR1200_OR32_J,
|
`OR1200_OR32_J,
|
`OR1200_OR32_JAL,
|
`OR1200_OR32_JAL,
|
`OR1200_OR32_JALR,
|
`OR1200_OR32_JALR,
|
`OR1200_OR32_JR,
|
`OR1200_OR32_JR,
|
Line 586... |
Line 589... |
if (rst)
|
if (rst)
|
alu_op <= #1 `OR1200_ALUOP_NOP;
|
alu_op <= #1 `OR1200_ALUOP_NOP;
|
else if (!ex_freeze & id_freeze | flushpipe)
|
else if (!ex_freeze & id_freeze | flushpipe)
|
alu_op <= #1 `OR1200_ALUOP_NOP;
|
alu_op <= #1 `OR1200_ALUOP_NOP;
|
else if (!ex_freeze) begin
|
else if (!ex_freeze) begin
|
case (id_insn[31:26]) // synopsys full_case parallel_case
|
case (id_insn[31:26]) // synopsys parallel_case
|
|
|
// l.j
|
// l.j
|
`OR1200_OR32_J:
|
`OR1200_OR32_J:
|
alu_op <= #1 `OR1200_ALUOP_IMM;
|
alu_op <= #1 `OR1200_ALUOP_IMM;
|
|
|
Line 675... |
Line 678... |
if (rst)
|
if (rst)
|
mac_op <= #1 `OR1200_MACOP_NOP;
|
mac_op <= #1 `OR1200_MACOP_NOP;
|
else if (!ex_freeze & id_freeze | flushpipe)
|
else if (!ex_freeze & id_freeze | flushpipe)
|
mac_op <= #1 `OR1200_MACOP_NOP;
|
mac_op <= #1 `OR1200_MACOP_NOP;
|
else if (!ex_freeze)
|
else if (!ex_freeze)
|
case (id_insn[31:26]) // synopsys full_case parallel_case
|
case (id_insn[31:26]) // synopsys parallel_case
|
|
|
// l.maci
|
// l.maci
|
`OR1200_OR32_MACI:
|
`OR1200_OR32_MACI:
|
mac_op <= #1 `OR1200_MACOP_MAC;
|
mac_op <= #1 `OR1200_MACOP_MAC;
|
|
|
Line 717... |
Line 720... |
if (rst)
|
if (rst)
|
rfwb_op <= #1 `OR1200_RFWBOP_NOP;
|
rfwb_op <= #1 `OR1200_RFWBOP_NOP;
|
else if (!ex_freeze & id_freeze | flushpipe)
|
else if (!ex_freeze & id_freeze | flushpipe)
|
rfwb_op <= #1 `OR1200_RFWBOP_NOP;
|
rfwb_op <= #1 `OR1200_RFWBOP_NOP;
|
else if (!ex_freeze) begin
|
else if (!ex_freeze) begin
|
case (id_insn[31:26]) // synopsys full_case parallel_case
|
case (id_insn[31:26]) // synopsys parallel_case
|
|
|
// j.jal
|
// j.jal
|
`OR1200_OR32_JAL:
|
`OR1200_OR32_JAL:
|
rfwb_op <= #1 `OR1200_RFWBOP_LR;
|
rfwb_op <= #1 `OR1200_RFWBOP_LR;
|
|
|
Line 805... |
Line 808... |
if (rst)
|
if (rst)
|
pre_branch_op <= #1 `OR1200_BRANCHOP_NOP;
|
pre_branch_op <= #1 `OR1200_BRANCHOP_NOP;
|
else if (flushpipe)
|
else if (flushpipe)
|
pre_branch_op <= #1 `OR1200_BRANCHOP_NOP;
|
pre_branch_op <= #1 `OR1200_BRANCHOP_NOP;
|
else if (!id_freeze) begin
|
else if (!id_freeze) begin
|
case (if_insn[31:26]) // synopsys full_case parallel_case
|
case (if_insn[31:26]) // synopsys parallel_case
|
|
|
// l.j
|
// l.j
|
`OR1200_OR32_J:
|
`OR1200_OR32_J:
|
pre_branch_op <= #1 `OR1200_BRANCHOP_BAL;
|
pre_branch_op <= #1 `OR1200_BRANCHOP_BAL;
|
|
|
Line 863... |
Line 866... |
if (rst)
|
if (rst)
|
lsu_op <= #1 `OR1200_LSUOP_NOP;
|
lsu_op <= #1 `OR1200_LSUOP_NOP;
|
else if (!ex_freeze & id_freeze | flushpipe)
|
else if (!ex_freeze & id_freeze | flushpipe)
|
lsu_op <= #1 `OR1200_LSUOP_NOP;
|
lsu_op <= #1 `OR1200_LSUOP_NOP;
|
else if (!ex_freeze) begin
|
else if (!ex_freeze) begin
|
case (id_insn[31:26]) // synopsys full_case parallel_case
|
case (id_insn[31:26]) // synopsys parallel_case
|
|
|
// l.lwz
|
// l.lwz
|
`OR1200_OR32_LWZ:
|
`OR1200_OR32_LWZ:
|
lsu_op <= #1 `OR1200_LSUOP_LWZ;
|
lsu_op <= #1 `OR1200_LSUOP_LWZ;
|
|
|