Jump to content
vasu_c

request_update() call when the writer policy is set to SC_MANY_WRITERS.

Recommended Posts

Hi,

With the writer policy set to SC_MANY_WRITERS, the following code in sc_signal.h ends up calling request_update() because policy_type::needs_update() always returns true for SC_MANY_WRITERS though there is no value change This is different from SystemC-2.3.1.  Is this an intentional change ? I looked through the LRM but did not come across anything that mentions about this.

289 sc_signal_t<T,POL>::write( const T& value_ )
290 {
291     // first write per eval phase: m_new_val == m_cur_val
292     bool value_changed = !( m_new_val == value_ );
293     if ( !policy_type::check_write(this, value_changed) )
294         return;
295 
296     m_new_val = value_;
297     if( value_changed || policy_type::needs_update() ) {
298         request_update();
299     }
300 }
 

Thanks for all the help.

 

Share this post


Link to post
Share on other sites

Yes, this change in behaviour of SystemC 2.3.2 with respect to SystemC 2.3.1 is intentional to better conform to IEEE Std 1666-2011, which states in clause 6.4.4 about signal writes under the SC_MANY_WRITERS policy:

Quote

If the template argument WRITER_POLICY has the value SC_MANY_WRITERS, it shall be an error to write to a given signal instance from more than one process instance during any given evaluation phase, but different process instances may write to a given signal instance during different delta cycles.

 This fix by @Philipp A Hartmann is documented in the RELEASENOTES of SystemC 2.3.2:

Quote

  - Correctly detect all conflicting signal writes under the SC_MANY_WRITERS writer policy.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×