Commit Graph

94 Commits

Author SHA1 Message Date
Jeff Young cdb99de862 Use HasSymbol() instead of a null logger. 2023-12-28 21:52:26 +00:00
Jeff Young e59612d56c Add realloc locking calls for ngspice42.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15941
2023-12-28 19:36:18 +00:00
Alex Shvartzkop 71fb1afe4c Add ngspice lib paths for when running from build dir. 2023-10-22 19:58:17 +03:00
Jeff Young 2dfdf0682f Don't ask for empty data. 2023-10-03 12:59:49 +01:00
Jeff Young ff044cd0cf Mostly a terminology update...
... but also makes DIALOG_SIM_COMMAND and SIMULATOR_REPORTER a bit
more simulator-agnostic.
2023-07-14 17:46:06 +01:00
Jeff Young bde9c2cbc5 ADDED FFT analyses.
CHANGED abandon the unpredictable behaviour of the Simulation Command
dialog.  You now separately add simulation tabs (which have invariant
command types once created), and the dialog edits the current tab.

Also a bunch of bug fixes to make multiple simulation plots actually
work.
2023-07-07 12:33:50 +01:00
Jeff Young d5d2800b03 Sort out terminology issues between vectors and plots. 2023-07-07 12:33:50 +01:00
Fabien Corona 886a7c2c04 ADDED: S-parameters simulation 2023-07-04 16:01:12 +00:00
Jeff Young 492ef62053 ADDED support to save contributions from all noise generators.
You must first check the checkbox in the Simulation Command dialog,
after which the signals will appear in the User Defined Signals
autocomplete lists.
2023-07-04 11:05:10 +01:00
Jeff Young 7d3fa8fb4e Plotting for noise simulations.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2369
2023-07-03 23:12:28 +01:00
Jeff Young b1d5da3da3 Allow ngspice to run in the background.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14085
2023-06-17 23:54:33 +01:00
Jeff Young 8c8c5e1824 Provide a default xaxis for DC-sweep so we can add traces before sim is run. 2023-02-25 22:42:52 +00:00
Jeff Young 6fcb95b24e ADDED user-defined signals. 2023-02-21 13:32:01 +00:00
Jeff Young 542719c753 Add "all" mode to HSPICE emulation. 2023-01-21 19:32:25 +00:00
Jeff Young f7ebaf1bab Add compatibility mode for netlist code.
(The non-A compatibility modes only run on included files.)

Fixes https://gitlab.com/kicad/code/kicad/issues/13589
2023-01-20 18:06:17 +00:00
jean-pierre charras bdf13ade7a Fix a compil issue on linux, round 2 2022-12-11 20:43:10 +01:00
jean-pierre charras 32995a31c6 Fix a compil issue 2022-12-11 20:19:56 +01:00
Jeff Young 5c53daadb0 Mostly coding standards, but also quote codemodel names before passing to spice.
Fixes https://gitlab.com/kicad/code/kicad/issues/12687
2022-12-11 18:42:57 +00:00
Jeff Young 69448afb47 Don't run simulation twice when the sim command is overridden.
Fixes https://gitlab.com/kicad/code/kicad/issues/12731
2022-12-07 01:34:56 +00:00
Jeff Young 7e1fecaf2e Formatting. 2022-12-05 20:03:42 +00:00
Jeff Young e09e521162 Remove GUI calls from netlisting. 2022-11-18 15:29:16 +00: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
Seth Hillbrand 35ac39844f Clean up some auto usage
Don't make new copies of shared_ptr if we can use references.  Keep auto
usage down to hard-to-type-out sequences
2022-08-15 11:29:45 -07:00
Mikolaj Wielgus a1a99b1ec2 Sim QA: Check NGSPICE's LoadNetlist() and Run() status code 2022-08-10 17:54:28 +02:00
Mikolaj Wielgus 739b9255d9 Sim Model Editor improvements
- Tab-switching,
- Automatic expansion of categories on tab-switch,
- Various minor simulation improvements,
- Various new simulation-related bugfixes.
2022-07-30 02:25:34 +00:00
Mikolaj Wielgus 978f01553b Sim Model Editor: Serialize models in fields
Implemented serialization and deserialization of models in symbol fields
through the SIM_VALUE class. We don't carry the Spice legacy of
case-insensitive suffixes, instead we conform to the SI standard (i.e. M
is Mega, not milli, P is peta, p is pico).

Parameter grid value validation is implemented by simply not allowing
any characters that will make the value invalid (instead of highlighting
the field in a red color). This will likely be changed at some point in
the future.
2022-07-30 02:25:34 +00:00
Eduardo Behr f246646d7a Fix severe simulation memory leaks 2022-05-28 20:40:24 +00:00
Sylwester Kocjan a9c61d21ca eeschema: fix crash when closing simulation frame
Destructor of SIM_PLOT_FRAME calls sim->Attach( nullptr ) in order to destroy
circuit model (former netlist exporter). If this is skipped, eeschema crashes
when program is closed. nullptr is a valid parameter for Attach()
2022-04-05 19:28:05 +00:00
Sylwester Kocjan f5dedd77c6 eeschema,sim: add SIMULATOR and SIM_MODEL interface
SIMULATOR has now an Attach() method, which should be called
with proper SIMULATION_MODEL that should be simulated, before calling Run()

Concrete class of SIMULATION_MODEL for ngspice is NGSPICE_CIRCUIT_MODEL,
renamed from NETLIST_EXPORTER_PSPICE_SIM. DIALOG_SIM_SETTINGS relies
on above mentioned object, so it was added as an argument of the constructor.
2022-04-01 19:28:31 +00:00
Seth Hillbrand 098e8f7d9b Revert "cmake: adding KICAD_MACOSX_APP_BUNDLE option"
This reverts commit ea9f960cc1.

Reverted for updates as this currently breaks kicad-mac-builder
2022-01-31 15:57:56 -08:00
Davide Gerhard ea9f960cc1 cmake: adding KICAD_MACOSX_APP_BUNDLE option
ADDED: with cmake KICAD_MACOSX_APP_BUNDLE option the user can disable
the macOS app bundle creation when compiling on macOS. This permit to
use/install KiCad like any other *nix platform (/usr/bin, /usr/share,
ecc.). By default, cmake build the app bundle.
2022-01-28 15:49:37 -08:00
jean-pierre charras d4e5861c62 Fix a few issue in simulation (noticeable only when the calculation time is high):
- Wait for end of simulation before return from "C" locale to current locale
(to avoid data files created by ngspice using curr locale instead of "C" locale)
- Do not allow changing signal list to plot during simulation calculation
(avoid crashes)
2021-05-05 20:28:46 +02:00
Seth Hillbrand 61289ab39a Cleanup ngspice calling signatures 2021-05-05 10:49:40 -07:00
Seth Hillbrand 36975c9cd0 Conditionally handle the SPICE signatures
ngspice updated their function signatures, requiring us to test.  They
also don't provide an indicator that the signature is changed, so we
need to test based on the existence of a new version define.

Fixes https://gitlab.com/kicad/code/kicad/issues/8358
2021-05-05 10:19:01 -07:00
jean-pierre charras e5dd54e05a Eeschema, spice sim: fix a crash when no value is available.
onSimFinished() try to analyse the list of plots, but did not test
if there is available data before using it.
Fixes #8169
https://gitlab.com/kicad/code/kicad/issues/8169
2021-04-14 21:01:39 +02:00
Wayne Stambaugh dbb0a125ac Fix build error when spice simulator build option is disabled. 2021-03-19 09:04:28 -04:00
Wayne Stambaugh acec6ad7fc Spice simulator: add Ngspce model behavior mode settings.
ADDED: Ngspice simulator model behavior mode settings for PSpice, LTSpice,
       PSpice and LTSpice, and HSpice.

Fixes https://gitlab.com/kicad/code/kicad/issues/5810
2021-03-18 15:31:02 -04:00
jean-pierre charras 14b1d36b38 Simulator: Fix a ugly bug that happens is some simulations
TRhe initial code was broken.
2021-03-08 20:01:36 +01:00
Marek Roszko b609c7dcd6 Kick the osx specific path helpers into PATHS 2021-02-16 23:29:26 -05:00
Marek Roszko f9c7eae63a Avoid null access in NGSPICE::AllPlots 2021-02-16 18:37:57 -05:00
Marek Roszko 1608282a57 Remove msys2 search paths for ngspice under msvc 2021-02-13 20:08:31 -05:00
Sylwester Kocjan 6a48e21eb2 simulator: update dialog to handle R, I & TEMP DC sweeps
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2370
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6195
Fixes https://gitlab.com/kicad/code/kicad/-/issues/2386
2021-01-25 21:29:13 +00:00
Marek Roszko 1d559108c8 Move LOCALE_IO out of common.h 2020-10-23 21:49:42 -04:00
jean-pierre charras f6b4b66a86 Avoid include wx/wx.h in many files that do not actually use this include.
Including wx.h includes the full set of wxWidgets include files, that is not good,
and can create some conflicts with some Windows headers on msys2.
2020-10-18 18:21:34 +02:00
Jeff Young 741481591e NetClass settings for Eeschema.
ADDED Eeschema-specific netclass settings including wire and bus
thickness, color, and line style.

Netclasses override individual wire & bus colors and line styles.
If that proves an issue we might look at something more sophisticated
with inheritance.

Fixes https://gitlab.com/kicad/code/kicad/issues/4581
2020-07-08 21:23:25 +01:00
Simon Richter 632494cba7 Add missing includes
A few more instances of missing <algorithm> for std::max
2020-05-10 00:24:11 +02:00
Sylwester Kocjan fdccdd5cb9 Eeschema: adding .op SPICE simulation support
ADDED new tab on simulation settings dialog, which allows to run .op analysis.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2368
2020-04-15 01:51:58 +00:00
Ian McInerney 0d017e262c Update documentation and comment 2020-01-22 08:47:14 +00:00
Simon Richter f87dc08801 Readd <config.h> to ngspice.cpp
This file should really be included first from any source file, because it
contains platform specific workarounds.

This also groups includes a bit by source.
2020-01-22 08:38:45 +00:00
Jeff Young 384ff2539a Fix uninitialized variables. 2020-01-21 09:29:33 +00:00