scsc Posted April 24, 2021 Report Posted April 24, 2021 This must be a very simple issue but ... So I had narrowed down to this simple function: #include <systemc.h> void test_overflow_modes() { sc_fixed<6, 4> a = -7; cout << " a in dec: " << a << endl; } int sc_main(int argc, char* argv[]) { test_overflow_modes(); sc_start(); return 0; } VS2017 had compilation error: Error (active) E0020 identifier "sc_fixed" is undefined. I checked my installation under /src/sysc/datatypes/fx and saw sc_fixed.h but not sc_fixed.cpp. And I recalled when I compiled this systemc 2.3.2 systemc.sln, I didn't see sc_fixed.cpp was compiled. Is this the problem? What is missing? Thanks Quote
Eyck Posted April 25, 2021 Report Posted April 25, 2021 Before inlcuding systemc.h you need to define SC_INCLUDE_FX: #define SC_INCLUDE_FX #include <systemc> using namespace sc_core; using namespace sc_dt; void test_overflow_modes() { sc_fixed<6, 4> a = -7; cout << " a in dec: " << a << endl; } ... You'll find that in the LRM... Quote
scsc Posted April 25, 2021 Author Report Posted April 25, 2021 Ah, thanks Eyck. It works! Apparently I didn't read the LRM ... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.