summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/plib/pfunction.h
Commit message (Collapse)AuthorAgeFilesLines
* netlist: static solver work and improve code readability (#9841) couriersud2022-05-301-1/+1
| | | | | | | | | | | - nltool: Added support for building individual static solver files. - Added pre-built documentation files for nltool and nlwav. - plib: Extended typed_version to have patchlevel as well. - plib: Compile more of ppmf.h with nvcc. - create_devinc.py: Add include guards to the generated files. - makefile: Recreate generated files when python code has changed. - Reduced nld_base.h usage in the core. - <oved extern template class declarations to where they belong. - Generally improved code readability and fixed a lot of issues cspell reported.
* 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: more clang lint fixes. couriersud2020-10-021-2/+20
|
* netlist: Add parse optimization to pfunction. couriersud2020-10-021-0/+5
| | | | * "(1 + 2)*a" now during parse step will be rewritten to "3*a".
* srcclean for 0.223 Vas Crabb2020-07-261-1/+1
|
* netlist: pfunction supports unary minus and removed duplicate code. couriersud2020-07-101-27/+39
|
* netlist: pfunction now supports unary minus operators. couriersud2020-07-051-0/+1
|
* netlist: add more constructors and () operator to pfunction. couriersud2020-07-031-3/+21
|
* netlist: Add log() to pfunction. Aaron Giles2020-07-031-0/+1
|
* netlist: Add comparison operators to pfunction. couriersud2020-07-021-0/+7
| | | | | | | | | | | | | | | | | | | 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: include file refactoring. couriersud2020-06-281-1/+0
| | | | | | | | 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: Restructered the save state system. (nw) couriersud2020-05-041-3/+3
| | | | | | | | | | | | | | | This change makes state saving contract based. Objects which need to save state need to have the following template member: template <typename ST> void save_state(ST &st) { /* Example */ st.save_item(m_p, "m_p"); st.save_item(m_buf, "m_buf"); } This member function is called when the object is passed to the state manager save function.
* netlist: simplify pfunction state handling. (nw) couriersud2020-05-031-15/+7
| | | Removes dependency on pstate.h.
* netlist: Fix clang-tidy warnings. (nw) couriersud2020-04-281-2/+2
|
* netlist: code maintenance and edge case fixes. (nw) couriersud2020-04-201-1/+2
| | | | | | | | | | | | "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-5/+10
|
* netlist: added min and max to pfunction. (nw) couriersud2020-02-161-0/+2
|
* netlist: clang lint readability fixes. (nw) couriersud2020-01-251-2/+2
|
* netlist: code maintenance. (nw) couriersud2020-01-201-3/+3
| | | | | | - remove pthrow trampline as proposed by Vas. - identify throwing code by adding noexcept(false) - move "connected term" information to setup code. - srcclean
* netlist: first steps on the way to calculated parameters. [Couriersud] couriersud2019-11-101-16/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-41/+43
| | | | | | | - 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-041-1/+1
| | | | | | | | - 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-0/+1
| | | | | | - 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-1/+3
| | | | | | 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-1/+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-2/+2
|
* netlist: Compile with float/double floating point. [Couriersud] couriersud2019-10-311-4/+8
| | | | | | | | | | | 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: MB3614 again, function controlled VARCLOCK and other couriersud2019-04-071-0/+1
| | | | | | | | | | | 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-2/+2
| | | | | | | | | | | | | 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-2/+2
| | | | | This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing changes made to 009cba4fb8102102168ef32870892438327f3705.
* netlist: Refactoring after adding clang-tidy support to netlist makefile couriersud2019-02-071-2/+2
| | | | | | | - 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.
* Fix state saving for pfunction lfsr. (nw) couriersud2017-05-281-0/+17
|
* srcclean (nw) Vas Crabb2017-05-281-4/+4
|
* Fix issues identified by Vas and LordKale4: couriersud2017-05-271-0/+12
| | | | | | - made local netlists in Cheeky Mouse static - replace stdlib rand by 16 bit galois lfsr (nw)
* Add rand() function to pfunction expression parser. Use this to simulate couriersud2017-05-271-0/+1
| | | E-B noise in Cheeky Mouse and fix the "cheese" choose. [Couriersud]
* More cppcheck fixes. (nw) Couriersud2017-03-051-4/+4
|
* srcclean (nw) Vas Crabb2017-02-191-1/+1
|
* Reorder include order to comply with best practices. (nw) couriersud2017-02-101-2/+2
|
* Cleanup of includes. (nw) couriersud2017-01-271-1/+0
|
* Added infix notation parsing to the function parser. (nw) couriersud2017-01-251-2/+20
|
* Netlist: couriersud2017-01-171-0/+70
- refactored reverse polish notation evaluator into own source files. - added function parameter to current and voltage sources VS and CS. You can now use those to e.g. produce a sine wave. - Changed code to allow devices to optionally be treated as dynamic or timestepping devices. [Couriersud]