Commit Graph

1926 Commits

Author SHA1 Message Date
couriersud
d00de16b41 netlist: analog readability refactoring. (nw)
Change the sign of go (or in other terms a12 and a21 matrix stencil
elements). This should make further optimization of matrix population
easier.
In addition hopefully improve the readability of the code by sacrifying
overloads for more verbose member names.
2019-02-25 22:11:04 +01:00
couriersud
6a3efe52d6 netlist: fix bugs in the alignment code. (nw) 2019-02-25 21:17:59 +01:00
couriersud
2e055aa97b netlist: tidy changes and better constexpr support for ptime class. (nw) 2019-02-24 18:45:16 +01:00
couriersud
0e07f9ac34 netlist: more alignment related refactoring. (nw) 2019-02-24 18:45:16 +01:00
couriersud
a7a8186283 Move fillmatrix to to matrix solver base class. (nw) 2019-02-24 18:45:15 +01:00
couriersud
89e0f698b6 Prepare further optimization. (nw) 2019-02-24 18:41:42 +01:00
Vas Crabb
0ed2d2684e srcclean (nw) 2019-02-24 14:25:42 +11: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
0b3787d5f4 netlist: Fix some more exotic compile options. (nw)
128bit integers on kaby lake are not that much slower than 64bit. This
may be an option for MAME's attotime as well.
2019-02-23 16:24:01 +01:00
couriersud
f44bc8108c Fix indentation. (nw) 2019-02-22 22:06:05 +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
couriersud
064050323e netlist: fix access specifiers. (nw) 2019-02-20 20:53:56 +01:00
couriersud
a5f3787058 netlist: fix a bug and some performance tweaks. (nw) 2019-02-20 20:16:08 +01:00
Vas Crabb
7983685096 (nw) clean up trivial stuff - the device delegate boilerplate is ugly, I will address it ASAP 2019-02-19 20:19:15 +11:00
couriersud
6207d7d2d3 netlist: tick off some issues clang-tidy highlights. (nw) 2019-02-18 20:22:16 +01:00
couriersud
17d784d83b netlist: remove locked-in context from sources. (nw) 2019-02-17 23:52:05 +01:00
couriersud
1fe9f5e2e5 netlist: refactoring startup process and array usage. (nw) 2019-02-17 18:30:34 +01:00
Vas Crabb
01ccbd89c9 (nw) remove some superfluous const, eliminate a superfluous temp, remove superflous semicolons, etc. and also fix a known broken build script change 2019-02-18 00:48:52 +11:00
couriersud
55000018e7 netlist: Separation of duties. (nw)
Make it clearer what is used during parsing a netlist, "compiling" a
netlist and execution of a netlist.
2019-02-16 14:31:59 +01:00
couriersud
b113d0c26d netlist: memory pool now supports aligned storage. (nw)
Set USE_MEMPOOL to 1 to try this (max 5% performance increase).

For mingw, there is no alignment support. This triggers -Wattribute
errors which due to -Werror crash the build.
2019-02-16 00:05:21 +01:00
couriersud
c5a513ca90 netlist: more memory allocation refactoring. (nw) 2019-02-14 01:16:39 +01:00
couriersud
aad01d572a netlist: indent. (nw) 2019-02-13 23:23:14 +01:00
couriersud
fb685c05b9 netlist: memory allocation clean-up. (nw) 2019-02-13 22:37:07 +01:00
couriersud
a905dffd08 netlist: More cpp core guidelines alignment. (nw) 2019-02-11 22:19:08 +01:00
couriersud
83bd138bec netlist: Fix crashes on certain hardware/library combos. (nw)
At least on macosx memory used by an object seems to be invalidated
before the dtor is executed. This of course is deadly for child objects
with references to the parent-in-deletion which may call back into the
parent.
One of the worst issues I had to fix. Ever. Lesson learnt: No tricks in
dtors. Never.
2019-02-09 23:07:27 +01:00
couriersud
9d8cb783e3 netlist: more core guidelines work. (nw) 2019-02-09 23:07:27 +01:00
AJR
50f185042f Fix clang build (nw) 2019-02-08 19:19:47 -05:00
couriersud
bd8bd7c4f1 netlist: added missing noexcept. (nw) 2019-02-09 00:32:31 +01:00
couriersud
5ea6e079f3 netlist: constants are now constexpr functions. (nw) 2019-02-09 00:21:14 +01:00
couriersud
8daa6e0a0d netlist: added parameter STARTUP_STRATEGY to switch between ...
startup strategies. This determines the order of device triggering.
0: Full - trigger all delegates. Next all devices not touched.
1: Backwards - trigger all devices backwards (only update delegate)
2: Forward - trigger all devices forward (only update delegate)
2019-02-08 23:18:48 +01:00
couriersud
8f94739f65 netlist: make constants struct members constexpr const. (nw)
- enable GCC diagnostics in vector ops for GCC 7 again
- Use forwarding in vector_ops
2019-02-08 23:18:47 +01:00
couriersud
f4c0f8c74b netlist: more cpp core guidelines work. (nw) 2019-02-08 23:18:47 +01:00
AJR
9807755a65 Awkward workaround for "undefined symbols" error caused by stupid non-inline constexpr semantics (nw) 2019-02-07 17:49:55 -05:00
couriersud
3b899b86e6 netlist: Refactoring after adding clang-tidy support to netlist makefile
- 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.
2019-02-07 21:54:11 +01:00
couriersud
6381ed11ed netlist: Optionally store input values instead of referencing them. (nw)
Useful for debugging purposes in the end - but not performance.

/*! Store input values in logic_terminal_t.
 *
 * Set to 1 to store values in logic_terminal_t instead of
 * accessing them indirectly by pointer from logic_net_t.
 * This approach is stricter and should identify bugs in
 * the netlist core faster.
 * By default it is disabled since it is not as fast as
 * the default approach.
 *
 */
#define USE_COPY_INSTEAD_OF_REFERENCE (0)
2019-02-05 18:31:14 +01:00
couriersud
6a7c3a8079 netlist: align solver calls. (nw) 2019-02-04 23:17:18 +01:00
couriersud
24e192fc86 netlist: Fix regression. (nw) 2019-02-04 20:38:59 +01:00
couriersud
759b7c3c88 netlist: Further simplification and optimization. (nw) 2019-02-04 19:36:02 +01:00
couriersud
c87a487d6d netlist: Refactoring and some functionality enhancements. (nw)
- Removed dead code.
- nltool now adds a define NLTOOL_VERSION. This can be tested in
  netlists. It is used in kidniki to ensure I stop committing
  debug parameters.
- Optimized the proposal for no-deactivate hints.
- Documented in breakout that hints were manually optimized.
- Minor optimizations in the order of 2% enhancement.
2019-02-04 00:27:23 +01:00
couriersud
f9f341f4d6 netlist: fix some issues. (nw) 2019-02-02 14:56:56 +01:00
couriersud
75146fd159 netlist: All devices now specify parameters in factory constructor. (nw)
This previously was part of net_lib.cpp and repeatedly caused bugs.
2019-02-01 22:46:43 +01:00
couriersud
b952577370 netlist: remove trampoline code. (nw) 2019-02-01 08:45:32 +01:00
couriersud
b4ba8dc552 netlist: code maintenance and fixing kidniki ... (nw)
to run at acceptable speed again.
2019-02-01 02:07:48 +01:00
couriersud
a80f10e1cf netlist: type safety for delegates. (nw) 2019-01-31 01:45:34 +01:00
couriersud
1513c777b4 netlist: Refactoring continues ... plus some innovations (nw)
Still some work ahead to separate interface from execution. This is a
preparation to switch to another sparse matrix format easily which may
be better suited for parallel processing.

On the linear algebra side there are some nice additions:

- Two additional sort modes: One tries to obtain a upper left identity
matrix, the other prefers a diagonal band matrix structure. Both deliver
slightly better performance than just sorting.
- Parallel execution analysis for Gaussian elimination and LU solve.
This determines which operations may be done independently.

All of this is not really useful right now. The matrix sizes are below
100 nets. I estimate that we at least need four times more so that CPU
parallel processing overhead pays off. For GPU, add another order. But
it's nice to have code which may scale.
2019-01-31 01:03:35 +01:00
Vas Crabb
76323eb770 srcclean and cleanup (nw) 2019-01-27 14:22:20 +11:00
AJR
212f26f759 Fix clang build (nw)
- src/lib/netlist/solver/mat_cr.h:143:32: error: call to 'abs' is ambiguous
- src/lib/netlist/solver/nld_ms_direct.h:62:19: error: non-type template argument evaluates to 18446744073709551488, which cannot be narrowed to type 'int' [-Wc++11-narrowing]
2019-01-26 18:32:16 -05:00
couriersud
32b0442c73 netlist: refactor code for better scalability and flexibility. (nw)
These changes aim to remove some of the duplication of code in the
various solvers.
Tested with gcc-7 clang-8 and nvcc-9.2
2019-01-27 00:01:51 +01:00