Fix WFI instruction

It repeated instructions after it multiple times when not going to sleep
This commit is contained in:
Andreas Traber 2015-08-31 10:55:16 +02:00
parent b84dde00b8
commit 387642f094

View file

@ -1045,7 +1045,8 @@ module controller
if (fetch_enable_i || irq_present_i)
begin
ctrl_fsm_ns = DECODE;
if (instr_ack_i == 1'b1)
ctrl_fsm_ns = DECODE;
end
end // case: SLEEP
@ -1091,6 +1092,7 @@ module controller
if (pipe_flush || exc_pipe_flush_i)
begin
halt_if = 1'b1;
halt_id = 1'b1;
ctrl_fsm_ns = FLUSH_EX;
end
@ -1179,19 +1181,17 @@ module controller
halt_if = 1'b1;
halt_id = 1'b1;
if(~stall_wb_o)
begin
if (fetch_enable_i == 1'b0)
if (~fetch_enable_i) begin
// we are requested to go to sleep
if(~stall_wb_o)
ctrl_fsm_ns = SLEEP;
else
begin
// unstall pipeline and continue operation
halt_if = 1'b1;
halt_id = 1'b0;
end else begin
// unstall pipeline and continue operation
halt_if = 1'b0;
halt_id = 1'b0;
if (~stall_id_o)
ctrl_fsm_ns = DECODE;
end
if (~stall_id_o)
ctrl_fsm_ns = DECODE;
end
end
endcase