Jump to content


  • Content Count

  • Joined

  • Last visited

Posts posted by AndrewH

  1. Thanks for all of the suggestions. It turns out that the file name and line number in the output that I originally posted can be used to set a breakpoint and from there a call stack can be dumped (with bt). This approach is a bit like what Roman had suggested.

    I was also able to get sc_report_handler::set_action() to work. It's great to have all of the options suggested here.



  2. On 3/2/2018 at 3:31 PM, David Black said:

    I suspect your problem is not understanding that the default action for SC_ERROR is to throw an exception. So you have two choices:

    1. Surround calls with a try/catch block.

    2. Change the default action to SC_DISPLAY without SC_THROW.

    I would also suggest you use the SC_REPORT_ERROR() macro so that you get the file and line number where the call originated.

    1. Doesn't try/catch block work only within that thread?

    2. Can you kindly point me to documentation on how to change the default action of SC_ERROR? I couldn't find it in the UserGuide and did not find useful googling the internet. I would like to change it to SC_ABORT and change the abort handler to use Boost to dump the stack (as Roman suggested above).

    Yes, SC_REPORT_ERROR() is being used and in the output that I showed above, it is identifying a system C include file as the place where SC_REPORT_ERROR() is called.


    On 3/2/2018 at 6:16 PM, Roman Popov said:


  3. Does anyone know if it is possible to see the call stack when sc_report_error() is called?

    Here's an example of the output under lldb when my systemC program is run. The call to sc_report_error() causes the program to exit, leaving no call stack.

    Error: (E5) out of bounds
    In file: /usr/local/systemc/include/sysc/datatypes/bit/sc_bit_proxies.h:2487
    In process: x.y.z @ 5 ns
    Process 10618 exited with status = 1 (0x00000001) 

    Is there a configuration flag to cause sc_report_error() to not cause an exit()?

    Thanks in advance for your help.