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 9bfb03d..c63fd9d 100644 (file)
--- a/Decode.v
+++ b/Decode.v
@@ -2,6 +2,7 @@
 
 module Decode(
        input clk,
 
 module Decode(
        input clk,
+       input stall,
        input [31:0] insn,
        input [31:0] inpc,
        input [31:0] incpsr,
        input [31:0] insn,
        input [31:0] inpc,
        input [31:0] incpsr,
@@ -226,12 +227,15 @@ module Decode(
 
        
        always @ (posedge clk) begin
 
        
        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
        end
 
 endmodule
index d7fc62c..daa65ab 100644 (file)
--- a/system.v
+++ b/system.v
@@ -158,6 +158,7 @@ module System(input clk);
        
        Decode decode(
                .clk(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),
                .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.023035 seconds and 4 git commands to generate.