diff --git a/hdl/arith/hazard3_alu.v b/hdl/arith/hazard3_alu.v index b89ce50..8a11844 100644 --- a/hdl/arith/hazard3_alu.v +++ b/hdl/arith/hazard3_alu.v @@ -124,7 +124,7 @@ always @ (*) begin: cpop_count integer i; cpop = {W_SHAMT+1{1'b0}}; for (i = 0; i < W_DATA; i = i + 1) begin - cpop = cpop + op_a[i]; + cpop = cpop + {{W_SHAMT{1'b0}}, op_a[i]}; end end @@ -167,7 +167,6 @@ always @ (*) begin {4'bzzzz, ALUOP_SRL }: result = shift_dout; {4'bzzzz, ALUOP_SRA }: result = shift_dout; {4'bzzzz, ALUOP_SLL }: result = shift_dout; - {4'bzzzz, ALUOP_SLL }: result = shift_dout; // Zba {4'b1zzz, ALUOP_SH1ADD }: result = sum; {4'b1zzz, ALUOP_SH2ADD }: result = sum; @@ -200,7 +199,7 @@ always @ (*) begin {4'bzzz1, ALUOP_BINV }: result = op_a ^ ~zbs_mask; {4'bzzz1, ALUOP_BEXT }: result = {{W_DATA-1{1'b0}}, shift_dout[0]}; - default: begin result = bitwise; end + default: result = bitwise; endcase end diff --git a/test/sim/common/init.S b/test/sim/common/init.S index 821d83b..5a0794e 100644 --- a/test/sim/common/init.S +++ b/test/sim/common/init.S @@ -124,6 +124,7 @@ _sbrk: mv a0, a2 ret +.p2align 2 heap_ptr: .word _end