accellera-official / systemc

SystemC Reference Implementation
https://systemc.org/overview/systemc/
Apache License 2.0
445 stars 141 forks source link

Inconsistent build setting between autoconf and cmake builds #24

Open eyck opened 2 years ago

eyck commented 2 years ago
  1. SystemC version: 2.3.3 / 2.3.4_pub_rev
  2. platform, compiler, flags: all
  3. description of the problem:

When building SystemC using autoconf/configure the experiental phase callback feature is by default off. Whne building using cmake the option ENABLE_PHASE_CALLBACKS_TRACING is set to ON (https://github.com/accellera-official/systemc/blob/master/CMakeLists.txt#L310). This leads to inconsitency e.g. when building libraries providing their own trace file implementations. Aside of this inconsistency there os no way to check at model build time what setting has been used used in thsi regard.

maehne commented 2 years ago

I agree, default settings should be consistent across the supported build systems.

celegen commented 2 years ago

I've just bumped into an issue where building with CMake with the option ENABLE_PHASE_CALLBACKS_TRACING set to ON sc_trace() causes a segmentation fault if you try to sc_trace AC-datatype -signals. When the option is set to OFF and SC is rebuilt the issue is solved.

This happened on Ubuntu LTS 20.04 running on WSL2, SystemC v2.3.3, GCC v9.4.0.

dcblack commented 1 year ago

A method should be provided to display all of the settings at runtime. This could be used either at the beginning or end of the simulation. Perhaps a new public method with the signature:

const char* ::sc_core::sc_build_config();

Then the user can add a call such as:

SC_REPORT_INFO_VERB( "/Accellera", ::sc_core::sc_build_configuraton(), ::sc_core::SC_NONE );

Information could/should contain:

This would be very useful when analyzing user reports.

If added to the standard, it would be an implementation-dependent option requiring certain of the above information.

I have written things like this in the past.