Marcus Posted May 22, 2023 Report Share Posted May 22, 2023 SystemC version 2.3.3. I have a class that inherits from sc_trace_file_base. This class is in a public SystemC header. The definition of this class (whether it inherits from sc_object or not) is defined (indirectly) by the SC_ENABLE_SIMULATION_PHASE_CALLBACKS_TRACING flag. But the SystemCLanguageConfig.cmake.in file doesn't propagate this flag. So any other cmake library (my code) using SystemC will always be built as if this flag is not set. This has the side effect that the destructor of sc_object crashes because it somehow gets an invalid this-pointer. Adding SC_ENABLE_SIMULATION_PHASE_CALLBACKS_TRACING to every cmake executable/library using SystemC fixes the issue. Is this a bug? Why isn't SC_ENABLE_SIMULATION_PHASE_CALLBACKS_TRACING propagated? Is it because trace file is not part of the language? Should all users of sc_trace_file_base manually add the flag? Why is SC_ENABLE_SIMULATION_PHASE_CALLBACKS_TRACING enabled by default while at the same time marked as experimental? Shouldn't defaults be stable? Quote Link to comment Share on other sites More sharing options...
Eyck Posted May 23, 2023 Report Share Posted May 23, 2023 This is an issue in 2.3.3, see also here: https://github.com/accellera-official/systemc/issues/24 And yes, to my knowledge there is no propagation of the setting to user code. Therefore e.g. the conan package explicitly sets the cmake option to OFF. Quote Link to comment Share on other sites More sharing options...
Marcus Posted May 23, 2023 Author Report Share Posted May 23, 2023 Thanks, Do you know if it is fixed in 2.3.4? At least I can't see any relevant changes related to ENABLE_PHASE_CALLBACKS_TRACING. It is still on and not propagated through target or cmake package config. Quote Link to comment Share on other sites More sharing options...
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.