update tracer setup

This commit is contained in:
Eyck Jentzsch 2023-11-20 17:45:27 +01:00
parent 0dfc5467a8
commit a88eb938ee
3 changed files with 16 additions and 10 deletions

View File

@ -12,7 +12,7 @@
</extensions> </extensions>
</storageModule> </storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> <storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.base.1730410661" name="Debug" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=" parent="org.eclipse.cdt.build.core.emptycfg"> <configuration artifactName="${ProjName}" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.base.1730410661" name="Debug" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="cdt.managedbuild.toolchain.gnu.base.1730410661.218663890" name="/" resourcePath=""> <folderInfo id="cdt.managedbuild.toolchain.gnu.base.1730410661.218663890" name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.base.953157788" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.base"> <toolChain id="cdt.managedbuild.toolchain.gnu.base.953157788" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.GNU_ELF" id="cdt.managedbuild.target.gnu.platform.base.1034252621" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/> <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.GNU_ELF" id="cdt.managedbuild.target.gnu.platform.base.1034252621" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
@ -46,13 +46,13 @@
<def name="BUILD_SHARED_LIBS" type="STRING" val="ON"/> <def name="BUILD_SHARED_LIBS" type="STRING" val="ON"/>
</defs> </defs>
</storageModule> </storageModule>
<storageModule buildDir="build/${ConfigName}" dirtyTs="1698265299303" moduleId="de.marw.cmake4eclipse.mbs.settings"> <storageModule buildDir="build/${ConfigName}" dirtyTs="1700498504002" moduleId="de.marw.cmake4eclipse.mbs.settings">
<options/> <options/>
<defs> <defs>
<def name="CMAKE_BUILD_TYPE" type="STRING" val="Debug"/> <def name="CMAKE_BUILD_TYPE" type="STRING" val="Debug"/>
<def name="USE_CWR_SYSTEMC" type="BOOL" val="OFF"/> <def name="USE_CWR_SYSTEMC" type="BOOL" val="OFF"/>
<def name="FW_BUILD" type="BOOL" val="ON"/> <def name="FW_BUILD" type="BOOL" val="ON"/>
<def name="WITH_LLVM" type="BOOL" val="ON"/> <def name="WITH_LLVM" type="BOOL" val="OFF"/>
</defs> </defs>
</storageModule> </storageModule>
</cconfiguration> </cconfiguration>

View File

@ -94,7 +94,7 @@ void CLIParser::build() {
("reset,r", po::value<std::string>(), ("reset,r", po::value<std::string>(),
"reset address") "reset address")
("trace-level,t", po::value<unsigned>()->default_value(0), ("trace-level,t", po::value<unsigned>()->default_value(0),
"enable tracing, or combination of 1=signals and 2=TX text, 4=TX compressed text, 6=TX in SQLite") "enable tracing, or combination of 1=signals and 2=TX")
("trace-default-on", ("trace-default-on",
"enables tracing for all unspecified modules") "enables tracing for all unspecified modules")
("trace-file", po::value<std::string>()->default_value("system"), ("trace-file", po::value<std::string>()->default_value("system"),

View File

@ -67,11 +67,17 @@ int sc_main(int argc, char *argv[]) {
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// set up tracing & transaction recording // set up tracing & transaction recording
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
auto trace_level = parser.get<unsigned>("trace-level");
scc::configurable_tracer trace(parser.get<std::string>("trace-file"), std::unique_ptr<scc::configurable_tracer> tracer;
static_cast<scc::tracer::file_type>(trace_level >> 1), // bit3-bit1 define the kind of transaction trace if( auto trace_level = parser.get<unsigned>("trace-level")) {
(trace_level&0x1) != 0, // bit0 enables vcd auto file_name = parser.get<std::string>("trace-file");
parser.is_set("trace-default-on")); auto enable_sig_trace = (trace_level&0x1) != 0;// bit0 enables sig trace
auto tx_trace_type = static_cast<scc::tracer::file_type>(trace_level >> 1); // bit3-bit1 define the kind of transaction trace
auto trace_default_on = parser.is_set("trace-default-on");
cfg.set_value("*.tx_trace_type", static_cast<unsigned>(scc::tracer::file_type::FTR));
cfg.set_value("*.sig_trace_type", static_cast<unsigned>(scc::tracer::file_type::SC_VCD));
tracer = scc::make_unique<scc::configurable_tracer>(file_name, tx_trace_type, enable_sig_trace, trace_default_on);
}
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// instantiate top level // instantiate top level
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
@ -79,7 +85,7 @@ int sc_main(int argc, char *argv[]) {
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// add non-implemented 'enableTracing' properties // add non-implemented 'enableTracing' properties
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
trace.add_control(); if(tracer) tracer->add_control();
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// dump configuration if requested // dump configuration if requested
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////