KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sim_model.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2022 Mikolaj Wielgus
5 * Copyright (C) 2022 CERN
6 * Copyright (C) 2022-2023 KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 3
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * https://www.gnu.org/licenses/gpl-3.0.html
21 * or you may search the http://www.gnu.org website for the version 3 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#ifndef SIM_MODEL_H
27#define SIM_MODEL_H
28
29#include <wx/string.h>
30#include <map>
31#include <utility>
32
33#include <reporter.h>
34#include <sch_field.h>
35#include <lib_field.h>
36
37// Must be included after sch_field.h (exactly eda_shape.h) to avoid a colliding
38// declaration with a window header (under msys2)
39#include <sim/sim_value.h>
40#include <enum_vector.h>
41
42class SIM_LIBRARY;
43struct SPICE_ITEM;
44class SPICE_GENERATOR;
46class PROJECT;
47
48
49#define SIM_REFERENCE_FIELD wxT( "Reference" )
50#define SIM_VALUE_FIELD wxT( "Value" )
51
52#define SIM_DEVICE_TYPE_FIELD wxT( "Sim.Device" )
53#define SIM_TYPE_FIELD wxT( "Sim.Type" )
54#define SIM_PINS_FIELD wxT( "Sim.Pins" )
55#define SIM_PARAMS_FIELD wxT( "Sim.Params" )
56// Note: this has been moved to an actual attribute and is no longer written
57// out as a field
58#define SIM_ENABLE_FIELD wxT( "Sim.Enable" )
59#define SIM_LIBRARY_FIELD wxT( "Sim.Library" )
60#define SIM_NAME_FIELD wxT( "Sim.Name" )
61
62#define SIM_LEGACY_DEVICE_TYPE_FIELD wxS( "Spice_Primitive" )
63#define SIM_LEGACY_TYPE_FIELD wxS( "Spice_Model" )
64#define SIM_LEGACY_PINS_FIELD wxS( "Spice_Node_Sequence" )
65#define SIM_LEGACY_ENABLE_FIELD wxS( "Spice_Netlist_Enabled" )
66#define SIM_LEGACY_LIBRARY_FIELD wxS( "Spice_Lib_File" )
67
68
70{
71public:
72 friend class SPICE_GENERATOR;
74
75 struct PIN;
76 struct PARAM;
77
78 // There's a trailing '_' because `DEVICE_TYPE` collides with something in Windows headers.
80 NONE,
81
82 R,
83 C,
84 L,
85 TLINE,
86 SW,
87
88 D,
89 NPN,
90 PNP,
91
92 NJFET,
93 PJFET,
94
95 NMES,
96 PMES,
97
98 NMOS,
99 PMOS,
100
101 V,
102 I,
103 E,
104 F,
105 G,
106 H,
107
108 SUBCKT,
109 XSPICE,
110
111 KIBIS,
112
113 SPICE
114 )
115
116 struct DEVICE_INFO
117 {
118 std::string fieldValue;
119 std::string description;
120 bool showInMenu;
121 };
122
123
125 NONE,
126
127 R,
128 R_POT,
129 R_BEHAVIORAL,
130
131 C,
132 C_BEHAVIORAL,
133
134 L,
135 L_MUTUAL,
136 L_BEHAVIORAL,
137
138 TLINE_Z0,
139 TLINE_RLGC,
140
141 SW_V,
142 SW_I,
143
144 D,
145
146 NPN_VBIC,
147 PNP_VBIC,
148 NPN_GUMMELPOON,
149 PNP_GUMMELPOON,
150 //NPN_MEXTRAM,
151 //PNP_MEXTRAM,
152 NPN_HICUM2,
153 PNP_HICUM2,
154 //NPN_HICUM_L0,
155 //PNP_HICUM_L0,
156
157 NJFET_SHICHMANHODGES,
158 PJFET_SHICHMANHODGES,
159
160 NJFET_PARKERSKELLERN,
161 PJFET_PARKERSKELLERN,
162
163
164 NMES_STATZ,
165 PMES_STATZ,
166
167 NMES_YTTERDAL,
168 PMES_YTTERDAL,
169
170 NMES_HFET1,
171 PMES_HFET1,
172
173 NMES_HFET2,
174 PMES_HFET2,
175
176
177 NMOS_VDMOS,
178 PMOS_VDMOS,
179
180 NMOS_MOS1,
181 PMOS_MOS1,
182
183 NMOS_MOS2,
184 PMOS_MOS2,
185
186 NMOS_MOS3,
187 PMOS_MOS3,
188
189 NMOS_BSIM1,
190 PMOS_BSIM1,
191
192 NMOS_BSIM2,
193 PMOS_BSIM2,
194
195 NMOS_MOS6,
196 PMOS_MOS6,
197
198 NMOS_MOS9,
199 PMOS_MOS9,
200
201 NMOS_BSIM3,
202 PMOS_BSIM3,
203
204 NMOS_B4SOI,
205 PMOS_B4SOI,
206
207 NMOS_BSIM4,
208 PMOS_BSIM4,
209
210 //NMOS_EKV2_6,
211 //PMOS_EKV2_6,
212
213 //NMOS_PSP,
214 //PMOS_PSP,
215
216 NMOS_B3SOIFD,
217 PMOS_B3SOIFD,
218
219 NMOS_B3SOIDD,
220 PMOS_B3SOIDD,
221
222 NMOS_B3SOIPD,
223 PMOS_B3SOIPD,
224
225 //NMOS_STAG,
226 //PMOS_STAG,
227
228 NMOS_HISIM2,
229 PMOS_HISIM2,
230
231 NMOS_HISIMHV1,
232 PMOS_HISIMHV1,
233
234 NMOS_HISIMHV2,
235 PMOS_HISIMHV2,
236
237
238 V,
239 V_SIN,
240 V_PULSE,
241 V_EXP,
242 //V_SFAM,
243 //V_SFFM,
244 V_VCL,
245 V_CCL,
246 V_PWL,
247 V_WHITENOISE,
248 V_PINKNOISE,
249 V_BURSTNOISE,
250 V_RANDUNIFORM,
251 V_RANDNORMAL,
252 V_RANDEXP,
253 //V_RANDPOISSON,
254 V_BEHAVIORAL,
255
256 I,
257 I_SIN,
258 I_PULSE,
259 I_EXP,
260 //I_SFAM,
261 //I_SFFM,
262 I_VCL,
263 I_CCL,
264 I_PWL,
265 I_WHITENOISE,
266 I_PINKNOISE,
267 I_BURSTNOISE,
268 I_RANDUNIFORM,
269 I_RANDNORMAL,
270 I_RANDEXP,
271 //I_RANDPOISSON,
272 I_BEHAVIORAL,
273
274 SUBCKT,
275 XSPICE,
276
277 KIBIS_DEVICE,
278 KIBIS_DRIVER_DC,
279 KIBIS_DRIVER_RECT,
280 KIBIS_DRIVER_PRBS,
281
282 RAWSPICE
283 )
284
285 struct INFO
286 {
287 DEVICE_T deviceType;
288 std::string fieldValue;
289 std::string description;
290 };
291
292
294 {
295 std::string itemType;
296 std::string modelType = "";
297 std::string inlineTypeString = "";
298 std::string level = "";
299 bool isDefaultLevel = false;
300 bool hasExpression = false;
301 std::string version = "";
302 };
303
304
305 struct PIN
306 {
307 const std::string name;
308 std::string symbolPinNumber;
309
310 static constexpr auto NOT_CONNECTED = -1;
311 };
312
313
314 struct PARAM
315 {
316 // MS Windows compilers complain about the names IN and OUT, so we prefix them.
317 enum DIR
318 {
322 };
323
324 enum class CATEGORY
325 {
326 PRINCIPAL,
327 GEOMETRY,
328 AC,
329 DC,
332 NOISE,
335 S_PARAM,
336 ADVANCED,
337 FLAGS,
338 WAVEFORM,
341 };
342
343 struct INFO
344 {
345 INFO( const std::string& aName = "",
346 unsigned aId = 0,
347 DIR aDir = DIR_INOUT,
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 = {} ) :
359 name( aName ),
360 id( aId ),
361 dir( aDir ),
362 type( aType ),
363 unit( aUnit ),
364 category( aCategory ),
365 defaultValue( aDefaultValue ),
366 description( aDescription ),
367 isSpiceInstanceParam( aIsSpiceInstanceParam ),
368 isInstanceParam( aIsInstanceParam ),
369 spiceModelName( aSpiceModelName ),
370 spiceInstanceName( aSpiceInstanceName ),
371 enumValues( std::move( aEnumValues ) )
372 {}
373
374 bool Matches( const std::string& aName ) const;
375
376 std::string name;
377 unsigned id;
380 std::string unit;
382 std::string defaultValue;
383 std::string description;
386 std::string spiceModelName;
387 std::string spiceInstanceName;
388 std::vector<std::string> enumValues;
389 };
390
391 PARAM( const INFO& aInfo ) :
392 info( aInfo )
393 {}
394
395 bool Matches( const std::string& aName ) const
396 {
397 return info.Matches( aName );
398 }
399
400 std::string value;
401 const INFO& info;
402 };
403
404
405 static DEVICE_INFO DeviceInfo( DEVICE_T aDeviceType );
406 static INFO TypeInfo( TYPE aType );
407 static SPICE_INFO SpiceInfo( TYPE aType );
408
409
410 template <typename T>
411 static TYPE ReadTypeFromFields( const std::vector<T>& aFields, REPORTER& aReporter );
412
413 static std::unique_ptr<SIM_MODEL> Create( TYPE aType, const std::vector<LIB_PIN*>& aPins,
414 REPORTER& aReporter );
415
416 static std::unique_ptr<SIM_MODEL> Create( const SIM_MODEL* aBaseModel,
417 const std::vector<LIB_PIN*>& aPins,
418 REPORTER& aReporter );
419
420 template <typename T>
421 static std::unique_ptr<SIM_MODEL> Create( const SIM_MODEL* aBaseModel,
422 const std::vector<LIB_PIN*>& aPins,
423 const std::vector<T>& aFields,
424 REPORTER& aReporter );
425
426 template <typename T>
427 static std::unique_ptr<SIM_MODEL> Create( const std::vector<T>& aFields,
428 const std::vector<LIB_PIN*>& aPins,
429 bool aResolved, REPORTER& aReporter );
430
431 template <typename T>
432 static std::string GetFieldValue( const std::vector<T>* aFields, const wxString& aFieldName,
433 bool aResolve = true );
434
435 template <typename T>
436 static void SetFieldValue( std::vector<T>& aFields, const wxString& aFieldName,
437 const std::string& aValue );
438
440 const SIM_MODEL_SERIALIZER& Serializer() const { return *m_serializer; }
441
442
443 // Move semantics.
444 // Rule of five.
445 virtual ~SIM_MODEL(); // = default in implementation file.
446 SIM_MODEL() = delete;
447 SIM_MODEL( const SIM_MODEL& aOther ) = delete;
448 SIM_MODEL( SIM_MODEL&& aOther ) = default;
449 SIM_MODEL& operator=(SIM_MODEL&& aOther ) = delete;
450
451 template <typename T>
452 void ReadDataFields( const std::vector<T>* aFields, const std::vector<LIB_PIN*>& aPins );
453
454 template <typename T>
455 void WriteFields( std::vector<T>& aFields ) const;
456
457 SPICE_INFO GetSpiceInfo() const { return SpiceInfo( GetType() ); }
458
459 void AddPin( const PIN& aPin );
460 void ClearPins();
461
462 int FindModelPinIndex( const std::string& aSymbolPinNumber );
463 void AddParam( const PARAM::INFO& aInfo );
464
465 DEVICE_INFO GetDeviceInfo() const { return DeviceInfo( GetDeviceType() ); }
466 INFO GetTypeInfo() const { return TypeInfo( GetType() ); }
467
468 DEVICE_T GetDeviceType() const { return GetTypeInfo().deviceType; }
469 TYPE GetType() const { return m_type; }
470
471 const SIM_MODEL* GetBaseModel() const { return m_baseModel; }
472 virtual void SetBaseModel( const SIM_MODEL& aBaseModel );
473
474 virtual std::vector<std::string> GetPinNames() const { return {}; }
475
476 int GetPinCount() const { return static_cast<int>( m_pins.size() ); }
477 const PIN& GetPin( unsigned aIndex ) const { return m_pins.at( aIndex ); }
478
479 std::vector<std::reference_wrapper<const PIN>> GetPins() const;
480
481 void SetPinSymbolPinNumber( int aPinIndex, const std::string& aSymbolPinNumber );
482 virtual void SetPinSymbolPinNumber( const std::string& aPinName,
483 const std::string& aSymbolPinNumber );
484
485
486 int GetParamCount() const { return static_cast<int>( m_params.size() ); }
487 virtual const PARAM& GetParam( unsigned aParamIndex ) const; // Return base parameter unless it's overridden.
488
489 virtual const PARAM* GetTunerParam() const { return nullptr; }
490
491 const PARAM* FindParam( const std::string& aParamName ) const;
492
493 std::vector<std::reference_wrapper<const PARAM>> GetParams() const;
494
495 const PARAM& GetParamOverride( unsigned aParamIndex ) const; // Return the actual parameter.
496 const PARAM& GetBaseParam( unsigned aParamIndex ) const; // Always return base parameter if it exists.
497
498
499 void SetParamValue( int aParamIndex, const std::string& aValue,
500 SIM_VALUE::NOTATION aNotation = SIM_VALUE::NOTATION::SI );
501 void SetParamValue( const std::string& aParamName, const std::string& aValue,
502 SIM_VALUE::NOTATION aNotation = SIM_VALUE::NOTATION::SI );
503
504 // Can modifying a model parameter also modify other parameters?
505 virtual bool HasAutofill() const { return false; }
506 virtual bool HasPrimaryValue() const { return false; }
507
508 void SetIsEnabled( bool aIsEnabled ) { m_isEnabled = aIsEnabled; }
509 bool IsEnabled() const { return m_isEnabled; }
510
511 void SetIsStoredInValue( bool aIsStoredInValue )
512 {
513 if( HasPrimaryValue() )
514 m_isStoredInValue = aIsStoredInValue;
515 }
516 bool IsStoredInValue() const { return m_isStoredInValue; }
517
518 virtual void SwitchSingleEndedDiff( bool aDiff ) { };
519
520 template <class T_symbol, class T_field>
521 static bool InferSimModel( T_symbol& aSymbol, std::vector<T_field>* aFields, bool aResolve,
522 SIM_VALUE_GRAMMAR::NOTATION aNotation, wxString* aDeviceType,
523 wxString* aModelType, wxString* aModelParams, wxString* aPinMap );
524
525 template <class T_symbol, class T_field>
526 static void MigrateSimModel( T_symbol& aSymbol, const PROJECT* aProject );
527
528protected:
529 static std::unique_ptr<SIM_MODEL> Create( TYPE aType );
530
531 SIM_MODEL( TYPE aType );
532 SIM_MODEL( TYPE aType, std::unique_ptr<SPICE_GENERATOR> aSpiceGenerator );
533 SIM_MODEL( TYPE aType, std::unique_ptr<SPICE_GENERATOR> aSpiceGenerator,
534 std::unique_ptr<SIM_MODEL_SERIALIZER> aSerializer );
535
536 void createPins( const std::vector<LIB_PIN*>& aSymbolPins );
537
538 virtual int doFindParam( const std::string& aParamName ) const;
539 virtual void doSetParamValue( int aParamIndex, const std::string& aValue );
540
541private:
542 template <typename T>
543 void doReadDataFields( const std::vector<T>* aFields, const std::vector<LIB_PIN*>& aPins );
544
545 template <typename T>
546 void doWriteFields( std::vector<T>& aFields ) const;
547
548 virtual bool requiresSpiceModelLine( const SPICE_ITEM& aItem ) const;
549
550protected:
551 std::vector<PARAM> m_params;
552 std::vector<PIN> m_pins;
554 std::unique_ptr<SIM_MODEL_SERIALIZER> m_serializer;
555
556private:
557 std::unique_ptr<SPICE_GENERATOR> m_spiceGenerator;
558
562};
563
564#endif // SIM_MODEL_H
Definition: kibis.h:216
Container for project specific data.
Definition: project.h:62
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:71
Serializes/deserializes a SIM_MODEL for storage in LIB_FIELDs/SCH_FIELDs.
int FindModelPinIndex(const std::string &aSymbolPinNumber)
Definition: sim_model.cpp:714
const SIM_MODEL * GetBaseModel() const
Definition: sim_model.h:471
const PARAM & GetBaseParam(unsigned aParamIndex) const
Definition: sim_model.cpp:839
void AddParam(const PARAM::INFO &aInfo)
Definition: sim_model.cpp:726
bool IsStoredInValue() const
Definition: sim_model.h:516
static bool InferSimModel(T_symbol &aSymbol, std::vector< T_field > *aFields, bool aResolve, SIM_VALUE_GRAMMAR::NOTATION aNotation, wxString *aDeviceType, wxString *aModelType, wxString *aModelParams, wxString *aPinMap)
Definition: sim_model.cpp:1140
virtual std::vector< std::string > GetPinNames() const
Definition: sim_model.h:474
std::unique_ptr< SPICE_GENERATOR > m_spiceGenerator
Definition: sim_model.h:557
virtual bool requiresSpiceModelLine(const SPICE_ITEM &aItem) const
Definition: sim_model.cpp:1095
void ClearPins()
Definition: sim_model.cpp:708
bool IsEnabled() const
Definition: sim_model.h:509
std::vector< PIN > m_pins
Definition: sim_model.h:552
static INFO TypeInfo(TYPE aType)
Definition: sim_model.cpp:97
DEFINE_ENUM_CLASS_WITH_ITERATOR(TYPE, NONE, R, R_POT, R_BEHAVIORAL, C, C_BEHAVIORAL, L, L_MUTUAL, L_BEHAVIORAL, 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_VCL, V_CCL, V_PWL, V_WHITENOISE, V_PINKNOISE, V_BURSTNOISE, V_RANDUNIFORM, V_RANDNORMAL, V_RANDEXP, V_BEHAVIORAL, I, I_SIN, I_PULSE, I_EXP, I_VCL, I_CCL, I_PWL, I_WHITENOISE, I_PINKNOISE, I_BURSTNOISE, I_RANDUNIFORM, I_RANDNORMAL, I_RANDEXP, I_BEHAVIORAL, SUBCKT, XSPICE, KIBIS_DEVICE, KIBIS_DRIVER_DC, KIBIS_DRIVER_RECT, KIBIS_DRIVER_PRBS, RAWSPICE) struct INFO
Definition: sim_model.h:124
int GetPinCount() const
Definition: sim_model.h:476
virtual const PARAM * GetTunerParam() const
Definition: sim_model.h:489
std::vector< std::reference_wrapper< const PIN > > GetPins() const
Definition: sim_model.cpp:745
static SPICE_INFO SpiceInfo(TYPE aType)
Definition: sim_model.cpp:237
void ReadDataFields(const std::vector< T > *aFields, const std::vector< LIB_PIN * > &aPins)
const SIM_MODEL_SERIALIZER & Serializer() const
Definition: sim_model.h:440
bool m_isEnabled
Definition: sim_model.h:560
static void SetFieldValue(std::vector< T > &aFields, const wxString &aFieldName, const std::string &aValue)
Definition: sim_model.cpp:652
const SPICE_GENERATOR & SpiceGenerator() const
Definition: sim_model.h:439
static std::string GetFieldValue(const std::vector< T > *aFields, const wxString &aFieldName, bool aResolve=true)
Definition: sim_model.cpp:621
virtual const PARAM & GetParam(unsigned aParamIndex) const
Definition: sim_model.cpp:785
static TYPE ReadTypeFromFields(const std::vector< T > &aFields, REPORTER &aReporter)
Definition: sim_model.cpp:381
void createPins(const std::vector< LIB_PIN * > &aSymbolPins)
Definition: sim_model.cpp:989
bool m_isStoredInValue
Definition: sim_model.h:561
static std::unique_ptr< SIM_MODEL > Create(TYPE aType, const std::vector< LIB_PIN * > &aPins, REPORTER &aReporter)
Definition: sim_model.cpp:448
virtual void SetBaseModel(const SIM_MODEL &aBaseModel)
Definition: sim_model.cpp:736
void doWriteFields(std::vector< T > &aFields) const
Definition: sim_model.cpp:1044
SIM_MODEL()=delete
int GetParamCount() const
Definition: sim_model.h:486
void SetPinSymbolPinNumber(int aPinIndex, const std::string &aSymbolPinNumber)
Definition: sim_model.cpp:755
DEVICE_INFO GetDeviceInfo() const
Definition: sim_model.h:465
DEVICE_T GetDeviceType() const
Definition: sim_model.h:468
void AddPin(const PIN &aPin)
Definition: sim_model.cpp:702
static DEVICE_INFO DeviceInfo(DEVICE_T aDeviceType)
Definition: sim_model.cpp:56
INFO GetTypeInfo() const
Definition: sim_model.h:466
const PIN & GetPin(unsigned aIndex) const
Definition: sim_model.h:477
const PARAM * FindParam(const std::string &aParamName) const
Definition: sim_model.cpp:814
virtual void doSetParamValue(int aParamIndex, const std::string &aValue)
Definition: sim_model.cpp:848
std::vector< PARAM > m_params
Definition: sim_model.h:551
const PARAM & GetParamOverride(unsigned aParamIndex) const
Definition: sim_model.cpp:833
SIM_MODEL(SIM_MODEL &&aOther)=default
virtual bool HasAutofill() const
Definition: sim_model.h:505
virtual ~SIM_MODEL()
DEFINE_ENUM_CLASS_WITH_ITERATOR(DEVICE_T, NONE, R, C, L, TLINE, SW, D, NPN, PNP, NJFET, PJFET, NMES, PMES, NMOS, PMOS, V, I, E, F, G, H, SUBCKT, XSPICE, KIBIS, SPICE) struct DEVICE_INFO
Definition: sim_model.h:79
void SetIsEnabled(bool aIsEnabled)
Definition: sim_model.h:508
SIM_MODEL & operator=(SIM_MODEL &&aOther)=delete
static void MigrateSimModel(T_symbol &aSymbol, const PROJECT *aProject)
Definition: sim_model.cpp:1473
void SetParamValue(int aParamIndex, const std::string &aValue, SIM_VALUE::NOTATION aNotation=SIM_VALUE::NOTATION::SI)
Definition: sim_model.cpp:854
SPICE_INFO GetSpiceInfo() const
Definition: sim_model.h:457
virtual void SwitchSingleEndedDiff(bool aDiff)
Definition: sim_model.h:518
std::vector< std::reference_wrapper< const PARAM > > GetParams() const
Definition: sim_model.cpp:822
void SetIsStoredInValue(bool aIsStoredInValue)
Definition: sim_model.h:511
void WriteFields(std::vector< T > &aFields) const
std::unique_ptr< SIM_MODEL_SERIALIZER > m_serializer
Definition: sim_model.h:554
virtual bool HasPrimaryValue() const
Definition: sim_model.h:506
virtual int doFindParam(const std::string &aParamName) const
Definition: sim_model.cpp:800
TYPE GetType() const
Definition: sim_model.h:469
void doReadDataFields(const std::vector< T > *aFields, const std::vector< LIB_PIN * > &aPins)
Definition: sim_model.cpp:1025
const TYPE m_type
Definition: sim_model.h:559
const SIM_MODEL * m_baseModel
Definition: sim_model.h:553
SIM_MODEL(const SIM_MODEL &aOther)=delete
@ TYPE_FLOAT
Definition: sim_value.h:69
@ NONE
Definition: kibis.h:54
#define F(x, y, z)
Definition: md5_hash.cpp:15
#define I(x, y, z)
Definition: md5_hash.cpp:18
#define G(x, y, z)
Definition: md5_hash.cpp:16
#define H(x, y, z)
Definition: md5_hash.cpp:17
SIM_MODEL::TYPE TYPE
Definition: sim_model.cpp:53
std::string spiceModelName
Definition: sim_model.h:386
std::vector< std::string > enumValues
Definition: sim_model.h:388
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={})
Definition: sim_model.h:345
SIM_VALUE::TYPE type
Definition: sim_model.h:379
bool Matches(const std::string &aName) const
Definition: sim_model.cpp:794
std::string defaultValue
Definition: sim_model.h:382
std::string spiceInstanceName
Definition: sim_model.h:387
std::string description
Definition: sim_model.h:383
PARAM(const INFO &aInfo)
Definition: sim_model.h:391
bool Matches(const std::string &aName) const
Definition: sim_model.h:395
std::string value
Definition: sim_model.h:400
const INFO & info
Definition: sim_model.h:401
std::string symbolPinNumber
Definition: sim_model.h:308
const std::string name
Definition: sim_model.h:307
static constexpr auto NOT_CONNECTED
Definition: sim_model.h:310
std::string inlineTypeString
Definition: sim_model.h:297
std::string itemType
Definition: sim_model.h:295
std::string modelType
Definition: sim_model.h:296
std::string level
Definition: sim_model.h:298
std::string version
Definition: sim_model.h:301