update tracer setup
This commit is contained in:
@@ -67,11 +67,17 @@ int sc_main(int argc, char *argv[]) {
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// set up tracing & transaction recording
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
auto trace_level = parser.get<unsigned>("trace-level");
|
||||
scc::configurable_tracer trace(parser.get<std::string>("trace-file"),
|
||||
static_cast<scc::tracer::file_type>(trace_level >> 1), // bit3-bit1 define the kind of transaction trace
|
||||
(trace_level&0x1) != 0, // bit0 enables vcd
|
||||
parser.is_set("trace-default-on"));
|
||||
|
||||
std::unique_ptr<scc::configurable_tracer> tracer;
|
||||
if( auto trace_level = parser.get<unsigned>("trace-level")) {
|
||||
auto file_name = parser.get<std::string>("trace-file");
|
||||
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
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@@ -79,7 +85,7 @@ int sc_main(int argc, char *argv[]) {
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// add non-implemented 'enableTracing' properties
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
trace.add_control();
|
||||
if(tracer) tracer->add_control();
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// dump configuration if requested
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user