← Back to team overview

kicad-developers team mailing list archive

Re: Integrated Simulator

 

Congratulations on everyone who made the is happen.  This is a nice
feature for KiCad and hopefully users will find it useful.

There are a few things will need to addressed that I missed when I
initially evaluated the code.

Maybe I missed it but I do not see any indication that the ngspice
headers and libraries are detected during cmake configuration (see
attachment).  This is a major no-no.  All external dependencies must be
found during configuration.  As a developer, there are few things that
make kick a software package to the curb faster than getting 3/4 of way
through a 30+ minute build only have the build fail because there is a
missing dependency header or library.  This should fail during
configuration to inform the developer that there are missing
dependencies.  Please write a FindNgSpice.cmake file.  I know I've said
this in the past but I will reiterate it, if you add a new dependency to
KiCad you *must* add the configuration code to ensure that all of the
required headers and/or libraries can be found before a valid
configuration can be completed.

Also, please update the Documentation/development/compiling.md file with
the added optional ng-spice dependency.  This is the official compiling
document that gets pushed to the kicad website so it needs to be kept up
to date.

Thanks again everyone for your hard work.

Cheers,

Wayne


On 8/11/2016 9:07 AM, Maciej Sumiński wrote:
> I have just merged the ngspice branch. It is still required to enable
> KICAD_SPICE switch in cmake in order to use it, so it does not cause
> problems on systems without ngspice library installed.
> 
> Regards,
> Orson
> 
> On 08/05/2016 09:40 PM, Maciej Sumiński wrote:
>> I had spoken with ngspice devs and they have suggested me a workaround
>> for the bug. Unfortunately, it requires a patch that is currently not
>> included in the release version, so we resort to building from the
>> source again.
>>
>> To ease the pain, I have updated get_libngspice_so.sh [1]. Now it should
>> build the correct library version for Linux, Windows (mingw64) & OS X. I
>> have managed to run the script successfully on all the mentioned
>> platforms, but I still do not have KiCad compiled on OS X, so I was not
>> able to test it there.
>>
>> I have updated the ngspice branch in my github repository [2]:
>> - applied fixes for Win7 & OS X (thank you Jean-Pierre & Johannes)
>> - resized dialogs, so all the fields are visible and windows fit 1024x768
>> - fixed a few minor bugs
>> - corrected demo circuits
>> - cleared, formatted & documented the code
>>  & added some documentation
>> I consider the code ready for merge. If there are no objections, I would
>> like to proceed next week.
>>
>> Regards,
>> Orson
>>
>> 1. https://orson.net.pl/pub/libngspice/get_libngspice_so.sh
>> 2. https://github.com/orsonmmz/kicad-source-mirror/tree/ngspice
>>
>> On 07/21/2016 11:16 PM, Chris Pavlina wrote:
>>> Really, really nice! I made it do a thing! https://misc.c4757p.com/kicad_sim.png
>>>
>>> I feel bad to provide a bug report on my very first communcation on
>>> this, but... found one: not sure if this sort of thing is actually
>>> standard SPICE or an LTspice extension, but I tried parameterizing a
>>> component value, setting a resistor's value to {R} - that sort of thing
>>> leads to irrecoverable lockups here.
>>>
>>> On Thu, Jul 21, 2016 at 09:37:57PM +0200, Tomasz Wlostowski wrote:
>>>> Hi,
>>>>
>>>> As some of you have noticed, we've been working on a "secret" feature
>>>> during the hackathon at CERN. The feature we're talking about is an
>>>> integrated circuit simulator. Currently it features:
>>>> - Seamless integration into schematic editor,
>>>> - AC/Transient/DC sweep simulations,
>>>> - Voltage probing from the schematics,
>>>> - Live tuning of component values.
>>>>
>>>> A video demonstrating the capabilities of the new simulator is available
>>>> on Tom's YouTube channel [1].
>>>>
>>>> The code is currently available in the ngspice branch on Tom's GitHub
>>>> [2] for review & testing. It's a big feature, so we didn't want to push
>>>> it immediately to the product branch. We'll greatly appreciate your
>>>> feedback!
>>>>
>>>> The simulator uses ngspice [3] as the Spice kernel. We'd like to thank
>>>> ngspice developers for providing a DLL interface which made seamless
>>>> integration of ngspice into Kicad possible.
>>>>
>>>> In order to get started:
>>>> - install ngspice shared library (is not provided by many Linux distros,
>>>> Arch Linux is a known exception, so you might have to compile it from
>>>> the sources with --with-ngshared --enable-xspice options).  Windows
>>>> DLLs, msys2 PKGBUILD & binary packages (to be included soon in
>>>> the official msys2 repo, currently merged to
>>>> https://github.com/Alexpux/MINGW-packages/) & Linux script to build the
>>>> library are available at [4].
>>>> - compile eeschema with -DKICAD_SPICE=ON option,
>>>> - have a look at some examples in demos/simulation directory.
>>>>
>>>> Happy simulating,
>>>> Tom
>>>>
>>>> [1] https://youtu.be/A2_-hdRcf4U
>>>> [2] https://github.com/twlostow/kicad-dev/tree/ngspice
>>>> [3] http://ngspice.sourceforge.net/
>>>> [4] https://orson.net.pl/pub/libngspice
>>>>
>>>> _______________________________________________
>>>> Mailing list: https://launchpad.net/~kicad-developers
>>>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~kicad-developers
>>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
>>
> 
> 
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 
$ cmake -G "MSYS Makefiles" -DUSE_SCH_IO_MANAGER=ON -DKICAD_SPICE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/mingw32 -DOPENSSL_ROOT_DIR=/mingw32 -DKICAD_SCRIPTING=ON -DKICAD_SCRIPTING_MODULES=ON -DKICAD_SCRIPTING_WXPYTHON=ON /c/src/kicad/product/
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: C:/msys64/mingw32/bin/gcc.exe
-- Check for working C compiler: C:/msys64/mingw32/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/msys64/mingw32/bin/g++.exe
-- Check for working CXX compiler: C:/msys64/mingw32/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Kicad install dir: <C:/msys64/mingw32>
-- Looking for malloc.h
-- Looking for malloc.h - found
-- Looking for iso646.h
-- Looking for iso646.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for strcasecmp
-- Looking for strcasecmp - found
-- Looking for strncasecmp
-- Looking for strncasecmp - found
-- Looking for strtok_r
-- Looking for strtok_r - found
-- Looking for malloc
-- Looking for malloc - found
-- Looking for math.h
-- Looking for math.h - found
-- Looking for C++ include cmath
-- Looking for C++ include cmath - found
-- Looking for asinh
-- Looking for asinh - found
-- Looking for acosh
-- Looking for acosh - found
-- Looking for atanh
-- Looking for atanh - found
-- Performing Test HAVE_CMATH_ISINF
-- Performing Test HAVE_CMATH_ISINF - Success
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - not found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for getc_unlocked
-- Looking for getc_unlocked - not found
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp
-- Found wxWidgets: -LC:/msys64/mingw32/lib;;;-pipe;-Wl,--subsystem,windows;-mwindows;-lwx_mswu_gl-3.0;-lwx_mswu_aui-3.0;-lwx_mswu_adv-3.0;-lwx_mswu_html-3.0;-lwx_mswu_core-3.0;-lwx_baseu_net-3.0;-lwx_baseu-3.0;-lwx_baseu_xml-3.0;-lwx_mswu_stc-3.0 (found suitable version "3.0.2", minimum required is "3.0.0")
-- Found OpenGL: opengl32
-- Found Glew: C:/msys64/mingw32/lib/libglew32.dll.a
-- Check for installed GLEW -- found
-- Found GLM: C:/msys64/mingw32/include (found suitable version "0.9.7.4", minimum required is "0.9.5.1")
-- Found CURL: C:/msys64/mingw32/lib/libcurl.dll.a (found version "7.49.1")
-- Found PkgConfig: C:/msys64/mingw32/bin/pkg-config.exe (found version "0.29.1")
-- Checking for module 'cairo'
--   Found cairo, version 1.15.2
-- Found Cairo: C:/msys64/mingw32/lib/libcairo.dll.a (found suitable version "1.15.2", minimum required is "1.8.8")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Boost version: 1.60.0
-- Found the following Boost libraries:
--   context
--   system
--   thread
--   chrono
--   date_time
--   atomic
-- Found PythonInterp: C:/msys64/mingw32/bin/python2.exe (found suitable version "2.7.11", minimum required is "2.6")
-- Check for installed Python Interpreter -- found
-- Python module install path: lib/python2.7/site-packages
-- Found PythonLibs: C:/msys64/mingw32/lib/libpython2.7.dll.a (found suitable version "2.7.11", minimum required is "2.6")
-- wxPython version 3.0 found.
-- Found Doxygen: C:/msys64/usr/bin/doxygen.exe (found version "1.8.11")
-- Searching for OpenSSL in MinGW.
-- OPENSSL_VERSION_STR=# define OPENSSL_VERSION_NUMBER  0x1000208fL
-- Found OpenSSL: C:/msys64/mingw32/lib/libssl.dll.a;C:/msys64/mingw32/lib/libcrypto.dll.a (found version "1.0.2h")
INFO: KICADSG_VERSION_MAJOR = 2
INFO: KICADSG_VERSION_MINOR = 0
INFO: KICADSG_VERSION_PATCH = 0
INFO: KICADSG_VERSION_REVI = 0
-- Found SWIG: C:/msys64/mingw32/bin/swig.exe (found suitable version "3.0.6", minimum required is "3.0")
-- Configuring done
-- Generating done
-- Build files have been written to: C:/msys64/home/wstambaugh/build32/kicad/spice-branch-release

Follow ups

References