Skip to content

Fix mxint cast (for the last time) - #17

Merged
splogdes merged 6 commits into
mainfrom
fix-mxint-cast
Mar 17, 2025
Merged

splogdes merged 6 commits into
mainfrom
fix-mxint-cast

Conversation

@splogdes

Copy link
Copy Markdown
Owner

This pull request includes several changes to the mxint_cast module in the src/mase_components/linear_layers/mxint_operators/rtl/mxint_cast.sv file and updates to the corresponding test file mxint_cast_tb.py. The changes aim to improve the handling of edge cases, enhance the accuracy of calculations, and update test parameters.

Improvements to edge case handling and accuracy:

  • Added a condition to handle the case where log2_max_value is zero in the computation of edata_out to avoid potential errors.
  • Updated the calculation of shift_value and introduced max_value to ensure accurate handling of large numbers and edge cases.
  • Introduced a two's complement function to handle signed arithmetic more effectively and updated conditions for mdata_out to use this function.

Test parameter updates:

  • Increased MAX_MANTISSA from 16 to 32 and adjusted the range for in_man and out_man in the get_mxint_cast_config_random function to allow for a wider range of test cases.
  • Updated the parameter overrides in the test_mxint_cast_random function to reflect the new maximum values for mantissa and exponent widths.


end

// =============================

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crazy stuff right here

@splogdes
splogdes merged commit cd81dc2 into main Mar 17, 2025
@splogdes
splogdes deleted the fix-mxint-cast branch March 17, 2025 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants