Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Xyce::Device::DeviceMaster< T > Class Template Reference

DeviceMaster instantiates a device as described by the device traits T. More...

#include <N_DEV_DeviceMaster.h>

Inheritance diagram for Xyce::Device::DeviceMaster< T >:
Collaboration diagram for Xyce::Device::DeviceMaster< T >:

Public Types

typedef T::ModelType ModelType
 Make the model begin defined available. More...
 
typedef T::InstanceType InstanceType
 Make the instance being define available. More...
 

Public Member Functions

 DeviceMaster (const Configuration &configuration, const FactoryBlock &factory_block, const SolverState &solver_state, const DeviceOptions &device_options)
 Constructs a device. More...
 
 DeviceMaster (const std::string &model_type_name, const Configuration &configuration, const FactoryBlock &factory_block, const SolverState &solver_state, const DeviceOptions &device_options)
 Constructs a device. More...
 
virtual ~DeviceMaster ()
 Destroys the device. More...
 
virtual const std::string & getName () const
 Returns the name of this device. More...
 
virtual const std::string & getDefaultModelName () const
 Returns the default model name to use if the instance being created does not specify one. More...
 
virtual DeviceEntityfindEntity (const std::string &entity_name)
 Returns a pointer to the model or instance entity with the specified name. More...
 
virtual const DeviceEntityfindEntity (const std::string &entity_name) const
 Returns a pointer to the model or instance entity with the specified name. More...
 
virtual bool isLinearDevice () const
 Returns true if this device is a linear device. More...
 
virtual bool isPDEDevice () const
 Returns true if this device is a PDE device. More...
 
virtual void forEachModel (DeviceModelOp &op) const
 Executes operator op, passing its DeviceModel pointer, for each device model. More...
 
virtual void forEachInstance (DeviceInstanceOp &op) const
 Executes operator op, passing its DeviceInstance pointer, for each device instance. More...
 
virtual DeviceModeladdModel (const ModelBlock &MB, const FactoryBlock &factory_block)
 Creates a device model and adds it to the device's list of models. More...
 
virtual DeviceInstanceaddInstance (const InstanceBlock &instance_block, const FactoryBlock &factory_block)
 Creates a device instance and adds to the device model's instance list. More...
 
virtual bool updateSources ()
 Updates the devices source information. More...
 
virtual bool updateState (double *solVec, double *staVec, double *stoVec)
 Updates the devices state information. More...
 
virtual bool updateSecondaryState (double *staDerivVec, double *stoVec)
 Updates the devices secondary state information. More...
 
virtual bool loadDAEVectors (double *solVec, double *fVec, double *qVec, double *storeLeadF, double *storeLeadQ)
 Populates the device's ExternData object with these pointers. More...
 
virtual bool loadDAEMatrices (N_LAS_Matrix &dFdx, N_LAS_Matrix &dQdx)
 Populates the device's Jacobian object with these pointers. More...
 
- Public Member Functions inherited from Xyce::Device::Device
 Device ()
 
virtual ~Device ()
 

Protected Types

typedef std::vector
< InstanceType * > 
InstanceVector
 
typedef std::map< std::string,
ModelType *, LessNoCase > 
ModelMap
 
typedef std::map< std::string,
DeviceEntity *, LessNoCase > 
EntityMap
 

Protected Member Functions

const SolverStategetSolverState () const
 Returns the solver state given during device construction. More...
 
const DeviceOptionsgetDeviceOptions () const
 Returns the device options given during device construction. More...
 
InstanceVector::const_iterator getInstanceBegin () const
 Returns an iterator to the beginning of the vector of all instances created for this device. More...
 
InstanceVector::const_iterator getInstanceEnd () const
 Returns an iterator to the ending of the vector of all instances created for this device. More...
 
bool isModelRequired () const
 Returns true if the model name must be specified for each instance. More...
 

Private Member Functions

 DeviceMaster (const DeviceMaster &right)
 No copying. More...
 
 DeviceMaster (const Device &)
 Eh? More...
 
DeviceMasteroperator= (const DeviceMaster &right)
 No assignments. More...
 
void addEntity (const std::string &name, DeviceEntity *entity)
 Adds an entity to the mapping of model and instance name to its entity. More...
 
virtual bool getBreakPoints (std::vector< Util::BreakPoint > &breakPointTimes)
 

Private Attributes

const std::string deviceName_
 
const std::string defaultModelName_
 
const Configurationconfiguration_
 
const SolverStatesolverState_
 
const DeviceOptionsdeviceOptions_
 
ModelMap modelMap_
 
InstanceVector instanceVector_
 
EntityMap entityMap_
 
ModelType *const defaultModel_
 

Detailed Description

template<class T>
class Xyce::Device::DeviceMaster< T >

DeviceMaster instantiates a device as described by the device traits T.

The Device Traits are described in in the device configuration.

See Also
Xyce::Device::Configuration
Parameters
Tdevice traits class
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Tue Feb 4 10:33:44 2014

Definition at line 103 of file N_DEV_DeviceMaster.h.

Member Typedef Documentation

template<class T>
typedef std::map<std::string, DeviceEntity *, LessNoCase> Xyce::Device::DeviceMaster< T >::EntityMap
protected

Definition at line 112 of file N_DEV_DeviceMaster.h.

template<class T>
typedef T::InstanceType Xyce::Device::DeviceMaster< T >::InstanceType

Make the instance being define available.

Definition at line 107 of file N_DEV_DeviceMaster.h.

template<class T>
typedef std::vector<InstanceType *> Xyce::Device::DeviceMaster< T >::InstanceVector
protected

Definition at line 110 of file N_DEV_DeviceMaster.h.

template<class T>
typedef std::map<std::string, ModelType *, LessNoCase> Xyce::Device::DeviceMaster< T >::ModelMap
protected

Definition at line 111 of file N_DEV_DeviceMaster.h.

template<class T>
typedef T::ModelType Xyce::Device::DeviceMaster< T >::ModelType

Make the model begin defined available.

Definition at line 106 of file N_DEV_DeviceMaster.h.

Constructor & Destructor Documentation

template<class T>
Xyce::Device::DeviceMaster< T >::DeviceMaster ( const Configuration configuration,
const FactoryBlock factory_block,
const SolverState solver_state,
const DeviceOptions device_options 
)
inline

Constructs a device.

When a device is constructed, a default model is created.

Parameters
configurationconst reference to device configuration
factory_blockconst reference to the factory provided parameters
solver_stateconst reference to the solver state to use for the device
device_optionsconst reference to the device options to use for the device
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Tue Feb 4 10:20:40 2014

Definition at line 128 of file N_DEV_DeviceMaster.h.

template<class T>
Xyce::Device::DeviceMaster< T >::DeviceMaster ( const std::string &  model_type_name,
const Configuration configuration,
const FactoryBlock factory_block,
const SolverState solver_state,
const DeviceOptions device_options 
)
inline

Constructs a device.

When a device is constructed, a default model is created.

Parameters
configurationconst reference to the device configuration
model_type_nameconst reference to the model type name inserted into the ModelBlock when creating the default model
factory_blockconst reference to the factory provided parameters
solver_stateconst reference to the solver state to use for the device
device_optionsconst reference to the device options to use for the device
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Tue Feb 4 10:22:41 2014

Definition at line 162 of file N_DEV_DeviceMaster.h.

template<class T>
virtual Xyce::Device::DeviceMaster< T >::~DeviceMaster ( )
inlinevirtual

Destroys the device.

Delete the models created by this device. The model will handle deleting the instances.

Returns
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Tue Feb 4 10:23:31 2014

Definition at line 193 of file N_DEV_DeviceMaster.h.

template<class T>
Xyce::Device::DeviceMaster< T >::DeviceMaster ( const DeviceMaster< T > &  right)
private

No copying.

template<class T>
Xyce::Device::DeviceMaster< T >::DeviceMaster ( const Device )
private

Eh?

Member Function Documentation

template<class T>
void Xyce::Device::DeviceMaster< T >::addEntity ( const std::string &  name,
DeviceEntity entity 
)
inlineprivate

Adds an entity to the mapping of model and instance name to its entity.

Note that currently if the name is duplicated, the previous value is overwritten.

Parameters
nameconst reference to the model or instance name
entitypointer to the model or instance
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Tue Feb 4 10:35:00 2014

Definition at line 427 of file N_DEV_DeviceMaster.h.

template<class T >
DeviceInstance * Xyce::Device::DeviceMaster< T >::addInstance ( const InstanceBlock instance_block,
const FactoryBlock factory_block 
)
virtual

Creates a device instance and adds to the device model's instance list.

Parameters
instance_blockconst reference to the model block describing the instance to create
factory_blockconst reference to the factory data needed to create the instance
Returns
pointer to the newly creates device instance
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Wed Jan 29 16:43:08 2014

Implements Xyce::Device::Device.

Definition at line 472 of file N_DEV_DeviceMaster.h.

template<class T >
DeviceModel * Xyce::Device::DeviceMaster< T >::addModel ( const ModelBlock model_block,
const FactoryBlock factory_block 
)
virtual

Creates a device model and adds it to the device's list of models.

Parameters
model_blockconst reference to the model block describing the model to create
factory_blockconst reference to the factory data needed to create the model
Returns
pointer to the newly created device model
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Wed Jan 29 16:40:30 2014

Implements Xyce::Device::Device.

Definition at line 526 of file N_DEV_DeviceMaster.h.

template<class T>
virtual DeviceEntity* Xyce::Device::DeviceMaster< T >::findEntity ( const std::string &  entity_name)
inlinevirtual

Returns a pointer to the model or instance entity with the specified name.

Parameters
entity_nameconst reference to the entity name
Returns
pointer to the entity or 0 is not found
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Tue Feb 4 10:36:44 2014

Implements Xyce::Device::Device.

Definition at line 242 of file N_DEV_DeviceMaster.h.

template<class T>
virtual const DeviceEntity* Xyce::Device::DeviceMaster< T >::findEntity ( const std::string &  entity_name) const
inlinevirtual

Returns a pointer to the model or instance entity with the specified name.

Parameters
entity_nameconst reference to the entity name
Returns
const pointer to the entity or 0 is not found
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Tue Feb 4 10:36:44 2014

Implements Xyce::Device::Device.

Definition at line 261 of file N_DEV_DeviceMaster.h.

template<class T>
virtual void Xyce::Device::DeviceMaster< T >::forEachInstance ( DeviceInstanceOp op) const
inlinevirtual

Executes operator op, passing its DeviceInstance pointer, for each device instance.

Since the instance information is managed in a map of InstanceType pointers, it is not possible to return the map as an association to DeviceInstance pointers. This function iterates over the instances and passes it the DeviceInstance pointer for each.

Parameters
opfunctor taking a DeviceInstance pointer as an argument
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Tue Feb 4 10:53:45 2014

Implements Xyce::Device::Device.

Definition at line 326 of file N_DEV_DeviceMaster.h.

template<class T>
virtual void Xyce::Device::DeviceMaster< T >::forEachModel ( DeviceModelOp op) const
inlinevirtual

Executes operator op, passing its DeviceModel pointer, for each device model.

Since the model information is managed in a map of ModelType pointers, it is not possible to return the map as an association to DeviceModel pointers. This function iterates over the models and passes it the DeviceModel pointer for each.

Parameters
opfunctor taking a DeviceModel pointer as an argument
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Tue Feb 4 10:53:45 2014

Implements Xyce::Device::Device.

Definition at line 308 of file N_DEV_DeviceMaster.h.

template<class T >
bool Xyce::Device::DeviceMaster< T >::getBreakPoints ( std::vector< Util::BreakPoint > &  breakPointTimes)
privatevirtual

Definition at line 595 of file N_DEV_DeviceMaster.h.

template<class T>
virtual const std::string& Xyce::Device::DeviceMaster< T >::getDefaultModelName ( ) const
inlinevirtual

Returns the default model name to use if the instance being created does not specify one.

Returns
const reference to the default model name
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Tue Feb 4 10:26:10 2014

Implements Xyce::Device::Device.

Definition at line 228 of file N_DEV_DeviceMaster.h.

template<class T>
const DeviceOptions& Xyce::Device::DeviceMaster< T >::getDeviceOptions ( ) const
inlineprotected

Returns the device options given during device construction.

Returns
const reference to the device options
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Tue Feb 4 10:27:48 2014

Definition at line 365 of file N_DEV_DeviceMaster.h.

template<class T>
InstanceVector::const_iterator Xyce::Device::DeviceMaster< T >::getInstanceBegin ( ) const
inlineprotected

Returns an iterator to the beginning of the vector of all instances created for this device.

While a device instance is created, the device model owns the pointer to the device. The instanceVector_ gets a copy so that all instances of this device may be iterated over without needing to go through the model.

Returns
iterator to the beginning of the device instance vector
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Tue Feb 4 10:28:29 2014

Definition at line 381 of file N_DEV_DeviceMaster.h.

template<class T>
InstanceVector::const_iterator Xyce::Device::DeviceMaster< T >::getInstanceEnd ( ) const
inlineprotected

Returns an iterator to the ending of the vector of all instances created for this device.

While a device instance is created, the device model owns the pointer to the device. The instanceVector_ gets a copy so that all instances of this device may be iterated over without needing to go through the model.

Returns
iterator to the ending of the device instance vector
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Tue Feb 4 10:28:29 2014

Definition at line 397 of file N_DEV_DeviceMaster.h.

template<class T>
virtual const std::string& Xyce::Device::DeviceMaster< T >::getName ( ) const
inlinevirtual

Returns the name of this device.

Returns
const reference to the device's name
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Tue Feb 4 10:25:37 2014

Implements Xyce::Device::Device.

Definition at line 215 of file N_DEV_DeviceMaster.h.

template<class T>
const SolverState& Xyce::Device::DeviceMaster< T >::getSolverState ( ) const
inlineprotected

Returns the solver state given during device construction.

Returns
const reference to the solver state
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Tue Feb 4 10:27:14 2014

Definition at line 352 of file N_DEV_DeviceMaster.h.

template<class T>
virtual bool Xyce::Device::DeviceMaster< T >::isLinearDevice ( ) const
inlinevirtual

Returns true if this device is a linear device.

Returns
the device is linear value provided via the device trait.
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Tue Feb 4 10:51:52 2014

Implements Xyce::Device::Device.

Definition at line 278 of file N_DEV_DeviceMaster.h.

template<class T>
bool Xyce::Device::DeviceMaster< T >::isModelRequired ( ) const
inlineprotected

Returns true if the model name must be specified for each instance.

Returns
the device model required value provided via the device trait.
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Tue Feb 4 10:32:10 2014

Definition at line 410 of file N_DEV_DeviceMaster.h.

template<class T>
virtual bool Xyce::Device::DeviceMaster< T >::isPDEDevice ( ) const
inlinevirtual

Returns true if this device is a PDE device.

Returns
the device is PDE value provided via the device trait.
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Tue Feb 4 10:53:10 2014

Implements Xyce::Device::Device.

Definition at line 291 of file N_DEV_DeviceMaster.h.

template<class T >
bool Xyce::Device::DeviceMaster< T >::loadDAEVectors ( double *  solVec,
double *  fVec,
double *  qVec,
double *  storeLeadF,
double *  storeLeadQ 
)
virtual

Populates the device's ExternData object with these pointers.

THIS FUNCTION MUST BE CALLED PRIOR TO CALLING loadDAEMatrices.

Parameters
solVecpointer to the analysis solution vector for this device
fVecpointer to the analysis f vector for this device
qVecpointer to the analysis q vector for this device
storeLeadFpointer to the analysis lead store f vector for this device
storeLeadQpoitner to the analysis load store q vector for this device
Returns
true if the update was successful
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Wed Jan 29 16:47:20 2014

Reimplemented from Xyce::Device::Device.

Reimplemented in Xyce::Device::MOSFET_B3SOI::Master, Xyce::Device::MOSFET_B4::Master, Xyce::Device::MOSFET_B3::Master, Xyce::Device::VDMOS::Master, Xyce::Device::MOSFET1::Master, Xyce::Device::BJT::Master, Xyce::Device::MOSFET2::Master, Xyce::Device::MOSFET3::Master, Xyce::Device::MOSFET6::Master, Xyce::Device::LTRA::Master, Xyce::Device::JFET::Master, Xyce::Device::MESFET::Master, Xyce::Device::Resistor::Master, Xyce::Device::Diode::Master, Xyce::Device::MutIndLin::Master, Xyce::Device::MutIndNonLin::Master, Xyce::Device::Capacitor::Master, Xyce::Device::Vsrc::Master, Xyce::Device::Resistor3::Master, Xyce::Device::Bsrc::Master, Xyce::Device::Inductor::Master, Xyce::Device::SW::Master, Xyce::Device::ThermalResistor::Master, Xyce::Device::Synapse4::Master, Xyce::Device::ROM::Master, Xyce::Device::ISRC::Master, Xyce::Device::DAC::Master, Xyce::Device::ADC::Master, Xyce::Device::Vcvs::Master, and Xyce::Device::VCCS::Master.

Definition at line 684 of file N_DEV_DeviceMaster.h.

template<class T>
DeviceMaster& Xyce::Device::DeviceMaster< T >::operator= ( const DeviceMaster< T > &  right)
private

No assignments.

template<class T >
bool Xyce::Device::DeviceMaster< T >::updateSecondaryState ( double *  staDerivVec,
double *  stoVec 
)
virtual

Updates the devices secondary state information.

This function is called by the analysis subsystem when it is time to update the device secondary state information.

Returns
true if the update was successful
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Wed Jan 29 16:44:34 2014

Reimplemented from Xyce::Device::Device.

Reimplemented in Xyce::Device::VDMOS::Master, Xyce::Device::BJT::Master, Xyce::Device::LTRA::Master, Xyce::Device::MutIndNonLin::Master, Xyce::Device::Bsrc::Master, Xyce::Device::Inductor::Master, Xyce::Device::SW::Master, Xyce::Device::Synapse4::Master, Xyce::Device::DAC::Master, Xyce::Device::Synapse::Master, Xyce::Device::Synapse2::Master, and Xyce::Device::ADC::Master.

Definition at line 663 of file N_DEV_DeviceMaster.h.

template<class T >
bool Xyce::Device::DeviceMaster< T >::updateSources ( )
virtual

Updates the devices source information.

This function is called by the analysis subsystem when it is time to update the device source information.

Returns
true if the update was successful
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Wed Jan 29 16:44:34 2014

Reimplemented from Xyce::Device::Device.

Definition at line 623 of file N_DEV_DeviceMaster.h.

template<class T >
bool Xyce::Device::DeviceMaster< T >::updateState ( double *  solVec,
double *  staVec,
double *  stoVec 
)
virtual

Member Data Documentation

template<class T>
const Configuration& Xyce::Device::DeviceMaster< T >::configuration_
private

Definition at line 439 of file N_DEV_DeviceMaster.h.

template<class T>
ModelType* const Xyce::Device::DeviceMaster< T >::defaultModel_
private

Definition at line 445 of file N_DEV_DeviceMaster.h.

template<class T>
const std::string Xyce::Device::DeviceMaster< T >::defaultModelName_
private

Definition at line 438 of file N_DEV_DeviceMaster.h.

template<class T>
const std::string Xyce::Device::DeviceMaster< T >::deviceName_
private

Definition at line 437 of file N_DEV_DeviceMaster.h.

template<class T>
const DeviceOptions& Xyce::Device::DeviceMaster< T >::deviceOptions_
private

Definition at line 441 of file N_DEV_DeviceMaster.h.

template<class T>
EntityMap Xyce::Device::DeviceMaster< T >::entityMap_
private

Definition at line 444 of file N_DEV_DeviceMaster.h.

template<class T>
InstanceVector Xyce::Device::DeviceMaster< T >::instanceVector_
private

Definition at line 443 of file N_DEV_DeviceMaster.h.

template<class T>
ModelMap Xyce::Device::DeviceMaster< T >::modelMap_
private

Definition at line 442 of file N_DEV_DeviceMaster.h.

template<class T>
const SolverState& Xyce::Device::DeviceMaster< T >::solverState_
private

Definition at line 440 of file N_DEV_DeviceMaster.h.


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