Sign in to follow this  
Followers 0
ankitks

adding new variable causing systemC simulation to behave diffrently

2 posts in this topic

seeing this crazy behavior that when I add a 'double m_temp' variable to my class, I end up getting very different behavior where my sc_assert fires. This only happens when I set my optimization flag -O3 with g++. If I remove -O3 and add -g (for debug) to my g++ flag, I go back to my original behavior and everything passes. This doesn't look random, as I can reproduce it.

I ran it with valgrind and I don't see any memory leak.

==23030== LEAK SUMMARY:
==23030==    definitely lost: 0 bytes in 0 blocks
==23030==    indirectly lost: 0 bytes in 0 blocks
==23030==      possibly lost: 177,955 bytes in 592 blocks
==23030==    still reachable: 3,585,485 bytes in 2,563 blocks
==23030==         suppressed: 0 bytes in 0 blocks
==23030==
==23030== For counts of detected and suppressed errors, rerun with: -v
==23030== Use --track-origins=yes to see where uninitialised values come from
==23030== ERROR SUMMARY: 25300 errors from 286 contexts (suppressed: 6 from 6)

 

Not sure what's going on. Any suggestions. Can't seem to run gdb/ddd since adding -g to g++ doesn't reproduce the behavior.

 

Share this post


Link to post
Share on other sites

Hi,

Can you share the build command (i.e. g++ <options> <input file> -o <output file>) in Release build?

If you are using CMake you can generate build commands by running.

make VERBOSE=1

in case you are using the autotools you can give this command to show the build commands.

make V=1

For other tools you will have to look into documentation for getting the g++ build commands.

Kindly post the results here to analyze further.

Also if possible kindly share minimal code which reproduces this behavior.

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  
Followers 0