Commit Graph

764 Commits

Author SHA1 Message Date
Seth Hillbrand 8b26f50003 SIM_VALUE stores significants in 64-bit
stol isn't neccesarily 64-bit though, so we use stoll and catch the
overflow if we have bad input data

Fixes KICAD-2EF

(cherry picked from commit 7779a01d48)
2023-06-29 10:45:29 -07:00
Fabien Corona bf78ac7a6c IBIS: model type should not be case sensitive
Fixes #15068


(cherry picked from commit 8abb701727)
2023-06-28 21:03:49 +00:00
jean-pierre charras f974c8259e spice_library_parser: catch an exception thrown when a spice model cannot be built.
Fixes #15012
https://gitlab.com/kicad/code/kicad/-/issues/15012
2023-06-20 10:34:50 +02:00
Jeff Young a01f9f99f4 More protection around an exceedingly dangerous hack.
The API is needed for wxFormBuilder, and I couldn't figure out any
way around it, but we can at least reduce the risk of someone calling
it accidentally (again).

(cherry picked from commit 46564055f4)
2023-06-14 13:57:27 +01:00
Jeff Young aa78abc649 Manual reimplementation of 84c72b087c
(cherry picked from commit 7cc55d2d3a)
2023-05-28 19:38:27 +02:00
Jeff Young 1c62fc868d Fix more SPICE case-insensitivity bugs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14793

(cherry picked from commit 03486443c7)
(cherry picked from commit e5d5335701)
2023-05-28 19:38:27 +02:00
Mark Visser f9c2f03a44 fix bug whereby spice params with capital letters no longer cause an error and data loss
Spice parameters were converted to lower-case before comparison. This is incorrect, as it
is legal and common for spice parameters to contain capital letters (e.g. potentiometers
typically use Rt and SET as their parameters).
Spice parameters are not case sensitive, so the correct behaviour is to instead do a
case-insensitive comparison on the parameter name.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14793

(cherry picked from commit 0d235ac64b)
(cherry picked from commit 888a35bbde)
2023-05-28 19:38:27 +02:00
Seth Hillbrand 248de56fb0 Revert "fix bug whereby spice params with capital letters no longer cause an error and data loss"
This reverts commit 888a35bbde.
2023-05-24 08:54:16 -07:00
Seth Hillbrand 89349c1084 Revert "Fix more SPICE case-insensitivity bugs."
This reverts commit e5d5335701.
2023-05-24 08:54:16 -07:00
Seth Hillbrand e2c0c6362f Revert "Manual reimplementation of 84c72b087c548829908d7fbbecfd2fa5968cc98b"
This reverts commit 7cc55d2d3a.
2023-05-24 08:54:16 -07:00
Jeff Young 7cc55d2d3a Manual reimplementation of 84c72b087c 2023-05-23 09:40:32 +01:00
Jeff Young e5d5335701 Fix more SPICE case-insensitivity bugs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14793

(cherry picked from commit 03486443c7)
2023-05-23 09:40:32 +01:00
Mark Visser 888a35bbde fix bug whereby spice params with capital letters no longer cause an error and data loss
Spice parameters were converted to lower-case before comparison. This is incorrect, as it
is legal and common for spice parameters to contain capital letters (e.g. potentiometers
typically use Rt and SET as their parameters).
Spice parameters are not case sensitive, so the correct behaviour is to instead do a
case-insensitive comparison on the parameter name.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14793

(cherry picked from commit 0d235ac64b)
2023-05-23 09:40:32 +01:00
jean-pierre charras a72fd0ebdd Simulator: Ensure connectivity is up to date (incremental mode) before building netlist
also: SIM_PLOT_FRAME::onShowNetlist(): verify all symbols are annotated.
2023-05-18 10:45:52 +02:00
Graham Keeth db5aacf984 sim: fix diode model default breakdown voltage
(Cherry-picked from 2970d97bf2)
2023-05-11 13:15:37 +01:00
Graham Keeth 111a56dd8a sim: fixup some diode parameter units
(cherry picked from commit df3560ab8e)
2023-05-11 01:15:52 +00:00
Jeff Young e28b50e8d6 Fix a bunch more issues with sheetpaths and allowExtraText.
A sheetpath is required to correctly resolve text variables.
Depending on currentSheet is rife with bugs.

There are many places where we do *not* want to be prepending
field names to the field values, such as netlisting,
building PDF hypertext menus, etc.

Also, Find/Replace needs to work on unresolved text, as
that's what we're going to display (and if replace nuked
your variable references you wouldn't be happy).

(cherry picked from commit b41d446f58)
2023-05-05 18:02:59 +01:00
Jeff Young 0fb2f35b10 Fix sheetPath handling in SPICE model generation.
(cherry picked from commit d5cb100f72)
2023-04-28 16:20:03 +01:00
Jeff Young 999cd8cd11 Simulator fixes.
1) Don't read libraries multiple times
2) VDMOS default is nchan if not specified
3) In the absence of a workbook default to LTSpice compatability
4) Don't attempt to write out a model line for a subckt; it never has
a baseModel
2023-04-24 13:55:34 +01:00
Jeff Young fd8b281731 Formatting. 2023-04-24 13:55:15 +01:00
Jeff Young d8481b4528 More robust file reading for simulator files. 2023-04-24 13:53:22 +01:00
Jeff Young 204549f55b Fix merge error. 2023-04-16 23:22:49 +01:00
Jeff Young 1707436cad Retire the lib-tree scoring algorithm.
It appears to cause more confusion than help.

Fixes https://gitlab.com/kicad/code/kicad/issues/13905

(cherry picked from commit d01c023d5a)
2023-04-15 00:09:34 +01:00
jean-pierre charras ea95d8604a Ensure we do not use a non existing pin in SIM_MODEL::MigrateSimModel()
From master branch
Fixes #14522
https://gitlab.com/kicad/code/kicad/issues/14522
2023-04-12 09:41:07 +02:00
Jeff Young 7931f315b1 Manually cherry-pick some fixes back from master.
Fixes https://gitlab.com/kicad/code/kicad/issues/14424
2023-03-26 11:00:23 +01:00
Jeff Young d4a312d6cb Move separation of model name from params earlier in the process.
We need just the model name when we look for a match in the library file.

(cherry picked from commit 60aadfee40)
2023-03-25 15:37:57 +00:00
Jon Evans b0b9e66fad Move to requiring explicit action to save project settings
(cherry picked from commit 610e787ada)

Fixes https://gitlab.com/kicad/code/kicad/issues/14414
2023-03-24 11:49:50 -07:00
Jeff Young 7026cfe140 Split name from additional params only when model is a library reference.
(cherry picked from commit b8cf7cc080)
2023-03-22 14:12:42 +00:00
Jeff Young b7cd1dd764 Handle single-token flag parameters.
Also fixes a bug where all VDMOS instance parameters weren't marked as
instance parameters.

Also fixes a bug where VDMOS thermal models weren't supported (they
have two extra pins: Tj and Tcase).

(cherry picked from commit 5bda3b99f9)
2023-03-22 14:12:42 +00:00
Jeff Young 09bb8fc4f4 Don't include non-overridden parameters in Sim.Params.
Fixes https://gitlab.com/kicad/code/kicad/issues/14369

(cherry picked from commit 9dc16eb014)
2023-03-22 14:12:42 +00:00
Jeff Young 1614dc975a Separate legacy model name from parameters.
Fixes https://gitlab.com/kicad/code/kicad/issues/13988

(cherry picked from commit 39a801423e)
2023-03-21 13:31:20 +00:00
Jeff Young a713ee852c Ignore extraneous LTSpice parameters for VDMOS models.
Also adds special case handling of VDMOS syntax to allow parens (or extra
spaces, linebreaks, etc.) between "VDMOS" and "NCHAN"/"PCHAN".

Fixes https://gitlab.com/kicad/code/kicad/issues/14299
2023-03-20 16:16:13 +00:00
Jeff Young 1dc9583e06 Don't attempt to load unknown plot types. 2023-03-20 10:24:22 +00:00
Jeff Young 3afe02ac1f Make sure legend reflects gain/phase for AC small signal analyses.
Fixes https://gitlab.com/kicad/code/kicad/issues/14301

(cherry picked from commit ec6d709929)
2023-03-20 10:24:22 +00:00
Jeff Young fb02e55424 Don't pass a REPORTER when checking for overrides.
It fails the unit tests (as it generates a message whenever no override
is found).
2023-03-17 15:30:24 +00:00
Jeff Young 70e86434ef Manual cherry-pick of much of 6d296038f3 2023-03-17 14:12:58 +00:00
Jeff Young 64641c28ef Handle underscore in parameter names.
Fixes https://gitlab.com/kicad/code/kicad/issues/14308

(cherry picked from commit 222cd4d009)
2023-03-16 23:51:56 +00:00
Jeff Young c5a69f073c Added PSPICE/LTSPICE JFET model parameters.
Fixes https://gitlab.com/kicad/code/kicad/issues/12425

(cherry picked from commit 3bc5e3dd8a)
2023-03-12 21:05:06 +00:00
Wayne Stambaugh 9e1fd16329 Coverity fixes and code cleaning.
(cherry picked from commit 4e99812145)
2023-03-10 11:21:19 -05:00
aris-kimi f1e060902b Simulator: Fix RLGC c unit
(Cherry-picked from db2780090c)
2023-03-06 15:59:54 +00:00
aris-kimi 05ab9e3836 Simulator: Fix diode ibv unit
(Cherry-picked from 5b43dc4e7b)
2023-03-06 14:20:33 +00:00
Jeff Young 9b61b350fe Don't commit changes on paint events or updateUI events.
Also use std::numeric_limits::epsilon for comparing doubles.

Fixes https://gitlab.com/kicad/code/kicad/issues/13851

(cherry picked from commit d714ff8549)
2023-03-04 00:10:39 +00:00
Jeff Young 94ec6cc362 Convert inline models in Sim.Params fields to SPICE syntax.
Fixes https://gitlab.com/kicad/code/kicad/issues/14157

(cherry picked from commit 14f1f3ec79)
2023-03-03 18:18:32 +00:00
Jeff Young c216ed2d1f Make SME prop-grid hack Mac-only.
Fixes https://gitlab.com/kicad/code/kicad/issues/13852

(cherry picked from commit dcba555d44)
2023-03-02 14:59:57 +00:00
Jeff Young 3a95826b42 Move only-write-model-if-it-contains-overrides up to base class.
It's necessary to keep us from writing out model lines for included
models and fall-backs of included models.

(cherry picked from commit f5edcf82f2)
2023-03-01 13:44:26 +00:00
aris-kimi ff6f658f9d Simulator: Fix some cases with initial conditions
(cherry picked from commit 4a761179d0)
2023-02-28 21:31:45 +00:00
jean-pierre charras 764ddd4773 Fix compil warnings. 2023-02-28 18:00:22 +01:00
Graham Keeth f7d9f1f69d Fix SPICE pins for BJTs and MESFETs
- MESFETs don't have a substrate/bulk pin
- BJTs have a substrate pin, and HICUM/VBIC have TJ

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/13848

(cherry picked from commit 6af3dadaee)
2023-02-28 14:21:12 +00:00
Jeff Young 42efd2d005 Make substrate and thermal junction nodes optional.
Fixes https://gitlab.com/kicad/code/kicad/issues/14083

(cherry picked from commit 1fdc81e68d)
2023-02-28 14:21:12 +00:00
Jeff Young d32e13daee Clear model name when switching to internal model.
Also fixes a bug to ensure that a modelLine gets written when using
an internal model.

Fixes https://gitlab.com/kicad/code/kicad/issues/14083

(cherry picked from commit 2e5bf0210a)
2023-02-28 14:21:12 +00:00