summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/nl_parser.h
Commit message (Collapse)AuthorAgeFilesLines
* netlist: gtrak10 performance and other improvements and fixes (#10032) couriersud2022-07-051-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | - added support parameter FORCE_TRISTATE_LOGIC on mk28000 - add system device SYS_PULSE to generate pulse based on input changes parameters are delay, pulse width, input polarity and output polarity - add USE_SPEED_HACKS define to gtrak10 to enable the use of the above Brings gtrak10 from 18% to 120%. - Improved interlaced video support in fixfreq.cpp Added two interlace modes: progressive and interlaced which can be selected in machine configuration. - more clang format work - rename link to connection - introduced typed aliases. This information may be used later to rewrite netlists. - added a three terminal base device This will allow the analog code to be more easily comparable to literature about MNA (Modal node analysis). BJT code is now a lot better readable. - fix doxygen consistency - added an example for a cmos inverter based on NMOS/PMOS fets. - TRUTHTABLE_START was renamed to TRUTH_TABLE - truth tables are now enclosed in braces - netlists are now enclosed in braces - TRUTHTABLE_END() and NETLIST_END() removed from files - Fixed static solver script - Add file path to includes in nltool
* netlist: fix bug, prepare for future changes and improve readability (#9947) couriersud2022-06-201-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * netlist: fix bug, prepare for future changes and improve readability - fix a bug where a net processing error may trigger a nullptr access - applied some clang-tidy recommendations - add no_return to plib::terminate - properly encapsulate dynamic_cast usage - more review of noexcept - added a clang-format file. Over time, all source files will be processed with clang-format - Used clang format on a number of files - Rewrote 74174 - all device constructors now use a struct to pass data on to base classes. Neither netlist state nor the name are intended to be used in a constructor. After the base class was constructed, they can be accessed by state() and name(). - The device construction macros can now be removed. Changes to the core will not need to be reflected in constructors. - Change truth table macros so that going forward NETLIST_END and TRUTH_TABLE_END can be replaced by a closing curly brace. netlists can than use curly braces enclosed blocks. - more clang-format - removed some macros completely - all derived classes from base_device_t now don't use macros any longer. - as a result, delegator_t was removed. This class was only used to support macros :-(
* netlist: static solver work and improve code readability (#9841) couriersud2022-05-301-16/+16
| | | | | | | | | | | - 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: applied some clang tidy recommendations couriersud2020-09-301-1/+1
|
* netlist: optimize headers. couriersud2020-09-171-1/+22
| | | | * where possible rely on forward declarations to optimiuze compile time.
* netlist: Move selected NET_MODELS into the core couriersud2020-09-121-1/+1
|
* netlist: move to generated header and link support files files. couriersud2020-09-121-0/+2
| | | | | | | | | | | | | * Removed device and macro header files. * All of those can be generated automatically so going forward there is no need for these any longer. * Introduced the modules concept. Modules are netlists for which automatic lib entries are generated. * Going forward you just store them in macro/modules and they will be automatically registered as device elements. * You need to do a "make generated" is src/lib/netlist/build * Some_device.cpp still needs to be added to netlist.lua * Added documentation on how to add devices to netlist. * Please refer to adding_devices.md for more information.
* netlist: code maintenance and performance optimizations. Couriersud2020-09-051-2/+2
| | | | | | | | | | | * 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: Truth tables are now standalone objects. couriersud2020-08-261-0/+1
| | | | | * Added TRUTHTABLE_ENTRY to netlist language. * Please see nlm_ttl74xx for reference implementation.
* netlist: improve parsing performance couriersud2020-08-121-1/+7
| | | * preparational work for easier device addition.
* netlist: align naming of files within the macro folder. couriersud2020-08-101-0/+5
| | | | * Use a consistent naming scheme. This is a preparational step towards improved parsing performance.
* netlist: Refactored pokenizer. couriersud2020-08-061-9/+13
| | | | | | | | | * Separated tokenizing and reading of tokens. * This enables caching of parsing results on the token level. * Implemented caching of token stream. * Overall this significantly improves parsing performance (~10x) * Next step towards a bare-bone nltool which does not depend on macro devices.
* netlist: Add a missing directive to the file parser. couriersud2020-07-281-1/+3
|
* netlist: Extended functionality and code cleanup. [Couriersud] couriersud2020-05-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - working macro level parameters - simplified code significantly - fixed a number of hidden issue - dead code removal It is now possible to define netlist level parameters using: static NETLIST_START(chip) DEFPARAM(parameter, 123) RES(R1, $(@.parameter)) .... NETLIST_END() NETLIST_START(main) chip(X1) PARAM(X1.parameter, 1000) ... NETLIST_END() This will pass on 1000 to R1 as a parameter. "@." will resolve to the current namespace. In this case it is X1, thus "X1.parameter. This is during parsing. During evalution, i.e. device creation, $(X1.parameter) is evaluated to 1000. This also means, that global parameters are possible and accessible ... DEFPARAM(P, 234) ... RES(R1, $(P)) or going forward RES(R1, 1000) CAP(C1, 1.0 / $(R1.R)) This opens up the path to more possibilities ... static NETLIST_START(DM9456_DIP) DEFPARAM(MODEL, "74XX") DM9456_GATE(X1) DM9456_GATE(X2) PARAM(X1.MODEL, $(@.MODEL)) PARAM(X2.MODEL, $(@.MODEL)) ... NETLIST_END() NETLIST_START(main) DM9456_DIP(X1) PARAM(X1.MODEL, "LS74XX") ... NETLIST_END() The code also has been prepared to allow something along the lines of LIBENTRY_MODEL(DM74LS00_DIP, DM7400_DIP, "LS74XX") to define a LS version on top of an DM7400_DIP bare TTL implementation. This however will need more efforts to existing devices to honour some timing adjustment in the model definition. It will already honour different output specifications between LS series and bare TTL if connected to analog components.
* netlist: Parameters evaluated when netlist is created. [Couriersud] couriersud2020-01-291-3/+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: Code maintenance. (nw) couriersud2020-01-271-1/+1
| | | | | | | | | - 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: more code maintenance. (nw) couriersud2019-11-161-3/+2
| | | | | | - refactor error messages. - Fix some drivers to cope with outputted added my the mame driver for video and sound. - Fix validation.
* netlist: code maintenance. (nw) couriersud2019-11-101-1/+1
| | | | | | - more doxygen \file annotations - moved MAINCLOCK back to nl_base.h - remove some const from simple function parameters
* netlist: maintenance. (nw) couriersud2019-11-081-8/+5
| | | | | - switch to VS 2019 community and fix standalone build. - more migration to C++ comment style. - add some more doxygen markup.
* 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: 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-1/+1
| | | | | | | | | | 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.
* (nw) Clean up the mess on master Vas Crabb2019-03-261-7/+11
| | | | | | | | | | | | | 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-11/+7
| | | | | This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing changes made to 009cba4fb8102102168ef32870892438327f3705.
* netlist: refactoring startup process and array usage. (nw) couriersud2019-02-171-3/+3
|
* 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-2/+6
|
* netlist: More run/setup separation. (nw) couriersud2019-01-181-1/+1
| | | Still some distance ahead in properly separating execution and setup.
* netlist: refactored netlist creation. (nw) couriersud2019-01-151-1/+1
| | | | | | This is an effort to separate netlist creation from netlist execution. The primary target is to avoid that code which will only run during execution is able to call setup code and thus create ugly hacks.
* Improve dealing ownership in pstreams. (nw) couriersud2019-01-131-2/+2
| | | | I am not really happy with this. But I am missing some creativity currently.
* More cppcheck fixes. (nw) Couriersud2017-03-051-1/+1
|
* Remove macro to avoid copying and replace with a struct. (nw) couriersud2017-01-271-1/+0
|
* Netlist: code refactoring couriersud2017-01-201-4/+2
| | | | | | | 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)
* Converted warnings and fatal log messages to constants. couriersud2017-01-201-1/+1
| | | Also refactored some code to ease the exercise. (nw)
* Keep track were registry elements are created. (nw) couriersud2017-01-161-1/+1
|
* Netlist changes couriersud2016-06-231-0/+2
| | | | | | | | | | | | | | | | | | | | | - 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/+0
| | | | | | | | | | | | | | - 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]
* Moved more code into plib namespace. (nw) couriersud2016-05-271-3/+3
|
* Various cleanups suggested by static analyzer (nw) Miodrag Milanovic2016-04-241-1/+1
|
* netlist override update (nw) Miodrag Milanovic2015-12-061-1/+1
|
* Moved netlist from emu to lib (nw) Miodrag Milanovic2015-09-121-0/+78