Commit Graph

604 Commits

Author SHA1 Message Date
jean-pierre charras 8ab8a48657 fix order of includes to avoid conflicts with a Windows header. 2022-12-03 10:59:46 +01:00
Fabien Corona bd235048f9 sim GUI: remove "Adjust value" checkbox.
We had a change in notation and this checkbox became useless.
2022-12-03 08:28:43 +00:00
Fabien Corona 6e45987005 fix build warning 2022-12-01 20:33:51 +00:00
Mikolaj Wielgus f38c5d8cd0 Sim: Add virtual destructor to SIM_SERDE 2022-12-01 17:18:55 +01:00
Mikolaj Wielgus 4ec7ea376e Sim Ibis: Minor code style changes 2022-12-01 17:13:37 +01:00
kliment 0f09172902 Eeschema: ibis_parser - Fix undefined behavior due to pointer aliasing in isNumberNA 2022-12-01 15:44:38 +00:00
Mikolaj Wielgus d2adcdfde0 Sim: Add "number of bits" parameter to KIBIS PRBS model and some more fixes
The other fixes:

- PRBS's `m_bits` should be an integer.
- Fix some references to outdated parameter names.
2022-12-01 09:19:41 +01:00
Mikolaj Wielgus 7d207c5d2f Sim Ibis: Change some strings for consistency 2022-11-30 17:38:09 +01:00
Mikolaj Wielgus e39c0b20ea Sim: Universally initialize enum parameters with their default values 2022-11-30 12:45:59 +01:00
Mikolaj Wielgus 39cd9f8980 Sim: Fix Sim.Params field generation logic
Don't generate the first parameter (e.g. for KIBIS it was 'vcc=""') when
it is empty in models without primary value.
2022-11-30 12:45:58 +01:00
jean-pierre charras f3aff63726 Fix minor compil warnings 2022-11-29 20:05:58 +01:00
Mikolaj Wielgus ab6caca384 Sim: Remove duplicate parameters 2022-11-29 15:02:45 +01:00
Mikolaj Wielgus b025b103de Sim Model Editor: Make the VBIC model the first BJT model to select 2022-11-29 10:13:20 +01:00
Mikolaj Wielgus 8143522371 Sim: Fix VDMOS model parsing 2022-11-29 09:48:01 +01:00
Fabien Corona 6510afe699 Ibis: Show the parser log if the parser fails 2022-11-28 17:46:42 +00:00
Mikolaj Wielgus 20ea191f66 Sim: Fix model param vs. instance param duplicates in diode model 2022-11-28 08:00:49 +01:00
Mikolaj Wielgus 7b1a460649 Sim: Fix unhandled MODEL_TYPE in SIM_MODEL_NGSPICE 2022-11-28 07:59:24 +01:00
Mikolaj Wielgus d836fbaaaa Sim: Add VBIC model support
Update generate_sim_model_ngspice_data.bash a little, but it's still
outdated.
2022-11-28 04:45:36 +01:00
Mikolaj Wielgus bbcb0c04fc Sim: Don't crash when parsing unknown model in a Spice file 2022-11-27 08:59:54 +01:00
Mikolaj Wielgus 71d194071b Sim: Allow Numparam expressions in models inside subckts
Global-level numparam expressions are not properly supported yet.

Fixes https://gitlab.com/kicad/code/kicad/issues/12953
2022-11-27 06:32:17 +01:00
Mikolaj Wielgus 0b5814f98f Sim: Allow .subckt parameter lists without "params:"
And fix .subckt parameter list parsing, because it was broken.

Fixes https://gitlab.com/kicad/code/kicad/issues/12779
2022-11-26 10:24:11 +01:00
Mikolaj Wielgus 6f630f7054 Sim: Make library path textbox editable
Load the library from the path if enter is pressed or focus is lost if
the library exists. If a library under the same path as previously is
to be loaded this way, don't do anything.

Fixes https://gitlab.com/kicad/code/kicad/issues/12970
2022-11-26 03:55:20 +01:00
Mikolaj Wielgus acc760dc25 Sim: Fix generation of Sim.Pins field in multipart models
Fixes https://gitlab.com/kicad/code/kicad/issues/12372
2022-11-26 01:34:10 +01:00
Mikolaj Wielgus 6d5cc9e606 Sim: Sort the generated Sim.Pins by symbol pin numbers
They were sorted by model pin numbers, which weren't the keys in the
key=value pairs generated into Sim.Pins.
2022-11-26 01:34:10 +01:00
Mikolaj Wielgus a65b35107d Sim: Make Sim.Pins have key-value pairs instead of a sequence
Moreover, upgrade models on schematic load instead of on model load
2022-11-25 05:38:21 +01:00
Fabien Corona 226dc9de78 Ibis: Don't create unnecessary B source 2022-11-22 21:09:08 +00:00
Fabien Corona 5d4b323009 Ibis : correct net name for device generation 2022-11-22 21:08:26 +00:00
jean-pierre charras b0b8a8dd67 Fix the order of some includes to avoid a conflict with a Windows header 2022-11-22 07:33:14 +01:00
Mikolaj Wielgus 23480cdee3 Sim: Make empty Sim.Params mean storing primary value in Value 2022-11-22 07:09:52 +01:00
Mikolaj Wielgus 1550a1e3a4 Sim Model Editor: Add "Save {} in Value field as "{}"" checkbox 2022-11-22 07:09:52 +01:00
Mikolaj Wielgus d63eac9778 Sim: s/SIM_MODEL_MUTUAL_INDUCTOR/SIM_MODEL_L_MUTUAL/ 2022-11-21 05:01:12 +01:00
Mikolaj Wielgus e9fe59a28c Sim: Rename the missed Sim_* fields to Sim.* 2022-11-21 03:33:11 +01:00
Mikolaj Wielgus 6969362813 Sim Model Editor: Don't provide library-only models as builtins 2022-11-20 22:07:39 +01:00
Fabien Corona 8498630876 Ibis: correctly load QA files up to v2.1 2022-11-20 19:10:46 +00:00
Mikolaj Wielgus 59501dfa15 Sim: Rename Ibis_* fields to Sim.Ibis.* 2022-11-20 03:53:10 +01:00
Mikolaj Wielgus 059ca8fc48 Sim: Rename Sim_* fields to Sim.* 2022-11-20 03:37:54 +01:00
Mikolaj Wielgus 9b6f7d5db7 Sim Model Editor: Use SIM_LIB_MGR class to manage library models 2022-11-19 01:55:38 +01:00
Mikolaj Wielgus 21ae2dd1c0 Sim Model Editor: Initialize all IBIS models as IBIS devices 2022-11-19 01:55:38 +01:00
Jeff Young e09e521162 Remove GUI calls from netlisting. 2022-11-18 15:29:16 +00:00
Mikolaj Wielgus 0f4cc2450d Sim Model Editor: Don't throw an error on opening a NONE model 2022-11-18 09:06:55 +01:00
Mikolaj Wielgus e7c43ca20a Sim: Remove inference from Reference and Value 2022-11-18 08:39:15 +01:00
jean-pierre charras b9ac486000 simulator: remove unused includes, and reorder a few includes to fix conflicts
Conflicts happen only on msys2 with wxWidgets 3.0. But this minor reorder
allows me to test Kicad compilation with "old" wxWidgets, used on Linux.
2022-11-16 10:09:54 +01:00
Mikolaj Wielgus ce3362ee12 Sim: Don't write inherited model params to symbol fields 2022-11-12 23:50:11 +01:00
Mikolaj Wielgus d66d810edc Sim Model Editor: Use SIM_LIB_MGR to store instance models 2022-11-12 23:27:22 +01:00
jean-pierre charras 7c9f3981ef Revert "Reorder includes is some simulator files to fix issues on msys2 (no code change)"
This reverts commit 78e45fa1b9.
Looks like it creates a compil issue on MSVC
2022-11-12 20:47:36 +01:00
jean-pierre charras 78e45fa1b9 Reorder includes is some simulator files to fix issues on msys2 (no code change)
Due to pegtl.hpp included in some files, reordering include fix some conflicts:
wxWidgets files must be included before pegtl.hpp, to compile with wxWidgets 3.0
I sometimes use wxWidgets 3.0 for debugging purposes.
2022-11-12 19:54:26 +01:00
Mikolaj Wielgus 0d42003247 Sim: Create missing SIM_MODEL factories in SIM_LIB_MGR 2022-11-12 18:20:56 +01:00
Fabien Corona 0d78ca8b1a Ibis: GUI fixes 2022-11-12 14:39:36 +00:00
Mikolaj Wielgus fef6eaa8ba Sim Model Editor: Don't use shared_ptr to hack around lifetimes 2022-11-12 03:15:27 +01:00
Mikolaj Wielgus 95b6cc80f5 Sim: PULSE source y2 param is "Pulsed value", not "Initial value" 2022-11-11 05:19:53 +01:00
Mikolaj Wielgus f33cd3e383 Sim: Remove vestiges of (de)serialization from SIM_MODEL 2022-11-11 05:17:26 +01:00
Mikolaj Wielgus 490069c5e6 Move (de)serialization of models into fields to new SIM_SERDE class 2022-11-11 03:08:32 +01:00
jean-pierre charras ffd578ef70 Ibis parser: fix a collision name with a windows header (msys2 specific)
This is recurrent conflict. (fixed by changing INPUT to INPUT_SDT).
2022-11-08 17:35:57 +01:00
Jeff Young ece752d5a2 Move annotation error reporting to preflight before simulation.
Fixes https://gitlab.com/kicad/code/kicad/issues/9220
2022-11-08 12:13:15 +00:00
Jeff Young 5af506777c Formatting and wxT 2022-11-08 12:13:15 +00:00
Mikolaj Wielgus e8762da4f4 Revert "Support for variable references in SPICE models."
This reverts commit 95ebfeeed1.
This reverts commit 672ce650a9.
2022-11-07 19:37:40 +01:00
Jeff Young 95ebfeeed1 Support for variable references in SPICE models.
Also fixes a couple of bugs where sheet instance data wasn't being
handled correctly.
2022-11-07 10:57:34 +00:00
Alex c279a2e696 Hotfix build when KICAD_SPICE=OFF 2022-11-02 11:03:09 +05:00
Jeff Young 9eef638f0b Don't validate on keystrokes.
KiCad policy is to validate on focus-loss so that you can make changes
which have intermediate states that are not valid.
2022-10-31 14:09:30 +00:00
Mikolaj Wielgus 5eca8dd8de Undo hardcoding swapping of diode pins
Revert commits d1e2acd3 70b4d1aa cff508fb
2022-10-30 11:01:59 +01:00
jean-pierre charras 50d2237f06 command_export_pcb_dxf.cpp: switch to "C" locale before exporting the file
Fix also a minor Coverity warning
2022-10-29 09:45:45 +02:00
Mikolaj Wielgus d1e2acd3d8 Sim: Reverse Cathode and Anode strings in diode model data 2022-10-28 15:16:34 +02:00
Mikolaj Wielgus 70b4d1aac8 Commit sim_model_diode.{cpp,h} 2022-10-28 14:29:32 +02:00
Mikolaj Wielgus cff508fb3b Sim: Reverse diode model pin order to match diode symbols 2022-10-28 14:01:09 +02:00
Mikolaj Wielgus 20ffb7d334 Sim: Don't throw exception for certain garbage characters in Value field 2022-10-27 06:42:43 +02:00
Jeff Young a9a2cc3e84 Enhance readability of Simulation Model dialog. 2022-10-27 00:01:38 +01:00
Wayne Stambaugh 6a0db3e7e2 Fix Coverity warnings. 2022-10-26 14:39:44 -04:00
Mikolaj Wielgus aa0e3666d1 Sim: Skip param name when writing primary param in model's Value field 2022-10-26 09:03:02 +02:00
Mikolaj Wielgus 01c69f1066 Sim: Swap pins instead of inverting position variable in potentiometers 2022-10-26 03:57:53 +02:00
Jeff Young 445657022b Don't attempt to read simulation model if symbol isn't included.
Also collect up all errors for one dialog when preparing simulation.
Also translate error messages.

Fixes https://gitlab.com/kicad/code/kicad/issues/12686
2022-10-26 00:41:31 +01:00
Jeff Young 5f3d440ce3 Fix compile error. 2022-10-25 13:29:38 +01:00
Fabien Corona 20b63f305e Sim: Ibis improvements and fixes
Follow-up after the KIBIS and KIBIS GUI merge requests.

- Move KIBIS from Pcbnew to Eeschema space,
- Make KIBIS obtain the Ku/Kd coefficients via the `SPICE_SIMULATOR` class instead of calling the `ngspice` executable via `system()`,
- Allow to toggle between differential and single-ended model in the GUI,
- Various GUI fixes and improvements.
2022-10-25 09:45:40 +00:00
Mikolaj Wielgus 3e0f4a47b0 Sim: Remove pins field in all inferred models with linear pin mapping 2022-10-25 08:52:12 +02:00
Mikolaj Wielgus 80c426f577 Sim: Fix writing inferred model for tlines 2022-10-25 08:52:12 +02:00
Mikolaj Wielgus d10fd7bb09 Sim: Remove tuner (log) scale choice button
We probably won't be using it for now.
2022-10-25 04:38:09 +02:00
Mikolaj Wielgus 0399d08aaa Sim: Fix potentiometers 2022-10-24 11:04:47 +02:00
Mikolaj Wielgus 9b6cc6c505 Sim: Fix tuners 2022-10-24 11:04:47 +02:00
Mikolaj Wielgus 78b193af5f Sim: Add tuner param virtual getter 2022-10-24 11:04:47 +02:00
Mikolaj Wielgus d14de1ce78 Sim: Rename Value field's "principal value" to "primary value" 2022-10-24 11:04:47 +02:00
jean-pierre charras 63002cec57 Do not add a title/comment in mandatory field strings when writting netlists.
This is mainly for "Sheetfile" property because current it is the only one
that has a title when plotting/drawing it.
2022-10-22 12:50:26 +02:00
Mikolaj Wielgus 958bd1897d Sim: Add potentiometer model 2022-10-22 04:33:52 +02:00
Mikolaj Wielgus 2a5bc9f87e Sim: Don't accept lone '.' as Value principal value 2022-10-22 04:33:52 +02:00
Mikolaj Wielgus 209ff933e7 Sim: Ignore everything between principal value and parameter-value pairs 2022-10-21 18:55:40 +02:00
Mikolaj Wielgus f95e77499b Sim: Make exception messages slightly more verbose 2022-10-21 08:15:29 +02:00
Mikolaj Wielgus 9819fa43dd Sim: Allow principal value in Value field to be followed by regular params 2022-10-21 08:14:13 +02:00
Mikolaj Wielgus d01dcc1c51 Sim: Interpret anything starting with .inc as .include 2022-10-20 05:13:32 +02:00
Mikolaj Wielgus 662f6c7d83 Sim: Don't match newlines in model names
This caused errors in AKO models with no overrides.
2022-10-20 04:00:33 +02:00
Mikolaj Wielgus 7ad927671d Sim Ltspice compat: Narrow ignoring undocumented parameters 2022-10-20 04:00:33 +02:00
Mikolaj Wielgus 5878749ed2 Sim LTspice compat: Ignore undocumented LTspice diode parameters 2022-10-20 04:00:33 +02:00
Mikolaj Wielgus 7378aaae9d Sim: Ignore the "mfg" parameter in all models 2022-10-19 06:53:39 +02:00
Mikolaj Wielgus 952f3da53f Sim: Only set sim command if the sheet sim command is different 2022-10-19 03:02:32 +02:00
Mikolaj Wielgus f68df09696 Sim: Fix analysis set from GUI 2022-10-19 02:32:50 +02:00
Mikolaj Wielgus 1965411bf5 Sim: Remove the parsing exception for LTspice compat
Silently ignoring this may be a cure worse than disease.
2022-10-18 23:19:48 +02:00
Mikolaj Wielgus 6e874f4c1e Ngspice: Preload a basically empty circuit to avoid error messages
Fixes https://gitlab.com/kicad/code/kicad/issues/12481
2022-10-18 05:48:01 +02:00
Mikolaj Wielgus 2475a703d6 Sim Model Editor: Checkbox for toggling inference 2022-10-16 05:10:57 +02:00
Mikolaj Wielgus c8e13813d9 Sim: Rename Sim_Disabled field to Sim_Enable 2022-10-16 00:49:44 +02:00
Mikolaj Wielgus c3d5b3b3e5 Sim: Only store device type in reference, not full model type
Instead of Reference="VSIN1", Value="dc=1 ampl=2 f=3", it's now
Reference="V1", Value="SIN dc=1 ampl=2 f=3".
2022-10-15 19:36:26 +02:00
Mikolaj Wielgus c857e533a9 Sim: Fix crash when a field tries to set an inexistent parameter
Refactored SetParamValue() and friends to use exceptions instead of
return values.
2022-10-12 04:27:48 +02:00
Mikolaj Wielgus 6ae333a116 Sim Model Editor: Fix crash when opening sources 2022-10-12 04:27:48 +02:00
Mikolaj Wielgus d47752ad75 Sim Model Editor: Fix displaying Ibis pin list 2022-10-11 02:22:59 +02:00