summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/nl_parser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* netlist: Parameters evaluated when netlist is created. [Couriersud] couriersud2020-01-291-52/+8
| | | | | | | | | | | | 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: Code maintenance. (nw) couriersud2020-01-271-8/+37
| | | | | | | | | - 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: clang lint readability fixes. (nw) couriersud2020-01-251-2/+3
|
* netlist: code maintenance. (nw) couriersud2020-01-201-1/+1
| | | | | | - remove pthrow trampline as proposed by Vas. - identify throwing code by adding noexcept(false) - move "connected term" information to setup code. - srcclean
* netlist: more code maintenance. (nw) couriersud2019-11-161-61/+62
| | | | | | - refactor error messages. - Fix some drivers to cope with outputted added my the mame driver for video and sound. - Fix validation.
* netlist: maintenance. (nw) couriersud2019-11-111-93/+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-28/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | - 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: more consistent exception handling. (nw) couriersud2019-11-051-1/+0
| | | | Still not optimal, but better than what we had previously. No exception logging comes closer.
* 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: improve readability. (nw) couriersud2019-11-021-7/+7
| | | | | | | 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-021-2/+10
| | | | | | | | | 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: maintenance and simplifcation. (nw) couriersud2019-10-311-9/+9
| | | | | | | - 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-291-1/+1
| | | | | | | | - 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: Preprocessor enhancements. [Couriersud] couriersud2019-10-281-3/+2
| | | | | | | | | | The builtin preprocessor now behaves closer to cpp: - supports macro parameters, i.e. define x(a) a - supports stringification, i.e. define x(a) #a - supports concatenation, i.e. define x(a) a ## _ext In addition, error reporting now provides a source context including the include history.
* netlist: mame netlist reorganization. [Couriersud] couriersud2019-10-131-2/+2
| | | | | | - moved netlists out of driver code into audio/ or machine/ as nl_xxx.cpp files. - identified and documented extended validation - updated arcade, mess and nl targets
* netlist: code maintenance (nw) couriersud2019-10-121-2/+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/+0
|
* netlist: more lint corrections. (nw) couriersud2019-09-281-0/+5
| | | | - fixed lint corrections - added NOLINT where needed
* 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: Add power terminals to most logic devices. couriersud2019-04-211-1/+13
| | | | | | | | | | | | This fixes an over simplification. Logic devices implicitly assumed that GND/VDD actually is connected to GND(i.e. 0V). There is no immediate benefit from this change. It is a preparation for the future scalability. Now all power terminals (typically 7/14, 8/16) have to be explicitly connected to the supply rails. Also added a validation mode to the netlist core. This is not intended for running, but solely to better indentify pins which are not properly connected.
* netlist: scalable error messages. couriersud2019-04-181-2/+2
| | | This approach uses functors for logging messages.
* (nw) Clean up the mess on master Vas Crabb2019-03-261-23/+20
| | | | | | | | | | | | | 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-20/+23
| | | | | This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing changes made to 009cba4fb8102102168ef32870892438327f3705.
* netlist: more cpp core guidelines work. (nw) couriersud2019-02-081-6/+5
|
* netlist: Refactoring after adding clang-tidy support to netlist makefile couriersud2019-02-071-4/+4
| | | | | | | - 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: pstream and ppreprocessor (now a pistream) refactoring. (nw) couriersud2019-01-191-6/+5
|
* Fix clang-8 warnings. (nw) couriersud2019-01-111-1/+1
|
* Improve type safety on string->numeric conversions. (nw) couriersud2019-01-101-4/+4
| | | | | | | Also fixed an issue with 7497. ./nltool -t 5 -f src/mame/machine/nl_tp1983.cpp -v now runs again.
* More c++ alignment. pstring now behaves like std::string. (nw) couriersud2019-01-061-6/+5
| | | | | This change removes all string extensions like trim, rpad, left, right, ... from pstring and replaces them by function templates. This aligns a lot better with the intentions of the standard library.
* Netlist code refactoring: couriersud2017-04-091-0/+1
| | | | | | | | | | | | | | | | | | | - 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]
* More cppcheck fixes. (nw) Couriersud2017-03-051-1/+1
|
* Separate include file usage for netlist. couriersud2017-01-291-2/+1
| | | | | | | | Device implementations (all cpp files in netlist/devices) now should only include nl_base.h. Netlist implementation sources should only include "net_lib.h". Refactored netlist.h and netlist.cpp to avoid namespace congestion in netlist.h. Fixed VC2015 build. (nw)
* Do not derive other classes from std::vector. More cleanup. (nw) couriersud2017-01-271-2/+2
|
* Netlist: code refactoring couriersud2017-01-201-2/+0
| | | | | | | Make streams provide binary access only. Use putf8_reader and putf8_writer to actually access streams. Replace some char * parameters with pstring where appropriate. Minor code refactoring and move functionality were it belongs. (nw)
* Assume string literals are UTF8 in netlist code. couriersud2017-01-201-8/+3
| | | | | | | At the same time, any char pointer has to be explicitly converted to pstring by specifying an encoding. Not yet optimal, but certainly better than what was there before. Removed unneeded methods from pstring. (nw)
* Converted warnings and fatal log messages to constants. couriersud2017-01-201-21/+4
| | | Also refactored some code to ease the exercise. (nw)
* Keep track were registry elements are created. (nw) couriersud2017-01-161-5/+5
|
* Fix parsing of macro devices. (nw) couriersud2017-01-041-1/+1
|
* Refactored factory. Use namespace "factory" instead of prefix factory_ couriersud2017-01-021-1/+1
| | | all over the place. (nw)
* Simplify code. Introduce consistent approach to loading macro devices. couriersud2017-01-021-39/+20
| | | | Changed nltool "listdevices" command accordingly. Fix some bugs which surfaced by this exercise. (nw)
* Netlist updates: couriersud2016-07-211-6/+6
| | | | | | | | | | | | | | | - 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]
* Moved two macros, added more RAII and improved exceptions. Fixed some couriersud2016-07-091-2/+2
| | | | bugs in parser code. (nw)
* Netlist changes couriersud2016-06-231-9/+24
| | | | | | | | | | | | | | | | | | | | | - Replaced shared_ptr by unique_ptr. - Better seperation of setup_t and netlist_t. - Fixed bugs in rdtsc code. Refactored timer code. - Simplify conditional activation/deactivation. - Introduced HINT(device, hint) to clarify that hints are inheritent and not specific to devices. - Added improved profiling support to netlist. Statistics output now proposes devices for which whole device activation/deactivation be disabled. No significant improvement for pong, but breakout experiences a 10% improvement. - Moved options code from include to cpp file. - Minor modifications to 7493 and 9316 - Introduced perftime_t and perfcount_t for gathering statistics. These templates do not create any code if statistics are not kept. - Make help2man ./nltool produce usuable output. - More truthtable refactoring. Removed half-finished code for internal state support. As implemented, this would have had no support for timing delays. [Couriersud]
* - More code cleanup. couriersud2016-06-071-1/+1
| | | | | | | | | | | | | | - 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-1/+1
| | | | | | | | | | | 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 more code into plib namespace. (nw) couriersud2016-05-271-8/+8
|
* Converted more devices to new layout. Improved memory handling in couriersud2016-05-211-2/+2
| | | factories. (nw)
* mergeme couriersud2016-05-121-3/+1
|