-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Macro FC4SC_NO_THROW stop simulation action work unexpected when illegal bin touched #20
Comments
Could you please provide a minimal example to test against? |
Refer to the examples/fir/src/stimulus.h
log:
|
Hi SchulzSt, Moreover, the FC4SC_NO_THROW macro works well in:
Due to the COVERPOINT macro will set has_sample_expression = true, then it capture the exception type is std::exception, while the coverpoint constructor will disable has_sample_expression, the function void coverpoint::sample(const T &cvp_val) can catch and rethrow the type of exception illegal_bin_sample_exception |
Thanks @seabeam for the detailed breakdown and example. I successfully reproduced the bug. The problem is indeed caused an illegal bin sample, which throws exception of type illegal_bin_sample_exception, as expected. But instead of being caught by the covergroup, it is caught by the coverpoint (and casted to std::exception when thrown again), which makes it past the covergoup. You are also correct about the fix. EDIT: also, FC4SC_NO_THROW macro could benefit from a rename, since the macro only controls exceptions related to sampling on illegal_bin. This would obviously not be backwards compatible, so maybe not worth it? |
Hi,
When illegal bin touched, simulation will be stopped regardless of whether it is defiened or not. The root cause is:
In fc4sc_coverpoint.hpp, line 555:
It catch an exception and type is std::exception then throw, but the cvg will not catch the excpetion in fc4sc_covergroup.hpp, line 190:
Due to the expected exception type is illegal_bin_sample_exception not std::exception, the simulation will be stopped.
Can you help to double check it pls?
Thanks!
The text was updated successfully, but these errors were encountered: