Commit Graph

40 Commits

Author SHA1 Message Date
couriersud
bcfa9eae6f netlist: maintenance and bug fixes, remove DUMMY_INPUT. [Couriersud]
- 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
2019-11-15 22:16:37 +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
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
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
6daeb4b4d1 netlist: Use unique_ptr where possible. (nw)
Also improve code readability.
2019-10-15 11:30:05 +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
couriersud
56f9e77b84 netlist: Fix MT06827.
All pstonum calls now need to specify if they want local locale
or the "classic" "C" locale.
2019-04-22 21:08:49 +02:00
couriersud
86f0b315b6 netlist: Add validation support to netlist device.
mame -validate now also checks all netlist devices. It does this
by constructing a temporary netlist.
This commit also fixes some memory leaks and a bad bug which
surfaced in validation.
2019-04-15 21:41: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
17fcc38a25 netlist: memory code refactoring. (nw) 2019-03-01 10:30:24 +01:00
couriersud
2e055aa97b netlist: tidy changes and better constexpr support for ptime class. (nw) 2019-02-24 18:45:16 +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
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
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
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
9d8cb783e3 netlist: more core guidelines work. (nw) 2019-02-09 23:07:27 +01:00
couriersud
f4c0f8c74b netlist: more cpp core guidelines work. (nw) 2019-02-08 23:18:47 +01: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
b4ba8dc552 netlist: code maintenance and fixing kidniki ... (nw)
to run at acceptable speed again.
2019-02-01 02:07:48 +01:00
couriersud
c89439dd23 netlist: refactored netlist creation. (nw)
This is an effort to separate netlist creation from netlist execution.
The primary target is to avoid that code which will only run during
execution is able to call setup code and thus create ugly hacks.
2019-01-15 23:42:16 +01:00
couriersud
f12f735f54 Fix clang-8 warnings. (nw) 2019-01-11 21:50:43 +01:00
couriersud
e8fed7f532 Refactoring and bug fixes. (nw) 2019-01-10 20:55:59 +01:00
couriersud
4213a396d8 Improve type safety on string->numeric conversions. (nw)
Also fixed an issue with 7497.

./nltool -t 5 -f src/mame/machine/nl_tp1983.cpp -v

now runs again.
2019-01-10 00:30:51 +01:00
couriersud
1415421fd7 More c++ alignment. pstring now behaves like std::string. (nw)
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.
2019-01-06 13:17:20 +01:00
couriersud
49d50c3045 Netlist code refactoring:
- more use of c++ features
- some CRTP in pfmtlog
- demangled code for truthtables
- use more constexpr
- rewrite main loop
- use default constructors and assignment operators were applicable.
- optimized 7448 and 9316

All of this has decreased startup time by approx. 25% to 30%. Complex
netlists like pong or kidniki are parsed, analyzed and constructed in
around 15 ms. Run performance has increased by about 5%.

All in all not to bad. A game like pong uses a clock of 7 MHz (after
division by 2). Thats 14 MHz clock invocations. Running at over 200%, 28
MHz. On a 3.9 GHz Machine about 140 cycles/clock change.

[Couriersud]
2017-04-09 00:04:10 +02:00
couriersud
58aa97913f pstring, pdynlib, pfmtlog refactoring :
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)
2017-04-04 02:02:56 +02:00
Couriersud
3c49610274 More cppcheck fixes. (nw) 2017-03-05 16:19:59 +01:00
Vas Crabb
8f15315a52 srcclean (nw) 2017-02-19 11:40:55 +11:00
couriersud
65806114b0 More truthtable rework and clean up. (nw) 2017-02-19 01:00:48 +01:00
couriersud
8536d065e2 Fix mingw 32 bit build. (nw) 2017-02-17 20:10:15 +01:00
couriersud
0716d96514 Reworked truthtables a bit.
- 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.
2017-02-17 20:10:15 +01:00
couriersud
ab17457707 Make sure netlist includes are not found directly on include path.
Instead, they have to be prefixed by "netlist/". Removed unneeded link
librariers for nltool and nlwav along the way. (nw)
2017-02-10 21:52:09 +01:00
couriersud
c713f9ed1d Separate include file usage for netlist.
Device implementations (all cpp files in netlist/devices) now should
only include nl_base.h. 
Netlist implementation sources should only include "net_lib.h". 
Refactored netlist.h and netlist.cpp to avoid namespace congestion in
netlist.h.
Fixed VC2015 build. (nw)
2017-01-29 15:47:12 +01:00