17 #ifndef _SCP_REPORT_H_
18 #define _SCP_REPORT_H_
20 #include <scc/report.h>
24 #define SCP_LOG_LEVEL_PARAM_NAME "log_level"
29 void init_logging(log level = log::WARNING,
unsigned type_field_width = 24,
bool print_time =
false) {
32 void reinit_logging(log level) { scc::reinit_logging(level); }
38 return static_cast<sc_core::sc_verbosity
>(::sc_core::sc_report_handler::get_verbosity_level());
48 #define SCP_LOG(lvl, ...) ::scc::ScLogger<::sc_core::SC_INFO>(__FILE__, __LINE__, lvl / 10).type(__VA_ARGS__).get()
50 #define SCP_TRACEALL(...) \
51 if(::scc::get_log_verbosity(__VA_ARGS__) >= sc_core::SC_DEBUG) \
52 SCP_LOG(sc_core::SC_DEBUG, __VA_ARGS__)
54 #define SCP_TRACE(...) \
55 if(::scc::get_log_verbosity(__VA_ARGS__) >= sc_core::SC_FULL) \
56 SCP_LOG(sc_core::SC_FULL, __VA_ARGS__)
58 #define SCP_DEBUG(...) \
59 if(::scc::get_log_verbosity(__VA_ARGS__) >= sc_core::SC_HIGH) \
60 SCP_LOG(sc_core::SC_HIGH, __VA_ARGS__)
62 #define SCP_INFO(...) \
63 if(::scc::get_log_verbosity(__VA_ARGS__) >= sc_core::SC_MEDIUM) \
64 SCP_LOG(sc_core::SC_MEDIUM, __VA_ARGS__)
66 #define SCP_WARN(...) ::scc::ScLogger<::sc_core::SC_WARNING>(__FILE__, __LINE__, sc_core::SC_MEDIUM).type(__VA_ARGS__).get()
68 #define SCP_ERR(...) ::scc::ScLogger<::sc_core::SC_ERROR>(__FILE__, __LINE__, sc_core::SC_MEDIUM).type(__VA_ARGS__).get()
70 #define SCP_FATAL(...) ::scc::ScLogger<::sc_core::SC_FATAL>(__FILE__, __LINE__, sc_core::SC_MEDIUM).type(__VA_ARGS__).get()
73 #define SCP_ASSERT(expr) ((void)0)
75 #define SCP_ASSERT(expr) ((void)((expr) ? 0 : (SC_REPORT_FATAL(::sc_core::SC_ID_ASSERTION_FAILED_, #expr), 0)))
void set_logging_level(log level)
sets the SystemC logging level
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
log get_logging_level()
get the SystemC logging level
void set_cycle_base(sc_core::sc_time period)
sets the cycle base for cycle based logging
sc_core::sc_verbosity get_log_verbosity()
get the global verbosity level
log
enum defining the log levels
the configuration class for the logging setup