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.
I just tried your code and this is the trace file I got (test.vcd):
$date
     Sep 07, 2015       20:30:28
$end
$version
 SystemC 2.3.1-Accellera --- Nov 29 2014 15:29:06
$end
$timescale
     1 ps
$end
$scope module SystemC $end
$var wire    1  aaaaa  A       $end
$var wire    1  aaaab  B       $end
$var wire    1  aaaac  C       $end
$var wire    1  aaaad  D       $end
$upscope $end
$enddefinitions  $end
$comment
All initial values are dumped below at time 0 sec = 0 timescale units.
$end
$dumpvars
xaaaaa
xaaaab
xaaaac
xaaaad
$end
#0
0aaaaa
1aaaab
0aaaac
1aaaad
#1
1aaaaa
#2
0aaaaa
0aaaab
1aaaac
0aaaad
#3
1aaaaa
Which looks correct to me. The table below shows the same data:
            a    b    c    d
at 0 ps    (0)  (1)  (0)  (1)
at 1 ps    (1)   1    0    1
at 2 ps    (0)  (0)  (1)  (0)
at 3 ps    (1)   0    1    0
at 4 ps    No more stimulus, simulation ends
() denotes a changed value
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With