Jump to content

"seed_monitor_on()" globally changes handling of severity Error by use of "set_actions()"


Recommended Posts

My SystemC-Code is using messages of severity "Error" to intentionally throw exceptions. Suddenly I realize that no longer exceptions are thrown. Analyzing this issue, I targeted the function in my code "scv_random::seed_monitor_on(true, "../../Source/seedfile.txt");" to be the cause of this. For my current scenario I screwed up the path to the "seedfile.txt" which results in an error in "seed_monitor_on()". In this "seed_monitor_on()" calls the following:
  cannot_open_seed_file() -> message() -> set_actions(SCV_ERROR,SCV_LOG|SCV_DISPLAY|SCV_CACHE_REPORT)
 
Conclusion at it seems to me: In case of a file not found "seed_monitor_on()" removes throwing off exception ("SC_THROW") in ALL(!) cases of messages with severity "Error". I would consider this to be an unwanted global side effect and probably a bug. Or?

Link to comment
Share on other sites

Dear Frank,

Thanks for reporting this issue! I have reported your issue to the SystemC Verification Working Group. I agree with you that scv_message should not tamper with the default actions for error/fatal messages. I checked the SCV code base by following your track. The actual setting of the default actions happens at the first call to _scv_message::setup() in src/scv/scv_report.cpp lines 96 and 97. By removing these two lines and recompiling/reinstalling SCV, you should be able to fix this issue.

Best regards,

Torsten Maehne

Link to comment
Share on other sites

  • 4 weeks later...
  • 4 weeks later...

Not sure if I should have opened another topic. Decided to continue here.

It seems that this type of "tampering with default actions" is more deeply distributed throughout SCV. My testcases intentionally (at least I accept it) trigger an scv_random_error -> "RANDOM_OUT_OF_ORDER_SEED".  This ends up in a call to _scv_message::setup() where I find in line scv_report.cpp::97 the following: scv_report_handler::set_actions(SCV_FATAL,SCV_LOG|SCV_DISPLAY|SCV_CACHE_REPORT);

Once again the default behavior is changed and I'm wondering here why my fatal messages do not end the simulation as expected.

Link to comment
Share on other sites

  • 1 month later...
On 1.9.2017 at 9:03 AM, Frank Poppen said:

Not sure if I should have opened another topic. Decided to continue here.

It seems that this type of "tampering with default actions" is more deeply distributed throughout SCV. My testcases intentionally (at least I accept it) trigger an scv_random_error -> "RANDOM_OUT_OF_ORDER_SEED".  This ends up in a call to _scv_message::setup() where I find in line scv_report.cpp::97 the following: scv_report_handler::set_actions(SCV_FATAL,SCV_LOG|SCV_DISPLAY|SCV_CACHE_REPORT);

Once again the default behavior is changed and I'm wondering here why my fatal messages do not end the simulation as expected.

Sorry for the late reply! I just saw that this post now. The lines containing scv_report_handler::set_actions(...) in the _scv_message::setup() member function implemented in scv_report.cpp were removed by @StS as suggested in my post from 2017-08-08. So you just stumbled again over the same issue.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...