59 Commits

Author SHA1 Message Date
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
Seth Hillbrand
b5f021ff9f Cleanup: Replace push_back with emplace_back
In cases where we create a new item and immediately push into a
container, the emplace idiom is faster and more efficient.
2019-12-05 13:41:21 -08:00
Adam Wolf
c7c49cee5a Add additional ngspice codemodel path for launching from standalone eeschema on macOS. 2019-10-04 13:41:50 -04:00
Simon Richter
05353049b5 Pull in macro definition for strncasecmp on MSVC 2019-07-17 08:10:47 -04:00
jean-pierre charras
6cdde97e6f ngspice dll search: add auxiliary search paths on Linux, like on other platforms 2019-04-15 11:04:59 +02:00
Maciej Suminski
b445b0fab2 Link eeschema with ngspice DLL
Adds a link-time dependency for libngspice, so that other tools may
detect ngspice as a KiCad dependency.

The library is still loaded with dlopen() as it gives a way to reload it
in case of problems. The DLL name is recognized during CMake
configuration and used to load the library at runtime.
2018-10-30 08:32:38 +01:00
Stefan Brüns
d1db2c7621 Use fixed version for libngspice.so.0
CanonicalizeName only adds the lib prefix and .so suffix, so loading
libngspice.so fails until the development package is installed.
MAC/Windows code paths lookup soversion 0 of ngspice as well, as this
is the only compatible version.
2018-10-27 10:20:09 +02:00
Wayne Stambaugh
7343e78347 Fix some Coverity uninitialized field warnings.
Fixes Coverity CIDs:

- 175824
- 169337
- 163191
- 175827
- 175440
- 175438
- 157136
2018-06-04 13:48:57 -04:00
Maciej Suminski
e3a06dca70 Fallback to system ngspice library when libngspice is not found in other paths on macOS 2018-04-19 14:48:31 +02:00
Maciej Suminski
4526f40fe1 ngspice: add extra paths to search for libngspice
The main purpose of the patch is to load libngspice from macOS bundle.
There are also some additional paths that could make Windows developers
easier.

Fixes: lp:1630675
* https://bugs.launchpad.net/kicad/+bug/1630675
2018-04-19 11:43:29 +02:00
Maciej Suminski
a8ef222517 ngspice: keep the ngspice DLL handle as an automatic variable 2018-04-19 11:44:48 +02:00
Maciej Suminski
058f2bffd0 Spice simulator: safety check 2018-03-22 18:20:02 +01:00
Maciej Suminski
bad462a228 Spice simulator: reload ngSpice dll on error
ngSpice frequently ends up a simulation with an error:
"Error: ngspice.dll cannot recover and awaits to be detached"
The only way forward is to reload the shared library and
reinitialize ngSpice.

Fixes: lp:1753101
* https://bugs.launchpad.net/kicad/+bug/1753101
2018-03-21 18:01:38 +01:00
Maciej Suminski
33620ecc85 Revert "libngspice is linked at compile time"
This reverts commit 75f8b20493100ac103476d3d3d33c140d92a0b15.
In case of problems, ngspice demands to be detached which is not
possible when it is linked at compile time.
2018-03-21 18:01:38 +01:00
Tomasz Włostowski
919b449595 Added 'show spice netlist' menu option in the simulator
Fixes: lp:1745887
* https://bugs.launchpad.net/kicad/+bug/1745887
2018-03-03 17:38:28 +01:00
Maciej Suminski
d7e1152aa3 Correct way of freeing memory in NGSPICE class
Strings created with strdup() should be deleted using free(), not
delete.
2017-03-01 13:56:24 +01:00
Maciej Suminski
af3d5befa7 Solve codemodel libraries loading problem in ngspice
Fixes: lp:1630675
* https://bugs.launchpad.net/kicad/+bug/1630675
2016-10-17 10:11:27 +02:00
Maciej Suminski
2a6b8f153b NGSPICE as a singleton
One cannot call ngSpice_Init() twice without unloading the dll. When calling
ngSpice_Init, we pass a pointer to a NGSPICE instance and thus it cannot be changed.
When any of the callback function is called with a stale pointer everything crashes.
2016-08-19 15:51:19 +02:00
Maciej Suminski
cac571c056 Initialize ngspice only once 2016-08-18 18:10:00 +02:00
Maciej Suminski
43d93682a2 Fix locale in NGSPICE methods using LOCALE_IO instead of setlocale.
More information: https://lists.launchpad.net/kicad-developers/msg25763.html
2016-08-15 15:52:07 +02:00
Maciej Suminski
75f8b20493 libngspice is linked at compile time 2016-08-15 13:52:13 +02:00
Maciej Suminski
18e99fa30f Fixed a crash with certain shared library versions 2016-08-11 14:42:21 +02:00
Maciej Suminski
0667b7ba63 Fixed ngspice freeze when there is an error in the simulated netlist Does not work with current ngspice head, it has to be compiled from the official master branch. 2016-08-11 14:42:18 +02:00
Maciej Suminski
eeeb3e0a9a Simulator code formatting and clean up 2016-08-11 14:42:17 +02:00
Maciej Suminski
957c6ec417 Removed hard limit for ngspice netlist 2016-08-11 14:42:17 +02:00
Maciej Suminski
0a6390701d NGSPICE uses a more convenient function to generate DLL name 2016-08-11 14:42:16 +02:00
Johannes Maibaum
c78462c4f5 sim: Modifications to compile the simulator on OSX. 2016-08-11 14:42:15 +02:00
Tomasz Wlostowski
36297f84c3 sim: further locale hacks, fixed plot/welcome message sizing 2016-08-11 14:42:02 +02:00
Tomasz Wlostowski
bba57097b7 sim: use C locale for SPICE simulation. Added error callback 2016-08-11 14:42:01 +02:00
Tomasz Wlostowski
ec1b8be528 sim: fixed build errors & locale issues 2016-08-11 14:41:58 +02:00
Maciej Suminski
caef84d622 SPICE_SIMULATOR::GetXAxis() 2016-08-11 14:41:51 +02:00
Maciej Suminski
d869771f04 Display an error message if ngspice DLL is missing 2016-08-11 14:41:48 +02:00
Maciej Suminski
f62a6425a3 Changed the simulator code license to GPLv3+ 2016-08-11 14:41:43 +02:00
Maciej Suminski
6bfe6342fc Simulator fixes for Windows 2016-08-11 14:41:41 +02:00
Maciej Suminski
6580a355ab Strip 'stdout' & 'stderr' from ngspice log 2016-08-11 14:41:35 +02:00
Maciej Suminski
0da13052dd SPICE_SIMULATOR interface allows to obtain different types of plots (mag, phase, real, imag) 2016-08-11 14:41:31 +02:00