summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/solver/nld_solver.cpp
Commit message (Collapse)AuthorAgeFilesLines
* netlist: Relicensing of the GPL code to BSD-3 with the blessing of the Olivier Galibert2021-03-091-1/+1
| | | | | | | | | | copyright owners. Much thanks for that Couriersud, the main creator and contributor, but also to Jonathan Gevaryahu and Sergey Svishchev. There are small remnants in machine/NL_*, specifially breakout, pong doubles and rebound that are also copyrighted by the DICE team, whoever that means. They're not critical since they only concern these drivers and not an important core subsystem.
* netlist: fix VS build. couriersud2020-10-031-1/+1
|
* netlist: simplify code. couriersud2020-10-021-1/+1
|
* netlist: move core_terms to netlist_state. couriersud2020-10-021-17/+17
| | | | | * These are used during creation and reset only. No need to maintain them on net_t level.
* netlist: more clang lint fixes. couriersud2020-10-021-2/+2
|
* netlist: Fix a net splitting issue with four term devices. couriersud2020-09-301-4/+8
| | | | | | | | | | * Under cirtum circumstances the splitter would create "ghost" solvers consisting of terminals already used in another and complete solver. This may impact all netlist which use opamps and thus is committed early in the cycle. * This commit adds functionality to instruct the splitter code to include terminals which will not create matrix elements into the parsing of net groups for solvers.
* netlist: applied some clang tidy recommendations couriersud2020-09-301-1/+1
|
* netlist: implement stricter validation. couriersud2020-09-281-1/+48
| | | | | | | | | | | * Devices like BJTs and FETs which are defined but not used will now cause an error. * An unused device will create an additional solver with a singular matrix. - This is adding unnecessary performance overhead. - It complicates debugging because the unused device will cause an arithmetic signal if used with --fperr (nltool). * Fixed all validation errors.
* netlist: Fix 128 bit integer support. couriersud2020-09-241-1/+1
|
* netlist: emscripten can not use specialization efficiently. couriersud2020-09-171-0/+2
| | | | * Consequently prefer to save on compile time and size.
* netlist: Pedantic and clang tidy updates couriersud2020-09-061-5/+5
| | | * also fix an issue with netlist vs build
* netlist: code maintenance and performance optimizations. Couriersud2020-09-051-2/+2
| | | | | | | | | | | * rename some misleading type names * remove callback_t and replace by better scalable approach * hide implementations details * move sources classes from putil.h to psources.h * reduce code complexity * improve parsing performance, parsing netlists now is twice as fast. * fix issues around multi-byte string support * moved psplit into pstrutil.h
* netlist: Fix various issues around include directories. couriersud2020-08-251-2/+2
| | | | | | | | | * removed include directory src/lib/netlist from various genie files to avoid potential issues. * Code using netlist should use #include "netlist/*". * Updated includes. * Fixed standalone makefile depend target to properly deal with relative paths.
* netlist: source stream refactoring couriersud2020-07-281-2/+2
| | | | | * This is an infrastructure change to enable better error reporting including file/source and line numbers in the future
* netlist: sub solvers now have their own parameter set. couriersud2020-07-251-40/+40
| | | | | | | | | | * Example: PARAM(Solver.Solver_0.METHOD, "GMRES") * Will use the GMRES solver instead of the default MAT_CR solver. * Same applies to all Solver parameters. * Please use with care. If you change your netlist (e.g. using frontiers) the allocation of nets to solvers and the number of solvers may change. Thus this type of tweaking should only be used after the netlist completely works.
* netlist: Fix scheduling bug. couriersud2020-07-251-1/+1
|
* netlist: include GMRES solver in build. couriersud2020-07-251-2/+2
| | | | | | | * The GMRES solver for larger matrices (>>100) can outperform Gaussian elimination. Including it so it gets wider attention. * As far as I know netlist is the only SPICE-like circuit simulation providing a GMRES solver.
* netlist: Rewrote scheduler scheduling. couriersud2020-07-251-15/+114
| | | | | | | | | | | | | | * All solver scheduling is now handled by nld_solver. * Previously, for dynamic timestepping the sub solvers would be responsible for their scheduling themselves. - This prevented any attemps to use parallel execution of solvers. * Now the route is free towards experiments to use parallel execution of solvers. * Uses ptimed_queue_linear in solver scheduling * Improved netlist queue implementation (template now) * Added const delegates. * Added subsolver stats * Removed dead code.
* netlist: nld_matrix_solver is now owned by nld_solver. couriersud2020-07-251-12/+12
|
* netlist: finished input handler refactoring. couriersud2020-07-121-1/+1
| | | * all inputs now explicitly specify a signal handler.
* netlist: code maintenance and bug fixes. couriersud2020-07-011-0/+1
| | | | | | | | | | | * palloc.h/pmatrix2d.h: Fix static_assert warnings at the origin. * Rework hints to broaden their use and fix NC hint. * 74377: use NC hint * plists.h: Fix debugging in MSVC * Include cleanup: Move everything not needed by netlists from nl_setup.h into core/setup.h * Fix some clang tidy warnings * srcclean
* netlist: include file refactoring. couriersud2020-06-281-6/+6
| | | | | | | | The purpose of this ongoing exercise is to remove unnecessary dependencies in header files. netlist implementations should only have access to what they need. The same applies to device implementations. Core stuff will be moved to the core subdirectory going forward.
* netlist: code maintenance couriersud2020-06-281-5/+10
| | | | | | * decrease use of reinterpret_cast. * change some defaults for better ttl game optimization. * various code cleanup.
* netlist: Performance improvement and refactoring. [Couriersud] couriersud2020-06-131-20/+11
| | | | | | | | | | | | | | | | | | | | | | | | Kidniki now achieves up to 910% when run with static solvers and with nltool. That is significant better than the 860% we have seen previously. This increase is driven by using a global memory pool in the solver code. In addition the following refactoring and code maintenance work is included. Please excuse the large commit, some of this took interfered with other work and the detail development steps were ugly. - gsl support: This commit adds pgsl.h which implements a very limited number of the functionality of the gsl header described in the c++ core guidelines. - clang-tidy fixes - A significant refactoring of palloc.h. Aligned hints were removed, they added complexity without a significant performance gain. Vector operations should better be done on special spans/views. The code has been tested on linux with g++-7, g++-9, clang-11. On Windows mingw-10 and VS2019, OSX clang-11.
* netlist: allow selection of base arena for pmempool_arena. (nw) couriersud2020-06-081-2/+2
|
* netlist: code maintenance. (nw) couriersud2020-06-081-44/+16
| | | | | | - more c++14, use enable_if_t instead of enable_if - cleaned up the use of memory allocation arenas - reduce MACRO usage, use std::conditional where possible
* netlist: Fix some tidy warnings. (nw) couriersud2020-05-031-0/+1
| | | moving over to clang-tidy-11 and enabling more warnings.
* netlist: improve const-awareness and tidy changes. (nw) couriersud2020-04-281-1/+5
| | | | Identified a number of code locations which could accept const arguments.
* netlist: unify solver calls. (nw) couriersud2020-04-251-9/+6
| | | | | | Calls to the solver used different paths. These changes unify these calls and provide a common call for discontinuous state changes on analog components (change_state).
* netlist: code maintenance and edge case fixes. (nw) couriersud2020-04-201-2/+5
| | | | | | | | | | | | "Edge cases" are compiles were the floting point type used for the core may be different from the one used by solvers, e.g. double/float. This does not happen in MAME, here currently this is always double/double. Since floats are better suited for GPUs whose double performance is limited it was time to review the code. This commit fixes warnings about type conversions and precision loss. In addition there is better support for INT128 and FLOAT128. The MAT solver has seen some minor performance increases.
* netlist: rename some camel case names. (nw) couriersud2020-04-191-18/+19
|
* netlist: compile time improvement and code maintenance. (nw) couriersud2020-04-191-6/+12
| | | | | Added a define NL_USE_ACADEMIC_SOLVERS and disabled it in the build. This will not compile in solvers which are either illustrative or only perform for large sparse matrices like GMRES.
* netlist: remove code duplication. (nw) couriersud2020-04-181-47/+2
|
* netlist: nltool usage and static compile changes. [Couriersud] couriersud2020-04-181-3/+6
| | | | | | | | | | | | | | | | | | | | | This commit simplifies the creation of static solvers. For this to happen the following changes were made: - nltool does no longer support the "-f netlist_file.cpp" option. All parts of netlist which used the option now expect the file to be specified after all other options. Before: nltool -t 10 -f somenetlist.cpp Now : nltool -t 10 somenetlist.cpp - The static compile command now supports an "--output" option to specify the file to be created and accepts multiple input files. To be create the static solver file for MAME use the script provided or: ./nltool --cmd static --output=src/lib/netlist/generated/static_solvers.cpp src/mame/audio/nl_*.cpp src/mame/machine/nl_*.cpp - Updated documentation and examples provided by nltool --help
* netlist: improve performance up to 65% on audio netlists. [Couriersud] couriersud2020-04-131-3/+3
| | | | | | | | | | | | | | | | | | | This commit introduces precompiled static solver code. Due to additional optimizations the compiler can use because the detail calculation steps for the solution are known e.g. the kidniki netlist sees a 100% speed increase. In all environments (windows/*nix/osx) the source for the static solver code can be created using bash src/lib/netlist/nl_create_mame_solvers.sh This will create src/lib/netlist/generated/static_solvers.cpp which is compiled into the mame binary. The script is just a temporary workaround. The intention is that nltool whill be able to create this file with one call. There are other improvements in this commit speeding up the processing of timestep and dynamic calculations.
* netlist: Fix some clang-tidy-10 warnings. (nw) couriersud2020-04-051-1/+1
|
* netlist: Code symplification and bugfixes. (nw) couriersud2020-01-311-29/+39
| | | | | - Fixes performance regression and net_splitter struct. - Fixes nltool time measurements - pstream simplification
* netlist: Code maintenance. (nw) couriersud2020-01-271-1/+1
| | | | | | | | | - Fixed some clang lint warnings - Removed dead code - Experimental parser code to allow calculations in parameter value. This already works for compiled netlists. These changes are currently disabled. Updated pong netlist (and CRC/SHA) to work with this new code.
* netlist: MAJOR bug fix. Expect other bugs to surface. [Couriersud] couriersud2020-01-261-8/+33
| | | | | | | | | | | This commit fixes an issue with parsing netlists. To cut a long story short: The separation of nets into independant groups of nets failed under some circumstances for four terminal devices (controlled voltage/current devices). Everything worked as long as an external feedback loop existed. Without external feedback loop, the separation would either fail or create "false" separated nets. This fix also highlighted an issue with cmos switches (4066/4016). There is a slight chance that other bugs may surface due to this change.
* netlist: code maintenance. (nw) couriersud2020-01-201-4/+6
| | | | | | - remove pthrow trampline as proposed by Vas. - identify throwing code by adding noexcept(false) - move "connected term" information to setup code. - srcclean
* netlist: Code maintenance. (nw) couriersud2020-01-121-2/+2
| | | | | | | | | Introduce an additional absolute time type netlist_time_ext to identify whether absolute or relative time is used in the netlist code. Extend ptime code to allow operations between ptime derived types with different internal types. In addition rewrote main queue serve loops. Adds a very small performance increase.
* netlist: maintenance. (nw) couriersud2019-11-111-3/+1
| | | | | | | - Fix automatic header generation - clang lint fixes. - srcclean - remove dead code
* netlist: code maintenance. (nw) couriersud2019-11-101-2/+12
| | | | | | - more doxygen \file annotations - moved MAINCLOCK back to nl_base.h - remove some const from simple function parameters
* netlist: code maintenance and bug fixes. (nw) couriersud2019-11-081-21/+16
| | | | | | | - comment style migration continues. - Fixed a two bugs in the truthtable ignore inputs code - refactored the truthtable code a bit for better readability. - updated netlist specific gitignore.
* netlist: code maintenance. (nw) couriersud2019-11-031-1/+0
| | | | | | - Separate code out into pmath.h and pstonum.h. - Fix VC build error - optimize pfmtlog.h a bit
* netlist: fix regression, preliminary __float128 support. (nw) couriersud2019-11-031-0/+5
| | | | | __float128 is a gnu extension delivering true 128 bit floating point support. Currently not supported by clang. In addition, the quadmath library needs to be linked. For the time being therefore disabled.
* netlist: Support for float, double and long double solvers. [Couriersud] couriersud2019-11-021-97/+115
| | | | | | | | | | | | | - Added new solver parameter FPTYPE. This determines in which floating point domain the linear system is solved. May be one of "FLOAT", "DOUBLE" or "LONGDOUBLE" - Added option "--fperr" to nltool. This enables floating point exceptions. This helps debugging the code under gdb. The purpose of this going forward is to have more choice in optimization. Non-dynamic systems should be just fine in the float domain. Dynamic systems (i.e. diodes, bjts, mosfets) should in general work with double. Certain edge cases may require long double resolution.
* netlist: Compile with float/double floating point. [Couriersud] couriersud2019-10-311-26/+26
| | | | | | | | | | | Added ability to compile using float instead of double. Specifically the the solver as well as the infrastructure now can have their own floating point type. Currently this is only an academic exercise since numerically demanding circuits like kidniki only work with double/double support. Using float here is pushing numerical stability over the limits. The long term design goal is too have the matrix type (double/float) being a parameter.
* netlist: maintenance and simplifcation. (nw) couriersud2019-10-311-26/+26
| | | | | | | - solver: align matrix population along the various solvers - solver: delete dead code - renamed nl_double to nl_fptype and use nl_fptype where previously double has been used. - renamed param_double_t to param_fp_t
* netlist: move solver stuff into separate namespace. (nw) couriersud2019-10-311-23/+23
| | | | | - new namespace "solver" - minor ptime modifications