mirror of
https://github.com/openhwgroup/cvw.git
synced 2025-04-24 13:57:07 -04:00
formatting
This commit is contained in:
parent
e9f90050d5
commit
fce62fc213
2 changed files with 9 additions and 7 deletions
|
@ -93,7 +93,7 @@ module alu #(parameter WIDTH=32) (
|
||||||
mux2 #(WIDTH) rotmux(A, {A[31:0], A[31:0]}, W64, rotA);
|
mux2 #(WIDTH) rotmux(A, {A[31:0], A[31:0]}, W64, rotA);
|
||||||
end else assign rotA = A;
|
end else assign rotA = A;
|
||||||
|
|
||||||
if (`ZBA_SUPPORTED) begin: zbamuxes
|
if (`ZBA_SUPPORTED) begin: zbapreshift
|
||||||
// Pre-Shift
|
// Pre-Shift
|
||||||
assign CondShiftA = CondExtA << (PreShiftAmt);
|
assign CondShiftA = CondExtA << (PreShiftAmt);
|
||||||
end else assign CondShiftA = A;
|
end else assign CondShiftA = A;
|
||||||
|
@ -103,7 +103,7 @@ module alu #(parameter WIDTH=32) (
|
||||||
assign {Carry, Sum} = CondShiftA + CondMaskInvB + {{(WIDTH-1){1'b0}}, SubArith};
|
assign {Carry, Sum} = CondShiftA + CondMaskInvB + {{(WIDTH-1){1'b0}}, SubArith};
|
||||||
|
|
||||||
// Shifts (configurable for rotation)
|
// Shifts (configurable for rotation)
|
||||||
shifter sh(.shA(CondExtA), .Sign(shSignA), .rotA(rotA), .Amt(B[`LOG_XLEN-1:0]), .Right(Funct3[2]), .W64(W64), .Y(Shift), .Rotate(Rotate));
|
shifter sh(.shA(CondExtA), .Sign(shSignA), .rotA, .Amt(B[`LOG_XLEN-1:0]), .Right(Funct3[2]), .W64, .Y(Shift), .Rotate);
|
||||||
|
|
||||||
// Condition code flags are based on subtraction output Sum = A-B.
|
// Condition code flags are based on subtraction output Sum = A-B.
|
||||||
// Overflow occurs when the numbers being subtracted have the opposite sign
|
// Overflow occurs when the numbers being subtracted have the opposite sign
|
||||||
|
@ -125,9 +125,9 @@ module alu #(parameter WIDTH=32) (
|
||||||
3'b010: FullResult = {{(WIDTH-1){1'b0}}, LT}; // slt
|
3'b010: FullResult = {{(WIDTH-1){1'b0}}, LT}; // slt
|
||||||
3'b011: FullResult = {{(WIDTH-1){1'b0}}, LTU}; // sltu
|
3'b011: FullResult = {{(WIDTH-1){1'b0}}, LTU}; // sltu
|
||||||
3'b100: FullResult = A ^ CondMaskInvB; // xor, xnor, binv
|
3'b100: FullResult = A ^ CondMaskInvB; // xor, xnor, binv
|
||||||
|
3'b101: FullResult = {{(WIDTH-1){1'b0}},{|(A & CondMaskB)}};// bext
|
||||||
3'b110: FullResult = A | CondMaskInvB; // or, orn, bset
|
3'b110: FullResult = A | CondMaskInvB; // or, orn, bset
|
||||||
3'b111: FullResult = A & CondMaskInvB; // and, bclr
|
3'b111: FullResult = A & CondMaskInvB; // and, bclr
|
||||||
3'b101: FullResult = {{(WIDTH-1){1'b0}},{|(A & CondMaskB)}};// bext
|
|
||||||
endcase
|
endcase
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
|
@ -145,15 +145,15 @@ module alu #(parameter WIDTH=32) (
|
||||||
end
|
end
|
||||||
|
|
||||||
if (`ZBC_SUPPORTED | `ZBB_SUPPORTED) begin: bitreverse
|
if (`ZBC_SUPPORTED | `ZBB_SUPPORTED) begin: bitreverse
|
||||||
bitreverse #(WIDTH) brA(.a(A), .b(RevA));
|
bitreverse #(WIDTH) brA(.A, .RevA);
|
||||||
end
|
end
|
||||||
|
|
||||||
if (`ZBC_SUPPORTED) begin: zbc
|
if (`ZBC_SUPPORTED) begin: zbc
|
||||||
zbc #(WIDTH) ZBC(.A(A), .RevA(RevA), .B(B), .Funct3(Funct3), .ZBCResult(ZBCResult));
|
zbc #(WIDTH) ZBC(.A, .RevA, .B, .Funct3, .ZBCResult);
|
||||||
end else assign ZBCResult = 0;
|
end else assign ZBCResult = 0;
|
||||||
|
|
||||||
if (`ZBB_SUPPORTED) begin: zbb
|
if (`ZBB_SUPPORTED) begin: zbb
|
||||||
zbb #(WIDTH) ZBB(.A(A), .RevA(RevA), .B(B), .ALUResult(ALUResult), .W64(W64), .lt(CompFlags[0]), .ZBBSelect(ZBBSelect), .ZBBResult(ZBBResult));
|
zbb #(WIDTH) ZBB(.A, .RevA, .B, .ALUResult, .W64, .lt(CompFlags[0]), .ZBBSelect, .ZBBResult);
|
||||||
end else assign ZBBResult = 0;
|
end else assign ZBBResult = 0;
|
||||||
|
|
||||||
// Support RV64I W-type addw/subw/addiw/shifts that discard upper 32 bits and sign-extend 32-bit result to 64 bits
|
// Support RV64I W-type addw/subw/addiw/shifts that discard upper 32 bits and sign-extend 32-bit result to 64 bits
|
||||||
|
|
|
@ -260,7 +260,9 @@ module controller(
|
||||||
|
|
||||||
// bit manipulation Configuration Block
|
// bit manipulation Configuration Block
|
||||||
if (`ZBS_SUPPORTED | `ZBA_SUPPORTED | `ZBB_SUPPORTED | `ZBC_SUPPORTED) begin: bitmanipi //change the conditional expression to OR any Z supported flags
|
if (`ZBS_SUPPORTED | `ZBA_SUPPORTED | `ZBB_SUPPORTED | `ZBC_SUPPORTED) begin: bitmanipi //change the conditional expression to OR any Z supported flags
|
||||||
bmuctrl bmuctrl(.clk, .reset, .StallD, .FlushD, .InstrD, .ALUSelectD, .BSelectD, .ZBBSelectD, .BRegWriteD, .BALUSrcBD, .BW64D, .BALUOpD, .BSubArithD, .IllegalBitmanipInstrD, .StallE, .FlushE, .ALUSelectE, .BSelectE, .ZBBSelectE, .BRegWriteE, .BComparatorSignedE, .BALUControlE);
|
bmuctrl bmuctrl(.clk, .reset, .StallD, .FlushD, .InstrD, .ALUSelectD, .BSelectD, .ZBBSelectD,
|
||||||
|
.BRegWriteD, .BALUSrcBD, .BW64D, .BALUOpD, .BSubArithD, .IllegalBitmanipInstrD, .StallE, .FlushE,
|
||||||
|
.ALUSelectE, .BSelectE, .ZBBSelectE, .BRegWriteE, .BComparatorSignedE, .BALUControlE);
|
||||||
if (`ZBA_SUPPORTED) begin
|
if (`ZBA_SUPPORTED) begin
|
||||||
// ALU Decoding is more comprehensive when ZBA is supported. slt and slti conflicts with sh1add, sh1add.uw
|
// ALU Decoding is more comprehensive when ZBA is supported. slt and slti conflicts with sh1add, sh1add.uw
|
||||||
assign sltD = (Funct3D == 3'b010 & (~(Funct7D[4]) | ~OpD[5])) ;
|
assign sltD = (Funct3D == 3'b010 & (~(Funct7D[4]) | ~OpD[5])) ;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue