Here is my program:
#include <systemc.h>
int sc_main(int argc, char* argv[])
{
sc_signal<sc_logic> a, b, c, d;
// trace file creation
sc_trace_file *tf = sc_create_vcd_trace_file("test");
//tf->set_time_unit(1, SC_PS);
sc_trace(tf, a, "A");
sc_trace(tf, b, "B");
sc_trace(tf, c, "C");
sc_trace(tf, d, "D");
sc_start(0, SC_PS);
bool a_tmp = false;
bool b_tmp = true;
int c_tmp = 0;
int d_tmp = 1;
a = sc_logic(a_tmp);
b = sc_logic(b_tmp);
c = sc_logic(c_tmp);
d = static_cast<sc_logic>(d_tmp);
sc_start(1, SC_PS);
a = SC_LOGIC_1; b = SC_LOGIC_1;
c = SC_LOGIC_0; d = SC_LOGIC_1;
sc_start(1, SC_PS);
a = SC_LOGIC_0; b = SC_LOGIC_0;
c = SC_LOGIC_1; d = SC_LOGIC_0;
sc_start(1, SC_PS);
a = SC_LOGIC_1; b = SC_LOGIC_0;
c = SC_LOGIC_1; d = SC_LOGIC_0;
sc_start(1, SC_PS);
sc_close_vcd_trace_file(tf);
return 0;
}
It is very strange that the wave form between 3~4ps have been lost and were not captured by the VCD file. What'f the reason? Even change a,b,c,d to variables can't resolve this problem.