Jump to content

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


dakupoto

Recommended Posts

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...