Commit Graph

82 Commits

Author SHA1 Message Date
couriersud
324f9d44d5
netlist: More c++, less macros, added support for cspell (#9794)
- More c++, less macros
  * Significantly reduced the use of unused_var and replaced it with
    [[maybe_unused]]
  * use enum class in ppmf.h

- Changes to testing code in ptest.h
  * Catch exceptions in more places
  * The verbosity of the output can now be controlled
  * Display of test stats totals

- added support for cspell
- fixed various typos
- fixed SUBTARGET=nl build
- fixed more file permissions
- srcclean and add fix_permissions target to netlist makefile
2022-05-22 01:16:50 +10:00
couriersud
74728bc4d4
netlist: Improved PPMF target support and test coverage. (#9752)
This addresses most of the issues described in #8590.

* Fixed standalone Visual Studio 2019 builds, including support for clang toolchain.
* Added static stub to PMF to support MSVC ABI.
* Better aligned ppmf syntax with MAME's delegate syntax.
* Add tests/test_ppmf*.cpp testing examples given in #8590.

Also worked around issues some versions of Apple clang have with 5aaae19230.
2022-05-15 20:03:54 +10:00
couriersud
4c187626e3
netlist: Fixed standalone nltool building with nvcc. (#9731)
nvcc 11.3 (latest cuda tools) has an issue with some auto x(some
variable) declarations.
2022-05-11 12:09:08 +10:00
Julian Sikorski
6c84aa7160
Drop unnecessary executable permissions (#9257) 2022-02-03 07:24:37 -05:00
Olivier Galibert
40acc597d4 netlist: Relicensing of the GPL code to BSD-3 with the blessing of the
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.
2021-03-09 09:26:00 +01:00
Stiletto
3153838929
Update "2020" text to "2021" (#7713)
Update "2020" text to "2021".
2021-01-28 00:11:17 -05:00
couriersud
ca31c844cd netlist: move to generated header and link support files files.
* 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.
2020-09-12 23:20:16 +02:00
Couriersud
f3eb632465 netlist: code maintenance and performance optimizations.
* 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
2020-09-05 21:31:49 +02:00
couriersud
0aa5aea84f netlist: Fix various issues around include directories.
* removed include directory src/lib/netlist from various genie files to
avoid potential issues.
* Code using netlist should use #include "netlist/*".
* Updated includes.
* Fixed standalone makefile depend target to properly deal with relative
paths.
2020-08-25 19:41:32 +02:00
couriersud
ab31af569f netlist: include file refactoring.
The purpose of this ongoing exercise is to remove unnecessary
dependencies in header files. netlist implementations should only have
access to what they need. The same applies to device implementations.

Core stuff will be moved to the core subdirectory going forward.
2020-06-28 13:14:43 +02:00
couriersud
3fcdfa0a9b netlist: code maintenance
* decrease use of reinterpret_cast.
* change some defaults for better ttl game optimization.
* various code cleanup.
2020-06-28 13:14:42 +02:00
couriersud
e949e9c29d netlist: Performance improvement and refactoring. [Couriersud]
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.
2020-06-13 15:49:35 +02:00
couriersud
f9fa6b1c81 netlist: code maintenance. (nw)
- 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
2020-06-08 02:52:39 +02:00
couriersud
3f9bb5d1ea netlist: Enable utf7 filenames on windows. (nw) 2020-06-06 20:43:10 +02:00
couriersud
37258b7439 netlist: clang-tidy, header order fixes. (nw) 2020-06-01 19:59:54 +02:00
couriersud
10e4f10d41 netlist: split plists.h and fix nvcc compile for 10.2 (nw)
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.
2020-05-25 23:57:49 +02:00
couriersud
e235420392 netlist: bug fixes and maintenace. (nw)
- nlwav: remove m_channels completely
- nltool: add more comments to static_solvers.cpp
- clang make: add -Wunused-private-field

Also updated static_solvers.cpp.
2020-05-08 08:56:50 +02:00
AJR
ff07f986fa Fix clang nltool build [-Werror,-Wunused-private-field] (nw) 2020-05-07 11:14:07 -04:00
couriersud
12a3abdb28 netlist: nlwav - new functionality. [Couriersud]
nlwav now supports 16 and 32 bit integer format (wav16s, wav32s)
as well as 32 bit float format (wav32f).
The "wav" format is no longer supported.
Added support for high and low pass filtering the wav output.
Dynamic volume adjustment (use "-a 0")
--hpboost can suppress spikes at the beginning of the file (<10ms)

The addition of the float format simplifies debugging significantly
since it covers the whole dynamic format.

Added nlwav to the local VS 2019 build.
2020-05-05 23:54:30 +02:00
couriersud
ece9501cc4 netlist: Fix two nlwav bugs. (nw)
First one corrupted wav files produced on windows. The second one
produced wrong sample integration results.
2020-05-05 23:09:51 +02:00
couriersud
40f8f99f9a netlist: Removed more magic numbers from the code. (nw) 2020-05-01 15:21:01 +02:00
couriersud
0cf99a5310 netlist: rename some macros. (nw)
Rename COPYASSIGN* and friends to PCOPYASSIGN*.
2020-04-26 01:35:31 +02:00
couriersud
6d35a38bf2 netlist: clang-tidy, srcclean and pedantic warnings fixed. (nw) 2020-04-18 22:23:32 +02:00
couriersud
5075448278 netlist: Fix some clang-tidy-10 warnings. (nw) 2020-04-05 16:28:01 +02:00
couriersud
fde057ba00 nlwav: add sampled output format. [Couriersud]
Using this output format nlwav will pick point samples at regular
intervals from log files. This can be used to e.g. calculate
RGB output levels with netlist.
2020-03-02 18:15:22 +01:00
couriersud
636315be5f netlist: code maintenance. (nw)
Remove dead code, fix lint warnings, make spice netlist conversion more
flexible, implement changes to controlled sources.
2020-02-03 20:21:40 +01:00
couriersud
84e3eb1deb netlist: Code symplification and bugfixes. (nw)
- Fixes performance regression and net_splitter struct.
- Fixes nltool time measurements
- pstream simplification
2020-01-31 20:23:40 +01:00
couriersud
6874b1f7ac netlist: clang lint readability fixes. (nw) 2020-01-25 21:13:21 +01:00
couriersud
9431ee68e7 netlist: clang lint fixes, srcclean and nlwav fix. (nw) 2020-01-25 21:12:01 +01:00
couriersud
9e272e4b55 netlist: code maintenance. (nw)
- remove pthrow trampline as proposed by Vas.
- identify throwing code by adding noexcept(false)
- move "connected term" information to setup code.
- srcclean
2020-01-20 21:15:22 +01:00
Stiletto
88909dc0d0
Happy New Year 2020 (nw) (#6128)
Happy New Year 2020 (nw) (#6128)
2020-01-04 01:13:50 -05:00
couriersud
88f702b416 netlist: code maintenance and bug fixes. (nw)
- 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.
2019-11-08 23:52:14 +01:00
couriersud
22e07506cc netlist: more consistent exception handling. (nw)
Still not optimal, but better than what we had previously. No exception
logging comes closer.
2019-11-05 00:08:52 +01:00
couriersud
2cf61b2e4c netlist: code maintenance. (nw)
- 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
2019-11-04 22:04:11 +01:00
Vas Crabb
32868b8e2a srcclean (nw) 2019-10-26 10:40:50 +11:00
couriersud
545f8069ef netlist: maintenance and lint fixes. (nw) 2019-10-06 23:50:13 +02:00
Vas Crabb
d8998f5d9b (nw) fix std::array initialisation with GCC5 in nlwav.cpp, stop suppressing -Wterminate now that asserts are really asserts 2019-10-05 00:37:55 +10:00
couriersud
1077396473 netlist: Fix more lint warnings/hints (nw) 2019-09-28 12:51:42 +02:00
couriersud
ce612896a8 netlist: Fix a number of minor issues. (nw)
- lint warnings
- remove const on return types
2019-09-27 22:30:33 +02:00
couriersud
441fb63087 netlist: switch to c++ streams. (nw)
Removed the home-brew implementation pstreams and replaced those with
c++ streams.
2019-09-25 01:10:39 +02:00
couriersud
8734df72ea netlist code maintenance (nw)
- prepare move to c++ streams and later std::string
- fix more lint and clang pedantic warnings/errors
- fix some bugs
2019-09-21 22:15:34 +02:00
couriersud
500ca5b8fc netlist code maintenance. (nw)
- remove a lot of c library use and instead use c++
- improved pstring compatibility to std::string
- prepare removal of pstream
2019-09-17 21:05:01 +02:00
Vas Crabb
97b6717027 (nw) Clean up the mess on master
This effectively reverts b380514764 and
c24473ddff, restoring the state at
598cd52272.

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.
2019-03-26 11:13:37 +11:00
andreasnaive
b380514764 Revert "conflict resolution (nw)"
This reverts commit c24473ddff, reversing
changes made to 009cba4fb8.
2019-03-25 23:13:40 +01:00
couriersud
2b49e6ed11 netlist: clang tidy. (nw) 2019-03-01 07:48:01 +01:00
couriersud
893e676387 netlist: cosmetic changes - mostly indentation. (nw) 2019-03-01 07:48:00 +01:00
couriersud
a65390cad5 netlist: Fix relative include paths and a conflict. (nw)
nl_types.h is part of libc++. Any project with a file with the same name
on the include path just fails to compile. Renamed to nltypes.h
2019-02-23 18:54:29 +01:00
couriersud
672f9b092a Move ptime struct into plib namespace and fix relative includes. (nw) 2019-02-23 18:54:27 +01:00
couriersud
66154af0f2 netlist: fix visibility issues and more issues reported by tidy. (nw) 2019-02-22 21:46:55 +01:00
couriersud
cf73ccc764 netlist: memory management. [Couriersud]
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.
2019-02-22 08:18:01 +01:00