Jump to content

reset during wait(int)


Recommended Posts

IEEE 1666-2011 describes wait(int ) as follows:


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

If my interpretation is correct,


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):


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?

Link to comment
Share on other sites

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()
-    if ( m_wait_cycle_n > 0 )
+    if ( m_wait_cycle_n > 0 && THROW_NONE == m_throw_status )

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,

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.

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...