Commit Graph

87 Commits

Author SHA1 Message Date
Justin Kerk
d2b7643753 netlist: Better fixes for Emscripten (#7031)
Silence indentation warning in 3rdparty/ under Emscripten (#7031)
2020-08-04 23:53:52 -07:00
Justin Kerk
2dd0985999 netlist: Fix build under Emscripten (#7031)
netlist: Fix crash under Emscripten by disabling aligned optimizations
2020-08-05 05:58:14 +00:00
couriersud
ffb37e9ae8 netlist: further nl_base.h splitting into headers in core subdir. 2020-07-28 20:40:59 +02:00
couriersud
c29a37c393 netlist: fix some clang tidy warnings. 2020-07-25 14:47:20 +02:00
couriersud
319be2dfd2 netlist: code maintenance and bug fixes.
* palloc.h/pmatrix2d.h: Fix static_assert warnings at the origin.
* Rework hints to broaden their use and fix NC hint.
* 74377: use NC hint
* plists.h: Fix debugging in MSVC
* Include cleanup: Move everything not needed by netlists from
nl_setup.h into core/setup.h
* Fix some clang tidy warnings
* srcclean
2020-07-01 20:59:04 +02:00
Aaron Giles
afb3a9b6cb Fix crash on Windows when freeing netlist objects. 2020-06-29 17:03:57 -07: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
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
d041e74e2c netlist: allow selection of base arena for pmempool_arena. (nw) 2020-06-08 03:10:58 +02:00
couriersud
1c635c1bfd netlist: Fix MSVC build. [Couriersud]
MSVC has an issue with SFINAE and overloading resolution.
A discussion can be found here:

https://stackoverflow.com/questions/31062892/overloading-on-static-in-conjunction-with-sfinae

The previous code compiled with gcc and clang on all platforms and
compilers apart from MSVC. Replaced with double template specialization.
2020-06-08 03:10:27 +02:00
couriersud
bed452a874 netlist: arena code maintenance. (nw) 2020-06-08 03:10:13 +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
9cd005b574 netlist: drop c++11 support. (nw)
This wasn't working since the last factory changes. Removed it.
Basically replace C14CONSTEXPR with constexpr.
2020-06-01 19:59:53 +02:00
couriersud
54293ab546 netlist: small memory system cleanup. (nw) 2020-05-25 23:57:49 +02:00
couriersud
e97a8709a8 netlist: code maintenance. (nw) 2020-05-25 23:57:48 +02:00
couriersud
e9a364dcc9 netlist: Add tristate support for rom devices. [Couriersud]
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.
2020-05-20 07:59:46 +02:00
couriersud
88edd7c665 netlist: code cleanup and development stage tristate [Couriersud]
Code cleanup to better separate the following stages:

- parsing
- setup
- run

In addition preliminary native tristate support was added. Not yet
production ready, please don't use it.
2020-05-15 13:09:22 +02:00
couriersud
534b58eee6 netlist: Fix some tidy warnings. (nw)
moving over to clang-tidy-11 and enabling more warnings.
2020-05-03 08:58:12 +02:00
couriersud
14e4c4bb3f netlist: improve const-awareness and tidy changes. (nw)
Identified a number of code locations which could accept const
arguments.
2020-04-28 21:08:05 +02:00
couriersud
14850cbb02 netlist: More clang-tidy fixes. (nw) 2020-04-28 21:08:02 +02:00
couriersud
2453c5b077 netlist: minor code maintenance. (nw) 2020-04-11 14:43:26 +02:00
couriersud
5075448278 netlist: Fix some clang-tidy-10 warnings. (nw) 2020-04-05 16:28:01 +02:00
couriersud
9214347334 netlist: fix log file option in nltool. (nw) 2020-02-17 22:43:49 +01:00
couriersud
e204d878f8 netlist: Fix VC compile. (nw) 2020-02-04 23:24:46 +01:00
couriersud
f7d8a10da5 netlist: Code maintenance. (nw)
- 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.
2020-01-27 21:47:41 +01:00
couriersud
0f69abe4dc netlist: clang tidy fixes. (nw) 2020-01-19 20:56:53 +01:00
couriersud
f6a7a6fe88 netlist: Code maintenance. (nw)
Checked and fixed conditional compile paths.
Simplified memory allocation.
Generalized signal handling.
2020-01-18 16:39:49 +01:00
couriersud
d070d8ebe6 netlist: move some functions to pmath. (nw) 2020-01-15 21:13:38 +01:00
couriersud
43637964a2 netlist: bug fix, code maintenance and performance improvement. (nw)
- fixed a code in the netlist creation which caused multiple proxies
  to be created for output->terminal connections. A nice side effect of
  this fix is a performance increase ~9% for kidniki and ~4% for pong.
  Speaking about pong ... maximum is 490%. Dice is running at
  280 FPS/60 FPS = 466%, however without any analog emulation.
- Replaced NL_NOEXCEPT with noexcept. assert is now exception-free.
- cppcheck and lint fixes.
2019-11-13 19:29:51 +01:00
couriersud
f4cf0cc86a netlist: code maintenance. (nw)
- 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.
2019-11-13 07:41:20 +01:00
couriersud
63561e2c2c netlist: maintenance. (nw)
- Fix automatic header generation
- clang lint fixes.
- srcclean
- remove dead code
2019-11-11 15:04:21 +01: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
e896b3914e netlist: code maintenance. (nw)
- leave a note that cstdlib is needed for getenv.
- Remove commented out includes
- make sure all headers are self - contained, i.e. compile
2019-11-04 00:32:47 +01:00
couriersud
470c416cc3 netlist: Hopefully fix MSVC compile. (nw) 2019-10-30 11:35:03 +01:00
couriersud
cac86fb1b4 netlist: code maintenance. (nw)
- 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
2019-10-29 19:55:53 +01:00
couriersud
b09fa00cca Netlist: code maintenance and improvements. [Couriersud]
- 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
2019-10-18 17:57:55 +02:00
couriersud
db318046c4 Netlist: code maintenance and bug fixes. (nw)
- 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
2019-10-17 10:21:00 +02:00
couriersud
55f1dfafc2 Netlist: pongf update and code maintenance. [Couriersud]
After the recent string of updates pongf performance increased again.
Also includes code maintenance and some fixes for the aligned memory
operations.
2019-10-16 13:57:54 +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
18c0e8de0e plib: don't assume constructors will only throw things derived from std::exception (nw)
funworld.cpp cleanup: (nw)
 * remove revision history - we use version control for a reason
 * don't #define things before inluding the PCH, and don't #define generic names before #including anything
2019-04-24 12:05:56 +10:00
couriersud
5d48ffbb3d netlist: fix exception handling and uninitialized var. (nw) 2019-04-22 22:25:49 +02:00
couriersud
7cc3012c22 netlist/plib: Fix memory leak when exception is thrown in constructor. 2019-04-22 21:08:50 +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
39a7c420b1 netlist: add MOSFET model. [Couriersud]
- added MOSFET model. Currently capacitances are not modelled.
  This is a 3-pin model (Bulk connected to Source) with provisions to
  extend it to 4-pin at a later stage.
- Add a capacitor generic model which is charge conserving.
  Switch netlist to use this model instead of constant capacity model.
- Start putting constants into a central place.

Please expect minor timing differences due to a different numerical
path.
The cmos inverter example illustrates the analog implementation of a
cmos inverter gate. These were used a lot back in the 70s/80s to
generate sinus waves. The model should also be able to better emulate
4066 analog switches.
The addition of a relatively simple capacitor model is planned at a
later stage.
Expect everything from the MOSFET model at the current stage. Wrong
results as well as convergence issues and crashes.
2019-03-25 21:45:37 +01:00
Vas Crabb
30caaa7bef srcclean (nw) 2019-03-24 09:48:58 +11:00
couriersud
46762510c9 netlist: Added B-E and B-C capacitance to EB model. [Couriersud]
Despite the overhead - two devices more per transistor - this addition
significantly reduces computing time on switching conditions by reducing
the needed Newton-Raphson loops dramatically.
2019-03-17 23:42:08 +01:00
couriersud
83a0e93837 netlist: remove printf. (nw) 2019-03-02 13:11:37 +01:00
couriersud
17fcc38a25 netlist: memory code refactoring. (nw) 2019-03-01 10:30:24 +01:00
couriersud
6a3efe52d6 netlist: fix bugs in the alignment code. (nw) 2019-02-25 21:17:59 +01:00