Line 1043... |
Line 1043... |
if (i_rst)
|
if (i_rst)
|
begin
|
begin
|
alu_wr <= 1'b0;
|
alu_wr <= 1'b0;
|
alF_wr <= 1'b0;
|
alF_wr <= 1'b0;
|
end else if (alu_ce)
|
end else if (alu_ce)
|
|
`ifdef OPT_ILLEGAL_INSTRUCTION
|
|
begin
|
|
// alu_reg <= opR;
|
|
alu_wr <= (opR_wr)&&(set_cond)&&(~op_illegal);
|
|
alF_wr <= (opF_wr)&&(set_cond);
|
|
end else if (~alu_busy) begin
|
|
// These are strobe signals, so clear them if not
|
|
// set for any particular clock
|
|
alu_wr <= (i_halt)&&(i_dbg_we);
|
|
alF_wr <= 1'b0;
|
|
end
|
|
`else
|
begin
|
begin
|
// alu_reg <= opR;
|
// alu_reg <= opR;
|
alu_wr <= (opR_wr)&&(set_cond);
|
alu_wr <= (opR_wr)&&(set_cond);
|
alF_wr <= (opF_wr)&&(set_cond);
|
alF_wr <= (opF_wr)&&(set_cond);
|
end else if (~alu_busy) begin
|
end else if (~alu_busy) begin
|
// These are strobe signals, so clear them if not
|
// These are strobe signals, so clear them if not
|
// set for any particular clock
|
// set for any particular clock
|
alu_wr <= (i_halt)&&(i_dbg_we);
|
alu_wr <= (i_halt)&&(i_dbg_we);
|
alF_wr <= 1'b0;
|
alF_wr <= 1'b0;
|
end
|
end
|
|
`endif
|
|
|
`ifdef OPT_VLIW
|
`ifdef OPT_VLIW
|
reg r_alu_phase;
|
reg r_alu_phase;
|
initial r_alu_phase = 1'b0;
|
initial r_alu_phase = 1'b0;
|
always @(posedge i_clk)
|
always @(posedge i_clk)
|
Line 1089... |
Line 1102... |
if ((alu_ce)||((master_ce)&&(opvalid_mem)&&(~clear_pipeline)
|
if ((alu_ce)||((master_ce)&&(opvalid_mem)&&(~clear_pipeline)
|
&&(~mem_stalled)))
|
&&(~mem_stalled)))
|
alu_pc <= op_pc;
|
alu_pc <= op_pc;
|
|
|
`ifdef OPT_ILLEGAL_INSTRUCTION
|
`ifdef OPT_ILLEGAL_INSTRUCTION
|
reg r_alu_illegal;
|
/*
|
initial r_alu_illegal = 0;
|
reg r_alu_illegal;
|
always @(posedge i_clk)
|
initial r_alu_illegal = 0;
|
if (clear_pipeline)
|
always @(posedge i_clk)
|
r_alu_illegal <= 1'b0;
|
if (clear_pipeline)
|
else if ((alu_ce)||(mem_ce))
|
r_alu_illegal <= 1'b0;
|
r_alu_illegal <= op_illegal;
|
else if ((alu_ce)||(mem_ce))
|
assign alu_illegal = (alu_illegal_op)||(r_alu_illegal);
|
r_alu_illegal <= op_illegal;
|
|
||(r_alu_illegal);
|
|
*/
|
|
assign alu_illegal = (alu_illegal_op);
|
`endif
|
`endif
|
|
|
// This _almost_ is equal to (alu_ce)||(mem_ce). The only
|
// This _almost_ is equal to (alu_ce)||(mem_ce). The only
|
// problem is that mem_ce is gated by the set_cond, and
|
// problem is that mem_ce is gated by the set_cond, and
|
// the PC will be valid independent of the set condition. Hence, this
|
// the PC will be valid independent of the set condition. Hence, this
|
Line 1185... |
Line 1201... |
// Note that the flags needed to be checked before issuing the
|
// Note that the flags needed to be checked before issuing the
|
// bus instruction, so they don't need to be checked here.
|
// bus instruction, so they don't need to be checked here.
|
// Further, alu_wr includes (set_cond), so we don't need to
|
// Further, alu_wr includes (set_cond), so we don't need to
|
// check for that here either.
|
// check for that here either.
|
`ifdef OPT_ILLEGAL_INSTRUCTION
|
`ifdef OPT_ILLEGAL_INSTRUCTION
|
assign wr_reg_ce = (~alu_illegal)&&
|
assign wr_reg_ce = (((alu_wr)&&(~clear_pipeline)
|
(((alu_wr)&&(~clear_pipeline)
|
|
&&((alu_valid)||(div_valid)||(fpu_valid)))
|
&&((alu_valid)||(div_valid)||(fpu_valid)))
|
||(mem_valid));
|
||(mem_valid));
|
`else
|
`else
|
assign wr_reg_ce = ((alu_wr)&&(~clear_pipeline))||(mem_valid)||(div_valid)||(fpu_valid);
|
assign wr_reg_ce = ((alu_wr)&&(~clear_pipeline))||(mem_valid)||(div_valid)||(fpu_valid);
|
`endif
|
`endif
|