summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib
Commit message (Collapse)AuthorAgeFilesLines
* netlist: more code maintenance. (nw)GravatarGravatar couriersud2019-11-1615-474/+502
| | | | | | - 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]GravatarGravatar couriersud2019-11-1532-348/+245
| | | | | | | | | | - 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]GravatarGravatar couriersud2019-11-1413-107/+184
| | | | | | | | | | | | | | | | | | - 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: bug fix, code maintenance and performance improvement. (nw)GravatarGravatar couriersud2019-11-1315-88/+121
| | | | | | | | | - 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.
* netlist: code maintenance. (nw)GravatarGravatar couriersud2019-11-1318-227/+322
| | | | | | - 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.
* netlist: maintenance. (nw)GravatarGravatar couriersud2019-11-1128-294/+129
| | | | | | | - Fix automatic header generation - clang lint fixes. - srcclean - remove dead code
* netlist: first steps on the way to calculated parameters. [Couriersud]GravatarGravatar couriersud2019-11-1022-106/+382
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit is a first step towards using formulas in parameters, i.e. MAINCLOCK(clock, 20 * 30) The intention is to improve readability and scalability. Since device registration already provides all necessary information about parameters, the code to create an include file for all devices has been improved. Long term, this will remove the need for device specific header files. In addition going forward devices will accept either no connections or all specified connections, i.e. TTL_7400_NAND(name, chip1.2, chip2.3) or TTL_7400_NAND(name) NET_C(...) NET_C(...) This will allow to remove all duplicate definitions which are currently necessary, i.e. TTL_7400_NAND/TTL_7400_GATE
* netlist: code maintenance. (nw)GravatarGravatar couriersud2019-11-1023-396/+469
| | | | | | - more doxygen \file annotations - moved MAINCLOCK back to nl_base.h - remove some const from simple function parameters
* netlist: code maintenance and bug fixes. (nw)GravatarGravatar couriersud2019-11-0882-1881/+1889
| | | | | | | - 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.
* netlist: maintenance. (nw)GravatarGravatar couriersud2019-11-0816-202/+238
| | | | | - switch to VS 2019 community and fix standalone build. - more migration to C++ comment style. - add some more doxygen markup.
* netlist: code and documentation maintenance fixes. [Couriersud]GravatarGravatar couriersud2019-11-0720-500/+809
| | | | | | | | | - "nltool -c docheader" now scans sources and creates usage focussed doxy documentation for devices. Very early stage, but works. For an example, please see ne555 source. - Started migrating to pure C++, i.e. "//" comments. - Various documentation fixes. - Added cppcheck configuration to netlist/build - Some smaller code changes.
* netlist: Minor optimizations. (nw)GravatarGravatar couriersud2019-11-054-38/+40
|
* netlist: more consistent exception handling. (nw)GravatarGravatar couriersud2019-11-0516-48/+44
| | | | Still not optimal, but better than what we had previously. No exception logging comes closer.
* netlist: code maintenance. (nw)GravatarGravatar couriersud2019-11-0443-191/+263
| | | | | | | | - 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
* misc cleanup (nw)GravatarGravatar Vas Crabb2019-11-051-1/+1
|
* Fix invalid std::vector<> lookup in aviio.cppGravatarGravatar npwoods2019-11-041-1/+2
| | | | | | | | | | | | | This fixes a case where: * m_soundbuf_samples == processedsamples * processedsamples > 0 * processedsamples * stream->channels() == m_soundbuf.size() In this scenario, the std::memmove() would do nothing (moving zero bytes), but the operator[] on the second parameter to std::memmove() overflows the array. This can be benign in optimized builds (because the third parameter to std::memmove() is 0), but on debugging builds this can cause an assert.
* netlist: code maintenance. (nw)GravatarGravatar couriersud2019-11-047-6/+2
| | | | | - leave a note that cstdlib is needed for getenv. - Remove commented out includes - make sure all headers are self - contained, i.e. compile
* Fix clang error: no member named 'getenv' in namespace 'std' (nw)GravatarGravatar AJR2019-11-031-0/+1
| | | | Library differences are the culprit once again.
* netlist: code maintenance. (nw)GravatarGravatar couriersud2019-11-0339-515/+557
| | | | | | - Separate code out into pmath.h and pstonum.h. - Fix VC build error - optimize pfmtlog.h a bit
* netlist: remove pragma once. (nw)GravatarGravatar couriersud2019-11-038-18/+0
| | | Only used inconsistently in the code. May as well go.
* netlist: Completed __float128 support. [Couriersud]GravatarGravatar couriersud2019-11-0319-57/+281
| | | | | | 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: fix regression, preliminary __float128 support. (nw)GravatarGravatar couriersud2019-11-0311-23/+172
| | | | | __float128 is a gnu extension delivering true 128 bit floating point support. Currently not supported by clang. In addition, the quadmath library needs to be linked. For the time being therefore disabled.
* netlist: improve readability. (nw)GravatarGravatar couriersud2019-11-0232-352/+355
| | | | | | | Renamed cast member of the constants struct to magic to clearly identify magic numbers. Introduced nlconst struct inheriting from plib::constants<nl_fptype> to make code better understandable.
* netlist: add RELTOL/VNTOL solver parameters. Type safety. [Couriersud]GravatarGravatar couriersud2019-11-0244-437/+510
| | | | | | | | | The newly added RELTOL and VNTOL parameters implement Newton convergence checks comparable following other SPICE implementations. The ACCURACY solver parameter now is only used for convergence checks in iterative solvers. In addition, type safety was significantly improved and a lot of "magic" numbers are identifiable now.
* netlist: Support for float, double and long double solvers. [Couriersud]GravatarGravatar couriersud2019-11-0233-263/+364
| | | | | | | | | | | | | - Added new solver parameter FPTYPE. This determines in which floating point domain the linear system is solved. May be one of "FLOAT", "DOUBLE" or "LONGDOUBLE" - Added option "--fperr" to nltool. This enables floating point exceptions. This helps debugging the code under gdb. The purpose of this going forward is to have more choice in optimization. Non-dynamic systems should be just fine in the float domain. Dynamic systems (i.e. diodes, bjts, mosfets) should in general work with double. Certain edge cases may require long double resolution.
* netlist: code maintenance and bugfixes. (nw)GravatarGravatar couriersud2019-11-0111-192/+199
| | | | - fixed a bug in the parray constructor - replaced NL_NOEXCEPT with noexcept where appropriate
* netlist: convert constexpr constants into constexpr inline funcs. (nw)GravatarGravatar couriersud2019-11-013-17/+18
|
* netlist: further solver refactoring. (nw)GravatarGravatar couriersud2019-11-0111-260/+270
|
* It's C++14 where constexpr variables still aren't inlined, making ridiculous ↵GravatarGravatar AJR2019-10-312-3/+3
| | | | workarounds like this necessary to fix builds (nw)
* netlist: fix clang warnings & srcclean. (nw)GravatarGravatar couriersud2019-10-315-17/+17
|
* netlist: Compile with float/double floating point. [Couriersud]GravatarGravatar couriersud2019-10-3112-221/+282
| | | | | | | | | | | 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)GravatarGravatar couriersud2019-10-3147-647/+595
| | | | | | | - 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
* netlist: move solver stuff into separate namespace. (nw)GravatarGravatar couriersud2019-10-3115-444/+446
| | | | | - new namespace "solver" - minor ptime modifications
* netlist solvers: fix some bad design. (nw)GravatarGravatar couriersud2019-10-3013-264/+215
|
* netlist: code maintenance. (nw)GravatarGravatar couriersud2019-10-3012-139/+140
| | | | Simplification, remove some trampolines.
* netlist: Hopefully fix MSVC compile. (nw)GravatarGravatar couriersud2019-10-301-1/+4
|
* netlist: improve localized storage. (nw)GravatarGravatar couriersud2019-10-299-129/+132
|
* netlist: code maintenance. (nw)GravatarGravatar couriersud2019-10-2936-1464/+1507
| | | | | | | | - 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
* netlist: Preprocessor enhancements. [Couriersud]GravatarGravatar couriersud2019-10-2810-127/+478
| | | | | | | | | | The builtin preprocessor now behaves closer to cpp: - supports macro parameters, i.e. define x(a) a - supports stringification, i.e. define x(a) #a - supports concatenation, i.e. define x(a) a ## _ext In addition, error reporting now provides a source context including the include history.
* Make devdelegate more like devcb for configuration. This is aGravatarGravatar Vas Crabb2019-10-261-32/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* srcclean (nw)GravatarGravatar Vas Crabb2019-10-267-10/+10
|
* (nw) at least try to be const-correctGravatarGravatar Vas Crabb2019-10-241-2/+2
|
* Fix spelling, tidy whitespaceGravatarGravatar Zoë Blade2019-10-213-16/+16
|
* Netlist: code maintenance and improvements. [Couriersud]GravatarGravatar couriersud2019-10-1824-197/+498
| | | | | | | | - 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. (nw)GravatarGravatar couriersud2019-10-1718-1734/+1638
| | | | | | | - 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
* Netlist: pongf update and code maintenance. [Couriersud]GravatarGravatar couriersud2019-10-167-119/+85
| | | | | After the recent string of updates pongf performance increased again. Also includes code maintenance and some fixes for the aligned memory operations.
* (nw) fixed compile error on gcc 5.3 . Apologies in advance if it breaks ↵GravatarGravatar Robbbert2019-10-161-1/+1
| | | | other compilers/versions.
* Netlist: code maintenance and bug fixes. [Couriersud]GravatarGravatar couriersud2019-10-1516-173/+209
| | | | | | | | | | | | - 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)GravatarGravatar couriersud2019-10-1513-94/+158
| | | Also improve code readability.
* netlist: mame netlist reorganization. [Couriersud]GravatarGravatar couriersud2019-10-1311-24/+43
| | | | | | - 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