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 
  397            return info.Matches( aName );
 
 
 
  405    static DEVICE_INFO 
DeviceInfo( DEVICE_T aDeviceType );
 
  411                                    bool aResolve, 
int aDepth, 
REPORTER& aReporter );
 
  413    static std::unique_ptr<SIM_MODEL> 
Create( 
TYPE aType, 
const std::vector<SCH_PIN*>& aPins,
 
  417                                              const std::vector<SCH_PIN*>& aPins,
 
  421                                              const std::vector<SCH_PIN*>& aPins,
 
  422                                              const std::vector<SCH_FIELD>& aFields,
 
  423                                              bool aResolve, 
int aDepth,
 
  426    static std::unique_ptr<SIM_MODEL> 
Create( 
const std::vector<SCH_FIELD>& aFields,
 
  427                                              bool aResolve, 
int aDepth,
 
  428                                              const std::vector<SCH_PIN*>& aPins,
 
  443    void ReadDataFields( 
const std::vector<SCH_FIELD>* aFields, 
bool aResolve, 
int aDepth,
 
  444                         const std::vector<SCH_PIN*>& aPins );
 
  446    void WriteFields( std::vector<SCH_FIELD>& aFields ) 
const;
 
  454    void AddParam( 
const PARAM::INFO& aInfo );
 
  465    virtual std::vector<std::string> 
GetPinNames()
 const { 
return {}; }
 
  470    std::vector<std::reference_wrapper<const SIM_MODEL_PIN>> 
GetPins() 
const;
 
  474                                                  const wxString& aSymbolPinNumber );
 
  488    void SetParamValue( 
int aParamIndex, 
const std::string& aValue,
 
  490    void SetParamValue( 
const std::string& aParamName, 
const std::string& aValue,
 
  510    static bool InferSimModel( 
T& aSymbol, std::vector<SCH_FIELD>* aFields, 
bool aResolve, 
int aDepth,
 
  512                               wxString* aModelType, wxString* aModelParams, wxString* aPinMap );
 
  518    static std::unique_ptr<SIM_MODEL> 
Create( 
TYPE aType );
 
  521    SIM_MODEL( 
TYPE aType, std::unique_ptr<SPICE_GENERATOR> aSpiceGenerator );
 
  522    SIM_MODEL( 
TYPE aType, std::unique_ptr<SPICE_GENERATOR> aSpiceGenerator,
 
  523               std::unique_ptr<SIM_MODEL_SERIALIZER> aSerializer );
 
  525    void createPins( 
const std::vector<SCH_PIN*>& aSymbolPins );
 
  527    virtual int doFindParam( 
const std::string& aParamName ) 
const;
 
  528    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
 
friend class NETLIST_EXPORTER_SPICE
 
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
 
std::vector< SIM_MODEL_PIN > m_modelPins
 
static INFO TypeInfo(TYPE aType)
 
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, bool aResolve, int aDepth, const std::vector< SCH_PIN * > &aPins)
 
static bool InferSimModel(T &aSymbol, std::vector< SCH_FIELD > *aFields, bool aResolve, int aDepth, SIM_VALUE_GRAMMAR::NOTATION aNotation, wxString *aDeviceType, wxString *aModelType, wxString *aModelParams, wxString *aPinMap)
 
const SPICE_GENERATOR & SpiceGenerator() const
 
virtual const PARAM & GetParam(unsigned aParamIndex) const
 
void createPins(const std::vector< SCH_PIN * > &aSymbolPins)
 
void WriteFields(std::vector< SCH_FIELD > &aFields) const
 
virtual void SetBaseModel(const SIM_MODEL &aBaseModel)
 
static TYPE ReadTypeFromFields(const std::vector< SCH_FIELD > &aFields, bool aResolve, int aDepth, REPORTER &aReporter)
 
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
 
friend class SPICE_GENERATOR
 
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
 
SIM_VALUE_GRAMMAR::NOTATION NOTATION
 
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