45 #include <Xyce_config.h>
52 #include <N_LAS_Matrix.h>
53 #include <N_UTL_FeatureTest.h>
177 .setDescription(
"Resistance")
178 .setAnalyticSensitivityAvailable(
true)
179 .setSensitivityFunctor(&
resSens);
182 .setDescription(
"Length");
185 .setDescription(
"Width");
189 .setDescription(
"Device temperature");
194 .setDescription(
"Linear Temperature Coefficient");
198 .setDescription(
"Quadratic Temperature Coefficient");
204 .setDescription(
"Device Temperature -- For compatibility only. Parameter is NOT used");
235 .setDescription(
"Linear Temperature Coefficient");
238 .setDescription(
"Quadratic Temperature Coefficient");
241 .setDescription(
"Sheet Resistance");
244 .setDescription(
"Resistance Multiplier");
247 .setDescription(
"Default Instance Width");
250 .setDescription(
"Narrowing due to side etching");
253 .setDescription(
"Parameter Measurement Temperature");
281 :
DeviceInstance(instance_block, configuration.getInstanceParameters(), factory_block),
286 temp(factory_block.deviceOptions_.temp.getImmutableValue<double>()),
290 tempCoeff1Given(false),
291 tempCoeff2Given(false),
299 APosEquPosNodeOffset(-1),
300 APosEquNegNodeOffset(-1),
301 ANegEquPosNodeOffset(-1),
302 ANegEquNegNodeOffset(-1)
305 f_PosEquPosNodePtr(0),
306 f_PosEquNegNodePtr(0),
307 f_NegEquPosNodePtr(0),
308 f_NegEquNegNodePtr(0)
382 UserWarning0(*
this) <<
"Resistance is set to 0, setting to the default, " <<
R <<
" ohms";
424 const std::vector<int> & intLIDVecRef,
425 const std::vector<int> & extLIDVecRef)
437 if (DEBUG_DEVICE && isActive(Diag::DEVICE_PARAMETERS))
442 <<
"li_Pos_ = " <<
li_Pos << std::endl
443 <<
"li_Neg_ = " <<
li_Neg << std::endl
630 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
690 double v_pos = solVec[
li_Pos];
691 double v_neg = solVec[
li_Neg];
692 i0 = (v_pos-v_neg)*
G;
878 bool bsuccess =
true;
879 double difference, factor;
881 if (temp_tmp != -999.0)
887 G = 1.0/(
R * factor);
907 noiseData.
resize(numSources);
976 (*it)->processParams();
1003 :
DeviceModel(model_block, configuration.getModelParameters(), factory_block),
1007 resistanceMultiplier(1.0),
1010 tnom(getDeviceOptions().tnom)
1076 os <<
"Number of Resistor Instances: " <<
instanceContainer.size() << std::endl;
1077 os <<
" name model name Parameters" << std::endl;
1082 os <<
" " << i <<
": " << (*it)->getName() <<
"\t";
1084 os <<
"\t\tR(Tnom) = " << (*it)->R;
1085 os <<
"\tG(T) = " << (*it)->G;
1111 for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
1148 double v_pos = solVec[ri.
li_Pos];
1149 double v_neg = solVec[ri.
li_Neg];
1152 ri.
i0 = (v_pos-v_neg)*ri.
G;
1187 bool Master::loadDAEVectors (
double * solVec,
double * fVec,
double *qVec,
double * bVec,
double * storeLeadF,
double * storeLeadQ,
double * leadF,
double * leadQ,
double * junctionV)
1236 #ifndef Xyce_NONPOINTER_MATRIX_LOAD
1293 .registerDevice(
"r", 1)
1294 .registerModelType(
"r", 1)
1295 .registerModelType(
"res", 1);
1308 const std::string & name,
1309 std::vector<double> & dfdp,
1310 std::vector<double> & dqdp,
1311 std::vector<double> & dbdp,
1312 std::vector<int> & Findices,
1313 std::vector<int> & Qindices,
1314 std::vector<int> & Bindices
1321 double v_pos = solVec[in->
li_Pos];
1322 double v_neg = solVec[in->
li_Neg];
1324 double dfdpLoc = -(v_pos-v_neg)*in->
G*in->
G;
1331 Findices[0] = in->
li_Pos;
1332 Findices[1] = in->
li_Neg;
const InstanceName & getName() const
static void loadModelParameters(ParametricData< Model > &p)
Loads the parameter definition into the model parameter map.
virtual bool updatePrimaryState()
Update the state variables.
int li_Pos
Index for Positive Node.
int ANegEquNegNodeOffset
Column index into force matrix of Neg/Neg conductance.
virtual void setupPointers()
Setup direct access pointer to solution matrix and vectors.
bool updateDependentParameters()
double sheetRes
Sheet resistance.
const DeviceOptions & deviceOptions_
Descriptor & addPar(const char *parName, T default_value, T U::*varPtr)
Adds the parameter description to the parameter map.
int li_branch_data
Index for Lead Current and junction voltage (for power calculations)
InstanceVector instanceContainer
List of owned resistor instances.
bool given(const std::string ¶meter_name) const
double length
Resistor length.
double * f_PosEquPosNodePtr
void G(const ScalarT &V1, const ScalarT &V2, const ScalarT &Ap, const ScalarT &An, ScalarT &Vp, ScalarT &Vn, ScalarT &fval)
Pure virtual class to augment a linear system.
Parameter may be specified as time dependent expression from netlist.
static resistorSensitivity resSens
static void initializeJacobianStamp()
Common Jacobian stamp initializer for all Resistor devices.
double * f_NegEquNegNodePtr
const std::string & getEncodedName() const
Return the instance name encoded as: [s:]*xname [s:]*Ytype!name [s:]*Utype!name!count.
double tempCoeff2
Second order temperature coeff.
virtual void registerBranchDataLIDs(const std::vector< int > &branchLIDVecRef)
Register the local store IDs.
void setNumStoreVars(int num_store_vars)
double resistanceMultiplier
resistance multiplier
int APosEquPosNodeOffset
Column index into force matrix of Pos/Pos conductance.
void addBranchDataNode(Util::SymbolTable &symbol_table, int index, const InstanceName &instance_name, const std::string &lead_name)
void makeVector(const std::string &cname, int len)
Allows the parameter to be specified as a vector.
std::vector< int > li_Neg
InstanceVector::const_iterator getInstanceEnd() const
Returns an iterator to the ending of the vector of all instances created for this device...
Base class for all parameters.
std::vector< int > li_Pos
virtual bool processParams()
Process parameters.
virtual void registerJacLIDs(const JacobianStamp &jacLIDVec)
double * nextJunctionVCompRawPtr
double tnom
nominal temperature for device params.
virtual bool updateState(double *solVec, double *staVec, double *stoVec)
Update state for all resistor instances, regardless of model.
static void loadInstanceParameters(ParametricData< Instance > &p)
Loads the parameter definition into the instance parameter map.
virtual void loadNodeSymbols(Util::SymbolTable &symbol_table) const
Populates and returns the store name map.
int getNumStoreVars() const
InstanceVector::const_iterator getInstanceBegin() const
Returns an iterator to the beginning of the vector of all instances created for this device...
std::vector< Param > params
Parameters from the line.
std::vector< double > noiseDens
virtual bool loadDAEVectors(double *solVec, double *fVec, double *qVec, double *bVec, double *storeLeadF, double *storeLeadQ, double *leadF, double *leadQ, double *junctionV)
Load DAE vectors of all resistor instances, regardless of model.
virtual void forEachInstance(DeviceInstanceOp &op) const
Apply a device instance "op" to all instances associated with this model.
std::vector< std::string > noiseNames
virtual bool loadDAEFVector()
Load the DAE F vector.
void setParams(const std::vector< Param > ¶ms)
double tempCoeff1
First order temperature coeff.
const std::string & getName() const
double * daeFVectorRawPtr
The FactoryBlock contains parameters needed by the device, instance and model creation functions...
virtual void operator()(const ParameterBase &entity, const std::string &name, std::vector< double > &dfdp, std::vector< double > &dqdp, std::vector< double > &dbdp, std::vector< int > &Findices, std::vector< int > &Qindices, std::vector< int > &Bindices) const
const DeviceOptions & getDeviceOptions() const
double temp
Temperature of this instance.
double * nextStoVectorRawPtr
double dtemp
Externally specified device temperature.
int li_store_dev_i
Index for Lead Current.
virtual void registerJacLIDs(const std::vector< std::vector< int > > &jacLIDVec)
Register the Jacobian local IDs.
int numBranchDataVarsIfAllocated
bool tempCoeff2Given
Second order temperature coeff was given in netlist.
Resistor device instance class.
static Config< T > & addConfiguration()
Adds the device to the Xyce device configuration.
Linear::Matrix * dFdxMatrixPtr
double narrow
Narrowing due to side etching.
double R
Resistance (ohms)
The Device class is an interface for device implementations.
virtual bool processInstanceParams()
Process the instance parameters of instance owned by this model.
void setupNoiseSources(Xyce::Analysis::NoiseData &noiseData)
virtual void registerStateLIDs(const std::vector< int > &staLIDVecRef)
Register the local state IDs.
virtual std::ostream & printOutInstances(std::ostream &os) const
Print instances associated with this model.
virtual bool loadDAEdFdx()
Load the DAE the derivative of the F vector with respect to the solution vector x, dFdx.
Model & model_
Owning model.
const SolverState & solverState_
Class Configuration contains device configuration data.
virtual void registerLIDs(const std::vector< int > &intLIDVecRef, const std::vector< int > &extLIDVecRef)
Register local IDs.
std::vector< double > lnNoiseDens
static Device * factory(const Configuration &configuration, const FactoryBlock &factory_block)
Create a new instance of the Resistor device.
double * nextLeadCurrFCompRawPtr
double width
Resistor width.
void setNumBranchDataVars(int num_branch_data_vars)
int ANegEquPosNodeOffset
Column index into force matrix of Neg/Pos conductance.
double G
Conductance(1.0/ohms)
#define Xyce_NONPOINTER_MATRIX_LOAD
void noiseSupport(double &noise, double &lnNoise, const int type, const double param, const double temp)
virtual bool processParams()
Process model parameters.
double tempCoeff1
First order temperature coefficient.
double tempCoeff2
Second order temperature coefficient.
virtual bool loadDAEMatrices(Linear::Matrix &dFdx, Linear::Matrix &dQdx)
Load DAE matrices for all resistor instances, regardless of model.
double defWidth
Default width.
virtual void registerStoreLIDs(const std::vector< int > &stoLIDVecRef)
Register the local store IDs.
const ExternData & extData
ModelBlock represents a .MODEL line from the netlist.
Manages parameter binding for class C.
~Model()
Destroy this model.
int li_Neg
Index for Negative Node.
static std::vector< std::vector< int > > jacStamp
All Resistor instances have a common Jacobian Stamp.
InstanceBlock represent a device instance line from the netlist.
void registerDevice()
Define how to use the device in a netlist.
Instance(const Configuration &configuration, const InstanceBlock &instance_block, Model &model, const FactoryBlock &factory_block)
Construct a resistor instance.
Util::Param temp
operating temperature of ckt.
std::vector< Param > params
virtual bool updateTemperature(const double &temp_tmp)
Update the parameters that depend on the temperature of the device.
int APosEquNegNodeOffset
Column index into force matrix of Pos/Neg conductance.
double * f_NegEquPosNodePtr
void getNoiseSources(Xyce::Analysis::NoiseData &noiseData)
double tnom
Parameter measurement temperature.
int getNumBranchDataVars() const
bool tempCoeff1Given
First order temperation value was given in netlist.
void setModParams(const std::vector< Param > ¶ms)
double * f_PosEquNegNodePtr
double * nextSolVectorRawPtr
int numLeadCurrentStoreVars
virtual bool updateIntermediateVars()
Update the intermediate variables.
bool dtempGiven
Externally specified device temperature was given in netlist.