Jump to content
Sign in to follow this  
katang

Can debugging interfere with SystemC kernel operation?

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)?)

 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×