summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/netlist.cpp
Commit message (Collapse)AuthorAgeFilesLines
* appease vs2019_clang with llvm 10.0 smf-2020-04-251-3/+3
|
* netlist: rename some camel case names. (nw) couriersud2020-04-191-4/+4
|
* netlist: nltool usage and static compile changes. [Couriersud] couriersud2020-04-181-0/+8
| | | | | | | | | | | | | | | | | | | | | This commit simplifies the creation of static solvers. For this to happen the following changes were made: - nltool does no longer support the "-f netlist_file.cpp" option. All parts of netlist which used the option now expect the file to be specified after all other options. Before: nltool -t 10 -f somenetlist.cpp Now : nltool -t 10 somenetlist.cpp - The static compile command now supports an "--output" option to specify the file to be created and accepts multiple input files. To be create the static solver file for MAME use the script provided or: ./nltool --cmd static --output=src/lib/netlist/generated/static_solvers.cpp src/mame/audio/nl_*.cpp src/mame/machine/nl_*.cpp - Updated documentation and examples provided by nltool --help
* netlist: improve performance up to 65% on audio netlists. [Couriersud] couriersud2020-04-131-3/+5
| | | | | | | | | | | | | | | | | | | 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.
* netlist: Reduce memory allocation calls in non-core code. (nw) couriersud2020-04-101-5/+5
|
* netlist: Parameters evaluated when netlist is created. [Couriersud] couriersud2020-01-291-5/+5
| | | | | | | | | | | | Parameters are now passed to the netlist core as strings. During netlist creation they are evaluated as functions. This opens the path to parameters on subdevice level. Examples: PARAM(device.XY, (1+2*0.005)) RES(R1, 2.05*RES_K(1)+1) In addition the commit contains dead code removal.
* srcclean, manual adjustments (nw) Vas Crabb2020-01-261-2/+2
|
* netlist: fix overclocking. (nw) couriersud2020-01-161-68/+72
|
* netlist: Increase resolution to 100 pico seconds. [Couriersud] couriersud2020-01-151-25/+43
| | | | | | | | Increase the time resolution from 1 nano second to 100 pico seconds. Make sure that icount and netlist internal time are better synched by tracking the remainder of the division. Fixed the netlist sound device. There is a one sample overflow every 13 seconds at 48000 Hz due to integer truncation which is now ignored. Added more doxygen documentation.
* netlist: Code maintenance. (nw) couriersud2020-01-121-21/+20
| | | | | | | | | Introduce an additional absolute time type netlist_time_ext to identify whether absolute or relative time is used in the netlist code. Extend ptime code to allow operations between ptime derived types with different internal types. In addition rewrote main queue serve loops. Adds a very small performance increase.
* srcclean and indentation cleanup (nw) Vas Crabb2019-11-241-1/+1
|
* netlist: more code maintenance. (nw) couriersud2019-11-161-3/+11
| | | | | | - refactor error messages. - Fix some drivers to cope with outputted added my the mame driver for video and sound. - Fix validation.
* netlist: maintenance and bug fixes, remove DUMMY_INPUT. [Couriersud] couriersud2019-11-151-1/+1
| | | | | | | | | | - 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
* netlist: Proxy and power terminal hack removal. [Couriersud] couriersud2019-11-141-0/+3
| | | | | | | | | | | | | | | | | | - Devices ttlhigh and ttlhow are no longer automatically created. - All logic input devices (e.g. TTL_INPUT, LOGIC_INPUT) now need to have their power terminals (VCC, GND) connected. This opens the route for more appropriate proxy devices but comes at a cost. If the connections are omitted your circuit will not work as expected. Example: LOGIC_INPUT(I_SD0, 1, "AY8910PORT") NET_C(VCC, I_SD0.VCC) NET_C(GND, I_SD0.GND) - Updated all netlists. - Removed proxy information from terminal objects. This was replaced by a lookup hash whose life-span does not exceed netlest setup. These changes enable the removal of a number of hacks from the source going forward.
* netlist: code maintenance. (nw) couriersud2019-11-131-67/+67
| | | | | | - 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.
* Make many device_execute_interface functions noexcept, including the ↵ AJR2019-11-091-2/+2
| | | | | | | | "information" overrides. This also covers several time-related functions in attotime, running_machine and emu_timer. (nw) m6805: Calculate min_cycles and max_cycles once at device_start time (Nw) attotime: Add as_khz and as_mhz (nw)
* netlist: Minor optimizations. (nw) couriersud2019-11-051-2/+2
|
* netlist: more consistent exception handling. (nw) couriersud2019-11-051-4/+8
| | | | Still not optimal, but better than what we had previously. No exception logging comes closer.
* netlist: Completed __float128 support. [Couriersud] couriersud2019-11-031-2/+2
| | | | | | Both compiling the core and the shaders with __float128 now work. The support was added to be ready to deal with academic edge cases. Performance drops to 10% of double - thus disabled by default.
* netlist: code maintenance and bugfixes. (nw) couriersud2019-11-011-0/+2
| | | | - fixed a bug in the parray constructor - replaced NL_NOEXCEPT with noexcept where appropriate
* netlist: Compile with float/double floating point. [Couriersud] couriersud2019-10-311-3/+2
| | | | | | | | | | | Added ability to compile using float instead of double. Specifically the the solver as well as the infrastructure now can have their own floating point type. Currently this is only an academic exercise since numerically demanding circuits like kidniki only work with double/double support. Using float here is pushing numerical stability over the limits. The long term design goal is too have the matrix type (double/float) being a parameter.
* netlist: maintenance and simplifcation. (nw) couriersud2019-10-311-14/+14
| | | | | | | - solver: align matrix population along the various solvers - solver: delete dead code - renamed nl_double to nl_fptype and use nl_fptype where previously double has been used. - renamed param_double_t to param_fp_t
* Spring cleaning: Vas Crabb2019-11-011-1/+1
| | | | | | | | | | | | * Changed emu_fatalerror to use util::string_format semantics * Fixed some incorrectly marked up stuff in build scripts * Make internal layout compression type a scoped enum (only zlib is supported still, but at least the values aren't magic numbers now) * Fixed memory leaks in Xbox USB * There can only be one "perfect quantum" device - enforce that only the root machine can set it, as allowing subdevices to will cause weird issues with slot cards overiding it * Allow multiple devices to set maximum quantum and use the most restrictive one (it's maximum quantum, it would be minimum interleave) * Got rid of device_slot_card_interface as it wasn't providing value * Added a helper template to reduce certain kinds of boilerplate in slots/buses * Cleaned up some particularly bad slot code (plenty more of that to do), and made some slots more idiomatic
* netlist: code maintenance. (nw) couriersud2019-10-301-1/+1
| | | | Simplification, remove some trampolines.
* netlist: code maintenance. (nw) couriersud2019-10-291-1/+1
| | | | | | | | - 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
* Make devdelegate more like devcb for configuration. This is a Vas Crabb2019-10-261-14/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fundamental change to show device delegates are configured. Device delegates are now aware of the current device during configuration and will resolve string tags relative to it. This means that device delegates need a device to be supplied on construction so they can find the machine configuration object. There's a one-dimensional array helper to make it easier to construct arrays of device delegates with the same owner. (I didn't make an n-dimensional one because I didn't hit a use case, but it would be a simple addition.) There's no more bind_relative_to member - just call resolve() like you would for a devcb. There's also no need to cast nullptr when creating a late bind device delegate. The flip side is that for an overloaded or non-capturing lambda you'll need to cast to the desired type. There is one less conditional branch in the hot path for calls for delegates bound to a function pointer of member function pointer. This comes at the cost of one additional unconditional branch in the hot path for calls to delegates bound to functoids (lambdas, functions that don't take an object reference, other callable objects). This applies to all delegates, not just device delegates. Address spaces will now print an error message if a late bind error is encountered while installing a handler. This will give the range and address range, hopefully making it easier to guess which memory map is faulty. For the simple case of allowing a device_delegate member to be configured, use a member like this: template <typename... T> void set_foo(T &&...args) { m_foo_cb.set(std::forward<T>(args)...); } For a case where different delegates need to be used depending on the function signature, see src/emu/screen.h (the screen update function setters). Device delegates now take a target specification and function pointer. The target may be: * Target omitted, implying the current device being configured. This can only be used during configuration. It will work as long as the current device is not removed/replaced. * A tag string relative to the current device being configured. This can only be used during configuration. It will not be callable until .resolve() is called. It will work as long as the current device is not removed/replaced. * A device finder (required_device/optional_device). The delegate will late bind to the current target of the device finder. It will not be callable until .resolve() is called. It will work properly if the target device is replaced, as long as the device finder's base object isn't removed/replaced. * A reference to an object. It will be callable immediately. It will work as long as the target object is not removed/replaced. The target types and restrictions are pretty similar to what you already have on object finders and devcb, so it shouldn't cause any surprises. Note that dereferencing a device finder will changes the effect. To illustrate this: ... required_device<some_device> m_dev; ... m_dev(*this, "dev") ... // will late bind to "dev" relative to *this // will work if "dev" hasn't been created yet or is replaced later // won't work if *this is removed/replaced // won't be callable until resolve() is called cb1.set(m_dev, FUNC(some_device::w)); ... // will bind to current target of m_dev // will not work if m_dev is not resolved // will not work if "dev" is replaced later // will be callable immediately cb2.set(*m_dev, FUNC(some_device::w)); ... The order of the target and name has been reversed for functoids (lambdas and other callable objects). This allows the NAME macro to be used on lambdas and functoids. For example: foo.set_something(NAME([this] (u8 data) { m_something = data; })); I realise the diagnostic messages get ugly if you use NAME on a large lambda. You can still give a literal name, you just have to place it after the lambda rather than before. This is uglier, but it's intentional. I'm trying to drive developers away from a certain style. While it's nice that you can put half the driver code in the memory map, it detracts from readability. It's hard to visualise the memory range mappings if the memory map functions are punctuated by large lambdas. There's also slightly higher overhead for calling a delegate bound to a functoid. If the code is prettier for trivial lambdas but uglier for non-trivial lambdas in address maps, it will hopefully steer people away from putting non-trivial lambdas in memory maps. There were some devices that were converted from using plain delegates without adding bind_relative_to calls. I fixed some of them (e.g. LaserDisc) but I probably missed some. These will likely crash on unresolved delegate calls. There are some devices that reset delegates at configuration complete or start time, preventing them from being set up during configuration (e.g. src/devices/video/ppu2c0x.cpp and src/devices/machine/68307.cpp). This goes against the design principles of how device delegates should be used, but I didn't change them because I don't trust myself to find all the places they're used. I've definitely broken some stuff with this (I know about asterix), so report issues and bear with me until I get it all fixed.
* Netlist: code maintenance and improvements. [Couriersud] couriersud2019-10-181-4/+4
| | | | | | | | - 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
* Netlist: code maintenance and bug fixes. [Couriersud] couriersud2019-10-151-2/+2
| | | | | | | | | | | | - optimized the core queue dispatching logic. Minor performance increase. - fixed a number of bugs in parray. Now parray<double, 0> will be purely dynamic allocation with the number of elements passed in the constructor. - Added noexpr where appropriate. - Simplified the queue Checked with gcc-7 (ubuntu), gcc-9, clang-10, macosx clang 10, mingw cross compile on linux.
* netlist: Use unique_ptr where possible. (nw) couriersud2019-10-151-11/+11
| | | Also improve code readability.
* netlist: mame netlist reorganization. [Couriersud] couriersud2019-10-131-1/+2
| | | | | | - moved netlists out of driver code into audio/ or machine/ as nl_xxx.cpp files. - identified and documented extended validation - updated arcade, mess and nl targets
* netlist: maintenance and lint fixes. (nw) couriersud2019-10-061-4/+4
|
* Fix build on Apple LLVM version 7.0.2 (clang-700.1.81) (nw) AJR2019-09-291-3/+10
| | | | The same fix might also be needed for some non-Apple clang versions.
* Make osd_printf_* use util/strformat semantics. Vas Crabb2019-09-261-3/+3
| | | | | | | | | | | | | | | | | (nw) This has been a long time coming but it's here at last. It should be easier now that logerror, popmessage and osd_printf_* behave like string_format and stream_format. Remember the differences from printf: * Any object with a stream out operator works with %s * %d, %i, %o, %x, %X, etc. work out the size by magic * No sign extending promotion to int for short/char * No widening/narrowing conversions for characters/strings * Same rules on all platforms, insulated from C runtime library * No format warnings from compiler * Assert in debug builds if number of arguments doesn't match format (nw) Also removed a pile of redundant c_str and string_format, and some workarounds for not being able to portably format 64-bit integers or long long.
* netlist: switch to c++ streams. (nw) couriersud2019-09-251-9/+19
| | | | Removed the home-brew implementation pstreams and replaced those with c++ streams.
* netlist code maintenance (nw) couriersud2019-09-211-2/+2
| | | | | - prepare move to c++ streams and later std::string - fix more lint and clang pedantic warnings/errors - fix some bugs
* netlist: code maintenance Couriersud2019-04-281-4/+4
| | | | | | | | - converted NL_MAX_LINK_RESOLVE_LOOPS into a netlist parameter. - Reduced potential bit-rot. - nltool -v --version now displays values of all compile time defines. There are still far too many compile time defines. However, most of them ensure and test future scalability.
* netlist: Fix MT06827. couriersud2019-04-221-1/+1
| | | | All pstonum calls now need to specify if they want local locale or the "classic" "C" locale.
* netlist: runtime performance statistics on demand. couriersud2019-04-221-4/+16
| | | | | | Runtime performance statistics can now be enabled with nltool option "-s". To enable those with MAME you need to run NL_STATS=1 ./mamenl64 -v -oslog game
* netlist: Add more validations and fix issues identified. couriersud2019-04-211-14/+100
|
* netlist: Add power terminals to most logic devices. couriersud2019-04-211-2/+4
| | | | | | | | | | | | This fixes an over simplification. Logic devices implicitly assumed that GND/VDD actually is connected to GND(i.e. 0V). There is no immediate benefit from this change. It is a preparation for the future scalability. Now all power terminals (typically 7/14, 8/16) have to be explicitly connected to the supply rails. Also added a validation mode to the netlist core. This is not intended for running, but solely to better indentify pins which are not properly connected.
* Fix validation crash. (nw) couriersud2019-04-171-2/+6
|
* netlist: Improve validation code. couriersud2019-04-161-17/+44
| | | Adjust warning levels and fix a number of topics identified.
* netlist: Add validation support to netlist device. couriersud2019-04-151-40/+146
| | | | | | 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.
* netlist: modernize interface. (nw) couriersud2019-04-131-6/+9
|
* netlist: bug fixing. couriersud2019-04-131-0/+10
| | | | | - fix sound route dependency - add "K" as a valid Kilo multiplier. - Fix current source parameter update.
* (nw) Clean up the mess on master Vas Crabb2019-03-261-174/+201
| | | | | | | | | | | | | This effectively reverts b380514764cf857469bae61c11143a19f79a74c5 and c24473ddff715ecec2e258a6eb38960cf8c8e98e, restoring the state at 598cd5227223c3b04ca31f0dbc1981256d9ea3ff. 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.
* Revert "conflict resolution (nw)" andreasnaive2019-03-251-201/+174
| | | | | This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing changes made to 009cba4fb8102102168ef32870892438327f3705.
* netlist: fix artificial clicks in streaming sound device. (nw) couriersud2019-03-161-2/+11
|
* fixedfreq: some renaming, remove members called only once. (nw) couriersud2019-03-161-0/+1
|
* netlist: fix bugs in object initialization order. (nw) Couriersud2019-03-061-24/+24
|