18 #ifndef SCC_FST_TRACE_H
19 #define SCC_FST_TRACE_H
21 #include <scc/observer.h>
22 #include <sysc/tracing/sc_trace.h>
23 #include <sysc/kernel/sc_ver.h>
48 #define DECL_TRACE_METHOD_A(tp) void trace(const tp& object, const std::string& name) override;
49 #define DECL_TRACE_METHOD_B(tp) void trace(const tp& object, const std::string& name, int width) override;
50 #if (SYSTEMC_VERSION >= 20171012)
51 DECL_TRACE_METHOD_A( sc_core::sc_event )
52 DECL_TRACE_METHOD_A( sc_core::sc_time )
54 DECL_TRACE_METHOD_A(
bool )
55 DECL_TRACE_METHOD_A( sc_dt::sc_bit )
56 DECL_TRACE_METHOD_A( sc_dt::sc_logic )
57 DECL_TRACE_METHOD_B(
unsigned char )
58 DECL_TRACE_METHOD_B(
unsigned short )
59 DECL_TRACE_METHOD_B(
unsigned int )
60 DECL_TRACE_METHOD_B(
unsigned long )
61 #ifdef SYSTEMC_64BIT_PATCHES
62 DECL_TRACE_METHOD_B(
unsigned long long)
64 DECL_TRACE_METHOD_B(
char )
65 DECL_TRACE_METHOD_B(
short )
66 DECL_TRACE_METHOD_B(
int )
67 DECL_TRACE_METHOD_B(
long )
68 DECL_TRACE_METHOD_B( sc_dt::int64 )
69 DECL_TRACE_METHOD_B( sc_dt::uint64 )
70 DECL_TRACE_METHOD_A(
float )
71 DECL_TRACE_METHOD_A(
double )
72 DECL_TRACE_METHOD_A( sc_dt::sc_int_base )
73 DECL_TRACE_METHOD_A( sc_dt::sc_uint_base )
74 DECL_TRACE_METHOD_A( sc_dt::sc_signed )
75 DECL_TRACE_METHOD_A( sc_dt::sc_unsigned )
76 DECL_TRACE_METHOD_A( sc_dt::sc_fxval )
77 DECL_TRACE_METHOD_A( sc_dt::sc_fxval_fast )
78 DECL_TRACE_METHOD_A( sc_dt::sc_fxnum )
79 DECL_TRACE_METHOD_A( sc_dt::sc_fxnum_fast )
80 DECL_TRACE_METHOD_A( sc_dt::sc_bv_base )
81 DECL_TRACE_METHOD_A( sc_dt::sc_lv_base )
82 #undef DECL_TRACE_METHOD_A
83 #undef DECL_TRACE_METHOD_B
85 void trace(
const unsigned int&
object,
86 const std::string& name,
87 const char** enum_literals )
override;
89 #define DECL_REGISTER_METHOD_A(tp) observer::notification_handle* observe(tp const& o, std::string const& nm) override;
90 #if (SYSTEMC_VERSION >= 20171012)
91 DECL_REGISTER_METHOD_A( sc_core::sc_event )
92 DECL_REGISTER_METHOD_A( sc_core::sc_time )
94 DECL_REGISTER_METHOD_A(
bool )
95 DECL_REGISTER_METHOD_A( sc_dt::sc_bit )
96 DECL_REGISTER_METHOD_A( sc_dt::sc_logic )
98 DECL_REGISTER_METHOD_A(
unsigned char )
99 DECL_REGISTER_METHOD_A(
unsigned short )
100 DECL_REGISTER_METHOD_A(
unsigned int )
101 DECL_REGISTER_METHOD_A(
unsigned long )
102 DECL_REGISTER_METHOD_A(
char )
103 DECL_REGISTER_METHOD_A(
short )
104 DECL_REGISTER_METHOD_A(
int )
105 DECL_REGISTER_METHOD_A(
long )
106 DECL_REGISTER_METHOD_A( sc_dt::int64 )
107 DECL_REGISTER_METHOD_A( sc_dt::uint64 )
109 DECL_REGISTER_METHOD_A(
float )
110 DECL_REGISTER_METHOD_A(
double )
111 DECL_REGISTER_METHOD_A( sc_dt::sc_int_base )
112 DECL_REGISTER_METHOD_A( sc_dt::sc_uint_base )
113 DECL_REGISTER_METHOD_A( sc_dt::sc_signed )
114 DECL_REGISTER_METHOD_A( sc_dt::sc_unsigned )
116 DECL_REGISTER_METHOD_A( sc_dt::sc_fxval )
117 DECL_REGISTER_METHOD_A( sc_dt::sc_fxval_fast )
118 DECL_REGISTER_METHOD_A( sc_dt::sc_fxnum )
119 DECL_REGISTER_METHOD_A( sc_dt::sc_fxnum_fast )
121 DECL_REGISTER_METHOD_A( sc_dt::sc_bv_base )
122 DECL_REGISTER_METHOD_A( sc_dt::sc_lv_base )
123 #undef DECL_REGISTER_METHOD_A
126 void write_comment(
const std::string& comment)
override;
129 void cycle(
bool delta_cycle)
override;
131 void set_time_unit(
double v, sc_core::sc_time_unit tu )
override;
133 void set_time_unit(
int exponent10_seconds )
override;
137 #if WITH_SC_TRACING_PHASE_CALLBACKS
139 virtual void trace( sc_trace_file* )
const;
143 std::function<bool()> check_enabled;
145 void* m_fst{
nullptr};
150 bool notify()
override;
152 :compare_and_update{compare_and_update}, trc{trc}, that{owner}{}
153 virtual ~trace_entry(){}
155 std::deque<trace_entry> all_traces;
156 std::vector<trace_entry*> pull_traces;
157 std::vector<trace::fst_trace*> changed_traces;
158 std::vector<trace::fst_trace*> triggered_traces;
159 uint64_t last_emitted_ts{std::numeric_limits<uint64_t>::max()};
A handle to be used be the observed object to notify the observer about a change.
The interface defining an observer.