Re: sc_start

From: <john.aynsley@doulos.com>
Date: Sat Jan 15 2011 - 10:36:33 PST

Philipp, Bishnupriya,

Comments below...

-----"Philipp A. Hartmann" <philipp.hartmann@offis.de> wrote: -----
To: john.aynsley@doulos.com
From: "Philipp A. Hartmann" <philipp.hartmann@offis.de>
Date: 01/13/2011 04:33PM
Cc: Bishnupriya Bhattacharya <bpriya@cadence.com>, David C Black <dcblack@xtreme-eda.com>, SystemC P1666 Technical <systemc-p1666-technical@eda.org>
Subject: Re: sc_start

John, Bishnupriya,

answers below.

On 13/01/11 17:14, john.aynsley@doulos.com wrote:
>
> Having re-read this thread, I am a bit confused. Let me recap what I
> think we have concluded:
>
>         sc_time now = sc_time_stamp();
>         sc_start(SC_ZERO_TIME);
>         sc_assert( sc_time_stamp() == now);
>
> Right? I am fine with that.

Yes.  Same for

  extern sc_time pause_time;

  pause_time = sc_time_stamp();   // ... somewhere in a process
  sc_pause();
  wait();
  // ...
  sc_start( ... );
  sc_assert( sc_time_stamp() == pause_time );

This is essentially as it is defined with the current delta cycle semantics.

[JA] Yes, agreed.

> Re. sc_start(0) issuing a warning if no activity happened, this is
> equivalent to
>
>         if ( sc_pending_activity_at_current_time() )
>           sc_start(SC_ZERO_TIME);
>         else
>            SC_REPORT_INFO("", "In effect, the implementation would issue
> this warning instead of the application?");
>
> In other words, "no activity" means
> !sc_pending_activity_at_current_time() when sc_start(0) is called,
> right? I am neutral on making this change to the LRM.

Yes.  I like Bishnupriya's suggestion to make the warning optional ("may
or may not").  Another issue here is the delta_count, when there's no
activity:

  sc_dt::uint64 delta = sc_delta_count();
  sc_start(0);
  sc_assert( sc_delta_count() == delta + 1);

Should this hold in all cases (even when there's no activity)?
In the PoC, the delta count is always incremented.

[JA] Interesting. While the scheduler is running, sc_pending_activity_at_current_time() == true whenever the evaluation phase is entered, meaning there exist runnable processes, so the delta count is only incremented after having run at least one process. If we force a delta cycle without any activity using sc_start(0), should the delta count increment? I think not, in which case I am starting to lean toward making that "no activity" warning mandatory. (As an aside, some of my regression tests are showing the delta count being incremented at unexpected times, and I've yet to resolve why.)

> Re. adding further functions, I like Bishnupriya's suggestion of:
>
> bool sc_pending_activity_at_current_time();
> bool sc_pending_activity_at_future_time();
> bool sc_pending_activity();

I also like this idea.

To complete this set of functions to achieve a step-wise walk through
the simulation, the relative _time_ of the next activity should be
accessible as well, right?

sc_time sc_next_pending_activity()
returns:
  · SC_ZERO_TIME,
       iff sc_pending_activity_at_current_time() == true
  · _relative_ time until next timed notification,
       iff sc_pending_activity_at_future_time() == true
  · sc_max_time() - sc_time_stamp(),
       otherwise

  The reason for 'sc_max_time() - sc_time_stamp' in the "other" case
ensures, that it if safe to call sc_start( sc_next_pending_activity() )
at all times, resulting in said step-wise walk.

[JA] Agreed. I propose the name:
sc_time sc_time_to_pending_activity();

John A

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Sat Jan 15 10:37:18 2011

This archive was generated by hypermail 2.1.8 : Sat Jan 15 2011 - 10:37:27 PST