30 if(expr.
id()==ID_constant)
32 if(type.
id()==ID_unsignedbv ||
33 type.
id()==ID_signedbv ||
35 type.
id()==ID_fixedbv ||
36 type.
id()==ID_floatbv ||
37 type.
id()==ID_pointer)
40 else if(expr.
id()==ID_array)
49 else if(expr.
id()==ID_struct)
58 else if(expr.
id()==ID_union)
68 if(type.
id()==ID_unsignedbv ||
69 type.
id()==ID_signedbv ||
70 type.
id()==ID_floatbv ||
71 type.
id()==ID_fixedbv ||
72 type.
id()==ID_pointer ||
91 out <<
"$date\n " << ctime(&t) <<
"$end" <<
"\n";
94 out <<
"$timescale 1 ns $end" <<
"\n";
100 for(
const auto &step : goto_trace.
steps)
102 if(step.is_assignment())
104 irep_idt identifier=step.lhs_object.get_identifier();
105 const typet &type=step.lhs_object.type();
107 const auto number=n.
number(identifier);
111 if(type.
id()==ID_bool)
117 out <<
"$var reg " << width <<
" V" << number <<
" " 118 << identifier <<
" $end" <<
"\n";
123 out <<
"$enddefinitions $end" <<
"\n";
125 unsigned timestamp=0;
127 for(
const auto &step : goto_trace.
steps)
133 irep_idt identifier=step.lhs_object.get_identifier();
134 const typet &type=step.lhs_object.type();
136 out <<
'#' << timestamp <<
"\n";
139 const auto number=n.
number(identifier);
142 if(type.
id()==ID_bool)
144 if(step.lhs_object_value.is_true())
145 out <<
"1" <<
"V" << number <<
"\n";
146 else if(step.lhs_object_value.is_false())
147 out <<
"0" <<
"V" << number <<
"\n";
149 out <<
"x" <<
"V" << number <<
"\n";
156 out <<
"b" << binary <<
" V" << number <<
" " <<
"\n";
The type of an expression.
const typet & follow(const typet &src) const
std::string as_vcd_binary(const exprt &expr, const namespacet &ns)
const mp_integer string2integer(const std::string &n, unsigned base)
mp_integer pointer_offset_bits(const typet &type, const namespacet &ns)
mp_integer pointer_offset_size(const typet &type, const namespacet &ns)
Traces of GOTO Programs in VCD (Value Change Dump) Format.
const irep_idt & id() const
#define forall_operands(it, expr)
void output_vcd(const namespacet &ns, const goto_tracet &goto_trace, std::ostream &out)
Base class for all expressions.
const std::string & get_string(const irep_namet &name) const
number_type number(const T &a)
std::size_t integer2size_t(const mp_integer &n)