]> Joshua Wise's Git repositories - firearm.git/commitdiff
Decode: Fix stupid bug in which stalls did not stall the decoder.
authorJoshua Wise <joshua@rebirth.joshuawise.com>
Fri, 9 Jan 2009 09:25:36 +0000 (04:25 -0500)
committerJoshua Wise <joshua@rebirth.joshuawise.com>
Fri, 9 Jan 2009 09:25:36 +0000 (04:25 -0500)
Decode.v
system.v

index 9bfb03ddf9e63c6b3c21c6a4b7bbf735faf67136..c63fd9d24422fa05bf0ebe4d7d6db6129f8a00c0 100644 (file)
--- 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
index d7fc62cea3631c4664160373c32875a77fb2f816..daa65ab7c5b6f4c10e5b66d35046510066d85d0e 100644 (file)
--- 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),
This page took 0.028681 seconds and 4 git commands to generate.