17 #ifndef _SCC_TRACE_TYPES_HH_
18 #define _SCC_TRACE_TYPES_HH_
20 #include <type_traits>
22 #include <sysc/datatypes/fx/fx.h>
24 #include <sysc/tracing/sc_tracing_ids.h>
27 static const char* SC_ID_TRACING_OBJECT_IGNORED_=
"object cannot not be traced";
28 static const char* SC_ID_TRACING_OBJECT_NAME_FILTERED_=
"traced object name filtered";
35 enum trace_type {WIRE, REAL};
40 static inline trace_type get_type() {
return std::is_floating_point<T>::value?REAL:WIRE;}
41 static inline unsigned get_bits(T
const&) {
return std::is_floating_point<T>::value?1:
sizeof(T)*8;}
45 template<>
inline trace_type traits<sc_dt::sc_fxval_fast>::get_type(){
return REAL;}
46 template<>
inline trace_type traits<sc_dt::sc_fxnum>::get_type(){
return REAL;}
47 template<>
inline trace_type traits<sc_dt::sc_fxnum_fast>::get_type(){
return REAL;}
49 template<>
inline unsigned traits<bool>::get_bits(
bool const&){
return 1; }
50 template<>
inline unsigned traits<sc_dt::sc_bit>::get_bits(sc_dt::sc_bit
const&){
return 1; }
51 template<>
inline unsigned traits<sc_dt::sc_logic>::get_bits(sc_dt::sc_logic
const&){
return 1; }
52 template<>
inline unsigned traits<sc_dt::sc_bv_base>::get_bits(sc_dt::sc_bv_base
const& o){
return o.length(); }
53 template<>
inline unsigned traits<sc_dt::sc_lv_base>::get_bits(sc_dt::sc_lv_base
const& o){
return o.length(); }
54 template<>
inline unsigned traits<sc_dt::sc_int_base>::get_bits(sc_dt::sc_int_base
const& o){
return o.length(); }
55 template<>
inline unsigned traits<sc_dt::sc_uint_base>::get_bits(sc_dt::sc_uint_base
const& o){
return o.length(); }
56 template<>
inline unsigned traits<sc_dt::sc_signed>::get_bits(sc_dt::sc_signed
const& o){
return o.length(); }
57 template<>
inline unsigned traits<sc_dt::sc_unsigned>::get_bits(sc_dt::sc_unsigned
const& o){
return o.length(); }
58 template<>
inline unsigned traits<sc_dt::sc_fxval>::get_bits(sc_dt::sc_fxval
const&){
return 1; }
59 template<>
inline unsigned traits<sc_dt::sc_fxval_fast>::get_bits(sc_dt::sc_fxval_fast
const&){
return 1; }
62 template<>
inline unsigned traits<sc_dt::sc_fxnum>::get_bits(sc_dt::sc_fxnum
const&){
return 1; }
63 template<>
inline unsigned traits<sc_dt::sc_fxnum_fast>::get_bits(sc_dt::sc_fxnum_fast
const& o){
return 1; }