Services and Modeling for Embedded Software Development
Embecosm divider strip
Prev  Next

4.2.2.  Module Declaration

The module is declared as a standard SystemC module, i.e. as a derived class of sc_core::sc_module.

class Or1ksimSC
  : public sc_core::sc_module
{
	  
[Note]Note

SystemC provides a macro, so that a module can be defined by:

SC_MODULE( Or1ksimSC )
	    

However this is equivalent (IEEE 1666-2005 section 5.2.5) to the C++ derived class declaration

class Or1ksimSC
  : public sc_core::sc_module
{
 public:
	    

By using SC_MODULE all functions and variables will be visible to all other classes (public) unless there is a subsequent protected: or private: declaration.

The examples provided with SystemC and TLM 2.0 all use explicit declarations of classes derived from sc_module rather than the SC_MODULE macro. This application note uses the same approach.

Embecosm divider strip