Jump to content

Lhotun

Members
  • Posts

    5
  • Joined

  • Last visited

Lhotun's Achievements

Member

Member (1/2)

0

Reputation

  1. Thanks for the answer, but as I already stated, it was an installation problem of systemC libraries. Now it executes once as expected.
  2. Looks like I solved the problem. There was an installation problem. Re-installing using option --enable-pthreads while configuring the installation solved the problem Thanks to everyone
  3. Alan, thanks for the answer, but it did not solved my problem. The threads seems not to run at all. Anyway, the code I posted should print "Hello World" once.
  4. Thanks to everyone for the asnwer, but I did a little mistake while posting the code. The one I previously posted works to me as well, the not working one is the following: #include <iostream> #include "systemc.h" SC_MODULE(stim) { sc_in<bool> Clk; void StimGen() { cout << sc_time_stamp() << "Hello World!\n"; } SC_CTOR(stim) { SC_THREAD(StimGen); sensitive << Clk.pos(); } }; int sc_main(int argc, char* argv[]) { sc_clock TestClk("clk", 10,SC_NS); stim Stim1("Stimulus"); Stim1.Clk(TestClk); sc_start(); return 0; } Which is identical to the previous one except for the fact that now i use SC_THREAD instead of SC_METHOD. Thanks again and sorry for the mistake. Dario
  5. Hello everyone! I am new in this forum. I am doing some SystemC exercises after a long time without using it, and I have a very basic problem. I wrote the following code: #include <iostream> #include "systemc.h" SC_MODULE(stim) { sc_in<bool> Clk; void StimGen() { cout << sc_time_stamp() << "Hello World!\n"; } SC_CTOR(stim) { SC_METHOD(StimGen); sensitive << Clk.pos(); } }; int sc_main(int argc, char* argv[]) { sc_clock TestClk("clk", 10,SC_NS); stim Stim1("Stimulus"); Stim1.Clk(TestClk); sc_start(); return 0; } When run the program, it terminates without printing "Hello World!" string on output. What am I doing wrong? If I substitute SC_THREAD with SC_METHOD, the "Hello World!" message is printed.
×
×
  • Create New...