scc 2025.09
SystemC components library
scc::configurable_tracer Class Reference

configurable tracer for automatic port and signal tracing More...

#include <configurable_tracer.h>

Inheritance diagram for scc::configurable_tracer:
Collaboration diagram for scc::configurable_tracer:

Public Member Functions

 configurable_tracer (std::string const &&name, bool enable_tx=true, bool enable_vcd=true, sc_core::sc_object *top=nullptr)
 configurable_tracer (std::string const &name, bool enable_tx=true, bool enable_vcd=true, sc_core::sc_object *top=nullptr)
 configurable_tracer (std::string const &&name, file_type type, bool enable_vcd=true, sc_core::sc_object *top=nullptr)
 configurable_tracer (std::string const &name, file_type type, bool enable_vcd=true, sc_core::sc_object *top=nullptr)
 configurable_tracer (std::string const &&name, file_type tx_type, file_type sig_type, sc_core::sc_object *top=nullptr)
 configurable_tracer (std::string const &name, file_type tx_type, file_type sig_type, sc_core::sc_object *top=nullptr)
 configurable_tracer (std::string const &&name, file_type type, sc_core::sc_trace_file *tf=nullptr, sc_core::sc_object *top=nullptr)
 configurable_tracer (std::string const &name, file_type type, sc_core::sc_trace_file *tf=nullptr, sc_core::sc_object *top=nullptr)
 ~configurable_tracer ()
void add_control ()
void add_control (bool trace_default)
Public Member Functions inherited from scc::tracer
 tracer (std::string const &&name, file_type tx_type, file_type sig_type, sc_core::sc_object *top=nullptr)
 tracer (std::string const &name, file_type tx_type=ENABLE, file_type sig_type=ENABLE, sc_core::sc_object *top=nullptr)
 tracer (std::string const &&name, file_type type, bool enable=true, sc_core::sc_object *top=nullptr)
 tracer (std::string const &name, file_type type, bool enable=true, sc_core::sc_object *top=nullptr)
 tracer (std::string const &&name, file_type type, sc_core::sc_trace_file *tf, sc_core::sc_object *top=nullptr)
 tracer (std::string const &name, file_type type, sc_core::sc_trace_file *tf, sc_core::sc_object *top=nullptr)
virtual ~tracer () override
 the destructor
Public Member Functions inherited from scc::tracer_base
 tracer_base (const sc_core::sc_module_name &nm)
 named constructor
 tracer_base (const sc_core::sc_module_name &nm, sc_core::sc_trace_file *tf, bool owned=true)
 named constructor with trace file
 ~tracer_base ()
 destructor
void set_trace_types (trace_types t)
 set the types to trace
const sc_core::sc_trace_file * get_trace_file () const
 get the tracefile used by this tracer
sc_core::sc_trace_file * get_trace_file ()
void set_trace_file (sc_core::sc_trace_file *trf)
 set the trace file of this tracer

Protected Member Functions

void descend (const sc_core::sc_object *, bool trace_all=false) override
 depth-first walk thru the design hierarchy and trace signals resp. call trace() function
bool get_trace_enabled (const sc_core::sc_object *, bool=false)
 check for existence of 'enableTracing' attribute and return value of default otherwise
void augment_object_hierarchical (sc_core::sc_object *, bool)
 add the 'enableTracing' attribute to sc_module
void end_of_elaboration () override
Protected Member Functions inherited from scc::tracer
 tracer (std::string const &&name, file_type tx_type, file_type sig_type, sc_core::sc_object *top, sc_core::sc_module_name const &nm)
 tracer (std::string const &&name, file_type type, sc_core::sc_trace_file *tf, sc_core::sc_object *top, sc_core::sc_module_name const &nm)
void end_of_elaboration () override
void end_of_simulation () override

Protected Attributes

std::vector< cci::cci_param_untyped * > params
 array of created cci parameter
bool control_added {false}
Protected Attributes inherited from scc::tracer
scv_tr::scv_tr_db * txdb {nullptr}
lwtr::tx_db * lwtr_db {nullptr}
std::unique_ptr< cci::cci_param< unsigned > > tx_trace_type
std::unique_ptr< cci::cci_param< unsigned > > sig_trace_type
std::unique_ptr< cci::cci_param< bool > > close_db_in_eos
Protected Attributes inherited from scc::tracer_base
sc_core::sc_trace_file * trf {nullptr}
trace_types types_to_trace {trace_types::ALL}
cci::cci_broker_handle cci_broker
std::unique_ptr< cci::cci_param< bool > > default_trace_enable

Additional Inherited Members

Public Types inherited from scc::tracer
enum  file_type {
  NONE , ENABLE , TEXT , COMPRESSED ,
  SQLITE , FTR , CFTR , LWFTR ,
  LWCFTR , CUSTOM , SC_VCD = TEXT , PULL_VCD = COMPRESSED ,
  PUSH_VCD = SQLITE , FST
}
 defines the transaction trace output type More...
Static Public Member Functions inherited from scc::tracer_base
static void set_default_trace_enable (bool)
static bool get_default_trace_enable ()
Public Attributes inherited from scc::tracer
cci::cci_param_handle tx_trace_type_handle
cci::cci_param_handle sig_trace_type_handle
cci::cci_param_handle close_db_in_eos_handle
Public Attributes inherited from scc::tracer_base
cci::cci_param_handle default_trace_enable_handle
Static Protected Member Functions inherited from scc::tracer_base
static std::string get_name ()
static void try_trace (sc_core::sc_trace_file *trace_file, const sc_core::sc_object *object, trace_types t)

Detailed Description

configurable tracer for automatic port and signal tracing

This class traverses the SystemC object hierarchy and registers all signals and ports found with the tracing infrastructure. Using a sc_core::sc_attribute or a CCI param named "enableTracing" this can be switch on or off on a per module basis

Definition at line 35 of file configurable_tracer.h.

Constructor & Destructor Documentation

◆ configurable_tracer() [1/8]

configurable_tracer::configurable_tracer ( std::string const && name,
bool enable_tx = true,
bool enable_vcd = true,
sc_core::sc_object * top = nullptr )

constructs a tracer object

Parameters
namebasename of the trace file(s)
enable_txenables transaction tracing
enable_vcdenable VCD (signal based) tracing
topthe topleve to use to trace variables

Definition at line 25 of file configurable_tracer.cpp.

◆ configurable_tracer() [2/8]

scc::configurable_tracer::configurable_tracer ( std::string const & name,
bool enable_tx = true,
bool enable_vcd = true,
sc_core::sc_object * top = nullptr )
inline

constructs a tracer object

Parameters
namebasename of the trace file(s)
enable_txenables transaction tracing
enable_vcdenable VCD (signal based) tracing
topthe topleve to use to trace variables

Definition at line 54 of file configurable_tracer.h.

◆ configurable_tracer() [3/8]

configurable_tracer::configurable_tracer ( std::string const && name,
file_type type,
bool enable_vcd = true,
sc_core::sc_object * top = nullptr )

constructs a tracer object

Parameters
namebasename of the trace file(s)
typetype of trace file for transactions
enableenable VCD (signal based) tracing
topthe topleve to use to trace variables

Definition at line 28 of file configurable_tracer.cpp.

◆ configurable_tracer() [4/8]

scc::configurable_tracer::configurable_tracer ( std::string const & name,
file_type type,
bool enable_vcd = true,
sc_core::sc_object * top = nullptr )
inline

constructs a tracer object

Parameters
namebasename of the trace file(s)
typetype of trace file for transactions
enable_vcdenable VCD (signal based) tracing
topthe topleve to use to trace variables

Definition at line 73 of file configurable_tracer.h.

◆ configurable_tracer() [5/8]

configurable_tracer::configurable_tracer ( std::string const && name,
file_type tx_type,
file_type sig_type,
sc_core::sc_object * top = nullptr )

constructs a tracer object

Parameters
namebasename of the trace file(s)
tx_typetype of trace file for transactions
sig_typetype of trace file for signals
topthe topleve to use to trace variables

Definition at line 31 of file configurable_tracer.cpp.

◆ configurable_tracer() [6/8]

scc::configurable_tracer::configurable_tracer ( std::string const & name,
file_type tx_type,
file_type sig_type,
sc_core::sc_object * top = nullptr )
inline

Definition at line 84 of file configurable_tracer.h.

◆ configurable_tracer() [7/8]

configurable_tracer::configurable_tracer ( std::string const && name,
file_type type,
sc_core::sc_trace_file * tf = nullptr,
sc_core::sc_object * top = nullptr )

constructs a tracer object

Parameters
namebasename of the trace file(s)
typetype of trace file for transactions
tfthe trace file to use for signal and POD tracing
topthe topleve to use to trace variables

Definition at line 34 of file configurable_tracer.cpp.

◆ configurable_tracer() [8/8]

scc::configurable_tracer::configurable_tracer ( std::string const & name,
file_type type,
sc_core::sc_trace_file * tf = nullptr,
sc_core::sc_object * top = nullptr )
inline

constructs a tracer object

Parameters
namebasename of the trace file(s)
typetype of trace file for transactions
tfthe trace file to use for signal and POD tracing
topthe topleve to use to trace variables

Definition at line 103 of file configurable_tracer.h.

◆ ~configurable_tracer()

scc::configurable_tracer::~configurable_tracer ( )

destructor

Definition at line 37 of file configurable_tracer.cpp.

Member Function Documentation

◆ add_control() [1/2]

void scc::configurable_tracer::add_control ( )
inline

adds default trace control attribute of name 'enableTracing' to each sc_module in a design hierarchy

Definition at line 112 of file configurable_tracer.h.

◆ add_control() [2/2]

void scc::configurable_tracer::add_control ( bool trace_default)
inline

adds default trace control attribute of name 'enableTracing' to each sc_module in a design hierarchy

Parameters
trace_defaultthe default value of the attribute to be added

Definition at line 118 of file configurable_tracer.h.

◆ augment_object_hierarchical()

void configurable_tracer::augment_object_hierarchical ( sc_core::sc_object * obj,
bool trace_enable )
protected

add the 'enableTracing' attribute to sc_module

Definition at line 95 of file configurable_tracer.cpp.

◆ descend()

void configurable_tracer::descend ( const sc_core::sc_object * obj,
bool trace_all = false )
overrideprotectedvirtual

depth-first walk thru the design hierarchy and trace signals resp. call trace() function

Reimplemented from scc::tracer_base.

Definition at line 43 of file configurable_tracer.cpp.

◆ end_of_elaboration()

void configurable_tracer::end_of_elaboration ( )
overrideprotected

Definition at line 118 of file configurable_tracer.cpp.

◆ get_trace_enabled()

auto scc::configurable_tracer::get_trace_enabled ( const sc_core::sc_object * ,
bool = false )
protected

check for existence of 'enableTracing' attribute and return value of default otherwise

Definition at line 81 of file configurable_tracer.cpp.

Member Data Documentation

◆ control_added

bool scc::configurable_tracer::control_added {false}
protected

Definition at line 137 of file configurable_tracer.h.

◆ params

std::vector<cci::cci_param_untyped*> scc::configurable_tracer::params
protected

array of created cci parameter

Definition at line 136 of file configurable_tracer.h.


The documentation for this class was generated from the following files: