ALU configurability changes

-stuff that was ZBA supported was in ZBB so I changed that
This commit is contained in:
Kevin Kim 2023-02-13 14:00:06 -08:00
parent c9e6b9aeef
commit ed6a0466ad

View File

@ -55,7 +55,7 @@ module alu #(parameter WIDTH=32) (
// Addition // Addition
if (`ZBB_SUPPORTED) if (`ZBA_SUPPORTED)
always_comb begin always_comb begin
case({Funct7, Funct3, W64}) case({Funct7, Funct3, W64})
11'b0010000_010_0: CondShiftA = {A[WIDTH-1:1], {1'b0}}; //sh1add 11'b0010000_010_0: CondShiftA = {A[WIDTH-1:1], {1'b0}}; //sh1add
@ -67,7 +67,12 @@ module alu #(parameter WIDTH=32) (
11'b0010000_110_1: CondShiftA = {{29{1'b0}},A[31:0], {3'b0}}; //sh3add.uw 11'b0010000_110_1: CondShiftA = {{29{1'b0}},A[31:0], {3'b0}}; //sh3add.uw
default: CondShiftA = A; default: CondShiftA = A;
endcase endcase
else begin
assign CondShiftA = A;
end
if (`ZBB_SUPPORTED)
always_comb begin
case ({Funct7,Funct3}) case ({Funct7,Funct3})
10'b0100000_111: InvB = 1'b1; //andn 10'b0100000_111: InvB = 1'b1; //andn
10'b0100000_110: InvB = 1'b1; //orn 10'b0100000_110: InvB = 1'b1; //orn
@ -83,8 +88,8 @@ module alu #(parameter WIDTH=32) (
endcase endcase
end end
else begin else begin
assign CondShiftA = A; InvB = 1'b0;
assign InvB = 1'b0; Rotate = 1'b0;
end end
assign CondInvB = (SubArith | InvB) ? ~B : B; assign CondInvB = (SubArith | InvB) ? ~B : B;