Skip to content

ac_std_float.h:2190 Missing set_data overload for class ac_ieee_float #27

@maubri

Description

@maubri

When AC_IEEE_FLOAT_USE_BUILTIN is defined class ac_ieee_float is missing the void set_data(const ac_int<width, true> &data) overload. This results in a bug whereby the ac_int passed to the existing API gets implicitly converted to data_t which in the case of AC_IEEE_FLOAT_USE_BUILTIN may be float or double.

The following patch against version 4.8.0 seems to sort out the issue

--- a/ac_std_float.h
+++ b/ac_std_float.h
@@ -2190,6 +2190,9 @@ public:
   void set_data(const data_t &data) {
     Base::set_data(data);
   }
+  void set_data(const ac_int<width, true> &data) {
+    Base::set_data(data);
+  }
   const ac_int<width,true> data_ac_int() const { return Base::data_ac_int();  }
   const data_t &data() const { return Base::d;  }
   template<typename T>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions