summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/plib/putil.cpp
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: code maintenance and performance optimizations. Couriersud2020-09-051-99/+6
| | | | | | | | | | | * 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: Performance improvement and refactoring. [Couriersud] couriersud2020-06-131-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | 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: Reduce macro usage and make use of pstring utf8. (nw) couriersud2020-06-061-7/+2
|
* netlist: Enable utf7 filenames on windows. (nw) couriersud2020-06-061-0/+7
|
* netlist: clang-tidy, header order fixes. (nw) couriersud2020-06-011-1/+1
|
* netlist: split plists.h and fix nvcc compile for 10.2 (nw) couriersud2020-05-251-1/+0
| | | | | | | | | plists.h was splitted into plists.h, pmulti_threading.h and ptimed_queue.h. In addition removed plists.h from a number of files it wasn't used in. Certain minor adjustment needed to be made for cuda toolkit 10.1 and 10.2.
* netlist: move penum into own header file. (nw) couriersud2020-05-241-1/+2
|
* netlist: basename function now accepts a suffix to remove. (nw) couriersud2020-04-181-3/+8
|
* netlist: clang lint readability fixes. (nw) couriersud2020-01-251-13/+8
|
* netlist: code maintenance. (nw) couriersud2019-11-041-1/+1
| | | | | - leave a note that cstdlib is needed for getenv. - Remove commented out includes - make sure all headers are self - contained, i.e. compile
* Fix clang error: no member named 'getenv' in namespace 'std' (nw) AJR2019-11-031-0/+1
| | | | Library differences are the culprit once again.
* 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: code maintenance and improvements. [Couriersud] couriersud2019-10-181-5/+27
| | | | | | | | - Added support for line markers to the preprocessor and parser. - Added support for include processing to the preprocessor. - Moved sources base type to plib to be used for preprocessor includes. This enables to include e.g. from rom memory regions. - Renamed some defines
* netlist: code maintenance (nw) couriersud2019-10-121-2/+1
| | | | - clang lint and pedantic fixes - mat_cr.h: separate solving linear systems from underlying matrix
* netlist: maintenance and lint fixes. (nw) couriersud2019-10-061-2/+2
|
* netlist: more code cleanup. (nw) couriersud2019-10-051-1/+1
| | | | | - avoid duplication in solver parameter code - matrix sort type is now a parameter
* netlist: Fix a number of minor issues. (nw) couriersud2019-09-271-2/+2
| | | | | - lint warnings - remove const on return types
* netlist code maintenance (nw) couriersud2019-09-211-2/+2
| | | | | - prepare move to c++ streams and later std::string - fix more lint and clang pedantic warnings/errors - fix some bugs
* netlist code maintenance. (nw) couriersud2019-09-171-22/+7
| | | | | | - remove a lot of c library use and instead use c++ - improved pstring compatibility to std::string - prepare removal of pstream
* (nw) Clean up the mess on master Vas Crabb2019-03-261-34/+41
| | | | | | | | | | | | | 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-41/+34
| | | | | This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing changes made to 009cba4fb8102102168ef32870892438327f3705.
* netlist: more core guidelines work. (nw) couriersud2019-02-091-24/+1
|
* netlist: Refactoring after adding clang-tidy support to netlist makefile couriersud2019-02-071-8/+8
| | | | | | | - 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: code maintenance and fixing kidniki ... (nw) couriersud2019-02-011-2/+2
| | | to run at acceptable speed again.
* Improve type safety on string->numeric conversions. (nw) couriersud2019-01-101-0/+30
| | | | | | | 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-4/+4
| | | | | 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.
* pstring, pdynlib, pfmtlog refactoring : couriersud2017-04-041-6/+6
| | | | | | | | | | | | | | | | | | | | | pstring: - added support for UTF16LE to pstring. - renamed size() to mem_t_size() - renmaed len() to length() - added size() == length() - added empty() - added simple compare() pfmtlog: - Simplified pfmtlog, added more c++ pdynlib: - add a dynproc type to dynlib to wrap dynamic library calls. various: - fix two coverty scan issue. - various clang warnings fixed. (nw)
* Change pstring to use std::string as storage container. couriersud2017-03-301-13/+13
| | | | | | | | This removes all allocation code from pstring. const_iterator is consequently now based on pstring::const_iterator. Removed pstring_buffer. This was class wasn't a good idea. Vas was right: This change did not impact runtime performance. Startup performance (string intensive) increased. (nw)
* Turn psring iterator into a real forward iterator that works with standard ↵ Vas Crabb2017-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | algorithms. There are a few changes to achieve this: * Rename to const_iterator since it's immutable * Typedef iterator to const_iterator for now as there's no mutable iterator * Add default constrcutor and operator-> required by concept, const-qualify operators * Remove operator+ and operator+= since it's not a random-access iterator (use std::next and std::advance instead) * Return reference/pointer to a proxy rather than a code_t value from opertator*/operator-> The final change is required to meet the requirement that operator* for two equivalent forward iterators return an equivalent reference. The pstring doesn't actually contain a sequence of code_t, so there's no way to return a reference to code_t directly. Instead, a reference to a proxy object aliased on the string storage is returned. The proxy is implicitly convertible to code_t. The most noticeable side effect is that auto c = *s.begin() or for (auto c : s) won't work. You need to do for (auto &c : s) or for (code_t c : s) instead.
* Move from <cstring> to std::copy and friends. (nw) couriersud2017-02-161-2/+2
|
* Reorder include order to comply with best practices. (nw) couriersud2017-02-101-4/+4
|
* Make sure netlist includes are not found directly on include path. couriersud2017-02-101-3/+3
| | | | Instead, they have to be prefixed by "netlist/". Removed unneeded link librariers for nltool and nlwav along the way. (nw)
* Minor refactoring. (nw) couriersud2017-01-271-2/+2
|
* Do not derive other classes from std::vector. More cleanup. (nw) couriersud2017-01-271-9/+13
|
* Added infix notation parsing to the function parser. (nw) couriersud2017-01-251-1/+1
|
* Assume string literals are UTF8 in netlist code. couriersud2017-01-201-3/+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)
* cstr() ==> c_str() (nw) couriersud2016-12-301-4/+4
|
* Fix noexcept and NL_NOEXCEPT to pass g++ 6.x builds. (nw) couriersud2016-08-071-1/+1
|
* Netlist updates: couriersud2016-07-211-14/+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]
* Srcclean on netlist files. Avoid the merge massacre. (nw) couriersud2016-06-251-3/+0
|
* Merge netlist_dev branch, all code_refactoring: (nw) couriersud2016-06-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+161
- 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]