Jump to content

disbale sc_assert statements

Recommended Posts

Yes, defining NDEBUG also disables the sc_assert statements in the SystemC proof-of-concept implementation.


Having said that, I don't think it is a good idea to do so globally.  You usually want your simulation to reliably abort in case of an error/bug, instead of running into arbitrary undefined behaviour.


I would recommend to leave assertions active by default until profiling proves that (specific) assertions have a significant performance impact.  In such cases, selectively disable only these assertions in optimized configurations.



Share this post

Link to post
Share on other sites

Hello Philipp


With following example, where I have #define NDEBUG, the sc_assert is still executed.

#include "systemc.h"
#define NDEBUG

    int i;
    trial(sc_module_name name){

int sc_main(int , char**){
    trial et("et");
    return 0;




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