18 #ifndef SCC_VCD_PUSH_TRACE_H
19 #define SCC_VCD_PUSH_TRACE_H
21 #include <scc/observer.h>
22 #include <sysc/tracing/sc_trace.h>
23 #include <sysc/kernel/sc_ver.h>
47 #define DECL_TRACE_METHOD_A(tp) void trace(const tp& object, const std::string& name) override;
48 #define DECL_TRACE_METHOD_B(tp) void trace(const tp& object, const std::string& name, int width) override;
49 #if (SYSTEMC_VERSION >= 20171012)
50 DECL_TRACE_METHOD_A( sc_core::sc_event )
51 DECL_TRACE_METHOD_A( sc_core::sc_time )
53 DECL_TRACE_METHOD_A(
bool )
54 DECL_TRACE_METHOD_A( sc_dt::sc_bit )
55 DECL_TRACE_METHOD_A( sc_dt::sc_logic )
56 DECL_TRACE_METHOD_B(
unsigned char )
57 DECL_TRACE_METHOD_B(
unsigned short )
58 DECL_TRACE_METHOD_B(
unsigned int )
59 DECL_TRACE_METHOD_B(
unsigned long )
60 #ifdef SYSTEMC_64BIT_PATCHES
61 DECL_TRACE_METHOD_B(
unsigned long long)
63 DECL_TRACE_METHOD_B(
char )
64 DECL_TRACE_METHOD_B(
short )
65 DECL_TRACE_METHOD_B(
int )
66 DECL_TRACE_METHOD_B(
long )
67 DECL_TRACE_METHOD_B( sc_dt::int64 )
68 DECL_TRACE_METHOD_B( sc_dt::uint64 )
69 DECL_TRACE_METHOD_A(
float )
70 DECL_TRACE_METHOD_A(
double )
71 DECL_TRACE_METHOD_A( sc_dt::sc_int_base )
72 DECL_TRACE_METHOD_A( sc_dt::sc_uint_base )
73 DECL_TRACE_METHOD_A( sc_dt::sc_signed )
74 DECL_TRACE_METHOD_A( sc_dt::sc_unsigned )
75 DECL_TRACE_METHOD_A( sc_dt::sc_fxval )
76 DECL_TRACE_METHOD_A( sc_dt::sc_fxval_fast )
77 DECL_TRACE_METHOD_A( sc_dt::sc_fxnum )
78 DECL_TRACE_METHOD_A( sc_dt::sc_fxnum_fast )
79 DECL_TRACE_METHOD_A( sc_dt::sc_bv_base )
80 DECL_TRACE_METHOD_A( sc_dt::sc_lv_base )
81 #undef DECL_TRACE_METHOD_A
82 #undef DECL_TRACE_METHOD_B
84 void trace(
const unsigned int&
object,
85 const std::string& name,
86 const char** enum_literals )
override;
88 #define DECL_REGISTER_METHOD_A(tp) observer::notification_handle* observe(tp const& o, std::string const& nm) override;
89 #if (SYSTEMC_VERSION >= 20171012)
90 DECL_REGISTER_METHOD_A( sc_core::sc_event )
91 DECL_REGISTER_METHOD_A( sc_core::sc_time )
93 DECL_REGISTER_METHOD_A(
bool )
94 DECL_REGISTER_METHOD_A( sc_dt::sc_bit )
95 DECL_REGISTER_METHOD_A( sc_dt::sc_logic )
97 DECL_REGISTER_METHOD_A(
unsigned char )
98 DECL_REGISTER_METHOD_A(
unsigned short )
99 DECL_REGISTER_METHOD_A(
unsigned int )
100 DECL_REGISTER_METHOD_A(
unsigned long )
101 DECL_REGISTER_METHOD_A(
char )
102 DECL_REGISTER_METHOD_A(
short )
103 DECL_REGISTER_METHOD_A(
int )
104 DECL_REGISTER_METHOD_A(
long )
105 DECL_REGISTER_METHOD_A( sc_dt::int64 )
106 DECL_REGISTER_METHOD_A( sc_dt::uint64 )
108 DECL_REGISTER_METHOD_A(
float )
109 DECL_REGISTER_METHOD_A(
double )
110 DECL_REGISTER_METHOD_A( sc_dt::sc_int_base )
111 DECL_REGISTER_METHOD_A( sc_dt::sc_uint_base )
112 DECL_REGISTER_METHOD_A( sc_dt::sc_signed )
113 DECL_REGISTER_METHOD_A( sc_dt::sc_unsigned )
115 DECL_REGISTER_METHOD_A( sc_dt::sc_fxval )
116 DECL_REGISTER_METHOD_A( sc_dt::sc_fxval_fast )
117 DECL_REGISTER_METHOD_A( sc_dt::sc_fxnum )
118 DECL_REGISTER_METHOD_A( sc_dt::sc_fxnum_fast )
120 DECL_REGISTER_METHOD_A( sc_dt::sc_bv_base )
121 DECL_REGISTER_METHOD_A( sc_dt::sc_lv_base )
122 #undef DECL_REGISTER_METHOD_A
125 void write_comment(
const std::string& comment)
override;
128 void cycle(
bool delta_cycle)
override;
130 void set_time_unit(
double v, sc_core::sc_time_unit tu )
override;
132 void set_time_unit(
int exponent10_seconds )
override;
136 #if WITH_SC_TRACING_PHASE_CALLBACKS
138 virtual void trace( sc_trace_file* )
const;
142 std::string prune_name(std::string
const& name);
143 std::string obtain_name();
144 std::function<bool()> check_enabled;
146 FILE* vcd_out{
nullptr};
151 bool notify()
override;
153 :compare_and_update{compare_and_update}, trc{trc}, that{owner}{}
154 virtual ~trace_entry(){}
156 std::deque<trace_entry> all_traces;
157 std::vector<trace_entry*> pull_traces;
158 std::vector<trace::vcd_trace*> changed_traces;
159 std::vector<trace::vcd_trace*> triggered_traces;
160 uint64_t last_emitted_ts{std::numeric_limits<uint64_t>::max()};
161 unsigned vcd_name_index{0};
A handle to be used be the observed object to notify the observer about a change.
The interface defining an observer.