Merge pull request #327 from harshinisrinath1001/main

Fixed the spacing in the fpu module
This commit is contained in:
Ross Thompson 2023-06-12 11:53:52 -04:00 committed by GitHub
commit e5bae37b0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 156 additions and 179 deletions

View File

@ -151,5 +151,4 @@ module fcmp import cvw::*; #(parameter cvw_t P) (
// - inf = inf and -inf = -inf // - inf = inf and -inf = -inf
// - return 0 if comparison with NaN (unordered) // - return 0 if comparison with NaN (unordered)
assign CmpIntRes = {(P.XLEN-1)'(0), (((EQ|BothZero)&OpCtrl[1])|(LT&OpCtrl[0]&~BothZero))&~EitherNaN}; assign CmpIntRes = {(P.XLEN-1)'(0), (((EQ|BothZero)&OpCtrl[1])|(LT&OpCtrl[0]&~BothZero))&~EitherNaN};
endmodule endmodule

View File

@ -1,4 +1,3 @@
/////////////////////////////////////////// ///////////////////////////////////////////
// fcvt.sv // fcvt.sv
// //
@ -222,5 +221,4 @@ module fcvt import cvw::*; #(parameter cvw_t P) (
if(Int64) Cs = Int[P.XLEN-1]&Signed; if(Int64) Cs = Int[P.XLEN-1]&Signed;
else Cs = Int[31]&Signed; else Cs = Int[31]&Signed;
else Cs = Xs; else Cs = Xs;
endmodule endmodule

View File

@ -56,7 +56,6 @@ module fhazard(
// if the needed value is in the writeback stage // if the needed value is in the writeback stage
end else if ((Adr1E == RdW) & FRegWriteW) ForwardXE = 2'b01; // choose FResult64W end else if ((Adr1E == RdW) & FRegWriteW) ForwardXE = 2'b01; // choose FResult64W
// if the needed value is in the memory stage - input 2 // if the needed value is in the memory stage - input 2
if ((Adr2E == RdM) & FRegWriteM) begin if ((Adr2E == RdM) & FRegWriteM) begin
// if the result will be FResM (can be taken from the memory stage) // if the result will be FResM (can be taken from the memory stage)
@ -64,7 +63,6 @@ module fhazard(
// if the needed value is in the writeback stage // if the needed value is in the writeback stage
end else if ((Adr2E == RdW) & FRegWriteW) ForwardYE = 2'b01; // choose FResult64W end else if ((Adr2E == RdW) & FRegWriteW) ForwardYE = 2'b01; // choose FResult64W
// if the needed value is in the memory stage - input 3 // if the needed value is in the memory stage - input 3
if ((Adr3E == RdM) & FRegWriteM) begin if ((Adr3E == RdM) & FRegWriteM) begin
// if the result will be FResM (can be taken from the memory stage) // if the result will be FResM (can be taken from the memory stage)
@ -72,5 +70,4 @@ module fhazard(
// if the needed value is in the writeback stage // if the needed value is in the writeback stage
end else if ((Adr3E == RdW) & FRegWriteW) ForwardZE = 2'b01; // choose FResult64W end else if ((Adr3E == RdW) & FRegWriteW) ForwardZE = 2'b01; // choose FResult64W
end end
endmodule endmodule

View File

@ -262,7 +262,6 @@ module fpu import cvw::*; #(parameter cvw_t P) (
.ToInt(FWriteIntE), .XZero(XZeroE), .Fmt(FmtE), .Ce(CeE), .ShiftAmt(CvtShiftAmtE), .ToInt(FWriteIntE), .XZero(XZeroE), .Fmt(FmtE), .Ce(CeE), .ShiftAmt(CvtShiftAmtE),
.ResSubnormUf(CvtResSubnormUfE), .Cs(CsE), .IntZero(IntZeroE), .LzcIn(CvtLzcInE)); .ResSubnormUf(CvtResSubnormUfE), .Cs(CsE), .IntZero(IntZeroE), .LzcIn(CvtLzcInE));
// NaN Box SrcA to convert integer to requested FP size // NaN Box SrcA to convert integer to requested FP size
if(P.FPSIZES == 1) assign AlignedSrcAE = {{P.FLEN-P.XLEN{1'b1}}, ForwardedSrcAE}; if(P.FPSIZES == 1) assign AlignedSrcAE = {{P.FLEN-P.XLEN{1'b1}}, ForwardedSrcAE};
else if(P.FPSIZES == 2) else if(P.FPSIZES == 2)

View File

@ -51,4 +51,3 @@ module fregfile #(parameter FLEN) (
assign #2 rd3 = rf[a3]; assign #2 rd3 = rf[a3];
endmodule // regfile endmodule // regfile

View File

@ -73,5 +73,4 @@ module fsgninj import cvw::*; #(parameter cvw_t P) (
endcase endcase
assign SgnRes = {SgnBits[3], X[P.Q_LEN-2:P.D_LEN], SgnBits[2], X[P.D_LEN-2:P.S_LEN], SgnBits[1], X[P.S_LEN-2:P.H_LEN], SgnBits[0], X[P.H_LEN-2:0]}; assign SgnRes = {SgnBits[3], X[P.Q_LEN-2:P.D_LEN], SgnBits[2], X[P.D_LEN-2:P.S_LEN], SgnBits[1], X[P.S_LEN-2:P.H_LEN], SgnBits[0], X[P.H_LEN-2:0]};
end end
endmodule endmodule

View File

@ -107,7 +107,6 @@ module unpackinput import cvw::*; #(parameter cvw_t P) (
// is the exponent all 1's // is the exponent all 1's
assign ExpMax = Fmt ? &In[P.FLEN-2:P.NF] : &In[P.LEN1-2:P.NF1]; assign ExpMax = Fmt ? &In[P.FLEN-2:P.NF] : &In[P.LEN1-2:P.NF1];
end else if (P.FPSIZES == 3) begin // three floating point precsions supported end else if (P.FPSIZES == 3) begin // three floating point precsions supported
// largest format | larger format | smallest format // largest format | larger format | smallest format
@ -247,7 +246,6 @@ module unpackinput import cvw::*; #(parameter cvw_t P) (
2'b10: Sgn = In[P.H_LEN-1]; 2'b10: Sgn = In[P.H_LEN-1];
endcase endcase
// extract the fraction // extract the fraction
always_comb always_comb
case (Fmt) case (Fmt)
@ -266,7 +264,6 @@ module unpackinput import cvw::*; #(parameter cvw_t P) (
2'b10: ExpNonZero = |In[P.H_LEN-2:P.H_NF]; 2'b10: ExpNonZero = |In[P.H_LEN-2:P.H_NF];
endcase endcase
// example double to single conversion: // example double to single conversion:
// 1023 = 0011 1111 1111 // 1023 = 0011 1111 1111
// 127 = 0000 0111 1111 (subtract this) // 127 = 0000 0111 1111 (subtract this)
@ -285,7 +282,6 @@ module unpackinput import cvw::*; #(parameter cvw_t P) (
2'b10: Exp = {In[P.H_LEN-2], {P.Q_NE-P.H_NE{~In[P.H_LEN-2]}}, In[P.H_LEN-3:P.H_NF+1], In[P.H_NF]|~ExpNonZero}; 2'b10: Exp = {In[P.H_LEN-2], {P.Q_NE-P.H_NE{~In[P.H_LEN-2]}}, In[P.H_LEN-3:P.H_NF+1], In[P.H_NF]|~ExpNonZero};
endcase endcase
// is the exponent all 1's // is the exponent all 1's
always_comb always_comb
case (Fmt) case (Fmt)

View File

@ -33,5 +33,3 @@ module adder #(parameter WIDTH=8) (
assign y = a + b; assign y = a + b;
endmodule endmodule

View File

@ -36,5 +36,3 @@ module counter #(parameter WIDTH=8) (
assign qnext = q + 1; assign qnext = q + 1;
flopenr #(WIDTH) cntrflop(clk, reset, en, qnext, q); flopenr #(WIDTH) cntrflop(clk, reset, en, qnext, q);
endmodule endmodule

View File

@ -32,4 +32,3 @@ module neg #(parameter WIDTH = 8) (
assign y = ~a + 1; assign y = ~a + 1;
endmodule endmodule

View File

@ -48,5 +48,3 @@ module or_rows #(parameter ROWS = 8, COLS=2) (
/* verilator lint_on UNOPTFLAT */ /* verilator lint_on UNOPTFLAT */
end end
endmodule endmodule

View File

@ -48,6 +48,3 @@ module prioritythermometer #(parameter N = 8) (
end end
/* verilator lint_on UNOPTFLAT */ /* verilator lint_on UNOPTFLAT */
endmodule endmodule