intel / rohd-hcl

A hardware component library developed with ROHD.
https://pub.dev/packages/rohd_hcl
BSD 3-Clause "New" or "Revised" License
81 stars 23 forks source link

Derived FloatingPointValue ofInts Function Crashes #124

Closed kimmeljo closed 2 weeks ago

kimmeljo commented 3 weeks ago

Describe the bug

ofInts function for derived FloatingPointValue objects (ex: FloatingPoint16Value) crashes when invoked (in all cases). This is because it does not pass valid exponent and mantissa widths to the super constructor which consequently takes them to be 0.

To Reproduce

final tmp = FloatingPoint16Value.ofInts(15, 0);

Expected behavior

Function call is successful and returns the corresponding FloatingPointValue derived type assuming the inputs are valid (i.e., within the integer bounds of the exponent and mantissa respectively).

Actual behavior

ROHD HCL exception due to bad exponent/mantissa widths.

Additional: Dart SDK info

No response

Additional: pubspec.yaml

No response

Additional: Context

No response

desmonddak commented 2 weeks ago

Fixed with PR #126