RE: sc_is_running

From: Bishnupriya Bhattacharya <bpriya@cadence.com>
Date: Thu Mar 25 2010 - 02:34:01 PDT

John,

If I understrand your question correctly, in between or after calls to sc_start(), sc_is_running() should return true if simulation has not ended, and false otherwise. For example, see code below.

int sc_main(...) {
  ...
  sc_start(100, SC_NS); <---------------- sc_stop() is not called and sc_start() returns to sc_main
  assert(sc_is_running() == true);
  sc_start(); <---------------- sc_stop() is called from a thread process at time 200 ns, and sc_start() returns to sc_main
  assert(sc_is_running() == false);
  return 0;
}

non-OSCI simulators may have other ways of ending simulation besides sc_stop(), but the behavior of sc_is_running() will still be the same if the wording is done in terms of "end of simulation" instead of in terms of sc_stop(), which is what the current wording is.

Does that sound right?

Thanks,
-Bishnupriya

________________________________
From: owner-systemc-p1666-technical@eda.org [mailto:owner-systemc-p1666-technical@eda.org] On Behalf Of john.aynsley@doulos.com
Sent: Thursday, March 25, 2010 2:28 PM
To: systemc-p1666-technical@eda.org
Subject: sc_is_running

The LRM is ambiguous about the value of sc_is_running() when called from sc_main between or after calls to sc_start(). In the OSCI implementation, sc_is_running returns true between or after calls to sc_start(), but then the OSCI sim does not call end_of_simulation unless sc_stop is explicitly called.

Comments? Do we want the LRM to specific the value of sc_is_running() as per the behavior of the OSCI sim?

Thanks

John A

--
This message has been scanned for viruses and
dangerous content by MailScanner<http://www.mailscanner.info/>, and is
believed to be clean.
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Mar 25 02:34:21 2010

This archive was generated by hypermail 2.1.8 : Thu Mar 25 2010 - 02:34:22 PDT