Jump to content

Runtime exception when running SystemC 2.3.3 under MS Visual Studio 2019

Recommended Posts

Hi all,

I am running into a very weird exception when I try to build SystemC applications that contain `SC_THREAD` under Visual Studio 2019. I managed to prepare a small reproduction example (see attached file) which looks like:

#include <systemc>


  explicit Test(sc_core::sc_module_name name)
      : sc_module(name) {

  void busy(void) {
    for(int i = 0; i < 10; i++) {
      sc_core::wait(1, sc_core::SC_NS);

int sc_main(int, char *[]) {
  Test ttt("ttt");


  return EXIT_SUCCESS;

The program is compiled using the attached CMakeLists.txt file. Upon execution, it runs into an exception and when I look in the debugger, the exception comes from:


The same program runs without any issues when compiled using GCC 9.2 on CentOS 7. On Windows, I am using Windows 10 with VS 2019 Enterprise.
Did anyone else run into similar issues when trying SystemC 2.3.3 with VS 2019?


Edit 1: Issue has been resolved. It turns out that you need to pass `/GR` and  `/vmg` in the compile flags.


Best Regards,


CMakeLists.txt ctor.cc

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