KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sim_model_ibis.cpp
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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 3
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * https://www.gnu.org/licenses/gpl-3.0.html
19 * or you may search the http://www.gnu.org website for the version 3 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#include <sim/kibis/kibis.h>
25#include <sim/sim_model_ibis.h>
27#include <fmt/core.h>
28#include <wx/filename.h>
29#include <kiway.h>
30#include <schematic.h>
31#include "sim_lib_mgr.h"
32
33std::string SPICE_GENERATOR_IBIS::ModelName( const SPICE_ITEM& aItem ) const
34{
35 return fmt::format( "{}.{}", aItem.refName, aItem.baseModelName );
36}
37
38
39std::string SPICE_GENERATOR_IBIS::ModelLine( const SPICE_ITEM& aItem ) const
40{
41 return "";
42}
43
44std::vector<std::string> SPICE_GENERATOR_IBIS::CurrentNames( const SPICE_ITEM& aItem ) const
45{
46 std::vector<std::string> currentNames;
47
48 for( const SIM_MODEL_PIN& pin : GetPins() )
49 currentNames.push_back( fmt::format( "I({}:{})", ItemName( aItem ), pin.modelPinName ) );
50
51 return currentNames;
52}
53
54
55std::string SPICE_GENERATOR_IBIS::IbisDevice( const SPICE_ITEM& aItem, SCHEMATIC* aSchematic,
56 const wxString& aCacheDir, REPORTER& aReporter ) const
57{
58 std::string ibisLibFilename = GetFieldValue( &aItem.fields, SIM_LIBRARY::LIBRARY_FIELD, true, 0 );
59 std::string ibisCompName = GetFieldValue( &aItem.fields, SIM_LIBRARY::NAME_FIELD, true, 0 );
60 std::string ibisPinName = GetFieldValue( &aItem.fields, SIM_LIBRARY_IBIS::PIN_FIELD, true, 0 );
61 std::string ibisModelName = GetFieldValue( &aItem.fields, SIM_LIBRARY_IBIS::MODEL_FIELD, true, 0 );
62 bool diffMode = GetFieldValue( &aItem.fields, SIM_LIBRARY_IBIS::DIFF_FIELD, true, 0 ) == "1";
63
64 WX_STRING_REPORTER reporter;
65 SIM_LIB_MGR mgr( &aSchematic->Project() );
66
67 std::vector<EMBEDDED_FILES*> embeddedFilesStack;
68 embeddedFilesStack.push_back( aSchematic->GetEmbeddedFiles() );
69 mgr.SetFilesStack( std::move( embeddedFilesStack ) );
70
71 wxString path = mgr.ResolveLibraryPath( ibisLibFilename, reporter );
72
73 if( reporter.HasMessage() )
74 THROW_IO_ERROR( reporter.GetMessages() );
75
76 KIBIS kibis( std::string( path.c_str() ) );
77 kibis.m_cacheDir = std::string( aCacheDir.c_str() );
78 kibis.m_Reporter = &aReporter;
79
80 if( !kibis.m_valid )
81 THROW_IO_ERROR( wxString::Format( _( "Invalid IBIS file '%s'" ), ibisLibFilename ) );
82
83 KIBIS_COMPONENT* kcomp = kibis.GetComponent( std::string( ibisCompName ) );
84
85 if( !kcomp )
86 THROW_IO_ERROR( wxString::Format( _( "Could not find IBIS component '%s'" ), ibisCompName ) );
87
88 KIBIS_PIN* kpin = kcomp->GetPin( ibisPinName );
89
90
91 if( !kcomp->m_valid )
92 THROW_IO_ERROR( wxString::Format( _( "Invalid IBIS component '%s'" ), ibisCompName ) );
93
94 if( !kpin )
95 {
96 THROW_IO_ERROR( wxString::Format( _( "Could not find IBIS pin '%s' in component '%s'" ),
97 ibisPinName,
98 ibisCompName ) );
99 }
100
101 if( !kpin->m_valid )
102 {
103 THROW_IO_ERROR( wxString::Format( _( "Invalid IBIS pin '%s' in component '%s'" ),
104 ibisPinName,
105 ibisCompName ) );
106 }
107
108 KIBIS_MODEL* kmodel = kibis.GetModel( ibisModelName );
109
110 if( !kmodel )
111 THROW_IO_ERROR( wxString::Format( _( "Could not find IBIS model '%s'" ), ibisModelName ) );
112
113 if( !kmodel->m_valid )
114 THROW_IO_ERROR( wxString::Format( _( "Invalid IBIS model '%s'" ), ibisModelName ) );
115
116 KIBIS_PARAMETER kparams;
117
118 if( const SIM_MODEL::PARAM* vcc = m_model.FindParam( "vcc" ) )
119 kparams.SetCornerFromString( kparams.m_supply, vcc->value );
120
121 if( const SIM_MODEL::PARAM* rpin = m_model.FindParam( "rpin" ) )
122 kparams.SetCornerFromString( kparams.m_Rpin, rpin->value );
123
124 if( const SIM_MODEL::PARAM* lpin = m_model.FindParam( "lpin" ) )
125 kparams.SetCornerFromString( kparams.m_Lpin, lpin->value );
126
127 if( const SIM_MODEL::PARAM* cpin = m_model.FindParam( "cpin" ) )
128 kparams.SetCornerFromString( kparams.m_Cpin, cpin->value );
129
130 //kparams.SetCornerFromString( kparams.m_Ccomp, FindParam( "ccomp" )->value );
131
132 std::string result;
133
134 switch( m_model.GetType() )
135 {
136 case SIM_MODEL::TYPE::KIBIS_DEVICE:
137 if( diffMode )
138 kpin->writeSpiceDiffDevice( result, aItem.modelName, *kmodel, kparams );
139 else
140 kpin->writeSpiceDevice( result, aItem.modelName, *kmodel, kparams );
141
142 break;
143
144 case SIM_MODEL::TYPE::KIBIS_DRIVER_DC:
145 {
146 std::string paramValue = "";
147
148 if( const SIM_MODEL::PARAM* dc = m_model.FindParam( "dc" ) )
149 paramValue = dc->value;
150
151 if( paramValue == "hi-Z" )
152 kparams.m_waveform = new KIBIS_WAVEFORM_HIGH_Z( kibis );
153 else if( paramValue == "low" )
154 kparams.m_waveform = new KIBIS_WAVEFORM_STUCK_LOW( kibis );
155 else if( paramValue == "high" )
156 kparams.m_waveform = new KIBIS_WAVEFORM_STUCK_HIGH( kibis );
157
158 if( diffMode )
159 kpin->writeSpiceDiffDriver( result, aItem.modelName, *kmodel, kparams );
160 else
161 kpin->writeSpiceDriver( result, aItem.modelName, *kmodel, kparams );
162
163 break;
164 }
165
166 case SIM_MODEL::TYPE::KIBIS_DRIVER_RECT:
167 {
169
170 if( const SIM_MODEL::PARAM* ton = m_model.FindParam( "ton" ) )
171 waveform->m_ton = SIM_VALUE::ToDouble( ton->value, 0 );
172
173 if( const SIM_MODEL::PARAM* toff = m_model.FindParam( "toff" ) )
174 waveform->m_toff = SIM_VALUE::ToDouble( toff->value, 0 );
175
176 if( const SIM_MODEL::PARAM* td = m_model.FindParam( "td" ) )
177 waveform->m_delay = SIM_VALUE::ToDouble( td->value, 0 );
178
179 if( const SIM_MODEL::PARAM* n = m_model.FindParam( "n" ) )
180 waveform->m_cycles = SIM_VALUE::ToInt( n->value, 1 );
181
182 kparams.m_waveform = waveform;
183
184 if( diffMode )
185 kpin->writeSpiceDiffDriver( result, aItem.modelName, *kmodel, kparams );
186 else
187 kpin->writeSpiceDriver( result, aItem.modelName, *kmodel, kparams );
188
189 break;
190 }
191
192 case SIM_MODEL::TYPE::KIBIS_DRIVER_PRBS:
193 {
194 KIBIS_WAVEFORM_PRBS* waveform = new KIBIS_WAVEFORM_PRBS( kibis );
195
196 if( const SIM_MODEL::PARAM* f0 = m_model.FindParam( "f0" ) )
197 waveform->m_bitrate = SIM_VALUE::ToDouble( f0->value, 0 );
198
199 if( const SIM_MODEL::PARAM* td = m_model.FindParam( "td" ) )
200 waveform->m_delay = SIM_VALUE::ToDouble( td->value, 0 );
201
202 if( const SIM_MODEL::PARAM* n = m_model.FindParam( "n" ) )
203 waveform->SetBits( SIM_VALUE::ToInt( n->value, 0 ) );
204
205 kparams.m_waveform = waveform;
206
207 if( diffMode )
208 kpin->writeSpiceDiffDriver( result, aItem.modelName, *kmodel, kparams );
209 else
210 kpin->writeSpiceDriver( result, aItem.modelName, *kmodel, kparams );
211
212 break;
213 }
214
215 default:
216 wxFAIL_MSG( "Unknown IBIS model type" );
217 return "";
218 }
219
220 return result;
221}
222
223
225 SIM_MODEL( aType, std::make_unique<SPICE_GENERATOR_IBIS>( *this ) ),
226 m_enableDiff( false ),
227 m_sourceModel( nullptr )
228{
229 static std::vector<PARAM::INFO> device = makeParamInfos( TYPE::KIBIS_DEVICE );
230 static std::vector<PARAM::INFO> dcDriver = makeParamInfos( TYPE::KIBIS_DRIVER_DC );
231 static std::vector<PARAM::INFO> rectDriver = makeParamInfos( TYPE::KIBIS_DRIVER_RECT );
232 static std::vector<PARAM::INFO> prbsDriver = makeParamInfos( TYPE::KIBIS_DRIVER_PRBS );
233
234 std::vector<PARAM::INFO>* paramInfos = nullptr;
235
236 switch( aType )
237 {
238 case SIM_MODEL::TYPE::KIBIS_DEVICE: paramInfos = &device; break;
239 case SIM_MODEL::TYPE::KIBIS_DRIVER_DC: paramInfos = &dcDriver; break;
240 case SIM_MODEL::TYPE::KIBIS_DRIVER_RECT: paramInfos = &rectDriver; break;
241 case SIM_MODEL::TYPE::KIBIS_DRIVER_PRBS: paramInfos = &prbsDriver; break;
242 default: wxFAIL; return;
243 }
244
245 for( const PARAM::INFO& paramInfo : *paramInfos )
246 AddParam( paramInfo );
247
248 SwitchSingleEndedDiff( false );
249}
250
251
253{
254 ClearPins();
255
256 if( aDiff )
257 {
258 AddPin( { "GND", "1" } );
259 AddPin( { "+", "2" } );
260 AddPin( { "-", "3" } );
261 }
262 else
263 {
264 AddPin( { "GND", "1" } );
265 AddPin( { "IN/OUT", "2" } );
266 }
267}
268
270 SIM_MODEL_IBIS( aType )
271{
272 for( PARAM& param1 : m_params )
273 {
274 for( int ii = 0; ii < aSource.GetParamCount(); ++ii )
275 {
276 const PARAM& param2 = aSource.GetParam( ii );
277
278 if( param1.info.name == param2.info.name )
279 param1.value = param2.value;
280 }
281 }
282
284
285 m_ibisPins = aSource.GetIbisPins();
286 m_ibisModels = aSource.GetIbisModels();
287
288 m_enableDiff = aSource.CanDifferential();
289}
290
291
292bool SIM_MODEL_IBIS::ChangePin( const SIM_LIBRARY_IBIS& aLib, const std::string& aPinNumber )
293{
294 KIBIS_COMPONENT* kcomp = aLib.m_kibis.GetComponent( std::string( GetComponentName() ) );
295
296 if( !kcomp )
297 return false;
298
299 KIBIS_PIN* kpin = kcomp->GetPin( aPinNumber );
300
301 if( !kpin )
302 return false;
303
304 m_ibisModels.clear();
305
306 for( KIBIS_MODEL* kmodel : kpin->m_models )
307 m_ibisModels.push_back( kmodel->m_name );
308
309 return true;
310}
311
312
314{
315 // Actual base models can only be of the same type, which is not the case here, as in addition
316 // to IBIS device model type we have multiple types of drivers available for the same sourced
317 // model. And we don't want to inherit the default values anyway. So we just store these models
318 // and use the only for Spice code generation.
319 m_sourceModel = dynamic_cast<const SIM_MODEL_IBIS*>( &aBaseModel );
320}
321
322
323std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_IBIS::makeParamInfos( TYPE aType )
324{
325 std::vector<PARAM::INFO> paramInfos;
326 PARAM::INFO paramInfo;
327
328 paramInfo.name = "vcc";
329 paramInfo.type = SIM_VALUE::TYPE_STRING;
330 paramInfo.unit = "";
331 paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
332 paramInfo.defaultValue = "typ";
333 paramInfo.description = _( "Power supply" );
334 paramInfo.spiceModelName = "";
335 paramInfo.enumValues = { "typ", "min", "max" };
336 paramInfos.push_back( paramInfo );
337
338 paramInfo.name = "rpin";
339 paramInfo.type = SIM_VALUE::TYPE_STRING;
340 paramInfo.unit = "";
341 paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
342 paramInfo.defaultValue = "typ";
343 paramInfo.description = _( "Parasitic pin resistance" );
344 paramInfo.spiceModelName = "";
345 paramInfo.enumValues = { "typ", "min", "max" };
346 paramInfos.push_back( paramInfo );
347
348 paramInfo.name = "lpin";
349 paramInfo.type = SIM_VALUE::TYPE_STRING;
350 paramInfo.unit = "";
351 paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
352 paramInfo.defaultValue = "typ";
353 paramInfo.description = _( "Parasitic pin inductance" );
354 paramInfo.spiceModelName = "";
355 paramInfo.enumValues = { "typ", "min", "max" };
356 paramInfos.push_back( paramInfo );
357
358 paramInfo.name = "cpin";
359 paramInfo.type = SIM_VALUE::TYPE_STRING;
360 paramInfo.unit = "";
361 paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
362 paramInfo.defaultValue = "typ";
363 paramInfo.description = _( "Parasitic pin capacitance" );
364 paramInfo.spiceModelName = "";
365 paramInfo.enumValues = { "typ", "min", "max" };
366 paramInfos.push_back( paramInfo );
367
368 std::vector<PARAM::INFO> dc = makeDcWaveformParamInfos();
369 std::vector<PARAM::INFO> rect = makeRectWaveformParamInfos();
370 std::vector<PARAM::INFO> prbs = makePrbsWaveformParamInfos();
371
372 switch( aType )
373 {
374 case TYPE::KIBIS_DRIVER_DC:
375 for( const PARAM::INFO& param : makeDcWaveformParamInfos() )
376 paramInfos.push_back( param );
377
378 break;
379
380 case TYPE::KIBIS_DRIVER_RECT:
381 for( const PARAM::INFO& param : makeRectWaveformParamInfos() )
382 paramInfos.push_back( param );
383
384 break;
385
386 case TYPE::KIBIS_DRIVER_PRBS:
387 for( const PARAM::INFO& param : makePrbsWaveformParamInfos() )
388 paramInfos.push_back( param );
389
390 break;
391
392 default:
393 break;
394 }
395
396 return paramInfos;
397}
398
399
400std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_IBIS::makeDcWaveformParamInfos()
401{
402 std::vector<PARAM::INFO> paramInfos;
403 PARAM::INFO paramInfo;
404
405 paramInfo.name = "dc";
406 paramInfo.type = SIM_VALUE::TYPE_STRING;
407 paramInfo.unit = "";
408 paramInfo.category = PARAM::CATEGORY::WAVEFORM;
409 paramInfo.defaultValue = "hi-Z";
410 paramInfo.description = _( "DC Value" );
411 paramInfo.enumValues = { "hi-Z", "low", "high" };
412 paramInfos.push_back( paramInfo );
413
414 return paramInfos;
415}
416
417
418std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_IBIS::makeRectWaveformParamInfos()
419{
420 std::vector<PARAM::INFO> paramInfos;
421 PARAM::INFO paramInfo;
422
423 paramInfo.name = "ton";
424 paramInfo.type = SIM_VALUE::TYPE_FLOAT;
425 paramInfo.unit = "s";
426 paramInfo.category = PARAM::CATEGORY::WAVEFORM;
427 paramInfo.defaultValue = "";
428 paramInfo.description = _( "ON time" );
429 paramInfos.push_back( paramInfo );
430
431 paramInfo.name = "toff";
432 paramInfo.type = SIM_VALUE::TYPE_FLOAT;
433 paramInfo.unit = "s";
434 paramInfo.category = PARAM::CATEGORY::WAVEFORM;
435 paramInfo.defaultValue = "";
436 paramInfo.description = _( "OFF time" );
437 paramInfos.push_back( paramInfo );
438
439 paramInfo.name = "td";
440 paramInfo.type = SIM_VALUE::TYPE_FLOAT;
441 paramInfo.unit = "s";
442 paramInfo.category = PARAM::CATEGORY::WAVEFORM;
443 paramInfo.defaultValue = "0";
444 paramInfo.description = _( "Delay" );
445 paramInfos.push_back( paramInfo );
446
447 paramInfo.name = "n";
448 paramInfo.type = SIM_VALUE::TYPE_INT;
449 paramInfo.unit = "";
450 paramInfo.category = PARAM::CATEGORY::WAVEFORM;
451 paramInfo.defaultValue = "1";
452 paramInfo.description = _( "Number of cycles" );
453 paramInfos.push_back( paramInfo );
454
455 return paramInfos;
456}
457
458
459std::vector<SIM_MODEL::PARAM::INFO> SIM_MODEL_IBIS::makePrbsWaveformParamInfos()
460{
461 std::vector<PARAM::INFO> paramInfos;
462 PARAM::INFO paramInfo;
463
464 paramInfo.name = "f0";
465 paramInfo.type = SIM_VALUE::TYPE_FLOAT;
466 paramInfo.unit = "Hz";
467 paramInfo.category = PARAM::CATEGORY::WAVEFORM;
468 paramInfo.defaultValue = "";
469 paramInfo.description = _( "Bitrate" );
470 paramInfos.push_back( paramInfo );
471
472 paramInfo.name = "td";
473 paramInfo.type = SIM_VALUE::TYPE_FLOAT;
474 paramInfo.unit = "s";
475 paramInfo.category = PARAM::CATEGORY::WAVEFORM;
476 paramInfo.defaultValue = "";
477 paramInfo.description = _( "Delay" );
478 paramInfos.push_back( paramInfo );
479
480 paramInfo.name = "n";
481 paramInfo.type = SIM_VALUE::TYPE_INT;
482 paramInfo.unit = "";
483 paramInfo.category = PARAM::CATEGORY::WAVEFORM;
484 paramInfo.defaultValue = "";
485 paramInfo.description = _( "Number of bits" );
486 paramInfos.push_back( paramInfo );
487
488 return paramInfos;
489}
490
REPORTER * m_Reporter
Definition ibis_parser.h:75
bool m_valid
Definition kibis.h:57
KIBIS_PIN * GetPin(const std::string &aPinNumber)
Get a pin by its number ( 1, 2, A1, A2, ... )
Definition kibis.cpp:390
std::string m_name
Definition kibis.h:269
IBIS_CORNER m_supply
Definition kibis.h:220
IBIS_CORNER m_Cpin
Definition kibis.h:218
IBIS_CORNER m_Lpin
Definition kibis.h:217
IBIS_CORNER m_Rpin
Definition kibis.h:216
void SetCornerFromString(IBIS_CORNER &aCorner, const std::string &aString)
Definition kibis.cpp:1475
KIBIS_WAVEFORM * m_waveform
Definition kibis.h:221
bool writeSpiceDiffDriver(std::string &aDest, const std::string &aName, KIBIS_MODEL &aModel, const KIBIS_PARAMETER &aParam)
Definition kibis.cpp:1384
bool writeSpiceDevice(std::string &aDest, const std::string &aName, KIBIS_MODEL &aModel, const KIBIS_PARAMETER &aParam)
Definition kibis.cpp:1335
std::vector< KIBIS_MODEL * > m_models
Definition kibis.h:386
bool writeSpiceDiffDevice(std::string &aDest, const std::string &aName, KIBIS_MODEL &aModel, const KIBIS_PARAMETER &aParam)
Definition kibis.cpp:1421
bool writeSpiceDriver(std::string &aDest, const std::string &aName, KIBIS_MODEL &aModel, const KIBIS_PARAMETER &aParam)
Definition kibis.cpp:1220
void SetBits(int aBits)
Definition kibis.h:146
Definition kibis.h:488
KIBIS_MODEL * GetModel(const std::string &aName)
Return the model with name aName .
Definition kibis.cpp:1451
KIBIS_COMPONENT * GetComponent(const std::string &aName)
Return the component with name aName .
Definition kibis.cpp:1463
std::string m_cacheDir
Absolute path of the directory that will be used for caching.
Definition kibis.h:503
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:73
virtual bool HasMessage() const
Returns true if any messages were reported.
Definition reporter.h:134
Holds all the data relating to one schematic.
Definition schematic.h:88
PROJECT & Project() const
Return a reference to the project this schematic is part of.
Definition schematic.h:103
EMBEDDED_FILES * GetEmbeddedFiles() override
static constexpr auto MODEL_FIELD
static constexpr auto PIN_FIELD
static constexpr auto DIFF_FIELD
static constexpr auto LIBRARY_FIELD
Definition sim_library.h:35
static constexpr auto NAME_FIELD
Definition sim_library.h:36
wxString ResolveLibraryPath(const wxString &aLibraryPath, REPORTER &aReporter)
void SetFilesStack(std::vector< EMBEDDED_FILES * > aFilesStack)
Definition sim_lib_mgr.h:48
SIM_MODEL_IBIS(TYPE aType)
static std::vector< PARAM::INFO > makeDcWaveformParamInfos()
std::vector< std::pair< std::string, std::string > > m_ibisPins
friend class SIM_LIBRARY_IBIS
std::vector< std::string > m_ibisModels
static std::vector< PARAM::INFO > makeRectWaveformParamInfos()
const PARAM & GetParam(unsigned aParamIndex) const override
static std::vector< PARAM::INFO > makePrbsWaveformParamInfos()
std::vector< std::pair< std::string, std::string > > GetIbisPins() const
void SwitchSingleEndedDiff(bool aDiff) override
const SIM_MODEL_IBIS * m_sourceModel
bool CanDifferential() const
std::vector< std::string > GetIbisModels() const
std::string m_componentName
void SetBaseModel(const SIM_MODEL &aBaseModel) override
bool ChangePin(const SIM_LIBRARY_IBIS &aLib, const std::string &aPinNumber)
update the list of available models based on the pin number.
static std::vector< PARAM::INFO > makeParamInfos(TYPE aType)
std::string GetComponentName() const
void AddParam(const PARAM::INFO &aInfo)
void ClearPins()
void AddPin(const SIM_MODEL_PIN &aPin)
SIM_MODEL()=delete
int GetParamCount() const
Definition sim_model.h:477
std::vector< PARAM > m_params
Definition sim_model.h:534
@ TYPE_STRING
Definition sim_value.h:71
static double ToDouble(const std::string &aString, double aDefault=NAN)
static int ToInt(const std::string &aString, int aDefault=-1)
std::string IbisDevice(const SPICE_ITEM &aItem, SCHEMATIC *aSchematic, const wxString &aCacheDir, REPORTER &aReporter) const
std::vector< std::string > CurrentNames(const SPICE_ITEM &aItem) const override
std::string ModelLine(const SPICE_ITEM &aItem) const override
std::string ModelName(const SPICE_ITEM &aItem) const override
virtual std::string ItemName(const SPICE_ITEM &aItem) const
virtual std::vector< std::reference_wrapper< const SIM_MODEL_PIN > > GetPins() const
const SIM_MODEL & m_model
A wrapper for reporting to a wxString object.
Definition reporter.h:191
const wxString & GetMessages() const
Definition reporter.cpp:77
#define _(s)
#define THROW_IO_ERROR(msg)
macro which captures the "call site" values of FILE_, __FUNCTION & LINE
STL namespace.
wxString GetFieldValue(const std::vector< SCH_FIELD > *aFields, FIELD_T aFieldType)
Definition sch_field.h:401
SIM_MODEL::TYPE TYPE
Definition sim_model.cpp:57
std::string value
Definition sim_model.h:400
const INFO & info
Definition sim_model.h:401
std::string refName
std::vector< SCH_FIELD > fields
std::string modelName
std::string baseModelName
std::string path
KIBIS_PIN * pin
wxString result
Test unit parsing edge cases and error handling.