From: Joshua Wise Date: Fri, 9 Jan 2009 09:25:36 +0000 (-0500) Subject: Decode: Fix stupid bug in which stalls did not stall the decoder. X-Git-Url: http://git.joshuawise.com/firearm.git/commitdiff_plain/e74c793647b821882d694fc3c8fe659ba7a62a77?hp=-c Decode: Fix stupid bug in which stalls did not stall the decoder. --- e74c793647b821882d694fc3c8fe659ba7a62a77 diff --git a/Decode.v b/Decode.v index 9bfb03d..c63fd9d 100644 --- a/Decode.v +++ b/Decode.v @@ -2,6 +2,7 @@ module Decode( input clk, + input stall, input [31:0] insn, input [31:0] inpc, input [31:0] incpsr, @@ -226,12 +227,15 @@ module Decode( always @ (posedge clk) begin - op0 <= op0_out; /* Rn - always */ - op1 <= op1_out; /* 'operand 2' - Rm */ - op2 <= op2_out; /* thirdedge - Rs */ - carry <= carry_out; - outcpsr <= incpsr; - outspsr <= inspsr; + if (!stall) + begin + op0 <= op0_out; /* Rn - always */ + op1 <= op1_out; /* 'operand 2' - Rm */ + op2 <= op2_out; /* thirdedge - Rs */ + carry <= carry_out; + outcpsr <= incpsr; + outspsr <= inspsr; + end end endmodule diff --git a/system.v b/system.v index d7fc62c..daa65ab 100644 --- a/system.v +++ b/system.v @@ -158,6 +158,7 @@ module System(input clk); Decode decode( .clk(clk), + .stall(stall_cause_execute), .insn(insn_out_fetch), .inpc(pc_out_fetch), .incpsr(writeback_out_cpsr), .inspsr(writeback_out_spsr), .op0(decode_out_op0), .op1(decode_out_op1), .op2(decode_out_op2), .carry(decode_out_carry), .outcpsr(decode_out_cpsr), .outspsr(decode_out_spsr),