SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
simics::systemc::RegisterModel Class Reference

Utility class to help register a setup and teardown function for the SystemC top-model with Simics. More...

#include <sc_factory.h>

Classes

class  FactoryInterface
 
class  ModelData
 

Public Member Functions

template<typename SetupFun , typename TeardownFun >
 RegisterModel (const char *class_name, const char *class_desc, const char *class_doc, SetupFun setup, TeardownFun teardown)
 
template<typename SetupFun >
 RegisterModel (const char *class_name, const char *class_desc, const char *class_doc, SetupFun setup)
 

Static Public Member Functions

template<typename TAdapter , typename TModelData >
static void registerWithFramework ()
 

Protected Member Functions

 RegisterModel ()
 

Static Protected Member Functions

template<typename TModelData >
static void addModelData (TModelData *model_data)
 

Detailed Description

Utility class to help register a setup and teardown function for the SystemC top-model with Simics.

Provides a convenient way to instantiate SystemC models in Simics. The user can register a setup and a teardown function that creates and destroys the simulation respectively. The RegisterModel instance will automatically define a Simics class that will, when instantiated, call the setup function and when it is deleted will call the teardown function. This will enable the SystemC model to be instantiated in Simics or a stand-alone simulation easily. The corresponding stand-alone simulation would look like this:

sc_main(...) {
  T *result = setup(...);
  sc_start();
  teardown(result);
}

Constructor & Destructor Documentation

◆ RegisterModel() [1/3]

template<typename SetupFun , typename TeardownFun >
simics::systemc::RegisterModel::RegisterModel ( const char *  class_name,
const char *  class_desc,
const char *  class_doc,
SetupFun  setup,
TeardownFun  teardown 
)
inline

◆ RegisterModel() [2/3]

template<typename SetupFun >
simics::systemc::RegisterModel::RegisterModel ( const char *  class_name,
const char *  class_desc,
const char *  class_doc,
SetupFun  setup 
)
inline

◆ RegisterModel() [3/3]

simics::systemc::RegisterModel::RegisterModel ( )
inlineprotected

Member Function Documentation

◆ addModelData()

template<typename TModelData >
static void simics::systemc::RegisterModel::addModelData ( TModelData *  model_data)
inlinestaticprotected

◆ registerWithFramework()

template<typename TAdapter , typename TModelData >
static void simics::systemc::RegisterModel::registerWithFramework ( )
inlinestatic

The documentation for this class was generated from the following file: