IM27: Improved SC_MODULE constructor forms

From: Stickley, John <john_stickley@mentorg.com>
Date: Wed Nov 03 2004 - 18:05:12 PST

ITC Team,

As per my action item, the Routed example has been retrofitted
with the new SC_MODULE constructor forms that allow additional
arguments to be passed to constructors of sc_module's for a
more flexible use model.

Old form:

SC_MODULE( my_sc_module ){
    public:
      void one_of_my_threads();
      SC_CTOR( my_sc_module )
      {
          SC_THREAD( one_of_my_threads() );
          ....
      }
}

New form:

class my_sc_module : public sc_module {
    public:
      void one_of_my_threads();
      SC_HAS_PROCESS( my_sc_module );

      my_sc_module( sc_module_name name, <additional custom args> )
        : sc_module(name)
      {
          SC_THREAD( one_of_my_threads() );
          ....
      }
}

The following sections are affected and the code samples contained
therein should be replaced with the equivalents found in the
attached files.

A.2.4.1 Entire SC_MODULE(System){ } should be replaced with corresponding
code in attached System.cxx

A.2.4.2: All code for errorHandler() and sc_main() should be replaced
with corresponding code in attached System.cxx

A.2.4.3: Entire SC_MODULE(SceMiDispatcher){ } should be replaced with
corresponding code in attached SceMiDispatcher.hxx

A.2.4.5: Entire SC_MODULE(Testbench){ } should be replaced with
corresponding code in attached Testbench.hxx

A.2.4.6: Entire SC_MODULE(Scheduler){ } should be replaced with
corresponding code in attached Scheduler.hxx

A.2.4.6.2 All this code is now contained inside the ::Scheduler()
constructor. The explanatory text should be moved to the end
of A.2.4.6 and this entire section should be removed.

-- johnS

______________________________/\/ \ \
John Stickley \ \ \
Principal Engineer \ \________________
Mentor Graphics - MED \_
17 E. Cedar Place \ john_stickley@mentor.com
Ramsey, NJ 07446 \ Phone: (201) 818-2585
________________________________________________________________

Received on Wed Nov 3 18:07:10 2004

This archive was generated by hypermail 2.1.8 : Wed Nov 03 2004 - 18:07:12 PST