summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/plib/pstring.cpp
Commit message (Collapse)AuthorAgeFilesLines
* netlist: code maintenance and performance optimizations. Couriersud2020-09-051-20/+50
| | | | | | | | | | | * 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-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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-0/+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: Code maintenance. (nw) couriersud2020-01-271-2/+2
| | | | | | | | | - 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/+2
|
* netlist: maintenance and bug fixes, remove DUMMY_INPUT. [Couriersud] couriersud2019-11-151-3/+3
| | | | | | | | | | - 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 and bug fixes. (nw) couriersud2019-11-081-4/+0
| | | | | | | - 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: code maintenance. (nw) couriersud2019-11-041-2/+2
| | | | | | | | - 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: code maintenance and bug fixes. (nw) couriersud2019-10-171-1/+1
| | | | | | | - solver now uses dynamic allocation on systems larger than 512x512 - fixed osx build - moved nl_lists.h classes to plists.h - fixed netlist makefile clint section - readability and typos
* netlist: less cpp - more headers (nw) couriersud2019-09-291-44/+0
| | | | - move more code in headers - delete some cpp files.
* (nw) Clean up the mess on master Vas Crabb2019-03-261-130/+1
| | | | | | | | | | | | | 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-1/+130
| | | | | This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing changes made to 009cba4fb8102102168ef32870892438327f3705.
* netlist: refactoring. (nw) couriersud2019-03-011-9/+0
|
* netlist: Refactoring after adding clang-tidy support to netlist makefile couriersud2019-02-071-1/+1
| | | | | | | - 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.
* More c++ alignment. pstring now behaves like std::string. (nw) couriersud2019-01-061-120/+0
| | | | | 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.
* fix assertion when debugging in visual studio (nw) smf-2018-01-291-20/+16
|
* pstring, pdynlib, pfmtlog refactoring : couriersud2017-04-041-26/+68
| | | | | | | | | | | | | | | | | | | | | 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-343/+53
| | | | | | | | 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-13/+13
| | | | | | | | | | | | | | | | | | | | 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.
* More cppcheck fixes. (nw) Couriersud2017-03-051-4/+4
|
* Reworked truthtables a bit. couriersud2017-02-171-4/+4
| | | | | - Moved 9312 and 74279 to ttl macro library. - Renamed TTL_9312_* to DM9312. This is more appropriate. - Fixed a number of warnings from latest ubuntu clang-5.0.
* Move from <cstring> to std::copy and friends. (nw) couriersud2017-02-161-27/+37
|
* Reorder include order to comply with best practices. (nw) couriersud2017-02-101-4/+4
|
* Fix a bug in pstring.cpp causing crash if moved object is reused. (nw) couriersud2017-02-051-7/+10
|
* Hopefully fix compile on some unknown compiler. (nw) couriersud2017-01-261-3/+4
|
* Netlist refactoring: couriersud2017-01-251-1/+1
| | | | | - Refactored netlist pmf code. - Small optimization for diode calculations. - Minor refactoring across the board. (nw)
* Added infix notation parsing to the function parser. (nw) couriersud2017-01-251-9/+7
|
* 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-38/+19
| | | | | | | 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-11/+11
|
* fix up pstring code (nw) Vas Crabb2016-11-161-5/+4
| | | | | | | | | | * instantiate static constant members for ODR context * declare static members of template classes properly * declare external template instantiations * fix blind use of autocomplete ("treats" really?) * fix ptype_traits on platforms where char is unsigned * signed char is never an alias for char even if char is signed * even if eclipse doesn't like using type, surely it supports typedef
* Netlist updates: couriersud2016-07-211-252/+209
| | | | | | | | | | | | | | | - 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-1/+2
| | | | bugs in parser code. (nw)
* Netlist improvements: couriersud2016-07-011-45/+14
| | | | | | | | | | | | | | | | | | | - 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]
* Netlist changes couriersud2016-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | - 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]
* 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-10/+9
| | | | | | | | | | | | | | - 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]
* Leading underscore massacre. (nw) couriersud2016-05-271-2/+2
|
* Moved more code into plib namespace. (nw) couriersud2016-05-271-9/+9
|
* Remove dependency on osd_ticks. Converted palloc and friends into couriersud2016-05-271-4/+4
| | | templates. First effort on a separate plib namespace. (nw)
* Various cleanups suggested by static analyzer (nw) Miodrag Milanovic2016-04-241-13/+13
|
* netlist updates: couriersud2016-03-141-5/+9
| | | | | | | | | | - First steps to move towards c++11. - Base plist on std::vector - Replace pstack with std::stack - Remove pnamed_list - use c++ "for each" in a number of places - Fixed two "time bombs" [couriersud]
* Rename *.c -> *.cpp in our source (nw) Miodrag Milanovic2015-11-081-0/+600