- More c++, less macros
* Significantly reduced the use of unused_var and replaced it with
[[maybe_unused]]
* use enum class in ppmf.h
- Changes to testing code in ptest.h
* Catch exceptions in more places
* The verbosity of the output can now be controlled
* Display of test stats totals
- added support for cspell
- fixed various typos
- fixed SUBTARGET=nl build
- fixed more file permissions
- srcclean and add fix_permissions target to netlist makefile
copyright owners. Much thanks for that Couriersud, the main creator
and contributor, but also to Jonathan Gevaryahu and Sergey Svishchev.
There are small remnants in machine/NL_*, specifially breakout, pong
doubles and rebound that are also copyrighted by the DICE team,
whoever that means. They're not critical since they only concern
these drivers and not an important core subsystem.
* 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.
* rename some misleading type names
* remove callback_t and replace by better scalable approach
* hide implementations details
* move sources classes from putil.h to psources.h
* reduce code complexity
* improve parsing performance, parsing netlists now is twice as fast.
* fix issues around multi-byte string support
* moved psplit into pstrutil.h
* also made nld_devinc.h srcclean friendly.
* nld_devinc.h and lib_entries.hxx are currently not used. You can try
the automated build by changing NL_AUTO_DEVICES in setup.h to 1.
* Separated tokenizing and reading of tokens.
* This enables caching of parsing results on the token level.
* Implemented caching of token stream.
* Overall this significantly improves parsing performance (~10x)
* Next step towards a bare-bone nltool which does not depend on macro
devices.
* 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
* Logic and analogue outputs can now be flagged as "NC" (not connected).
* Example: "HINT(IC13.4, NC)".
* This will suppress info messages to be logged.
* The HINT must apply to an existing terminal. HINTs for non-existing
terminals are treated as fatal errors.
* Terminals and logic inputs not connected are still treated as
warnings. These need though and a proper fix.
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.
This change will make it a lot easier to add enhanced functionality to
the factory infrastructure.
Using integral constants also improves linking stability.
During object creation netlist tracks the source files which provide
object creation. This is later used e.g. by nltool to create
documentation from source.
- working macro level parameters
- simplified code significantly
- fixed a number of hidden issue
- dead code removal
It is now possible to define netlist level parameters using:
static NETLIST_START(chip)
DEFPARAM(parameter, 123)
RES(R1, $(@.parameter))
....
NETLIST_END()
NETLIST_START(main)
chip(X1)
PARAM(X1.parameter, 1000)
...
NETLIST_END()
This will pass on 1000 to R1 as a parameter.
"@." will resolve to the current namespace. In this case it is X1, thus
"X1.parameter. This is during parsing. During evalution, i.e. device
creation, $(X1.parameter) is evaluated to 1000.
This also means, that global parameters are possible and accessible ...
DEFPARAM(P, 234)
...
RES(R1, $(P))
or going forward
RES(R1, 1000)
CAP(C1, 1.0 / $(R1.R))
This opens up the path to more possibilities ...
static NETLIST_START(DM9456_DIP)
DEFPARAM(MODEL, "74XX")
DM9456_GATE(X1)
DM9456_GATE(X2)
PARAM(X1.MODEL, $(@.MODEL))
PARAM(X2.MODEL, $(@.MODEL))
...
NETLIST_END()
NETLIST_START(main)
DM9456_DIP(X1)
PARAM(X1.MODEL, "LS74XX")
...
NETLIST_END()
The code also has been prepared to allow something along the lines of
LIBENTRY_MODEL(DM74LS00_DIP, DM7400_DIP, "LS74XX")
to define a LS version on top of an DM7400_DIP bare TTL implementation.
This however will need more efforts to existing devices to honour some
timing adjustment in the model definition. It will already honour
different output specifications between LS series and bare TTL if
connected to analog components.
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.
- Fixed some clang lint warnings
- Removed dead code
- Experimental parser code to allow calculations in parameter value.
This already works for compiled netlists. These changes are
currently disabled. Updated pong netlist (and CRC/SHA) to work
with this new code.
- remove pthrow trampline as proposed by Vas.
- identify throwing code by adding noexcept(false)
- move "connected term" information to setup code.
- srcclean
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
- 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.
- 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
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.
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.
- 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
- 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
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.
- 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
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.
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.
- 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.