Fixed disabling MulDiv when not supported. Started adding generate for FPU unsupported

This commit is contained in:
David Harris 2021-07-04 19:33:46 -04:00
parent 004cac91e1
commit ac163e091c
2 changed files with 351 additions and 331 deletions

View File

@ -43,6 +43,10 @@ module fpu (
output logic [4:0] SetFflagsM, // FPU flags output logic [4:0] SetFflagsM, // FPU flags
output logic [`XLEN-1:0] FPUResultW); // FPU result output logic [`XLEN-1:0] FPUResultW); // FPU result
// *** change FMA to do 16 - 32 - 64 - 128 FEXPBITS // *** change FMA to do 16 - 32 - 64 - 128 FEXPBITS
/*generate
if (`F_SUPPORTED) begin */
// control logic signal instantiation // control logic signal instantiation
logic FWriteEnD, FWriteEnE, FWriteEnM, FWriteEnW; // FP register write enable logic FWriteEnD, FWriteEnE, FWriteEnM, FWriteEnW; // FP register write enable
logic [2:0] FrmD, FrmE, FrmM; // FP rounding mode logic [2:0] FrmD, FrmE, FrmM; // FP rounding mode
@ -362,7 +366,7 @@ module fpu (
//***turn into muxs //***turn into muxs
always_comb begin always_comb begin
case (FResultSelW) case (FResultSelW)
3'b000 : FPUFlagsW = 5'b0; 3'b000 : FPUFlagsW = 5'b0;
@ -392,11 +396,25 @@ module fpu (
// define offsets for LSB zero extension or truncation // define offsets for LSB zero extension or truncation
always_comb begin always_comb begin
// zero extension // zero extension
//***turn into mux //***turn into mux
FPUResultW = FmtW ? FPUResult64W[63:64-`XLEN] : {{`XLEN-32{1'b0}}, FPUResult64W[63:32]}; FPUResultW = FmtW ? FPUResult64W[63:64-`XLEN] : {{`XLEN-32{1'b0}}, FPUResult64W[63:32]};
//*** put into mem stage //*** put into mem stage
SetFflagsM = FPUFlagsW; SetFflagsM = FPUFlagsW;
end end
/* end else begin
assign FStallD = 0;
assign FWriteIntE = 0;
assign FWriteIntM = 0;
assign FWriteIntW = 0;
assign FWriteDataE = 0;
assign FIntResM = 0;
assign FDivBusyE = 0;
assign IllegalFPUInstrD = 0;
assign SetFflagsM = 0;
assign FPUResultW = 0;
end
endgenerate*/
endmodule // fpu endmodule // fpu

View File

@ -139,6 +139,8 @@ module muldiv (
end else begin // no M instructions supported end else begin // no M instructions supported
assign MulDivResultW = 0; assign MulDivResultW = 0;
assign DivBusyE = 0;
assign DivDoneE = 0;
end end
endgenerate endgenerate