summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/plib/pfunction.cpp
Commit message (Collapse)AuthorAgeFilesLines
* srcclean in preparation for 0.226 release branch Vas Crabb2020-10-251-2/+2
|
* netlist: catch parenthesis count mismatch in formulas. couriersud2020-10-031-0/+2
|
* netlist: more clang lint fixes. couriersud2020-10-021-23/+20
|
* netlist: Add parse optimization to pfunction. couriersud2020-10-021-20/+94
| | | | * "(1 + 2)*a" now during parse step will be rewritten to "3*a".
* netlist: make pstring length/size use consistent. couriersud2020-09-241-1/+1
| | | | | | | | | | | * length reports the number of character codes in the string * size reports the size in memory units * Reminder: Set PSTRING_USE_STD_STRING to 1 in pstring.h and get native std::string * pstrings are compatible to std::string but only support a limited subset of functionality. * By default (always like this) utf8 is supported and thus length reports the number of multi-byte characters.
* netlist: code maintenance and performance optimizations. Couriersud2020-09-051-1/+1
| | | | | | | | | | | * 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: further nl_base.h splitting into headers in core subdir. couriersud2020-07-281-1/+1
|
* srcclean for 0.223 Vas Crabb2020-07-261-1/+1
|
* netlist: pfunction supports unary minus and removed duplicate code. couriersud2020-07-101-76/+76
|
* netlist: pfunction now supports unary minus operators. couriersud2020-07-051-42/+66
|
* netlist: fix pfunction if couriersud2020-07-041-2/+4
| | | The if postfix evaluation corrupted the stack.
* netlist: Add log() to pfunction. Aaron Giles2020-07-031-0/+3
|
* netlist: Add comparison operators to pfunction. couriersud2020-07-021-3/+29
| | | | | | | | | | | | | | | | | | | Comparison operators evaluate either into 0.0 or 1.0. Thus they can be used like "(a==1)*(b==2)" which will only result in 1.0 if a equal 1 and b equal 1. From the yet to be released test code: * PFUNCEXPECT("1==1", 1.0) * PFUNCEXPECT("1 *0 == 2-1-1", 1.0) * PFUNCEXPECT("0!=1", 1.0) * PFUNCEXPECT("0<1", 1.0) * PFUNCEXPECT("1>0", 1.0) * PFUNCEXPECT("0<=1", 1.0) * PFUNCEXPECT("1>=0", 1.0) * PFUNCEXPECT("1<=1", 1.0) * PFUNCEXPECT("1>=1", 1.0) * PFUNCEXPECT("if(1>0, 2, 0)", 2.0) * PFUNCEXPECT("if(0>1, 2, 3)", 3.0) * PFUNCEXPECT("if(sin(1)>0, 2, 3)", 3.0) // fail
* netlist: Performance improvement and refactoring. [Couriersud] couriersud2020-06-131-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | 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: code maintenance. (nw) couriersud2020-06-081-2/+2
| | | | | | - 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: clang-tidy, header order fixes. (nw) couriersud2020-06-011-1/+1
|
* netlist: Add tristate support for rom devices. [Couriersud] couriersud2020-05-201-3/+0
| | | | | | | | | Rom and prom devices now properly support tristate outputs. Native OC output still on the todo list. In addition this commit fixes a number of bugs around dealing with macro level parameters and improves documentation by adding a parameter table. Also srcclean.
* Fix OS X build (implicit inclusion differences between standard libraries ↵ AJR2020-05-031-0/+1
| | | | strike again) (nw)
* netlist: Add the NE566 as a macro device. [Couriersud] couriersud2020-05-011-2/+43
| | | | | | | | The device can be found in nlm_other.cpp. Removed nld_ne566.* Added SYS_SW, SYS_SW2 and SYS_COMP. These are single switch, alternating switch and a analog comparator with digital outputs. Renamed RES_SWITCH to SYS_SW. Added example ne566.cpp in netlist/examples.
* netlist: Fix clang-tidy warnings. (nw) couriersud2020-04-281-4/+8
|
* netlist: code maintenance and edge case fixes. (nw) couriersud2020-04-201-3/+3
| | | | | | | | | | | | "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: code maintenance on pfunction. (nw) couriersud2020-04-191-8/+8
|
* netlist: added min and max to pfunction. (nw) couriersud2020-02-161-0/+6
|
* netlist: Fix crash in infix function evaluation. (nw) couriersud2020-01-291-1/+1
|
* netlist: clang lint readability fixes. (nw) couriersud2020-01-251-13/+13
|
* netlist: code maintenance. (nw) couriersud2020-01-201-8/+8
| | | | | | - remove pthrow trampline as proposed by Vas. - identify throwing code by adding noexcept(false) - move "connected term" information to setup code. - srcclean
* 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-101-7/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 and bug fixes. (nw) couriersud2019-11-081-4/+0
| | | | | | | - 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: more consistent exception handling. (nw) couriersud2019-11-051-4/+4
| | | | Still not optimal, but better than what we had previously. No exception logging comes closer.
* netlist: code maintenance. (nw) couriersud2019-11-041-2/+2
| | | | | | | | - 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-031-1/+2
| | | | | | - Separate code out into pmath.h and pstonum.h. - Fix VC build error - optimize pfmtlog.h a bit
* netlist: Completed __float128 support. [Couriersud] couriersud2019-11-031-4/+7
| | | | | | 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: add RELTOL/VNTOL solver parameters. Type safety. [Couriersud] couriersud2019-11-021-2/+3
| | | | | | | | | 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: fix clang warnings & srcclean. (nw) couriersud2019-10-311-3/+3
|
* netlist: Compile with float/double floating point. [Couriersud] couriersud2019-10-311-171/+179
| | | | | | | | | | | 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: code maintenance. (nw) couriersud2019-10-291-2/+2
| | | | | | | | - 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
* netlist: code maintenance (nw) couriersud2019-10-121-1/+2
| | | | - clang lint and pedantic fixes - mat_cr.h: separate solving linear systems from underlying matrix
* netlist: maintenance and lint fixes. (nw) couriersud2019-10-061-1/+1
|
* netlist code maintenance (nw) couriersud2019-09-211-1/+1
| | | | | - prepare move to c++ streams and later std::string - fix more lint and clang pedantic warnings/errors - fix some bugs
* netlist: Fix MT06827. couriersud2019-04-221-1/+1
| | | | All pstonum calls now need to specify if they want local locale or the "classic" "C" locale.
* netlist: MB3614 again, function controlled VARCLOCK and other couriersud2019-04-071-4/+7
| | | | | | | | | | | improvements. - fix MB3614 parameter - Added VARCLOCK which derives step size from function - optimized function handling in CS and VS - fixed a bug in ppreprocessor - add trunc to pfunction - added opamp_amplification_curve to derive characteristic amplification curve
* (nw) Clean up the mess on master Vas Crabb2019-03-261-16/+16
| | | | | | | | | | | | | This effectively reverts b380514764cf857469bae61c11143a19f79a74c5 and c24473ddff715ecec2e258a6eb38960cf8c8e98e, restoring the state at 598cd5227223c3b04ca31f0dbc1981256d9ea3ff. Before pushing, please check that what you're about to push is sane. Check your local commit log and ensure there isn't anything out-of-place before pushing to mainline. When things like this happen, it wastes everyone's time. I really don't need this in a week when real work™ is busting my balls and I'm behind where I want to be with preparing for MAME release.
* Revert "conflict resolution (nw)" andreasnaive2019-03-251-16/+16
| | | | | This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing changes made to 009cba4fb8102102168ef32870892438327f3705.
* netlist: fix visibility issues and more issues reported by tidy. (nw) couriersud2019-02-221-1/+1
|
* netlist: more core guidelines work. (nw) couriersud2019-02-091-1/+1
|
* netlist: Refactoring after adding clang-tidy support to netlist makefile couriersud2019-02-071-6/+7
| | | | | | | - convert macros to c++ code. - order of device creation should not depend on std lib. - some state saving cleanup. - added support for clang-tidy to makefile. - modifications triggered by clang-tidy-9.
* netlist: code maintenance and fixing kidniki ... (nw) couriersud2019-02-011-1/+0
| | | to run at acceptable speed again.
* Fix clang-8 warnings. (nw) couriersud2019-01-111-2/+2
|
* Improve type safety on string->numeric conversions. (nw) couriersud2019-01-101-1/+3
| | | | | | | Also fixed an issue with 7497. ./nltool -t 5 -f src/mame/machine/nl_tp1983.cpp -v now runs again.