Commit Graph

142 Commits

Author SHA1 Message Date
couriersud
0c258c9d70
netlist: Fixes to address PR #9752 and issue #8590 / EMSCRIPTEN (#9773)
netlist: pointer to member function code 

- Address PR #9752 and issue #8590
- change comments in ppmf.h
- add support for function desciptors (IA64)
- sizeof(size_t) may be different on build targets
  make plib::hash use uint64 to ensure consistent static solver
  hashes across platforms (EMSCRIPTEN)
- Moved constructor and member functions outside the class declaration
  with the exception of "call" member functions.
- Updated comment on accessing RDX
- Added more test cases

* Removed execution bit on certain files
I have separated out the raw processing code into `ppmf.cpp`. I have
also taken first steps to clean the abi identification.

The code submitted now supports:

a) The unknown virtual inheritance case with specific code for MSVC for
simple (i.e. scalar, void, reference, pointer) return types using the
optimized code. This is the test case only supported under MSVC and
which should return 7. Please have a look at the code. Basically
m_vptr_offset is an index into a pointer table. It needs to be
multiplied by `sizeof(void *)`.

b) If you enable PPMF_EXPERIMENTAL complex return type member functions
for MSVC will also use the optimized code path. This is explained in
detail in the code in ppmf, including caveats and possible solutions.

c) Enabling PPMF_USE_MAME_DELEGATES will use `src/lib/util/delegate.h`
as a replacement for `ppmf.h`. This allows to run the same tests
(`nltool -c tests` from standalone build) as for the ppmf code.

d) The code now also supports `clang-cl`

e) sizeof(size_t) may be different on build targets.

Make plib::hash use uint64 to ensure consistent static solver hashes
across platforms. This fixes loading static solvers (if enabled) on
EMSCRIPTEN.
2022-05-19 19:40:00 +02:00
Roberto Benfatto
02d6b1e457
scripts: Remove references to non-existent headers and duplicate source file references. (#7770) 2021-02-14 22:15:17 +11:00
couriersud
3a95d1e4fd netlist: Convert driver filenames to lower case. 2020-09-30 08:38:06 +02:00
Vas Crabb
6e807013c5 Disable SOUND_DEBUG for non-debug builds, and srcclean 2020-09-27 11:00:56 +10:00
couriersud
63efcfcb85 netlist: code refactoring.
- rename mat_cr.h to pmatrix_cr.h
- Optimization to the gmres solver.
- Simplifcation of vector operation code
2020-09-20 17:34:54 +02:00
Lord-Nightmare
bff0710c57 Netlist devices for MCM14524, CD4029, CD4030, CD4042, CD4049, CD4076 [Lord Nightmare] 2020-09-17 22:56:49 -04:00
couriersud
c127811083 netlist: Move ICL8038_DIP and NE556_DIP to core.
* Remove code duplication.
2020-09-17 19:44:51 +02:00
couriersud
48fada3c34 netlist: remove obsolete headers from netlist.lua 2020-09-13 12:20:11 +02: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
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
Ryan Holtz
e2231ddcd2 -atarittl: Added netlist for Tank. currently runs at about 0.005% of full speed, unsure why. 2020-08-16 20:04:34 +02:00
couriersud
87b702b31f netlist: more include untangling.
* nl_base.h now basically only includes files from core.
* all headers in core compile on their own.
2020-08-12 20:17:10 +02:00
couriersud
9809a7b991 netlist: align naming of files within the macro folder.
* Use a consistent naming scheme. This is a preparational step towards
improved parsing performance.
2020-08-10 18:31:34 +02:00
couriersud
923de88abb netlist: more header file separation 2020-08-08 20:10:12 +02:00
Ryan Holtz
e404f347c6 -fireone: Committed netlist for couriersud to have a look at. 2020-08-06 20:16:22 +02:00
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
Aaron Giles
9414a219a9 netlist: Added CD4017/4022 devices.
* Also contains squashed clang signedness fixes
2020-08-01 18:27:21 +02:00
Aaron Giles
c0ecd68341 netlist: Device refactoring
* Move DIPs for 82S16, 82S115, and 2102A devices into nlm_proms
* Moved 7448 DIP to a macro. Replaced 7442 with truthtable and macro.
* Moved 74LS629 DIP into macro.
* Expand truthtable to handle 10 outputs.
2020-08-01 18:27:17 +02:00
couriersud
c7359e0aea netlist: Fix an issue during proxy hookup.
* Add cd4053 to netlist.lua
* Recreated nld_devinc.h
2020-07-28 20:44:07 +02:00
couriersud
494690081b netlist: separate nl_base.h into separate header files.
* This clean-up exercise will hopefully make it easier to navigate the
core code. Another long term goal is to further straighten the object
model.
2020-07-25 14:47:22 +02:00
Aaron Giles
a6239d582b netlist: Add 74113 device. 2020-07-10 20:04:17 +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
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
3fd176a7a6 netlist: device factory enhancements. (nw)
Factory elements can now pass additional parameters to device
constructors. This makes the design of interface objects like analog
callbacks easier.

The change also allowed to remove some "deep" calls into the core from
the MAME interface in netlist.h
2020-06-01 19:59:52 +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
de615ac138 netlist: move penum into own header file. (nw) 2020-05-24 10:48:06 +02:00
couriersud
6141fa4a9c netlist: Fix performance issues and VC2019. [Couriersud]
For reasons unknown to me compile optimizations do not behave for
template code. If the implementation is in separate compile units, the
code compiles and performs.
2020-05-22 01:15:18 +02:00
couriersud
5a43cc6432 netlist: consolidate 9316-type counters. [Couriersud]
This needs more attention since for certain compilers there is a
considerable performance degregation. It looks like this is only
triggered if too many variants are declared in one cpp file and the
compiler stops inlining.
2020-05-22 01:15:18 +02:00
couriersud
7d4bb358c8 netlist: Fix cd4013 implementation and include it in compile. (nw) 2020-05-17 02:08:51 +02:00
couriersud
7035821f87 netlist: rewrite rom devices from scratch. [Couriersud]
Thanks to Aaron Giles who made me think about a different approach.

This is a rewrite from scratch for rom devices. It uses a generic
template to implement rom devices which is used together with a
description struct to define a rom device. This leads to highly
efficient code since all information is available at compile time.

This is also a step forward to support tristate outputs. All rom devices
covered by this approach have tristate or open collector outputs and
thus all code changes to support tristate outputs can now be made
consistently in one file.
2020-05-17 01:34:16 +02:00
Aaron Giles
5739043ced netlist: Add 74377/74378/74379 devices to netlist. [Aaron Giles] 2020-05-15 13:10:15 +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
b2c40086e6 netlist: Add two noise sources. [Couriersud]
The two sources act as voltage sources, though noise may also be
injected as conductivy or current noise.

SYS_NOISE_MT_U: Mersenne Twister uniform noise
SYS_NOISE_MT_N: Mersenne Twister normal noise

nld_sys_noise is templated:

	using NETLIB_NAME(sys_noise_mt_u) =
		NETLIB_NAME(sys_noise)<plib::mt19937_64,
plib::uniform_distribution_t>;

Thus the approach is scalable. The implementation is state save aware,
and thus reproducible results are guaranteed.

An example use case is provided as well, see examples/noise.cpp.
2020-05-03 17:23:50 +02:00
couriersud
9dd0b48b3e netlist: add 393 to netlist.lua (nw) 2020-05-01 10:23:08 +02:00
couriersud
13f6e92cec netlist: Add the NE566 as a macro device. [Couriersud]
The device can be found in nlm_other.cpp.
Removed nld_ne566.*
Added SYS_SW, SYS_SW2 and SYS_COMP. These are single switch,
alternating switch and a analog comparator with digital outputs.
Renamed RES_SWITCH to SYS_SW.
Added example ne566.cpp in netlist/examples.
2020-05-01 10:04:22 +02:00
couriersud
184c198a88 Fixed indenting in netlist.lua. (nw) 2020-04-29 16:00:35 +02:00
couriersud
c782a0ef33 netlist: add NE566 to netlist.lua. (nw) 2020-04-29 14:38:58 +02:00
Vas Crabb
8a923f9361 srcclean and manual cleanup (nw) 2020-04-26 12:04:54 +10:00
couriersud
0054862e3c netlist: compile time improvement and code maintenance. (nw)
Added a define NL_USE_ACADEMIC_SOLVERS and disabled it in the build.
This will not compile in solvers which are either illustrative or only
perform for large sparse matrices like GMRES.
2020-04-19 16:08:43 +02:00
couriersud
5b6013caea netlist: improve performance up to 65% on audio netlists. [Couriersud]
This commit introduces precompiled static solver code. Due to
additional optimizations the compiler can use because the detail
calculation steps for the solution are known e.g. the kidniki netlist
sees a 100% speed increase.

In all environments (windows/*nix/osx) the source for the static
solver code can be created using
	bash src/lib/netlist/nl_create_mame_solvers.sh

This will create src/lib/netlist/generated/static_solvers.cpp which is
compiled into the mame binary.
The script is just a temporary workaround. The intention is that nltool
whill be able to create this file with one call.

There are other improvements in this commit speeding up the processing
of timestep and dynamic calculations.
2020-04-13 21:32:00 +02:00
Vas Crabb
a7fec751ed srcclean, manual adjustments (nw) 2020-01-26 12:39:27 +11:00
couriersud
42d351a4eb netlist: New devices and some fixes. [Couriersud]
- add CD4006 and CD4070 devices
- add TL084 opamp model
- Clock now supports proxies, i.e. can be connected to
  analog devices.
- Fixed netlists using CLOCK
- added some comments
- removed a forgotten header file.
2020-01-25 15:26:59 +01:00
Vas Crabb
e64edf6c71 srcclean and indentation cleanup (nw) 2019-11-24 13:52:11 +11:00
MooglyGuy
6d9e191488 -netlist: Added 7442 4-Line BCD to 10-Line Decimal Decoder. [Ryan Holtz] 2019-11-23 13:52:24 +01:00
MooglyGuy
2aa304ebc7 -netlist: Added 7492 Divide-by-12 Counter. [Ryan Holtz] 2019-11-23 12:43:30 +01:00
couriersud
60379b658a netlist: code maintenance. (nw)
- Separate code out into pmath.h and pstonum.h.
- Fix VC build error
- optimize pfmtlog.h a bit
2019-11-03 23:19:52 +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
Vas Crabb
32868b8e2a srcclean (nw) 2019-10-26 10:40:50 +11: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