Почему трассировка SystemC не может захватить последний сигнал?

Вот моя программа:

#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;
}

Очень странно, что форма волны между 3~4ps была потеряна и не была захвачена файлом VCD. В чем причина? Даже изменение a,b,c,d на переменные не может решить эту проблему.

1 ответ

Я только что попробовал ваш код, и это файл трассировки, который я получил (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

Что выглядит правильно для меня. В таблице ниже приведены те же данные:

            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
Другие вопросы по тегам