Xyce
6.1
|
The DeviceTraits template describes the configuration of a device. More...
#include <N_DEV_Configuration.h>
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 Device * | factory (const Configuration &configuration, const FactoryBlock &factory_block) |
Creates a device via the device template. More... | |
static int | numNodes () |
Number of nodes must be provided in the deriving class. More... | |
static int | numOptionalNodes () |
Default number of optional nodes. More... | |
static int | numFillNodes () |
Default number of fill nodes. More... | |
static 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 bool | isLinearDevice () |
Linear device flag must be provided in the deriving class. More... | |
static bool | isPDEDevice () |
By default, device is not a PDE device. More... | |
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.
registerModel()
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
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
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 165 of file N_DEV_Configuration.h.
typedef I Xyce::Device::DeviceTraits< M, I, G >::InstanceType |
Make instance template parameter available.
Definition at line 168 of file N_DEV_Configuration.h.
typedef G Xyce::Device::DeviceTraits< M, I, G >::ModelGroupTraits |
Make model group traits template parameter available.
Definition at line 170 of file N_DEV_Configuration.h.
typedef ModelGroupType_<M, G>::GroupType_ Xyce::Device::DeviceTraits< M, I, G >::ModelGroupType |
Make model group template parameter available.
Definition at line 171 of file N_DEV_Configuration.h.
typedef M Xyce::Device::DeviceTraits< M, I, G >::ModelType |
Make model template parameter available.
Definition at line 169 of file N_DEV_Configuration.h.
|
static |
Creates a device via the device template.
Generally implemented as:
or
when Master extends DeviceMaster.
configuration | const reference to the device configuration |
factory_block | const reference to the factory parameters |
|
inlinestatic |
By default, there is no instance default parameter.
Definition at line 270 of file N_DEV_Configuration.h.
|
inlinestatic |
Returns the instance type identifier.
Definition at line 186 of file N_DEV_Configuration.h.
|
static |
Linear device flag must be provided in the deriving class.
|
inlinestatic |
By default, device is not a PDE device.
Definition at line 272 of file N_DEV_Configuration.h.
|
inlinestatic |
Returns the model group identifier.
Definition at line 222 of file N_DEV_Configuration.h.
|
inlinestatic |
By default, model is not required.
Definition at line 268 of file N_DEV_Configuration.h.
|
inlinestatic |
Returns the model type identifier.
Definition at line 204 of file N_DEV_Configuration.h.
|
inlinestatic |
Default number of fill nodes.
Definition at line 267 of file N_DEV_Configuration.h.
|
static |
Number of nodes must be provided in the deriving class.
|
inlinestatic |
Default number of optional nodes.
Definition at line 266 of file N_DEV_Configuration.h.
|
inlinestatic |
By default, there is no primary parameter.
Definition at line 269 of file N_DEV_Configuration.h.