hle Posted February 23, 2018 Report Share Posted February 23, 2018 IEEE 1666-2011 describes wait(int ) as follows: Quote A call to this function shall be equivalent to calling the function wait with an empty argument list for a number of times in immediate succession, the number of times being passed as the value of the argument. It shall be an error to pass an argument value less than or equal to zero. The implementation is expected to optimize the execution speed of this function for clocked thread processes. If my interpretation is correct, wait(3); should always be equivalent to wait(); wait(); wait(); However, after applying such an equivalent transformation to tests/systemc/kernel/reset_signal_is/test02/test02.cpp from the regression suite, I got a different simulation output (with systemc-2.3.2): Quote 0 s: initializing 3 ns: waited 3 4 ns: initializing 5 ns: initializing 8 ns: waited 3 11 ns: waited 3 12 ns: initializing 13 ns: initializing 14 ns: initializing 15 ns: initializing 16 ns: initializing Is this possibly a bug in the reference implementation? AmeyaVS and Shashidhar 2 Quote Link to comment Share on other sites More sharing options...
Roman Popov Posted February 24, 2018 Report Share Posted February 24, 2018 Most likely the problem is that cthead suspended with wait(n) ignores reset. So yes, this can be a problem with reference implementation. Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted February 25, 2018 Report Share Posted February 25, 2018 I agree with your conclusion that the observed behavior of the proof-of-concept implementation does not match the requirements of IEEE 1666-2011. I checked the code and it can be fixed by adding the check for resets to sc_thread_process.h (in the trigger_static() function): diff --git a/src/sysc/kernel/sc_thread_process.h b/src/sysc/kernel/sc_thread_process.h --- a/src/sysc/kernel/sc_thread_process.h +++ b/src/sysc/kernel/sc_thread_process.h @@ -485,5 +486,5 @@ sc_thread_process::trigger_static() #endif // SC_ENABLE_IMMEDIATE_SELF_NOTIFICATIONS - if ( m_wait_cycle_n > 0 ) + if ( m_wait_cycle_n > 0 && THROW_NONE == m_throw_status ) { --m_wait_cycle_n; I'll take this change to the language working group to get it fixed in a future version of the SystemC PoC kernel. Thanks for reporting! Greetings from Duisburg, Philipp Shashidhar, AmeyaVS and maehne 3 Quote Link to comment Share on other sites More sharing options...
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.