Jump to content

SC_CTHREAD slows down simulation


Recommended Posts

Hey all.

i am a novice user of SystemC, and couldn't find an answer to the following question?

ive noticed that when ever i tried using SC_CTHREAD(proc_name, clk.pos()) -> the simulation time was increased significantly (to a level where it appeared to be stuck).

what is the right use of SC_CTHREAD so that it doesnt jam the simulation?

i am adding an example of what i did:

SC_CTHREAD(monitor_intr_in, clk.pos());


void TMG_helper::monitor_intr_in() {

   while(true) {
        cout << "i am here" << endl;


thank you in advance !

Link to comment
Share on other sites

6 hours ago, Timur Kelin said:

Hi Roman

Could you please recommend a multi-threaded profiler for SC. I tried making use of gprof but with no success. 

Many commercial SystemC tools have SystemC-specific profilers measuring runtimes of SC processes. On Windows I usually use Visual Studio built-in profiler. I don't have experience with profiling on Linux.

Link to comment
Share on other sites

On 1/16/2020 at 9:44 AM, Meir said:


thanks for replying.

the code that i posted was a snippet.

it did include the wait() statement.

so my questions still remains:

1. what is the right use case for SC_CTHREAD ?

2. why in my give example the simulation gets "stuck" ?



Your simulation was stuck because it was not proceeding with time ... 

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.

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...