Xyce  6.1
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...
 
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 DeviceModelfindModel (const ModelName &model_name)
 Returns a pointer to the model or model model with the specified name. More...
 
virtual const DeviceModelfindModel (const ModelName &model_name) const
 Returns a pointer to the model or model model with the specified name. More...
 
virtual DeviceEntityfindInstance (const InstanceName &instance_name)
 Returns a pointer to the model or instance entity with the specified name. More...
 
virtual const DeviceEntityfindInstance (const InstanceName &instance_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 ModelTypeaddModel (const ModelBlock &MB, const FactoryBlock &factory_block)
 Creates a device model and adds it to the device's list of models. More...
 
virtual InstanceTypeaddInstance (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 *bVec, double *storeLeadF, double *storeLeadQ, double *leadF, double *leadQ, double *junctionV)
 Populates the device's ExternData object with these pointers. More...
 
virtual bool loadDAEMatrices (Linear::Matrix &dFdx, Linear::Matrix &dQdx)
 Populates the device's Jacobian object with these pointers. More...
 
virtual bool isConverged () const
 Checks that the device is converged. More...
 
- Public Member Functions inherited from Xyce::Device::Device
 Device ()
 
virtual ~Device ()
 

Protected Types

typedef std::vector< InstanceType * > InstanceVector
 
typedef unordered_map< std::string, ModelType *, HashNoCase, EqualNoCase > ModelMap
 
typedef unordered_map< std::string, InstanceType *, HashNoCase, EqualNoCase > InstanceMap
 

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...
 
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_
 
InstanceMap instanceMap_
 

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 114 of file N_DEV_DeviceMaster.h.

Member Typedef Documentation

template<class T>
typedef unordered_map<std::string, InstanceType *, HashNoCase, EqualNoCase> Xyce::Device::DeviceMaster< T >::InstanceMap
protected

Definition at line 123 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 118 of file N_DEV_DeviceMaster.h.

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

Definition at line 121 of file N_DEV_DeviceMaster.h.

template<class T>
typedef unordered_map<std::string, ModelType *, HashNoCase, EqualNoCase> Xyce::Device::DeviceMaster< T >::ModelMap
protected

Definition at line 122 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 117 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 139 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 165 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 >
DeviceMaster< T >::InstanceType * 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

Implements Xyce::Device::Device.

Definition at line 466 of file N_DEV_DeviceMaster.h.

template<class T >
DeviceMaster< T >::ModelType * 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

Implements Xyce::Device::Device.

Definition at line 538 of file N_DEV_DeviceMaster.h.

template<class T>
virtual DeviceEntity* Xyce::Device::DeviceMaster< T >::findInstance ( const InstanceName instance_name)
inlinevirtual

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

Parameters
instance_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 253 of file N_DEV_DeviceMaster.h.

template<class T>
virtual const DeviceEntity* Xyce::Device::DeviceMaster< T >::findInstance ( const InstanceName instance_name) const
inlinevirtual

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

Parameters
instance_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 272 of file N_DEV_DeviceMaster.h.

template<class T>
virtual DeviceModel* Xyce::Device::DeviceMaster< T >::findModel ( const ModelName model_name)
inlinevirtual

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

Parameters
model_nameconst reference to the model name
Returns
pointer to the model 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 215 of file N_DEV_DeviceMaster.h.

template<class T>
virtual const DeviceModel* Xyce::Device::DeviceMaster< T >::findModel ( const ModelName model_name) const
inlinevirtual

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

Parameters
model_nameconst reference to the model name
Returns
const pointer to the model 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 234 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 337 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 319 of file N_DEV_DeviceMaster.h.

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

Reimplemented in Xyce::Device::ADC::Master.

Definition at line 607 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 200 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 378 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 394 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 410 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 187 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 365 of file N_DEV_DeviceMaster.h.

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

Checks that the device is converged.

Reimplemented from Xyce::Device::Device.

Definition at line 746 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 289 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 423 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 302 of file N_DEV_DeviceMaster.h.

template<class T >
bool Xyce::Device::DeviceMaster< T >::loadDAEVectors ( double *  solVec,
double *  fVec,
double *  qVec,
double *  bVec,
double *  storeLeadF,
double *  storeLeadQ,
double *  leadF,
double *  leadQ,
double *  junctionV 
)
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

Reimplemented from Xyce::Device::Device.

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

Definition at line 696 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

Reimplemented from Xyce::Device::Device.

Reimplemented in Xyce::Device::BJT::Master, Xyce::Device::VDMOS::Master, Xyce::Device::LTRA::Master, Xyce::Device::MutIndNonLin::Master, Xyce::Device::Inductor::Master, Xyce::Device::Bsrc::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 675 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

Reimplemented from Xyce::Device::Device.

Definition at line 635 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 434 of file N_DEV_DeviceMaster.h.

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

Definition at line 433 of file N_DEV_DeviceMaster.h.

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

Definition at line 432 of file N_DEV_DeviceMaster.h.

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

Definition at line 436 of file N_DEV_DeviceMaster.h.

template<class T>
InstanceMap Xyce::Device::DeviceMaster< T >::instanceMap_
private

Definition at line 439 of file N_DEV_DeviceMaster.h.

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

Definition at line 438 of file N_DEV_DeviceMaster.h.

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

Definition at line 437 of file N_DEV_DeviceMaster.h.

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

Definition at line 435 of file N_DEV_DeviceMaster.h.


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