summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/devices/nld_system.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.
* -unidasm: Allow input piped from stdin by specifying a bare hyphen as the ↵ Vas Crabb2020-11-181-6/+2
| | | | | | | | | | filename. [AJR, Vas Crabb] -netlist: Give devices the C++17 namespace treatment. -Tidied up compiler warning options for 3rdparty. -emu/render.cpp: Exposed a few information view item properties.
* netlist: minor code cleanup. couriersud2020-09-251-1/+1
| | | | | | * a number of minor fixes leading to an increase of 570% to 588% on pongf. * admittedly micro optimization. * Includes some comments why certain decisions have been taken.
* netlist: Pedantic and clang tidy updates couriersud2020-09-061-1/+1
| | | * also fix an issue with netlist vs build
* netlist: code maintenance and performance optimizations. Couriersud2020-09-051-1/+97
| | | | | | | | | | | * 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: separate nl_base.h into separate header files. couriersud2020-07-251-5/+2
| | | | | | * This clean-up exercise will hopefully make it easier to navigate the core code. Another long term goal is to further straighten the object model.
* netlist: finished input handler refactoring. couriersud2020-07-121-40/+0
| | | * all inputs now explicitly specify a signal handler.
* netlist: Align design VARCLOCK to AFUNC. Aaron Giles2020-07-031-1/+1
|
* netlist: Change use of NETLIB_DELEGATE macro. (nw) couriersud2020-06-011-4/+1
| | | | The macro now has only one parameter, the local name of the delegate.
* netlist: remove family_setter and other maintenance. (nw) couriersud2020-05-091-2/+2
| | | | | | | | | | | | | | | - removed family_setter - naming alignment, family becomes model. - architecture cleanups.) - reviewed reset logic. - pass truthtable family as string to factory. This is another set of changes on the path to align logic families and models. As a side effect, the object model now makes a clear distinction between analog models and logic models. The number of macros in nl_base.h has decreased significantly due to these changes.
* netlist: Add two noise sources. [Couriersud] couriersud2020-05-031-0/+9
| | | | | | | | | | | | | | | | | | | The two sources act as voltage sources, though noise may also be injected as conductivy or current noise. SYS_NOISE_MT_U: Mersenne Twister uniform noise SYS_NOISE_MT_N: Mersenne Twister normal noise nld_sys_noise is templated: using NETLIB_NAME(sys_noise_mt_u) = NETLIB_NAME(sys_noise)<plib::mt19937_64, plib::uniform_distribution_t>; Thus the approach is scalable. The implementation is state save aware, and thus reproducible results are guaranteed. An example use case is provided as well, see examples/noise.cpp.
* netlist: Add the NE566 as a macro device. [Couriersud] couriersud2020-05-011-1/+3
| | | | | | | | 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: use initializer_list. (nw) couriersud2020-03-021-0/+3
| | | | | | - Use initializer_list in object_array_t. - Added constructor which accepts a format string for object names. - Started work on logic_input8 which provides 8 logic outputs.
* netlist: Code maintenance. (nw) couriersud2020-01-121-1/+1
| | | | | | | | | 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 and bug fixes, remove DUMMY_INPUT. [Couriersud] couriersud2019-11-151-1/+1
| | | | | | | | | | - 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: first steps on the way to calculated parameters. [Couriersud] couriersud2019-11-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-101-3/+3
| | | | | | - more doxygen \file annotations - moved MAINCLOCK back to nl_base.h - remove some const from simple function parameters
* netlist: code and documentation maintenance fixes. [Couriersud] couriersud2019-11-071-50/+7
| | | | | | | | | - "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: Support for float, double and long double solvers. [Couriersud] couriersud2019-11-021-1/+1
| | | | | | | | | | | | | - 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: maintenance and simplifcation. (nw) couriersud2019-10-311-1/+1
| | | | | | | - 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: Use unique_ptr where possible. (nw) couriersud2019-10-151-1/+1
| | | Also improve code readability.
* netlist: MB3614 again, function controlled VARCLOCK and other couriersud2019-04-071-14/+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-58/+37
| | | | | | | | | | | | | 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-37/+58
| | | | | This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing changes made to 009cba4fb8102102168ef32870892438327f3705.
* netlist: Fix relative include paths and a conflict. (nw) couriersud2019-02-231-2/+2
| | | | nl_types.h is part of libc++. Any project with a file with the same name on the include path just fails to compile. Renamed to nltypes.h
* netlist: align solver calls. (nw) couriersud2019-02-041-13/+4
|
* netlist: Refactoring and some functionality enhancements. (nw) couriersud2019-02-041-0/+23
| | | | | | | | | | - Removed dead code. - nltool now adds a define NLTOOL_VERSION. This can be tested in netlists. It is used in kidniki to ensure I stop committing debug parameters. - Optimized the proposal for no-deactivate hints. - Documented in breakout that hints were manually optimized. - Minor optimizations in the order of 2% enhancement.
* netlist: All devices now specify parameters in factory constructor. (nw) couriersud2019-02-011-11/+13
| | | | This previously was part of net_lib.cpp and repeatedly caused bugs.
* netlist: remove trampoline code. (nw) couriersud2019-02-011-2/+2
|
* netlist: code maintenance and fixing kidniki ... (nw) couriersud2019-02-011-37/+0
| | | to run at acceptable speed again.
* Move information where it belongs ... into the drivers. (nw) couriersud2019-01-101-11/+11
|
* Fix state saving for pfunction lfsr. (nw) couriersud2017-05-281-1/+1
|
* Netlist code refactoring: couriersud2017-04-091-1/+2
| | | | | | | | | | | | | | | | | | | - more use of c++ features - some CRTP in pfmtlog - demangled code for truthtables - use more constexpr - rewrite main loop - use default constructors and assignment operators were applicable. - optimized 7448 and 9316 All of this has decreased startup time by approx. 25% to 30%. Complex netlists like pong or kidniki are parsed, analyzed and constructed in around 15 ms. Run performance has increased by about 5%. All in all not to bad. A game like pong uses a clock of 7 MHz (after division by 2). Thats 14 MHz clock invocations. Running at over 200%, 28 MHz. On a 3.9 GHz Machine about 140 cycles/clock change. [Couriersud]
* Clean up net_t interface and increase readability. (nw) couriersud2017-02-221-2/+2
|
* Make sure netlist includes are not found directly on include path. couriersud2017-02-101-2/+2
| | | | Instead, they have to be prefixed by "netlist/". Removed unneeded link librariers for nltool and nlwav along the way. (nw)
* More netlist refactoring: couriersud2017-01-251-2/+2
| | | | | | | | - Remove virtual from some destructors and make them protected. - Various cleanups. - Small performance improvement. - Fixed some inconsistencies. - More c++ refactoring. (nw)
* Netlist: couriersud2017-01-171-72/+3
| | | | | | | | | - 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]
* Improve readability and remove some trampolines. (nw) couriersud2017-01-121-0/+35
|
* Fix timing issue in CD4538. Add "pow" (power) to the function model. couriersud2017-01-121-0/+4
| | | Minor documentation updates. Slight improvement of gorilla sound. (nw)
* - setup_t is owned by netlist_t. Stop being complicated. couriersud2017-01-121-0/+5
| | | | | | - Remove gnd() method. - Further simplification. - Fix potential reset and initialization issues. (nw)
* Moved proxy code into separate file. (nw) couriersud2016-12-281-32/+0
|
* Netlist updates: couriersud2016-07-211-13/+13
| | | | | | | | | | | | | | | - Removed trampolines (OUTLOGIC, INPLOGIC and friends). - Started using doxygen comment and documentation style. Added doxygen files to documentation folder. - Refactored code triggered by doxygen output. - Moved internal and support classes into namespace detail. - Use an anordered map in parser. - -Wconversion fixes - All done now. - Fixed -Wold-style-cast warnings in netlist code. - Added iterators to pstring. - Moved two macros, added more RAII and improved exceptions. Fixed some bugs in parser code. - Fixed a number of bugs in parser code and exception handling. [Couriersud]
* Netlist improvements: couriersud2016-07-011-1/+1
| | | | | | | | | | | | | | | | | | | - nltool now accepts -Ddefine=value to pass on to netlists - improved option handling and added "dummy" options to add grouping and examples in help output. - improved --cmd=listdevices output - Fix dynamic timestepping. This will work with breakout using real capacitor modelling instead of delay devices. Really slow, but very useful to calibrate timings. - Fix an awful bug in timing for delay devices. - Switched to clang 3.8 and made code compile with -Weverything -Werror -Wno-old-style-cast -Wno-padded -Wno-weak-vtables -Wno-missing-variable-declarations -Wno-conversion -Wno-c++98-compat -Wno-float-equal -Wno-cast-align -Wno-global-constructors -Wno-c++98-compat-pedantic -Wno-exit-time-destructors -Wno-format-nonliteral -Wno-weak-template-vtables This was a helpful exercise since it brought forward some serious issues with implicit constructors. [Couriersud]
* Srcclean on netlist files. Avoid the merge massacre. (nw) couriersud2016-06-251-1/+0
|
* Merge netlist_dev branch, all code_refactoring: (nw) couriersud2016-06-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Object model optimisation. Merge remote-tracking branch 'origin/master' into netlist_dev Fix a merge issue. #if ==> #elif. Ouch. Default PHAS_PMF_INTERNAL=0 for 32bit windows mingw. Change UINT8 to uint_[fast|least|8_t. Move state_var so it can be used by base devices as well. Remove last traces of ATTR_ALIGN. Refactored netlist_time into a template. Removed implicit double assignment to netlist. Doomed to produce bugs. Instead, use netlist_time::from_double. Switch to using proper (i.e. bool type) param_logic_t. Formally differentiate between logic inputs (e.g. switches) and int inputs (e.g. resistor ladders or selection switches). Added parameter USE_DEACTIVATE to truthtable devices. Added more constexpr to netlist_time. Fixed some ifdef code paths. - More c++. - Simplify main processing loop. As a nice side-effect that squeezed out some cycles. - More cycle squeezing. - Removed pvector_t. - Use std::sort. - Refactored netlist state manager. - Introduction of state_var object template to be used on device state members. - Changed remaining save occurrences to state_var. - Rewrote nltool's listdevices command. This allowed removal of one member from devices which served solely for listdevices. - Remove hashmap_t. Fix kidniki regression.
* - More code cleanup. couriersud2016-06-071-20/+5
| | | | | | | | | | | | | | - Dead code removal and minor refactoring. - Simplify. Align naming with stl. Fix somed pedantic warnings. - More STL compatability. - Remove ATTR_HOT and ATTR_COLD. Refactored netlist_time. - Fix long standing workaround which would ignore policy of change-only" propagation. - Rewrote for loops to use auto : semantics. - Truthtable cleanup. (nw) - Get rid of nl_math. Remove nl_util.h and moved contents to plib/putil.h. - Fix standalone build. Refactor ptypes.h. [Couriersud]
* - Minor cosmetic refactoring. Added a "uninitialised array" template to balr0g2016-06-071-161/+177
| | | | | | | | | | | allow in-place creation (for increased locality) of netlist classes. Main use is in truthtable class. - Remove PLIB_NAMESPACE macros. - Remove namespace macros. Use explicit namespace declarations. - Moved device definitions into cpp files. - Moved more device definitions into cpp files. - New prefix "nlid" for include files flags purely internal include files not to be leaked into userland. - Fix factory code.
* Moved all parameter definitions in constructors. (nw) couriersud2016-05-251-10/+14
|
* Added == operator to netlist_time couriersud2016-05-211-1/+7
|