scc  2022.4.0
SystemC components library
scc Namespace Reference

SCC SystemC utilities. More...

Namespaces

 trace
 SCC SystemC tracing utilities.
 

Classes

class  ticking_clock
 
class  tickless_clock
 
class  memory
 simple TLM2.0 LT memory model More...
 
class  sc_register_indexed
 
class  sc_register_masked
 
class  resetable
 base class for components having a reset More...
 
class  resource_access_if
 interface defining access to a resource e.g. a register More...
 
class  indexed_resource_access_if
 interface defining access to an indexed resource e.g. register file More...
 
class  router
 a TLM2.0 router for loosly-timed (LT) models More...
 
struct  addr_range
 struct representing address range More...
 
class  tlm_target
 a simple access-width based bus interface (no DMI support) More...
 
struct  target_memory_map_entry
 
struct  target_name_map_entry
 
struct  tlm_target_mod
 
struct  tlm_target_bfs_params
 
class  tlm_target_bfs_base
 
class  tlm_target_bfs
 Peripheral base class using scc::tlm_target. More...
 
class  abstract_bitfield
 Abstract baseclass for bitfield. More...
 
class  bitfield_register
 Register that can contain bitfields. More...
 
class  bitfield
 
class  tlm_target_bfs_register_base
 
class  cci_broker
 
struct  _min_max_restriction
 
struct  _min_max_excl_restriction
 
struct  _min_restriction
 
struct  _min_excl_restriction
 
struct  _max_restriction
 
struct  _max_excl_restriction
 
struct  _discrete_restriction
 
struct  cci_param_restricted
 extension of cci_param<T, TM> which automatically registeres a callback to restrict the valid values given to the parameter. More...
 
class  configurable_tracer
 configurable tracer for automatic port and signal tracing More...
 
class  configurer
 design configuration reader More...
 
class  ext_attribute
 extended sc_attribute More...
 
class  fifo_w_cb
 fifo with callbacks More...
 
struct  fst_trace_file
 
class  hierarchy_dumper
 
class  MT19937
 a mersenne-twister based random number generator More...
 
struct  observer
 The interface defining an observer. More...
 
class  ordered_semaphore
 The ordered_semaphore primitive channel class. More...
 
struct  ordered_semaphore_t
 
struct  peq
 priority event queue More...
 
class  perf_estimator
 a performance estimator More...
 
struct  LogConfig
 the configuration class for the logging setup More...
 
struct  ScLogger
 the logger class More...
 
class  stream_redirection
 stream redirector More...
 
class  sc_attribute_randomized
 
struct  sc_clock_ext
 A clock source with construction time configurable start delay. More...
 
class  sc_owning_signal
 sc_signal which takes ownership of the data (acquire()/release()) More...
 
class  sc_thread_pool
 
struct  sc_variable_b
 
struct  sc_variable
 SystemC variable. More...
 
struct  sc_variable< bool >
 
struct  sc_variable_vector
 
struct  sc_ref_variable
 the sc_ref_variable for a particular plain data type. This marks an existing C++ variable as discoverable via the sc_object tree. Whenever possible sc_variable should be used as this does not support value change callback. More...
 
struct  sc_ref_variable< sc_core::sc_event >
 
struct  sc_ref_variable_masked
 the sc_variable for a particular plain data type with limited bit width More...
 
class  sc_in_opt
 
class  sc_in_opt< bool >
 
class  sc_in_opt< sc_dt::sc_logic >
 
class  sc_inout_opt
 
class  sc_inout_opt< bool >
 
class  sc_inout_opt< sc_dt::sc_logic >
 
class  sc_out_opt
 
struct  tick2time
 
struct  time2tick
 translate a tick-less clock (sc_time based) to boolean clock More...
 
class  traceable
 interface defining a traceable component More...
 
class  tracer
 a component traversing the SystemC object hierarchy and tracing the objects More...
 
struct  ForLoop
 
struct  ForLoop< 1 >
 
struct  sc_uint_tester
 
struct  sc_int_tester
 
struct  sc_biguint_tester
 
struct  sc_bigint_tester
 
struct  sc_bv_tester
 
struct  sc_lv_tester
 
class  tracer_base
 base class for automatic tracer More...
 
class  value_registry_impl
 
struct  value_registry_if
 
class  value_registry
 
struct  vcd_mt_trace_file
 
struct  vcd_pull_trace_file
 
struct  vcd_push_trace_file
 

Typedefs

template<typename DATATYPE >
using sc_register = impl::sc_register< typename impl::helper< DATATYPE >::Type >
 import the implementation into the scc namespace
 
typedef struct scc::tlm_target_bfs_params tlm_target_bfs_params_t
 
using writer_type = PrettyWriter< OStreamWrapper >
 
using sc_trace_file = sc_core::sc_trace_file
 
using sc_object = sc_core::sc_object
 

Enumerations

enum class  log {
  NONE , FATAL , ERROR , WARNING ,
  INFO , DEBUG , TRACE , TRACEALL ,
  DBGTRACE = TRACEALL
}
 enum defining the log levels
 
enum class  trace_types : unsigned {
  NONE = 0x0 , SIGNALS = 0x1 , PORTS = 0x2 , SOCKETS = 0x4 ,
  VARIABLES = 0x8 , ALL = 0xff
}
 identifies the various type to be traced More...
 
enum  { LT = 0 }
 

Functions

bool init_cci (std::string name)
 
template<typename T >
_min_max_restriction< T > min_max_restriction (T min, T max)
 creates a min/max restriction with including the limits More...
 
template<typename T >
_min_max_excl_restriction< T > min_max_excl_restriction (T min, T max)
 creates a min/max restriction with excluding the limits More...
 
template<typename T >
_min_restriction< T > min_restriction (T min)
 creates a minimum restriction including the minimum value More...
 
template<typename T >
_min_restriction< T > gte_restriction (T min)
 alias for min_restriction(T min)
 
template<typename T >
_min_excl_restriction< T > min_excl_restriction (T min)
 creates a minimum restriction excluding the minimum value More...
 
template<typename T >
_min_excl_restriction< T > gt_excl_restriction (T min)
 alias for min_excl_restriction(T min)
 
template<typename T >
_max_restriction< T > max_restriction (T max)
 creates a maximum restriction including the maximum value More...
 
template<typename T >
_max_restriction< T > lte_restriction (T max)
 alias for max_restriction(T max)
 
template<typename T >
_max_excl_restriction< T > max_excl_restriction (T max)
 creates a maximum restriction excluding the maximum value More...
 
template<typename T >
_max_excl_restriction< T > lt_excl_restriction (T max)
 alias for max_excl_restriction(T max)
 
template<typename T >
_discrete_restriction< T > discrete_restriction (std::initializer_list< T > values)
 creates a restriction for a discrete values set More...
 
template<typename T , size_t SZ>
_discrete_restriction< T > discrete_restriction (std::array< T, SZ > values)
 creates a restriction for a discrete values set More...
 
template<typename T >
_discrete_restriction< T > discrete_restriction (std::vector< T > values)
 creates a restriction for a discrete values set More...
 
std::string hier_name_as_regex (std::string const &parname)
 
auto get_value_from_hierarchy (const std::string &hier_name, Value const &value) -> Value const &
 
template<typename T , typename OT = T>
bool changed (trace::fst_trace *trace)
 
sc_core::sc_trace_file * create_fst_trace_file (const char *name, std::function< bool()> enable=std::function< bool()>())
 create FST file which uses pull mechanism
 
void close_fst_trace_file (sc_core::sc_trace_file *tf)
 close the FST file
 
template<class T >
void sc_trace (sc_core::sc_trace_file *tf, const sc_core::sc_signal_in_if< T > &object, const char *name)
 
template<class T >
void sc_trace (sc_core::sc_trace_file *tf, const sc_core::sc_signal_in_if< T > &object, const std::string &name)
 
template<class T >
void sc_trace (sc_core::sc_trace_file *tf, const sc_core::sc_in< T > &port, char const *name)
 
template<class T >
void sc_trace (sc_core::sc_trace_file *tf, const sc_core::sc_in< T > &port, const std::string &name)
 
template<class T >
void sc_trace (sc_core::sc_trace_file *tf, const sc_core::sc_inout< T > &port, char const *name)
 
template<class T >
void sc_trace (sc_core::sc_trace_file *tf, const sc_core::sc_inout< T > &port, const std::string &name)
 
 SC_HAS_PROCESS (perf_estimator)
 
log as_log (int logLevel)
 safely convert an integer into a log level More...
 
std::istream & operator>> (std::istream &is, log &val)
 read a log level from input stream e.g. used by boost::lexical_cast More...
 
std::ostream & operator<< (std::ostream &os, log const &val)
 output the textual representation of the log level More...
 
void init_logging (log level=log::WARNING, unsigned type_field_width=24, bool print_time=false)
 initializes the SystemC logging system with a particular logging level More...
 
void reinit_logging (log level=log::WARNING)
 
void init_logging (const LogConfig &log_config)
 initializes the SystemC logging system with a particular configuration More...
 
bool is_logging_initialized ()
 get the state of the SCC logging system More...
 
void set_logging_level (log level)
 sets the SystemC logging level More...
 
log get_logging_level ()
 get the SystemC logging level More...
 
void set_cycle_base (sc_core::sc_time period)
 sets the cycle base for cycle based logging More...
 
sc_core::sc_verbosity get_log_verbosity ()
 get the global verbosity level More...
 
sc_core::sc_verbosity get_log_verbosity (char const *t)
 get the scope-based verbosity level More...
 
sc_core::sc_verbosity get_log_verbosity (std::string const &t)
 
template<typename T >
operator+ (sc_variable< T > const &a, sc_variable< T > const &b)
 
template<typename T >
operator- (sc_variable< T > const &a, sc_variable< T > const &b)
 
template<typename T >
operator* (sc_variable< T > const &a, sc_variable< T > const &b)
 
template<typename T >
operator/ (sc_variable< T > const &a, sc_variable< T > const &b)
 
template<typename T >
operator+ (T const &a, sc_variable< T > const &b)
 
template<typename T >
operator- (T const &a, sc_variable< T > const &b)
 
template<typename T >
operator* (T const &a, sc_variable< T > const &b)
 
template<typename T >
operator/ (T const &a, sc_variable< T > const &b)
 
sc_core::sc_trace_file * scc_create_vcd_trace_file (const char *name, std::function< bool()> enable=std::function< bool()>())
 keep backward compatibility
 
void scc_close_vcd_trace_file (sc_core::sc_trace_file *tf)
 
template<typename T >
::std::ostream & operator<< (::std::ostream &os, const sc_in_opt< T > &a)
 
template<typename T >
::std::ostream & operator<< (::std::ostream &os, const sc_inout_opt< T > &a)
 
template<class T >
void sc_trace (sc_core::sc_trace_file *tf, const sc_in_opt< T > &port, const std::string &name)
 
template<class T >
void sc_trace (sc_core::sc_trace_file *tf, const sc_inout_opt< T > &port, const std::string &name)
 
sc_core::sc_trace_file * create_vcd_pull_trace_file (const char *name, std::function< bool()> enable=std::function< bool()>())
 create VCD file which uses pull mechanism
 
void close_vcd_pull_trace_file (sc_core::sc_trace_file *tf)
 close the VCD file
 
sc_core::sc_trace_file * create_vcd_push_trace_file (const char *name, std::function< bool()> enable=std::function< bool()>())
 create VCD file which uses push mechanism
 
void close_vcd_push_trace_file (sc_core::sc_trace_file *tf)
 close the VCD file
 
sc_core::sc_trace_file * create_vcd_mt_trace_file (const char *name, std::function< bool()> enable=std::function< bool()>())
 create compressed VCD file which uses push mechanism and multithreading
 
void close_vcd_mt_trace_file (sc_core::sc_trace_file *tf)
 close the VCD file
 
template<typename T >
auto try_trace_obj (sc_trace_file *trace_file, const sc_object *object, trace_types types_to_trace) -> bool
 
trace_types operator| (trace_types lhs, trace_types rhs)
 operator overload to allow boolean or operations on trace_types More...
 
trace_types operator& (trace_types lhs, trace_types rhs)
 operator overload to allow boolean and operations on trace_types More...
 
template<typename T , typename... Args>
std::unique_ptr< T > make_unique (Args &&... args)
 
char * legalize_name (char *const name)
 
std::string legalize_name (std::string const &name)
 
bool icompare (std::string const &a, std::string const &b)
 
sc_core::sc_time parse_from_string (std::string value, std::string unit) noexcept
 
sc_core::sc_time parse_from_string (std::string value) noexcept
 
sc_core::sc_time time_to_next_posedge (sc_core::sc_clock const *clk)
 
unsigned ilog2 (uint32_t val)
 
template<typename T >
get_value (sc_core::sc_attribute< T > &a)
 
template<typename T >
void set_value (sc_core::sc_attribute< T > &a, T &&value)
 
template<typename T >
get_value (cci::cci_param_typed< T > &a)
 
template<typename T >
void set_value (cci::cci_param_typed< T > &a, T &&value)
 
auto operator<< (std::ostream &os, const sc_event &evt) -> std::ostream &
 
template<typename T , typename OT = T>
bool changed (trace::vcd_trace *trace)
 
void record_changes (FILE *vcd_out, std::vector< trace::vcd_trace * > const &changed, std::vector< trace::vcd_trace * > const &triggered)
 

Detailed Description

SCC SystemC utilities.

Enumeration Type Documentation

◆ trace_types

enum scc::trace_types : unsigned
strong

identifies the various type to be traced

Enumerator
NONE 

NONE

SIGNALS 

SIGNALS

PORTS 

PORTS

SOCKETS 

SOCKETS

VARIABLES 

VARIABLES

ALL 

ALL

Definition at line 35 of file tracer_base.h.

Function Documentation

◆ as_log()

log scc::as_log ( int  logLevel)
inline

safely convert an integer into a log level

Parameters
logLevelthe logging level
Returns
the log level

Definition at line 92 of file report.h.

◆ discrete_restriction() [1/3]

template<typename T , size_t SZ>
_discrete_restriction<T> scc::discrete_restriction ( std::array< T, SZ >  values)
inline

creates a restriction for a discrete values set

Template Parameters
Tthe type of the value the restricion applies
SZsize of the array
Parameters
valuesthe set of allowed values
Returns
_discrete_restriction<T>

Definition at line 161 of file cci_param_restricted.h.

◆ discrete_restriction() [2/3]

template<typename T >
_discrete_restriction<T> scc::discrete_restriction ( std::initializer_list< T >  values)
inline

creates a restriction for a discrete values set

Template Parameters
Tthe type of the value the restricion applies
Parameters
valuesthe set of allowed values
Returns
_discrete_restriction<T>

Definition at line 150 of file cci_param_restricted.h.

◆ discrete_restriction() [3/3]

template<typename T >
_discrete_restriction<T> scc::discrete_restriction ( std::vector< T >  values)
inline

creates a restriction for a discrete values set

Template Parameters
Tthe type of the value the restricion applies
Parameters
valuesthe set of allowed values
Returns
_discrete_restriction<T>

Definition at line 171 of file cci_param_restricted.h.

◆ get_log_verbosity() [1/2]

sc_core::sc_verbosity scc::get_log_verbosity ( )
inline

get the global verbosity level

Returns
the global verbosity level

Definition at line 308 of file report.h.

◆ get_log_verbosity() [2/2]

sc_core::sc_verbosity scc::get_log_verbosity ( char const *  t)

get the scope-based verbosity level

The function returns a scope specific verbosity level if defined (e.g. by using a CCI param named "log_level"). Otherwise the global verbosity level is being returned

Parameters
tthe SystemC hierarchy scope name
Returns
the verbosity level

Definition at line 542 of file report.cpp.

◆ get_logging_level()

log scc::get_logging_level ( )

get the SystemC logging level

Returns
the logging level

Definition at line 460 of file report.cpp.

◆ icompare()

bool scc::icompare ( std::string const &  a,
std::string const &  b 
)
inline

case-insensitive string compare

Parameters
astring a
bstring b
Returns
result of std::equal

Definition at line 220 of file utilities.h.

◆ init_logging() [1/2]

void scc::init_logging ( const LogConfig log_config)

initializes the SystemC logging system with a particular configuration

Parameters
log_configthe logging configuration

Definition at line 446 of file report.cpp.

◆ init_logging() [2/2]

void scc::init_logging ( scc::log  level = log::WARNING,
unsigned  type_field_width = 24,
bool  print_time = false 
)

initializes the SystemC logging system with a particular logging level

Parameters
levelthe log level
type_field_widththe with of the type field in the output
print_timewhether to print the system time stamp

Definition at line 438 of file report.cpp.

◆ is_logging_initialized()

log scc::is_logging_initialized ( )

get the state of the SCC logging system

Returns
true if the logging system has been initialized

Definition at line 436 of file report.cpp.

◆ max_excl_restriction()

template<typename T >
_max_excl_restriction<T> scc::max_excl_restriction ( max)
inline

creates a maximum restriction excluding the maximum value

Template Parameters
Tthe type of the value the restricion applies
Parameters
maxthe upper bound
Returns
_max_excl_restriction<T>

Definition at line 140 of file cci_param_restricted.h.

◆ max_restriction()

template<typename T >
_max_restriction<T> scc::max_restriction ( max)
inline

creates a maximum restriction including the maximum value

Template Parameters
Tthe type of the value the restricion applies
Parameters
maxthe upper bound
Returns
_max_restriction<T>

Definition at line 130 of file cci_param_restricted.h.

◆ min_excl_restriction()

template<typename T >
_min_excl_restriction<T> scc::min_excl_restriction ( min)
inline

creates a minimum restriction excluding the minimum value

Template Parameters
Tthe type of the value the restricion applies
Parameters
minthe lower bound
Returns
_min_excl_restriction<T>

Definition at line 120 of file cci_param_restricted.h.

◆ min_max_excl_restriction()

template<typename T >
_min_max_excl_restriction<T> scc::min_max_excl_restriction ( min,
max 
)
inline

creates a min/max restriction with excluding the limits

Template Parameters
Tthe type of the value the restricion applies
Parameters
minthe lower bound
maxthe upper bound
Returns
_min_max_excl_restriction<T> instance of the restriction functor

Definition at line 100 of file cci_param_restricted.h.

◆ min_max_restriction()

template<typename T >
_min_max_restriction<T> scc::min_max_restriction ( min,
max 
)
inline

creates a min/max restriction with including the limits

Template Parameters
Tthe type of the value the restricion applies
Parameters
minthe lower bound
maxthe upper bound
Returns
_min_max_restriction<T> instance of the restriction functor

Definition at line 91 of file cci_param_restricted.h.

◆ min_restriction()

template<typename T >
_min_restriction<T> scc::min_restriction ( min)
inline

creates a minimum restriction including the minimum value

Template Parameters
Tthe type of the value the restricion applies
Parameters
minthe lower bound
Returns
_min_restriction<T>

Definition at line 110 of file cci_param_restricted.h.

◆ operator&()

trace_types scc::operator& ( trace_types  lhs,
trace_types  rhs 
)
inline

operator overload to allow boolean and operations on trace_types

Parameters
lhsleft hand side
rhsright hand side
Returns
result

Definition at line 62 of file tracer_base.h.

◆ operator<<()

std::ostream & scc::operator<< ( std::ostream &  os,
log const &  val 
)
inline

output the textual representation of the log level

Parameters
osoutput stream
vallogging level
Returns
reference to the stream for chaining

Definition at line 124 of file report.h.

◆ operator>>()

std::istream & scc::operator>> ( std::istream &  is,
log val 
)
inline

read a log level from input stream e.g. used by boost::lexical_cast

Parameters
isinput stream holding the string representation
valthe value holding the resulting value
Returns
the input stream

Definition at line 105 of file report.h.

◆ operator|()

trace_types scc::operator| ( trace_types  lhs,
trace_types  rhs 
)
inline

operator overload to allow boolean or operations on trace_types

Parameters
lhsleft hand side
rhsright hand side
Returns
result

Definition at line 51 of file tracer_base.h.

◆ parse_from_string() [1/2]

sc_core::sc_time scc::parse_from_string ( std::string  value)
inlinenoexcept

parse a time value from a given string

Parameters
valuethe string to parse
Returns
the parsed sc_core::sc_time value

Definition at line 260 of file utilities.h.

◆ parse_from_string() [2/2]

sc_core::sc_time scc::parse_from_string ( std::string  value,
std::string  unit 
)
inlinenoexcept

parse a time value from given strings

Parameters
valuethe string to parse
unitthe unit string
Returns
the parsed sc_core::sc_time value

Definition at line 235 of file utilities.h.

◆ set_cycle_base()

void scc::set_cycle_base ( sc_core::sc_time  period)

sets the cycle base for cycle based logging

if this is set to a non-SC_ZERO_TIME value all logging timestamps are printed as cyles (multiple of this value)

Parameters
periodthe cycle period

◆ set_logging_level()

void scc::set_logging_level ( scc::log  level)

sets the SystemC logging level

Parameters
levelthe logging level

Definition at line 452 of file report.cpp.