Jump to content

Can debugging interfere with SystemC kernel operation?


katang

Recommended Posts

If I understood correctly, when a during debugging SystemC program reaches a breakpoint, that thread will be suspended, unlike the other threads. Depending on the actual situation, not sending more events from the breakpointed thread to the kernel might affect execution of the other threads. Is there any mechanism which actually suspends operation of the simulator when a breakpoint reached? (in other words: is it possible to execute a simulation stepwise (in virtual time)?)

 

Link to comment
Share on other sites

Hello @katang,

The way the SystemC library is configured by default it doesn't create system threads(OS threads).

That is it uses "user-space library" for creating the notion of parallel execution of threads(in user-space). This depends on the platform and configuration option provided to SystemC kernel while building it.

e.g:

  • In Windows under Visual Studio it uses the fiber user space threading library for execution of SC_THREAD's/CTHREAD's.
  • In UNIX/Linux you can use QuickThreads (User-space threading) which is selected by default while running the configuration option for SystemC library.

As per the OS it only sees one thread of execution for the whole simulation.

Note: In-case you have configured the SystemC library with pthreads in Linux/UNIX like environment then the debugger will show you multiple threads of execution.

  • Even in that scenario you can look here for reference on gdb and multi-threaded debugging, by default on most Linux systems the GDB suspends other threads making it easier to narrow down thread racing condition(the OSCI SystemC kernel sceduler implementation is already synchronized with the main execution thread of the SystemC application).

 

As per your question

1 hour ago, katang said:

is it possible to execute a simulation stepwise (in virtual time)?

The answer is: Yes it is possible to run the SystemC simulation stepwise while is debugging mode.

In-case you need more clarification let us know.

Regards,

Ameya Vikram Singh

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