Quantcast
Channel: SystemC Language Forum RSS Feed
Viewing all articles
Browse latest Browse all 595

Is there any special way to start a clock - SystemC 2.3, 2.2?

$
0
0
Could some SystemC guru please help ?
I have in the test harness for a simple master slave
JK flip-flop the following clock:
sc_core::sc_clock clk("clk", 2.0, sc_core::SC_PS, 0.5);
.........
sc_core::sc_start(10.0, sc_core::SC_PS);
sc_core::sc_stop();
return 0;
}

However, the output always looks like:
0 jkmsff_0.inv_0 1 0
0 jkmsff_0.nnd3_0 0 1 0
0 jkmsff_0.nnd3_1 0 1 0
0 jkmsff_0.nnd3_1 1 1 0
0 jkmsff_0.nnd2_o2_0 1 0
0 jkmsff_0.nnd2_o2_1 1 0
0 jkmsff_0.nnd2_0 1 0
......
.....
Where the first 0 is supposed to be a time stamp
extracted as in an inverter

SC_MODULE(inv)
{
sc_core::sc_in<bool> din;
sc_core::sc_out<bool> dout;
bool b0;

void inv_proc0()
{
while(1)
{
wait();
b0 = din.read();
dout.write(!b0);
std::cout<<sc_core::sc_time_stamp().to_seconds()<<" "<<name()<<" "<<b0<<" "<<!b0<<std::endl;
}
}

SC_CTOR(inv):b0(false)
{
SC_THREAD(inv_proc0);
sensitive << din;
}

~inv(){}
};

The results are identical as SystemC 2.3.0, 2.2.0

Is there any glaring error ? I have used similar clocks
over and over in other modules, and they work just fine.
Any hints, suggestions would be of immense help.

Viewing all articles
Browse latest Browse all 595

Latest Images

Trending Articles



Latest Images