Jump to content
brxue

sc_start(0) warning: no activity or clock movement

Recommended Posts

Hi,

 

I'm trying to co-simulate verilog and systemc using vpi. The basic step is

 

  1. At verilog side, whenever posedge of clock occurs, call sc_start(delta) to let systemc time catch up verilog time;
  2. Execute clk.write(1)
  3. Call sc_start(0) to let the write really occur at systemc side (clk posedge ocurrs at evaluation phase of systemc side )
  4. Then call another sc_start(0) to let the updated systemc output to be propagated to verilog side.

 

Actually, I merge step3 and step4 to the following

 

      while(sc_pending_activity_at_current_time()) sc_start(0);

 

All works fine except the warning which fired at step 3:

 

      Warning: (W571) no activity or clock movement for sc_start() invocation
      In file: ../../../../src/sysc/kernel/sc_simcontext.cpp:1606

 

Here my question is that,

  1. At what condition, sc_pending_activity_at_current_time() will return true? Will executing clk.write(1) let it to return true? I suppose yes.
  2. What's the popurse for this warning? It seems this warning will not be fired at systemc-2.2.0, but only systemc-2.3.0

 

Thanks in advance,

Brian

Share this post


Link to post
Share on other sites

Brian,
 
you ran into a (known) issue/corner-case regarding the new delta-cycle/sc_pause/sc_start semantics in IEEE 1666-2011.
 

Here my question is that,

  • At what condition, sc_pending_activity_at_current_time() will return true? Will executing clk.write(1) let it to return true? I suppose yes.
  • What's the popurse for this warning? It seems this warning will not be fired at systemc-2.2.0, but only systemc-2.3.0

 
Regarding (1), see IEEE 1666-2011, Section 4.5.7:
 

The function sc_pending_activity_at_current_time shall return the value true if and only if the set of runnable processes is not empty, the set of update requests is not empty, or the set of delta notifications and time-outs is not empty. By implication, if sc_pending_activity_at_current_time were to return the value false, the next action of the scheduler would be to execute the timed notification phase.

 
Regarding (2), a warning is required by IEEE 1666-2011 according to Section 4.3.4.2 (IEEE 1666-2005, i.e. SystemC 2.2.0 didn't have this functionality):
 

If, when sc_start is called with a zero-valued time argument, the set of runnable processes is empty, the set of update requests is empty, and the set of delta notifications and time-outs is empty; that is, if sc_pending_activity_at_current_time() == false, the implementation shall issue a warning and the value returned from sc_delta_count shall not be incremented.

 
In your case, the set of runnable processes is empty, but the set of update requests is not (due to the clk.write(1)).  The generation of the warning due to an empty evaluation phase is somewhat beyond the spec here, since sc_pending_activity_at_current_time correctly returns true but no "real activity" is performed (except for processing the update phase).  On the other hand, the value of sc_delta_count value is defined as:

 

The function sc_delta_count shall return an integer value that is incremented exactly once in each delta cycle in which at least one process is triggered or resumed [...], ignoring any delta cycles in which there were no runnable processes.

 

Therefore, it is reasonable to suppress the warning in this case.  This is a minor issue in SystemC 2.3.0 and will be fixed in subsequent versions of the ASI proof-of-concept simulator. Until that, you can manually suppress the warning in your model by something like this:

 

// helper macro for version checks
#define SC_MAKE_VERSION( x, y, z ) \
  (((x)*10000) + ((y)*100) + (z))

#if SC_MAKE_VERSION(SC_VERSION_MAJOR,SC_VERSION_MINOR,SC_VERSION_PATCH) <= SC_MAKE_VERSION(2,3,0)
  sc_core::sc_report_handler::set_actions( sc_core::SC_ID_NO_SC_START_ACTIVITY_, sc_core::SC_DO_NOTHING );
#endif

 

Greetings from Oldenburg,

  Philipp

Share this post


Link to post
Share on other sites

Hi Philipp,

 

Thanks for your explanation.

 

So you mean the simulator should not issue the warning because sc_pending_activity_at_current_time() returns true, which is caused by 'clk.write(1)' ----- no runnable process but has update-request ?

 

Best Regards,

Brian

Share this post


Link to post
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...