John,
I concur with this proposal.
Just a minor remark (my email is flaky today, sorry).
On 22/11/10 18:05, john.aynsley@doulos.com wrote:
[snip]
> We add a recommendation that an application should call sc_stop() from
> sc_main() at the end of simulation, e.g.
> if (sc_get_status() && SC_PAUSED) {
This should probably be a bitwise AND operator.
> SC_REPORT_WARNING(MSGID, "Simulation stopped running from SC_PAUSED");
> sc_stop();
> }
Within sc_main(), sc_get_status() usually equals SC_PAUSED, right?
Only when returning via an sc_stop (or an error?) within the model,
sc_start would not leave the simulation status in SC_PAUSED.
I agree, that explicitly calling sc_stop() is good practice before
leaving sc_main(), but a warning seems to indicate an
unwanted/unexpected situation. Maybe, this should be changed to
if( !( sc_get_status() & ( SC_STOPPED | SC_END_OF_SIMULATION ) ) ) {
SC_REPORT_INFO(MSGID, "Simulation stopped ");
sc_stop();
}
Greetings from Oldenburg,
Philipp
[snip]
-- Philipp A. Hartmann Hardware/Software Design Methodology Group OFFIS Institute for Information Technology R&D Division Transportation · FuE-Bereich Verkehr Escherweg 2 · 26121 Oldenburg · Germany · http://offis.de/en/ Phone/Fax: +49-441-9722-420/282 · PGP: 0x9161A5C0 · Skype: phi.har -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Mon Nov 22 09:30:28 2010
This archive was generated by hypermail 2.1.8 : Mon Nov 22 2010 - 09:30:29 PST