Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
maubri opened this issue Oct 16, 2024 · 0 comments
Open

Comments

@maubri
Copy link

maubri commented Oct 16, 2024

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>
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

No branches or pull requests

1 participant