Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Xyce::Device::DeviceTraits< M, I, G > Class Template Reference

The DeviceTraits template describes the configuration of a device. More...

#include <N_DEV_Configuration.h>

Inheritance diagram for Xyce::Device::DeviceTraits< M, I, G >:

Public Types

typedef I InstanceType
 Make instance template parameter available. More...
 
typedef M ModelType
 Make model template parameter available. More...
 
typedef G ModelGroupTraits
 Make model group traits template parameter available. More...
 
typedef ModelGroupType_< M, G >
::GroupType_ 
ModelGroupType
 Make model group template parameter available. More...
 

Static Public Member Functions

static const InstanceTypeId instanceType ()
 Returns the instance type identifier. More...
 
static const ModelTypeId modelType ()
 Returns the model type identifier. More...
 
static const ModelTypeId modelGroup ()
 Returns the model group identifier. More...
 
static Devicefactory (const Configuration &configuration, const FactoryBlock &factory_block)
 Creates a device via the device template. More...
 
static const int numNodes ()
 Number of nodes must be provided in the deriving class. More...
 
static const int numOptionalNodes ()
 Default number of optional nodes. More...
 
static const int numFillNodes ()
 Default number of fill nodes. More...
 
static const bool modelRequired ()
 By default, model is not required. More...
 
static const char * primaryParameter ()
 By default, there is no primary parameter. More...
 
static const char * instanceDefaultParameter ()
 By default, there is no instance default parameter. More...
 
static const bool isLinearDevice ()
 Linear device flag must be provided in the deriving class. More...
 
static const bool isPDEDevice ()
 By default, device is not a PDE device. More...
 

Detailed Description

template<class M, class I, class G>
class Xyce::Device::DeviceTraits< M, I, G >

The DeviceTraits template describes the configuration of a device.

Generally a device uses a typedef to define its traits:

typedef DeviceTraits<Instance, Model> Traits; ///< Device traits for a group device

or

typedef DeviceTraits<Instance, Model, Resistor::Traits> Traits ///< Device is part of the Resistor device group

Every device has an Instance class, a Model class and a ModelGroup class. An Instance is created for every device in the netlist. A Model class is created for each unique model definition in the net list. The ModelGroup serves as a device type grouping mechanism and is generally the level 1 device of a model with the other models having higher level values.

The EntityTypeId, ModelTypeId and InstanceTypeId are all descriptive typedefs for Util::type_index. These model type identifiers and instance type identifiers are uniquely defined for each instance and model. The model type identifier also serves as the model group identifier. The model groups are identified when the model traits is ModeGroupLeadTraits which is the case for the two parameter DeviceTraits trait.

Every device also has or may have nodes, optional nodes, fill nodes, a model required flags, a primary parameter, a linear device flags and PDE device flag. These values are all provided via static traits functions, most of which have default implementations.

Every device must specify not only the device relationships above as template parameters, but must also define the numNodes() and isLinearDevice() functions as providing a default value was too error prone.

DEVICE REGISTRATION: Each device calls registerDevice() to register the device with the configuration. Each device must also call registerModelType() for each model type to be defined.

registerDevice()

  • adds to the configurationMap_: (device_name, device_level) -> configuration
  • adds to the modelTypeConfigurationMap_: model_type_id -> configuration

registerModel()

  • if model_type_id == model_group_id, adds to the modelTypeNameModelGroupMap_: model_name -> model_group_id
  • adds to the modelTypeNameLevelModelTypeMap_: (model_name, level) -> model_type_id
  • adds the model_name to the modelTypeNames list of device configuration

THE CONFIGURATION IS CURRENTLY STORED IN A SINGLETON. This may not be as issue in that the configuration is constructed exactly once via device registration and plugin loading at Xyce startup.

The default parameter for a device is the parameter that will be used if a single untagged parameter value is given on an instance line. For example, the resistor's default parameter is R, and on the line

R1 A B 5k

the untagged value (5k) will be assigned to the resistor's R parameter.

A primary parameter is the parameter that will be changed by a .STEP loop or natural parameter homotopy when only the device name is given. In the resistor, the primary parameter is also "R", and so

.STEP R1 1 10 1

will step R1's R parameter from 1 to 10. In most existing devices the primary parameter is the same as the default parameter, but it is not required that this be the case.

Optional nodes are nodes that may be specified on the instance line, and if not specified are internal nodes instead of external. Fill nodes are like optional nodes, but if not specified they are connected to ground. Examples of optional nodes include the internal and external body contacts in the BSIM3 SOI model. Examples of fill nodes include the substrate node of the level 1 BJT model.

Definition at line 157 of file N_DEV_Configuration.h.

Member Typedef Documentation

template<class M, class I, class G>
typedef I Xyce::Device::DeviceTraits< M, I, G >::InstanceType

Make instance template parameter available.

Definition at line 160 of file N_DEV_Configuration.h.

template<class M, class I, class G>
typedef G Xyce::Device::DeviceTraits< M, I, G >::ModelGroupTraits

Make model group traits template parameter available.

Definition at line 162 of file N_DEV_Configuration.h.

template<class M, class I, class G>
typedef ModelGroupType_<M, G>::GroupType_ Xyce::Device::DeviceTraits< M, I, G >::ModelGroupType

Make model group template parameter available.

Definition at line 163 of file N_DEV_Configuration.h.

template<class M, class I, class G>
typedef M Xyce::Device::DeviceTraits< M, I, G >::ModelType

Make model template parameter available.

Definition at line 161 of file N_DEV_Configuration.h.

Member Function Documentation

template<class M, class I, class G>
static Device* Xyce::Device::DeviceTraits< M, I, G >::factory ( const Configuration configuration,
const FactoryBlock factory_block 
)
static

Creates a device via the device template.

Generally implemented as:

static Device *factory(const Configuration &configuration, const FactoryBlock &factory_block)
{
return new DeviceMaster<Traits>(configuration, factory_block, factory_block.solverState_, factory_block.deviceOptions_);
}

or

static Device *factory(const Configuration &configuration, const FactoryBlock &factory_block)
{
return new Master(configuration, factory_block, factory_block.solverState_, factory_block.deviceOptions_);
}

when Master extends DeviceMaster.

Parameters
configurationconst reference to the device configuration
factory_blockconst reference to the factory parameters
Returns
pointer to the newly created device
template<class M, class I, class G>
static const char* Xyce::Device::DeviceTraits< M, I, G >::instanceDefaultParameter ( )
inlinestatic

By default, there is no instance default parameter.

Definition at line 262 of file N_DEV_Configuration.h.

template<class M, class I, class G>
static const InstanceTypeId Xyce::Device::DeviceTraits< M, I, G >::instanceType ( )
inlinestatic

Returns the instance type identifier.

Returns
the typeid wrapper for the instance type identifier

Definition at line 178 of file N_DEV_Configuration.h.

template<class M, class I, class G>
static const bool Xyce::Device::DeviceTraits< M, I, G >::isLinearDevice ( )
static

Linear device flag must be provided in the deriving class.

template<class M, class I, class G>
static const bool Xyce::Device::DeviceTraits< M, I, G >::isPDEDevice ( )
inlinestatic

By default, device is not a PDE device.

Definition at line 264 of file N_DEV_Configuration.h.

template<class M, class I, class G>
static const ModelTypeId Xyce::Device::DeviceTraits< M, I, G >::modelGroup ( )
inlinestatic

Returns the model group identifier.

Returns
the typeid wrapper for the model group identifier

Definition at line 214 of file N_DEV_Configuration.h.

template<class M, class I, class G>
static const bool Xyce::Device::DeviceTraits< M, I, G >::modelRequired ( )
inlinestatic

By default, model is not required.

Definition at line 260 of file N_DEV_Configuration.h.

template<class M, class I, class G>
static const ModelTypeId Xyce::Device::DeviceTraits< M, I, G >::modelType ( )
inlinestatic

Returns the model type identifier.

Returns
the typeid wrapper for the model type identifier

Definition at line 196 of file N_DEV_Configuration.h.

template<class M, class I, class G>
static const int Xyce::Device::DeviceTraits< M, I, G >::numFillNodes ( )
inlinestatic

Default number of fill nodes.

Definition at line 259 of file N_DEV_Configuration.h.

template<class M, class I, class G>
static const int Xyce::Device::DeviceTraits< M, I, G >::numNodes ( )
static

Number of nodes must be provided in the deriving class.

template<class M, class I, class G>
static const int Xyce::Device::DeviceTraits< M, I, G >::numOptionalNodes ( )
inlinestatic

Default number of optional nodes.

Definition at line 258 of file N_DEV_Configuration.h.

template<class M, class I, class G>
static const char* Xyce::Device::DeviceTraits< M, I, G >::primaryParameter ( )
inlinestatic

By default, there is no primary parameter.

Definition at line 261 of file N_DEV_Configuration.h.


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