49#define SIM_REFERENCE_FIELD wxT( "Reference" )
50#define SIM_VALUE_FIELD wxT( "Value" )
52#define SIM_DEVICE_FIELD wxT( "Sim.Device" )
53#define SIM_DEVICE_SUBTYPE_FIELD wxT( "Sim.Type" )
54#define SIM_PINS_FIELD wxT( "Sim.Pins" )
55#define SIM_PARAMS_FIELD wxT( "Sim.Params" )
56#define SIM_LIBRARY_FIELD wxT( "Sim.Library" )
57#define SIM_NAME_FIELD wxT( "Sim.Name" )
58#define SIM_NODES_FORMAT_FIELD wxT( "Sim.NodesFormat" )
60#define SIM_LEGACY_ENABLE_FIELD_V7 wxT( "Sim.Enable" )
61#define SIM_LEGACY_PRIMITIVE_FIELD wxS( "Spice_Primitive" )
62#define SIM_LEGACY_MODEL_FIELD wxS( "Spice_Model" )
63#define SIM_LEGACY_PINS_FIELD wxS( "Spice_Node_Sequence" )
64#define SIM_LEGACY_ENABLE_FIELD wxS( "Spice_Netlist_Enabled" )
65#define SIM_LEGACY_LIBRARY_FIELD wxS( "Spice_Lib_File" )
126 std::string fieldValue;
127 std::string description;
166 NJFET_SHICHMANHODGES,
167 PJFET_SHICHMANHODGES,
169 NJFET_PARKERSKELLERN,
170 PJFET_PARKERSKELLERN,
297 std::string fieldValue;
298 std::string description;
345 INFO(
const std::string& aName =
"",
349 const std::string& aUnit =
"",
350 CATEGORY aCategory = CATEGORY::PRINCIPAL,
351 const std::string& aDefaultValue =
"",
352 const std::string& legacy_unused_value =
"",
353 const std::string& aDescription =
"",
354 bool aIsSpiceInstanceParam =
false,
355 bool aIsInstanceParam =
false,
356 const std::string& aSpiceModelName =
"",
357 const std::string& aSpiceInstanceName =
"",
358 std::vector<std::string> aEnumValues = {} ) :
374 bool Matches(
const std::string& aName )
const;
395 bool Matches(
const std::string& aName )
const
405 static DEVICE_INFO
DeviceInfo( DEVICE_T aDeviceType );
412 static std::unique_ptr<SIM_MODEL>
Create(
TYPE aType,
const std::vector<SCH_PIN*>& aPins,
416 const std::vector<SCH_PIN*>& aPins,
420 const std::vector<SCH_PIN*>& aPins,
421 const std::vector<SCH_FIELD>& aFields,
424 static std::unique_ptr<SIM_MODEL>
Create(
const std::vector<SCH_FIELD>& aFields,
425 const std::vector<SCH_PIN*>& aPins,
426 bool aResolved,
REPORTER& aReporter );
428 static std::string
GetFieldValue(
const std::vector<SCH_FIELD>* aFields,
429 const wxString& aFieldName,
430 bool aResolve =
true );
432 static void SetFieldValue( std::vector<SCH_FIELD>& aFields,
const wxString& aFieldName,
433 const std::string& aValue );
448 const std::vector<SCH_PIN*>& aPins );
450 void WriteFields( std::vector<SCH_FIELD>& aFields )
const;
469 virtual std::vector<std::string>
GetPinNames()
const {
return {}; }
474 std::vector<std::reference_wrapper<const SIM_MODEL_PIN>>
GetPins()
const;
478 const wxString& aSymbolPinNumber );
492 void SetParamValue(
int aParamIndex,
const std::string& aValue,
494 void SetParamValue(
const std::string& aParamName,
const std::string& aValue,
514 static bool InferSimModel( T& aSymbol, std::vector<SCH_FIELD>* aFields,
bool aResolve,
516 wxString* aModelType, wxString* aModelParams, wxString* aPinMap );
522 static std::unique_ptr<SIM_MODEL>
Create(
TYPE aType );
525 SIM_MODEL(
TYPE aType, std::unique_ptr<SPICE_GENERATOR> aSpiceGenerator );
526 SIM_MODEL(
TYPE aType, std::unique_ptr<SPICE_GENERATOR> aSpiceGenerator,
527 std::unique_ptr<SIM_MODEL_SERIALIZER> aSerializer );
529 void createPins(
const std::vector<SCH_PIN*>& aSymbolPins );
531 virtual int doFindParam(
const std::string& aParamName )
const;
532 virtual void doSetParamValue(
int aParamIndex,
const std::string& aValue );
Container for project specific data.
A pure virtual class used to derive REPORTER objects from.
Serializes/deserializes a SIM_MODEL for storage in LIB_FIELDs/SCH_FIELDs.
int FindModelPinIndex(const std::string &aSymbolPinNumber)
const SIM_MODEL * GetBaseModel() const
static void MigrateSimModel(T &aSymbol, const PROJECT *aProject)
const PARAM & GetBaseParam(unsigned aParamIndex) const
void AddParam(const PARAM::INFO &aInfo)
bool IsStoredInValue() const
virtual std::vector< std::string > GetPinNames() const
std::unique_ptr< SPICE_GENERATOR > m_spiceGenerator
virtual bool requiresSpiceModelLine(const SPICE_ITEM &aItem) const
DEFINE_ENUM_CLASS_WITH_ITERATOR(TYPE, NONE, R, R_POT, R_BEHAVIORAL, C, C_BEHAVIORAL, L, L_BEHAVIORAL, K, TLINE_Z0, TLINE_RLGC, SW_V, SW_I, D, NPN_VBIC, PNP_VBIC, NPN_GUMMELPOON, PNP_GUMMELPOON, NPN_HICUM2, PNP_HICUM2, NJFET_SHICHMANHODGES, PJFET_SHICHMANHODGES, NJFET_PARKERSKELLERN, PJFET_PARKERSKELLERN, NMES_STATZ, PMES_STATZ, NMES_YTTERDAL, PMES_YTTERDAL, NMES_HFET1, PMES_HFET1, NMES_HFET2, PMES_HFET2, NMOS_VDMOS, PMOS_VDMOS, NMOS_MOS1, PMOS_MOS1, NMOS_MOS2, PMOS_MOS2, NMOS_MOS3, PMOS_MOS3, NMOS_BSIM1, PMOS_BSIM1, NMOS_BSIM2, PMOS_BSIM2, NMOS_MOS6, PMOS_MOS6, NMOS_MOS9, PMOS_MOS9, NMOS_BSIM3, PMOS_BSIM3, NMOS_B4SOI, PMOS_B4SOI, NMOS_BSIM4, PMOS_BSIM4, NMOS_B3SOIFD, PMOS_B3SOIFD, NMOS_B3SOIDD, PMOS_B3SOIDD, NMOS_B3SOIPD, PMOS_B3SOIPD, NMOS_HISIM2, PMOS_HISIM2, NMOS_HISIMHV1, PMOS_HISIMHV1, NMOS_HISIMHV2, PMOS_HISIMHV2, V, V_SIN, V_PULSE, V_EXP, V_AM, V_SFFM, V_VCL, V_CCL, V_PWL, V_WHITENOISE, V_PINKNOISE, V_BURSTNOISE, V_RANDUNIFORM, V_RANDGAUSSIAN, V_RANDEXP, V_RANDPOISSON, V_BEHAVIORAL, I, I_SIN, I_PULSE, I_EXP, I_AM, I_SFFM, I_VCL, I_CCL, I_PWL, I_WHITENOISE, I_PINKNOISE, I_BURSTNOISE, I_RANDUNIFORM, I_RANDGAUSSIAN, I_RANDEXP, I_RANDPOISSON, I_BEHAVIORAL, SUBCKT, XSPICE, KIBIS_DEVICE, KIBIS_DRIVER_DC, KIBIS_DRIVER_RECT, KIBIS_DRIVER_PRBS, RAWSPICE) struct INFO
static TYPE ReadTypeFromFields(const std::vector< SCH_FIELD > &aFields, REPORTER &aReporter)
std::vector< SIM_MODEL_PIN > m_modelPins
static INFO TypeInfo(TYPE aType)
static void SetFieldValue(std::vector< SCH_FIELD > &aFields, const wxString &aFieldName, const std::string &aValue)
virtual const PARAM * GetTunerParam() const
void AddPin(const SIM_MODEL_PIN &aPin)
static SPICE_INFO SpiceInfo(TYPE aType)
const SIM_MODEL_SERIALIZER & Serializer() const
void ReadDataFields(const std::vector< SCH_FIELD > *aFields, const std::vector< SCH_PIN * > &aPins)
const SPICE_GENERATOR & SpiceGenerator() const
virtual const PARAM & GetParam(unsigned aParamIndex) const
static bool InferSimModel(T &aSymbol, std::vector< SCH_FIELD > *aFields, bool aResolve, SIM_VALUE_GRAMMAR::NOTATION aNotation, wxString *aDeviceType, wxString *aModelType, wxString *aModelParams, wxString *aPinMap)
void createPins(const std::vector< SCH_PIN * > &aSymbolPins)
void WriteFields(std::vector< SCH_FIELD > &aFields) const
virtual void SetBaseModel(const SIM_MODEL &aBaseModel)
static std::string GetFieldValue(const std::vector< SCH_FIELD > *aFields, const wxString &aFieldName, bool aResolve=true)
int GetParamCount() const
void AssignSymbolPinNumberToModelPin(int aPinIndex, const wxString &aSymbolPinNumber)
DEVICE_INFO GetDeviceInfo() const
DEVICE_T GetDeviceType() const
static DEVICE_INFO DeviceInfo(DEVICE_T aDeviceType)
const PARAM * FindParam(const std::string &aParamName) const
virtual void doSetParamValue(int aParamIndex, const std::string &aValue)
std::vector< PARAM > m_params
const PARAM & GetParamOverride(unsigned aParamIndex) const
SIM_MODEL(SIM_MODEL &&aOther)=default
virtual bool HasAutofill() const
void SetIsEnabled(bool aIsEnabled)
static std::unique_ptr< SIM_MODEL > Create(TYPE aType, const std::vector< SCH_PIN * > &aPins, REPORTER &aReporter)
SIM_MODEL & operator=(SIM_MODEL &&aOther)=delete
void SetParamValue(int aParamIndex, const std::string &aValue, SIM_VALUE::NOTATION aNotation=SIM_VALUE::NOTATION::SI)
SPICE_INFO GetSpiceInfo() const
virtual void SwitchSingleEndedDiff(bool aDiff)
const SIM_MODEL_PIN & GetPin(unsigned aIndex) const
void SetIsStoredInValue(bool aIsStoredInValue)
std::unique_ptr< SIM_MODEL_SERIALIZER > m_serializer
virtual bool HasPrimaryValue() const
virtual int doFindParam(const std::string &aParamName) const
DEFINE_ENUM_CLASS_WITH_ITERATOR(DEVICE_T, NONE, R, C, L, K, TLINE, SW, D, NPN, PNP, NJFET, PJFET, NMES, PMES, NMOS, PMOS, V, I, E, F, G, H, SUBCKT, XSPICE, KIBIS, SPICE) struct DEVICE_INFO
std::vector< std::reference_wrapper< const SIM_MODEL_PIN > > GetPins() const
const SIM_MODEL * m_baseModel
SIM_MODEL(const SIM_MODEL &aOther)=delete
@ NONE
No connection to this item.
std::string spiceModelName
std::vector< std::string > enumValues
INFO(const std::string &aName="", unsigned aId=0, DIR aDir=DIR_INOUT, SIM_VALUE::TYPE aType=SIM_VALUE::TYPE_FLOAT, const std::string &aUnit="", CATEGORY aCategory=CATEGORY::PRINCIPAL, const std::string &aDefaultValue="", const std::string &legacy_unused_value="", const std::string &aDescription="", bool aIsSpiceInstanceParam=false, bool aIsInstanceParam=false, const std::string &aSpiceModelName="", const std::string &aSpiceInstanceName="", std::vector< std::string > aEnumValues={})
bool Matches(const std::string &aName) const
std::string spiceInstanceName
bool isSpiceInstanceParam
bool Matches(const std::string &aName) const
static constexpr auto NOT_CONNECTED
const std::string modelPinName