summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/analog
Commit message (Collapse)AuthorAgeFilesLines
...
* netlist: improve const-awareness and tidy changes. (nw) couriersud2020-04-281-1/+0
| | | | Identified a number of code locations which could accept const arguments.
* netlist: More clang-tidy fixes. (nw) couriersud2020-04-285-60/+94
|
* netlist: Fix clang-tidy warnings. (nw) couriersud2020-04-282-8/+8
|
* netlist: unify solver calls. (nw) couriersud2020-04-253-58/+59
| | | | | | 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: improve readability. (nw) couriersud2020-04-251-2/+0
| | | | The purpose here is to make clear what is actually done and to reduce usage of calls to update.
* netlist: document trapezoidal capacitor integration. (nw) couriersud2020-04-231-1/+47
|
* netlist: rename some camel case names. (nw) couriersud2020-04-195-27/+27
|
* netlist: clang-tidy, srcclean and pedantic warnings fixed. (nw) couriersud2020-04-181-0/+1
|
* netlist: Move macros where they belong. (nw) couriersud2020-04-181-19/+0
|
* netlist: Document alternative approach to CD4016. (nw) couriersud2020-04-171-1/+3
| | | | | | | | | | | | The CD4016 is an analog switch IC. Document an experimental approach to implement the analog switch as a 3 terminal element which is completely being dealt with as part as the linear system. The intention was to improve convergence when the switch is in a feedback loop. One example are two-opamp tridiagonal wave generators. Unfortunately the approach did not work out and in addition was performing far worse than the net-separating original code. Also updated comment in nld_generic_models.h.
* netlist: improve performance up to 65% on audio netlists. [Couriersud] couriersud2020-04-133-5/+65
| | | | | | | | | | | | | | | | | | | 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-052-3/+2
|
* srcclean (nw) Vas Crabb2020-03-221-1/+1
|
* netlist: Document alternative opamp output stage. (nw) couriersud2020-03-211-2/+33
|
* netlist: document linearized diode model above max. dissip. [Couriersud] couriersud2020-03-211-5/+55
| | | | | Document linearized diode model in the range exceeding maximum dissipation. The intention is to have a faster convergence but this yet not really is observable.
* netlist: Fix inductor. (nw) couriersud2020-03-021-1/+1
| | | | | Fix inductor calculation. Updated turkey shoot example to skip start-up swinging of L1/C60 LC circuit. Recording now starts at 1ms.
* netlist: Code symplification and bugfixes. (nw) couriersud2020-01-311-5/+11
| | | | | - Fixes performance regression and net_splitter struct. - Fixes nltool time measurements - pstream simplification
* netlist: Parameters evaluated when netlist is created. [Couriersud] couriersud2020-01-291-7/+1
| | | | | | | | | | | | Parameters are now passed to the netlist core as strings. During netlist creation they are evaluated as functions. This opens the path to parameters on subdevice level. Examples: PARAM(device.XY, (1+2*0.005)) RES(R1, 2.05*RES_K(1)+1) In addition the commit contains dead code removal.
* netlist: fix parameter update recalculation. (nw) couriersud2020-01-293-6/+14
|
* netlist: make gain parameter mandatory for controoled sources. (nw) couriersud2020-01-292-12/+12
|
* netlist: Code maintenance. (nw) couriersud2020-01-271-1/+5
| | | | | | | | | - 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: add current controlled voltage source (CCVS). [Couriersud] couriersud2020-01-263-3/+71
|
* netlist: New devices and some fixes. [Couriersud] couriersud2020-01-251-1/+2
| | | | | | | | | - add CD4006 and CD4070 devices - add TL084 opamp model - Clock now supports proxies, i.e. can be connected to analog devices. - Fixed netlists using CLOCK - added some comments - removed a forgotten header file.
* netlist: code maintenance. (nw) couriersud2020-01-202-2/+2
| | | | | | - remove pthrow trampline as proposed by Vas. - identify throwing code by adding noexcept(false) - move "connected term" information to setup code. - srcclean
* netlist: Make sure diodes step enough ... [Couriersud] couriersud2020-01-151-6/+9
| | | | | | | | Long story: The diode model uses log-stepping as proposed in "Circuit Simulation" (Farid N. Najm) page 183. If the previous voltage was sufficiently negative the new voltage after a log step could not have increased enough to alter matrix and rhs vector. This bug surfaced in stuntcyc video signal mixing which uses a diode for the composite signal.
* netlist: clang lint fixes and standalone build fix. (nw) couriersud2019-11-241-1/+1
|
* netlist: maintenance and bug fixes, remove DUMMY_INPUT. [Couriersud] couriersud2019-11-155-27/+27
| | | | | | | | | | - Removed DUMMY_INPUT. NC (not connected) pins should now use NC_PIN. If a NC_PIN is actually connected, an error will be logged and validation will fail. - Enabled "extended" validation. This will catch now if power terminals are not connected. - Added const and noexcept where appropriate. - Removed dead code. - Fixed the 7414 Schmitt-Trigger device to use nld_power_pins
* netlist: Proxy and power terminal hack removal. [Couriersud] couriersud2019-11-141-1/+11
| | | | | | | | | | | | | | | | | | - Devices ttlhigh and ttlhow are no longer automatically created. - All logic input devices (e.g. TTL_INPUT, LOGIC_INPUT) now need to have their power terminals (VCC, GND) connected. This opens the route for more appropriate proxy devices but comes at a cost. If the connections are omitted your circuit will not work as expected. Example: LOGIC_INPUT(I_SD0, 1, "AY8910PORT") NET_C(VCC, I_SD0.VCC) NET_C(GND, I_SD0.GND) - Updated all netlists. - Removed proxy information from terminal objects. This was replaced by a lookup hash whose life-span does not exceed netlest setup. These changes enable the removal of a number of hacks from the source going forward.
* netlist: bug fix, code maintenance and performance improvement. (nw) couriersud2019-11-131-1/+1
| | | | | | | | | - fixed a code in the netlist creation which caused multiple proxies to be created for output->terminal connections. A nice side effect of this fix is a performance increase ~9% for kidniki and ~4% for pong. Speaking about pong ... maximum is 490%. Dice is running at 280 FPS/60 FPS = 466%, however without any analog emulation. - Replaced NL_NOEXCEPT with noexcept. assert is now exception-free. - cppcheck and lint fixes.
* netlist: code maintenance. (nw) couriersud2019-11-131-3/+3
| | | | | | - move memory pool to netlist_state_t removing one static allocation. - add memory allocation stats to verbose output - nl_assert no longer throws, first step to remove NL_EXCEPT macro.
* netlist: maintenance. (nw) couriersud2019-11-111-1/+1
| | | | | | | - Fix automatic header generation - clang lint fixes. - srcclean - remove dead code
* netlist: first steps on the way to calculated parameters. [Couriersud] couriersud2019-11-102-19/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit is a first step towards using formulas in parameters, i.e. MAINCLOCK(clock, 20 * 30) The intention is to improve readability and scalability. Since device registration already provides all necessary information about parameters, the code to create an include file for all devices has been improved. Long term, this will remove the need for device specific header files. In addition going forward devices will accept either no connections or all specified connections, i.e. TTL_7400_NAND(name, chip1.2, chip2.3) or TTL_7400_NAND(name) NET_C(...) NET_C(...) This will allow to remove all duplicate definitions which are currently necessary, i.e. TTL_7400_NAND/TTL_7400_GATE
* netlist: code maintenance. (nw) couriersud2019-11-106-159/+159
| | | | | | - 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-0815-399/+374
| | | | | | | - 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: maintenance. (nw) couriersud2019-11-081-4/+0
| | | | | - switch to VS 2019 community and fix standalone build. - more migration to C++ comment style. - add some more doxygen markup.
* netlist: code and documentation maintenance fixes. [Couriersud] couriersud2019-11-073-21/+21
| | | | | | | | | - "nltool -c docheader" now scans sources and creates usage focussed doxy documentation for devices. Very early stage, but works. For an example, please see ne555 source. - Started migrating to pure C++, i.e. "//" comments. - Various documentation fixes. - Added cppcheck configuration to netlist/build - Some smaller code changes.
* netlist: Minor optimizations. (nw) couriersud2019-11-051-4/+4
|
* netlist: more consistent exception handling. (nw) couriersud2019-11-051-1/+1
| | | | Still not optimal, but better than what we had previously. No exception logging comes closer.
* netlist: code maintenance. (nw) couriersud2019-11-043-5/+8
| | | | | | | | - more const - explicitly raise exceptions instead of leaving this to log.fatal() - correct a number of cppcheck findings. - dead code removal - clang lint corrections, e.g. include order
* netlist: code maintenance. (nw) couriersud2019-11-037-15/+0
| | | | | | - Separate code out into pmath.h and pstonum.h. - Fix VC build error - optimize pfmtlog.h a bit
* netlist: remove pragma once. (nw) couriersud2019-11-032-4/+0
| | | Only used inconsistently in the code. May as well go.
* netlist: Completed __float128 support. [Couriersud] couriersud2019-11-036-26/+26
| | | | | | Both compiling the core and the shaders with __float128 now work. The support was added to be ready to deal with academic edge cases. Performance drops to 10% of double - thus disabled by default.
* netlist: improve readability. (nw) couriersud2019-11-029-193/+191
| | | | | | | Renamed cast member of the constants struct to magic to clearly identify magic numbers. Introduced nlconst struct inheriting from plib::constants<nl_fptype> to make code better understandable.
* netlist: add RELTOL/VNTOL solver parameters. Type safety. [Couriersud] couriersud2019-11-0210-182/+201
| | | | | | | | | The newly added RELTOL and VNTOL parameters implement Newton convergence checks comparable following other SPICE implementations. The ACCURACY solver parameter now is only used for convergence checks in iterative solvers. In addition, type safety was significantly improved and a lot of "magic" numbers are identifiable now.
* netlist: Support for float, double and long double solvers. [Couriersud] couriersud2019-11-026-12/+12
| | | | | | | | | | | | | - 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: convert constexpr constants into constexpr inline funcs. (nw) couriersud2019-11-011-7/+7
|
* It's C++14 where constexpr variables still aren't inlined, making ridiculous ↵ AJR2019-10-311-2/+2
| | | | workarounds like this necessary to fix builds (nw)
* netlist: Compile with float/double floating point. [Couriersud] couriersud2019-10-312-5/+5
| | | | | | | | | | | 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-319-248/+248
| | | | | | | - 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: code maintenance. (nw) couriersud2019-10-292-0/+3
| | | | | | | | - Removed code no longer used - Add noexcept where appropriate - split pparser.[c|h] into ppreprocessor and ptokenizer - smaller optimizations, e.g. use of std::size_t - fix lint warnings