Procházet zdrojové kódy

fpga/picorv32: fix decoding of sw/sw.u

Fix a typo in the instruction decoding of the sw/sw.u instructions,
with obviously catastrophic consequences.
H. Peter Anvin před 2 měsíci
rodič
revize
cd1183b125
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      fpga/picorv32.v

+ 1 - 1
fpga/picorv32.v

@@ -1158,7 +1158,7 @@ module picorv32 #(
 
 			instr_sb    <= is_sb_sh_sw && mem_rdata_q[14:12] == 3'b000;
 			instr_sh    <= is_sb_sh_sw && mem_rdata_q[14:12] == 3'b001;
-			instr_sw    <= is_sb_sh_sw && mem_rdata_q[14:12] == 2'b01; // Includes sw.u
+			instr_sw    <= is_sb_sh_sw && mem_rdata_q[14:13] == 2'b01; // Includes sw.u
 			instr_addi  <= is_alu_reg_imm && mem_rdata_q[14:12] == 3'b000;
 			instr_slti  <= is_alu_reg_imm && mem_rdata_q[14:12] == 3'b010;
 			instr_sltiu <= is_alu_reg_imm && mem_rdata_q[14:12] == 3'b011;