00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #ifndef SC_VCD_TRACE_H
00048 #define SC_VCD_TRACE_H
00049
00050 #include "sysc/tracing/sc_trace_file_base.h"
00051
00052 namespace sc_core {
00053
00054 class vcd_trace;
00055 template<class T> class vcd_T_trace;
00056
00057
00058
00059
00060
00061
00062
00063
00064 class vcd_trace_file
00065 : public sc_trace_file_base
00066 {
00067 public:
00068
00069 enum vcd_enum {VCD_WIRE=0, VCD_REAL=1, VCD_LAST};
00070
00071
00072 #if 0 // deprecated
00073 inline void sc_set_vcd_time_unit(int exponent10_seconds)
00074 { set_time_unit(exponent10_seconds); }
00075 #endif
00076
00077
00078
00079 vcd_trace_file(const char *name);
00080
00081
00082 ~vcd_trace_file();
00083
00084 protected:
00085
00086
00087
00088
00089
00090 void trace(const bool& object, const std::string& name);
00091
00092
00093 virtual void trace( const sc_dt::sc_bit& object,
00094 const std::string& name);
00095
00096
00097 void trace(const sc_dt::sc_logic& object, const std::string& name);
00098
00099
00100 void trace(const unsigned char& object, const std::string& name,
00101 int width);
00102
00103
00104 void trace(const unsigned short& object, const std::string& name,
00105 int width);
00106
00107
00108 void trace(const unsigned int& object, const std::string& name,
00109 int width);
00110
00111
00112 void trace(const unsigned long& object, const std::string& name,
00113 int width);
00114
00115
00116 void trace(const char& object, const std::string& name, int width);
00117
00118
00119 void trace(const short& object, const std::string& name, int width);
00120
00121
00122 void trace(const int& object, const std::string& name, int width);
00123
00124
00125 void trace(const long& object, const std::string& name, int width);
00126
00127
00128 void trace(const sc_dt::int64& object, const std::string& name,
00129 int width);
00130
00131
00132 void trace(const sc_dt::uint64& object, const std::string& name,
00133 int width);
00134
00135
00136 void trace(const float& object, const std::string& name);
00137
00138
00139 void trace(const double& object, const std::string& name);
00140
00141
00142 void trace (const sc_dt::sc_uint_base& object,
00143 const std::string& name);
00144
00145
00146 void trace (const sc_dt::sc_int_base& object,
00147 const std::string& name);
00148
00149
00150 void trace (const sc_dt::sc_unsigned& object,
00151 const std::string& name);
00152
00153
00154 void trace (const sc_dt::sc_signed& object, const std::string& name);
00155
00156
00157 void trace( const sc_dt::sc_fxval& object, const std::string& name );
00158
00159
00160 void trace( const sc_dt::sc_fxval_fast& object,
00161 const std::string& name );
00162
00163
00164 void trace( const sc_dt::sc_fxnum& object, const std::string& name );
00165
00166
00167 void trace( const sc_dt::sc_fxnum_fast& object,
00168 const std::string& name );
00169
00170 template<class T>
00171 void traceT(const T& object, const std::string& name,
00172 vcd_enum type=VCD_WIRE)
00173 {
00174 if( add_trace_check(name) )
00175 traces.push_back(new vcd_T_trace<T>( object, name
00176 , obtain_name(),type) );
00177 }
00178
00179
00180 virtual void trace(const sc_dt::sc_bv_base& object,
00181 const std::string& name);
00182
00183
00184 virtual void trace(const sc_dt::sc_lv_base& object,
00185 const std::string& name);
00186
00187
00188
00189 void trace(const unsigned& object, const std::string& name,
00190 const char** enum_literals);
00191
00192
00193 void write_comment(const std::string& comment);
00194
00195
00196 void cycle(bool delta_cycle);
00197
00198 private:
00199
00200 #if SC_TRACING_PHASE_CALLBACKS_
00201
00202 virtual void trace( sc_trace_file* ) const { sc_assert(false); }
00203 #endif // SC_TRACING_PHASE_CALLBACKS_
00204
00205
00206 virtual void do_initialize();
00207
00208 unsigned vcd_name_index;
00209
00210 unsigned previous_time_units_low;
00211 unsigned previous_time_units_high;
00212
00213 public:
00214
00215
00216 std::vector<vcd_trace*> traces;
00217
00218
00219 std::string obtain_name();
00220
00221 };
00222
00223 }
00224
00225 #endif // SC_VCD_TRACE_H
00226