summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/nl_factory.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert "netlist: Remove redundant usages of fatal logger (#15218)" Vas Crabb2026-04-141-0/+2
| | | | | | | | | | This reverts commit 7689ad57e746a33dfeae9299821992e15dd63ea9. The nl_exception doesn't inherently log anything, and whatever catches it may send its log output to a different place to the netlist devices' loggers if it end up logging the message. All the error conditions are supposed to be sent to the netlist devices' own loggers to ensure you have visibility.
* netlist: Remove redundant usages of fatal logger (#15218) FlykeSpice2026-04-131-2/+0
| | | | | * netlist: Remove redundant usages of fatal logger * nl_factory.h: Fix Wunused compiling error
* netlist: fix bug, prepare for future changes and improve readability (#9947) couriersud2022-06-201-18/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-5/+7
| | | | | | | | | | | - 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: standalone makefile and prototype modifications (#9708) couriersud2022-05-081-4/+2
| | | | | | - update netlist makefile to more recent compilers - prototypes for NETLISTs in macros are now created create_devinc.py - apply ctidy recommendations - Python None in create_device.py
* 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: Pedantic and clang tidy updates couriersud2020-09-061-1/+1
| | | * also fix an issue with netlist vs build
* netlist: Truth tables are now standalone objects. couriersud2020-08-261-6/+15
| | | | | * Added TRUTHTABLE_ENTRY to netlist language. * Please see nlm_ttl74xx for reference implementation.
* netlist: Potential regression trigger. couriersud2020-07-171-1/+0
| | | | | | | | | * Removed update and NETLIB_UPDATE completely. * Startup initialization order may change. * This may cause regression tests to trigger. This is expected. Logic TTL devices do not have a defined power-up state. That's why reset circuits exist which create a reset signal *after* all power supply lines are stable.
* netlist: comment out empty reset and update calls couriersud2020-07-161-2/+2
|
* netlist: Performance improvement and refactoring. [Couriersud] couriersud2020-06-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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: code maintenance. (nw) couriersud2020-05-251-1/+6
|
* netlist: move netlist parsing where it belongs. (nw) couriersud2020-05-251-7/+0
|
* netlist: Add tristate support for rom devices. [Couriersud] couriersud2020-05-201-2/+2
| | | | | | | | | 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.
* netlist: simplify factory call structure. (nw) couriersud2020-05-201-10/+3
| | | | | This change will make it a lot easier to add enhanced functionality to the factory infrastructure. Using integral constants also improves linking stability.
* netlist: improve typesafety for source locations. (nw) couriersud2020-05-171-3/+4
| | | | | | During object creation netlist tracks the source files which provide object creation. This is later used e.g. by nltool to create documentation from source.
* netlist: Extended functionality and code cleanup. [Couriersud] couriersud2020-05-121-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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: remove family_setter and other maintenance. (nw) couriersud2020-05-091-1/+1
| | | | | | | | | | | | | | | - 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: Reduce memory allocation calls in non-core code. (nw) couriersud2020-04-101-1/+1
|
* netlist: code maintenance. (nw) couriersud2020-01-201-2/+2
| | | | | | - remove pthrow trampline as proposed by Vas. - identify throwing code by adding noexcept(false) - move "connected term" information to setup code. - srcclean
* netlist: maintenance and bug fixes, remove DUMMY_INPUT. [Couriersud] couriersud2019-11-151-2/+2
| | | | | | | | | | - 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: code maintenance. (nw) couriersud2019-11-131-2/+2
| | | | | | - move memory pool to netlist_state_t removing one static allocation. - add memory allocation stats to verbose output - nl_assert no longer throws, first step to remove NL_EXCEPT macro.
* netlist: maintenance. (nw) couriersud2019-11-081-6/+3
| | | | | - switch to VS 2019 community and fix standalone build. - more migration to C++ comment style. - add some more doxygen markup.
* netlist: code maintenance. (nw) couriersud2019-11-041-1/+4
| | | | | | | | - 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: Use unique_ptr where possible. (nw) couriersud2019-10-151-2/+2
| | | Also improve code readability.
* 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-79/+61
| | | | | | | | | | | | | 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-61/+79
| | | | | This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing changes made to 009cba4fb8102102168ef32870892438327f3705.
* netlist: memory code refactoring. (nw) couriersud2019-03-011-1/+1
|
* netlist: memory management. [Couriersud] couriersud2019-02-221-1/+1
| | | | | | | | | | | | | | Memory management in plib is now alignment-aware. All allocations respect c++11 alignas. Selected classes like parray and aligned_vector also provide hints (__builtin_assume_aligned) to g++ and clang. The alignment optimizations have little impact on the current use cases. They only become effective on bigger data processing. What has a measurable impact is memory pooling. This speeds up netlist games like breakout and pong by about 5%. Tested with linux, macosx and windows cross builds. All features are disabled since I can not rule out they may temporarily break more exotic builds.
* netlist: Separation of duties. (nw) couriersud2019-02-161-8/+8
| | | | Make it clearer what is used during parsing a netlist, "compiling" a netlist and execution of a netlist.
* netlist: memory pool now supports aligned storage. (nw) couriersud2019-02-161-2/+2
| | | | | | Set USE_MEMPOOL to 1 to try this (max 5% performance increase). For mingw, there is no alignment support. This triggers -Wattribute errors which due to -Werror crash the build.
* netlist: More cpp core guidelines alignment. (nw) couriersud2019-02-111-5/+0
|
* netlist: more core guidelines work. (nw) couriersud2019-02-091-3/+3
|
* netlist: Refactoring after adding clang-tidy support to netlist makefile couriersud2019-02-071-7/+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: All devices now specify parameters in factory constructor. (nw) couriersud2019-02-011-75/+65
| | | | This previously was part of net_lib.cpp and repeatedly caused bugs.
* netlist: code maintenance and fixing kidniki ... (nw) couriersud2019-02-011-4/+0
| | | to run at acceptable speed again.
* netlist: refactored netlist creation. (nw) couriersud2019-01-151-3/+3
| | | | | | 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.
* Move information where it belongs ... into the drivers. (nw) couriersud2019-01-101-0/+4
|
* cheekyms: add preliminary netlist sound based on schematics provided by Sam ↵ Vas Crabb2017-05-261-0/+0
| | | | | | | | | | | | | | | | Grech (nw) It doesn't work quite right yet. The "Hammer" and "Pest" sounds are generated by free-running 555/556 timers and gated with LM324 applifiers. For whatever reason, the netlist system produces a kind of buzzing from the "Hammer" circuit when it's supposed to be suppressed, and it doesn't think the pest sound should be suppressed completely so you can always hear it at a low level in the background. The "Cheese" circuit is a bit weird - either they're using the base-emitter junction of a 2SC945 as a signal diode, or there's an error in the schematic (collector is shown unconnected). Connecting this part of the circuit causes the netlist system to hang, so R2/R3/C8/Q2 are not connected for now.
* Fix VS2015 compile. (nw) couriersud2017-02-221-2/+1
|
* Separate include file usage for netlist. couriersud2017-01-291-0/+15
| | | | | | | | 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)
* Keep track were registry elements are created. (nw) couriersud2017-01-161-1/+9
|
* Prepare source for consistent error message usage. (nw) couriersud2017-01-141-3/+7
|
* Fix clang "-Wno-weak-vtables" warnings in netlist source. Refactored couriersud2017-01-051-1/+21
| | | code along the way. (nw)
* Refactored factory. Use namespace "factory" instead of prefix factory_ couriersud2017-01-021-5/+22
| | | all over the place. (nw)
* Simplify code. Introduce consistent approach to loading macro devices. couriersud2017-01-021-17/+0
| | | | Changed nltool "listdevices" command accordingly. Fix some bugs which surfaced by this exercise. (nw)
* Netlist updates: couriersud2016-07-211-1/+3
| | | | | | | | | | | | | | | - 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]
* Srcclean on netlist files. Avoid the merge massacre. (nw) couriersud2016-06-251-1/+0
|