Skip to content

Commit

Permalink
🔖 Release 0.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Mach committed Jun 12, 2019
2 parents 120f7f5 + 4ead3e8 commit 3f98ba3
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 49 deletions.
10 changes: 10 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ Versions of the IP in the same major relase are "pin-compatible" with each other
### Fixed


## [0.5.6] - 2019-06-12

### Changed
- Don't care logic value can be changed from the package now
- Default pipeline config in the package is now `BEFORE`

### Fixed
- Don't care values are assigned `'1` instead of `'X` by default


## [0.5.5] - 2019-06-02

### Fixed
Expand Down
26 changes: 13 additions & 13 deletions src/fpnew_cast_multi.sv
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,11 @@ module fpnew_cast_multi #(
// Compensation for the difference in mantissa widths used for leading-zero count
assign fmt_shift_compensation[fmt] = signed'(INT_MAN_WIDTH - 1 - MAN_BITS);
end else begin : inactive_format
assign info_q[fmt] = 'X; // propagate don't care (format disabled)
assign fmt_sign[fmt] = 'x; // propagate don't care (format disabled)
assign fmt_exponent[fmt] = 'X; // propagate don't care (format disabled)
assign fmt_mantissa[fmt] = 'X; // propagate don't care (format disabled)
assign fmt_shift_compensation[fmt] = 'X; // propagate don't care (format disabled)
assign info_q[fmt] = '{default: fpnew_pkg::DONT_CARE}; // format disabled
assign fmt_sign[fmt] = fpnew_pkg::DONT_CARE; // format disabled
assign fmt_exponent[fmt] = '{default: fpnew_pkg::DONT_CARE}; // format disabled
assign fmt_mantissa[fmt] = '{default: fpnew_pkg::DONT_CARE}; // format disabled
assign fmt_shift_compensation[fmt] = '{default: fpnew_pkg::DONT_CARE}; // format disabled
end
end

Expand All @@ -219,7 +219,7 @@ module fpnew_cast_multi #(
ifmt_input_val[ifmt][INT_WIDTH-1:0] = operands_q[INT_WIDTH-1:0];
end
end else begin : inactive_format
assign ifmt_input_val[ifmt] = 'X; // don't care about disabled formats
assign ifmt_input_val[ifmt] = '{default: fpnew_pkg::DONT_CARE}; // format disabled
end
end

Expand Down Expand Up @@ -492,7 +492,7 @@ module fpnew_cast_multi #(
fmt_pre_round_abs[fmt] = {final_exp[EXP_BITS-1:0], final_mant[MAN_BITS-1:0]}; // 0-extend
end
end else begin : inactive_format
assign fmt_pre_round_abs[fmt] = 'X;
assign fmt_pre_round_abs[fmt] = '{default: fpnew_pkg::DONT_CARE};
end
end

Expand All @@ -508,7 +508,7 @@ module fpnew_cast_multi #(
ifmt_pre_round_abs[ifmt][INT_WIDTH-1:0] = final_int[INT_WIDTH-1:0];
end
end else begin : inactive_format
assign ifmt_pre_round_abs[ifmt] = 'X;
assign ifmt_pre_round_abs[ifmt] = '{default: fpnew_pkg::DONT_CARE};
end
end

Expand Down Expand Up @@ -550,9 +550,9 @@ module fpnew_cast_multi #(
: {rounded_sign, rounded_abs[EXP_BITS+MAN_BITS-1:0]};
end
end else begin : inactive_format
assign fmt_uf_after_round[fmt] = 'X;
assign fmt_of_after_round[fmt] = 'X;
assign fmt_result[fmt] = 'X;
assign fmt_uf_after_round[fmt] = fpnew_pkg::DONT_CARE;
assign fmt_of_after_round[fmt] = fpnew_pkg::DONT_CARE;
assign fmt_result[fmt] = '{default: fpnew_pkg::DONT_CARE};
end
end

Expand Down Expand Up @@ -596,7 +596,7 @@ module fpnew_cast_multi #(
fmt_special_result[fmt][FP_WIDTH-1:0] = special_res;
end
end else begin : inactive_format
assign fmt_special_result[fmt] = 'X;
assign fmt_special_result[fmt] = '{default: fpnew_pkg::DONT_CARE};
end
end

Expand Down Expand Up @@ -642,7 +642,7 @@ module fpnew_cast_multi #(
ifmt_special_result[ifmt][INT_WIDTH-1:0] = special_res;
end
end else begin : inactive_format
assign ifmt_special_result[ifmt] = 'X;
assign ifmt_special_result[ifmt] = '{default: fpnew_pkg::DONT_CARE};
end
end

Expand Down
12 changes: 6 additions & 6 deletions src/fpnew_fma.sv
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@ module fpnew_fma #(
info_c = '{is_zero: 1'b1, is_boxed: 1'b1, default: 1'b0}; //zero, boxed value.
end
default: begin // propagate don't cares
operand_a = 'X;
operand_b = 'X;
operand_c = 'X;
info_a = 'X;
info_b = 'X;
info_c = 'X;
operand_a = '{default: fpnew_pkg::DONT_CARE};
operand_b = '{default: fpnew_pkg::DONT_CARE};
operand_c = '{default: fpnew_pkg::DONT_CARE};
info_a = '{default: fpnew_pkg::DONT_CARE};
info_b = '{default: fpnew_pkg::DONT_CARE};
info_c = '{default: fpnew_pkg::DONT_CARE};
end
endcase
end
Expand Down
32 changes: 16 additions & 16 deletions src/fpnew_fma_multi.sv
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ module fpnew_fma_multi #(
(SUPER_MAN_BITS - MAN_BITS); // move to left of mantissa
end
end else begin : inactive_format
assign info_q[fmt] = 'X; // propagate don't care (format disabled)
assign fmt_sign[fmt] = 'x; // propagate don't care (format disabled)
assign fmt_exponent[fmt] = 'X; // propagate don't care (format disabled)
assign fmt_mantissa[fmt] = 'X; // propagate don't care (format disabled)
assign info_q[fmt] = '{default: fpnew_pkg::DONT_CARE}; // format disabled
assign fmt_sign[fmt] = fpnew_pkg::DONT_CARE; // format disabled
assign fmt_exponent[fmt] = '{default: fpnew_pkg::DONT_CARE}; // format disabled
assign fmt_mantissa[fmt] = '{default: fpnew_pkg::DONT_CARE}; // format disabled
end
end

Expand Down Expand Up @@ -241,12 +241,12 @@ module fpnew_fma_multi #(
info_c = '{is_zero: 1'b1, is_boxed: 1'b1, default: 1'b0}; //zero, boxed value.
end
default: begin // propagate don't cares
operand_a = 'X;
operand_b = 'X;
operand_c = 'X;
info_a = 'X;
info_b = 'X;
info_c = 'X;
operand_a = '{default: fpnew_pkg::DONT_CARE};
operand_b = '{default: fpnew_pkg::DONT_CARE};
operand_c = '{default: fpnew_pkg::DONT_CARE};
info_a = '{default: fpnew_pkg::DONT_CARE};
info_b = '{default: fpnew_pkg::DONT_CARE};
info_c = '{default: fpnew_pkg::DONT_CARE};
end
endcase
end
Expand Down Expand Up @@ -332,7 +332,7 @@ module fpnew_fma_multi #(
fmt_special_result[fmt][FP_WIDTH-1:0] = special_res;
end
end else begin : inactive_format
assign fmt_special_result[fmt] = 'X;
assign fmt_special_result[fmt] = '{default: fpnew_pkg::DONT_CARE};
end
end

Expand Down Expand Up @@ -689,8 +689,8 @@ module fpnew_fma_multi #(
assign fmt_round_sticky_bits[fmt][0] = sticky_after_norm | of_before_round;
end
end else begin : inactive_format
assign fmt_pre_round_abs[fmt] = 'X;
assign fmt_round_sticky_bits[fmt] = 'X;
assign fmt_pre_round_abs[fmt] = '{default: fpnew_pkg::DONT_CARE};
assign fmt_round_sticky_bits[fmt] = '{default: fpnew_pkg::DONT_CARE};
end
end

Expand Down Expand Up @@ -734,9 +734,9 @@ module fpnew_fma_multi #(
fmt_result[fmt][FP_WIDTH-1:0] = {rounded_sign, rounded_abs[EXP_BITS+MAN_BITS-1:0]};
end
end else begin : inactive_format
assign fmt_uf_after_round[fmt] = 'X;
assign fmt_of_after_round[fmt] = 'X;
assign fmt_result[fmt] = 'X;
assign fmt_uf_after_round[fmt] = fpnew_pkg::DONT_CARE;
assign fmt_of_after_round[fmt] = fpnew_pkg::DONT_CARE;
assign fmt_result[fmt] = '{default: fpnew_pkg::DONT_CARE};
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/fpnew_i2fcast.sv
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ module fpnew_i2fcast #(
.clk_i,
.rst_ni,
.operands_i,
.is_boxed_i ( 'X ), // unused
.is_boxed_i ( '{default: fpnew_pkg::DONT_CARE} ), // unused
.rnd_mode_i,
.op_i ( fpnew_pkg::FMADD ), // unused
.op_mod_i,
Expand Down
14 changes: 7 additions & 7 deletions src/fpnew_noncomp.sv
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ module fpnew_noncomp #(
fpnew_pkg::RTZ: sgnj_result.sign = ~sign_b; // SGNJN
fpnew_pkg::RDN: sgnj_result.sign = sign_a ^ sign_b; // SGNJX
fpnew_pkg::RUP: sgnj_result = operand_a; // passthrough
default: sgnj_result = 'X; // propagate X
default: sgnj_result = '{default: fpnew_pkg::DONT_CARE}; // don't care
endcase
end

Expand Down Expand Up @@ -223,7 +223,7 @@ module fpnew_noncomp #(
unique case (rnd_mode_q)
fpnew_pkg::RNE: minmax_result = operand_a_smaller ? operand_a : operand_b; // MIN
fpnew_pkg::RTZ: minmax_result = operand_a_smaller ? operand_b : operand_a; // MAX
default: minmax_result = 'X; // propagate X
default: minmax_result = '{default: fpnew_pkg::DONT_CARE}; // don't care
endcase
end
end
Expand Down Expand Up @@ -262,7 +262,7 @@ module fpnew_noncomp #(
if (any_operand_nan) cmp_result = op_mod_q; // NaNs are valid, always campare as not equal
else cmp_result = operands_equal ^ op_mod_q;
end
default: cmp_result = 'X; // propagate X
default: cmp_result = '{default: fpnew_pkg::DONT_CARE}; // don't care
endcase
end
end
Expand Down Expand Up @@ -323,14 +323,14 @@ module fpnew_noncomp #(
extension_bit_d = cmp_extension_bit;
end
fpnew_pkg::CLASSIFY: begin
result_d = 'X; // unused
result_d = '{default: fpnew_pkg::DONT_CARE}; // unused
status_d = class_status;
extension_bit_d = class_extension_bit;
end
default: begin
result_d = 'X; // propaagate X
status_d = 'X; // propaagate X
extension_bit_d = 'X; // propaagate X
result_d = '{default: fpnew_pkg::DONT_CARE}; // dont care
status_d = '{default: fpnew_pkg::DONT_CARE}; // dont care
extension_bit_d = fpnew_pkg::DONT_CARE; // dont care
end
endcase
end
Expand Down
4 changes: 2 additions & 2 deletions src/fpnew_opgroup_block.sv
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ module fpnew_opgroup_block #(
assign fmt_out_valid[fmt] = 1'b0; // don't emit values
assign fmt_busy[fmt] = 1'b0; // never busy
// Outputs are don't care
assign fmt_outputs[fmt] = 'X;
assign fmt_outputs[fmt] = '{default: fpnew_pkg::DONT_CARE};

// Tie off disabled formats
end else if (!FpFmtMask[fmt] || (FmtUnitTypes[fmt] == fpnew_pkg::DISABLED)) begin : disable_fmt
assign fmt_in_ready[fmt] = 1'b0; // don't accept operations
assign fmt_out_valid[fmt] = 1'b0; // don't emit values
assign fmt_busy[fmt] = 1'b0; // never busy
// Outputs are don't care
assign fmt_outputs[fmt] = 'X;
assign fmt_outputs[fmt] = '{default: fpnew_pkg::DONT_CARE};
end
end

Expand Down
9 changes: 7 additions & 2 deletions src/fpnew_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ package fpnew_pkg;
'{default: MERGED}, // DIVSQRT
'{default: PARALLEL}, // NONCOMP
'{default: MERGED}}, // CONV
PipeConfig: AFTER
PipeConfig: BEFORE
};

localparam fpu_implementation_t DEFAULT_SNITCH = '{
Expand All @@ -267,9 +267,14 @@ package fpnew_pkg;
'{default: DISABLED}, // DIVSQRT
'{default: PARALLEL}, // NONCOMP
'{default: MERGED}}, // CONV
PipeConfig: AFTER
PipeConfig: BEFORE
};

// -----------------------
// Synthesis optimization
// -----------------------
localparam logic DONT_CARE = 1'b1; // the value to assign as don't care

// -------------------------
// General helper functions
// -------------------------
Expand Down
4 changes: 2 additions & 2 deletions src/fpnew_rounding.sv
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ module fpnew_rounding #(
2'b01: round_up = 1'b0; // < ulp/2 away, round down
2'b10: round_up = abs_value_i[0]; // = ulp/2 away, round towards even result
2'b11: round_up = 1'b1; // > ulp/2 away, round up
default: round_up = 1'bx; // propagate X
default: round_up = fpnew_pkg::DONT_CARE;
endcase
fpnew_pkg::RTZ: round_up = 1'b0; // always round down
fpnew_pkg::RDN: round_up = (| round_sticky_bits_i) ? sign_i : 1'b0; // to 0 if +, away if -
fpnew_pkg::RUP: round_up = (| round_sticky_bits_i) ? ~sign_i : 1'b0; // to 0 if -, away if +
fpnew_pkg::RMM: round_up = round_sticky_bits_i[1]; // round down if < ulp/2 away, else up
default: round_up = 1'bx; // propagate x
default: round_up = fpnew_pkg::DONT_CARE; // propagate x
endcase
end

Expand Down

0 comments on commit 3f98ba3

Please sign in to comment.