4

I have been using both OpenCV and SystemC for several applications with great satisfaction.

Now, I have this application where I need to display images with OpenCV in a SystemC simulation environment. For some reason however, both packages seem to be incompatible "at runtime":

  • There is no problem when I call cvNamedWindow or cvShowImage in a SystemC class before sc_start() was called.
  • However, when cvNamedWindow or cvShowImage is called in a sc_thread, the execution of the program is aborted:

    Thread 1: EXC_BAD_ACCESS(code=2, address=0x7c91ad70).

There is no problem with querying frames (cvQueryFrame), only window-related functions seem to cause problems. If someone has an idea what could cause this problem and if there is a solution or a work-around for this issue, that would be great.

P.S. I'm using Xcode, but I suppose that the problem is not related to the coding environment.

Community
  • 1
  • 1
  • Maybe you could have your OpenCV calls in non-sc threads and then use events and handshake mechanism to share the data that needs to be displayed at the proper time. The mechanism to share the data could be something like what they discuss here: http://forums.accellera.org/index.php?/topic/29-async-request-update-example/ – stephenmm Mar 20 '13 at 16:31
  • @user2120472 Please review the answers carefully, and up vote the ones that helped you. You can also click on the checkbox near an answer to select it as the official answer to your question. – karlphillip Mar 21 '13 at 17:26

1 Answers1

3

It won't work, SystemC doesn't support GUIs (Graphical User Interfaces).

Somebody did some research on this subject: Implementing a Graphical User Interface for SystemC

SystemC is an open source library used for developing models of software algorithms, hardware architecture and system-level designs. Although SystemC is very rich in possibilities for Hardware Description, the simulation is made via a console application, thus textual only, hence it is cumbersome to view the results. Our objective is to develop a GUI for SystemC to provide a more intuitive representation of simulation results. We will document our experiment and compare the cost, in terms of simulation time, of our solution.

karlphillip
  • 92,053
  • 36
  • 243
  • 426
  • Thanks for the response, interesting paper. I can understand that user-interaction with SystemC is problematic. In this case however, there is no user interaction, the program just wants to display a picture. But I guess the only way to do this is by using the OS API. So other graphical packages like Qt will have the same problem in SystemC? – user2120472 Mar 01 '13 at 08:25
  • I believe so. Feel free to up vote my answer if it helped you, or even select it as the official answer by clicking in the checkbox near it. – karlphillip Mar 01 '13 at 16:27