vedant-cst Posted June 19, 2018 Report Posted June 19, 2018 Can you explain how the reset() function works in sc_process_handle? Basically, I want to understand if I can perform any cleanup task before the reset() function resets any thread or method. Quote
David Black Posted June 19, 2018 Report Posted June 19, 2018 Reset is accomplished by throwing an exception. You cannot perform cleanup *before*, but you can perform cleanup on the way out in two manners. First, automatically created objects will of course run their destructors as guaranteed by C++. Second, you can catch exceptions by strategic placement of try-catch blocks and looking for the appropriate sc_exception. It is required by SystemC that you rethrow after catching; otherwise, you will corrupt the SystemC kernel. maehne 1 Quote
vedant-cst Posted June 20, 2018 Author Report Posted June 20, 2018 Thanks, @David Black I was more interested in the second manner. Quote
Philipp A Hartmann Posted June 20, 2018 Report Posted June 20, 2018 There is an example for catching and re-throwing an sc_unwind_exception in IEEE 1666-2011, clause 5.6.6.6. Hope that helps, Philipp David Black 1 Quote
Recommended Posts
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.