Commit Graph

41 Commits

Author SHA1 Message Date
couriersud
9ea6b12ccb netlist: added min and max to pfunction. (nw) 2020-02-16 19:17:32 +01:00
couriersud
2742727a0b netlist: Fix crash in infix function evaluation. (nw) 2020-01-29 18:51:26 +01:00
couriersud
6874b1f7ac netlist: clang lint readability fixes. (nw) 2020-01-25 21:13:21 +01:00
couriersud
9e272e4b55 netlist: code maintenance. (nw)
- remove pthrow trampline as proposed by Vas.
- identify throwing code by adding noexcept(false)
- move "connected term" information to setup code.
- srcclean
2020-01-20 21:15:22 +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
b8c43342d5 netlist: first steps on the way to calculated parameters. [Couriersud]
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
2019-11-10 19:54:26 +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
60379b658a netlist: code maintenance. (nw)
- Separate code out into pmath.h and pstonum.h.
- Fix VC build error
- optimize pfmtlog.h a bit
2019-11-03 23:19:52 +01:00
couriersud
34ccb11c53 netlist: Completed __float128 support. [Couriersud]
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.
2019-11-03 15:25:01 +01:00
couriersud
77ea61bac7 netlist: add RELTOL/VNTOL solver parameters. Type safety. [Couriersud]
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.
2019-11-02 22:25:11 +01:00
couriersud
9fe2af2be1 netlist: fix clang warnings & srcclean. (nw) 2019-10-31 22:07:50 +01:00
couriersud
c6b281685d netlist: Compile with float/double floating point. [Couriersud]
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.
2019-10-31 21:53:50 +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
8f83e4392f netlist: code maintenance (nw)
- clang lint and pedantic fixes
- mat_cr.h: separate solving linear systems from underlying matrix
2019-10-12 19:36:50 +02:00
couriersud
545f8069ef netlist: maintenance and lint fixes. (nw) 2019-10-06 23:50:13 +02:00
couriersud
8734df72ea netlist code maintenance (nw)
- prepare move to c++ streams and later std::string
- fix more lint and clang pedantic warnings/errors
- fix some bugs
2019-09-21 22:15:34 +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
58e6383ada netlist: MB3614 again, function controlled VARCLOCK and other
improvements.

- fix MB3614 parameter
- Added VARCLOCK which derives step size from function
- optimized function handling in CS and VS
- fixed a bug in ppreprocessor
- add trunc to pfunction
- added opamp_amplification_curve to derive characteristic
  amplification curve
2019-04-07 19:09:48 +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
66154af0f2 netlist: fix visibility issues and more issues reported by tidy. (nw) 2019-02-22 21:46:55 +01:00
couriersud
9d8cb783e3 netlist: more core guidelines work. (nw) 2019-02-09 23:07:27 +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
f12f735f54 Fix clang-8 warnings. (nw) 2019-01-11 21:50:43 +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
e9a5e08b41 Fix state saving for pfunction lfsr. (nw) 2017-05-28 09:03:29 +02:00
couriersud
0a2d4a256d Fix issues identified by Vas and LordKale4:
- made local netlists in Cheeky Mouse static
- replace stdlib rand by 16 bit galois lfsr

(nw)
2017-05-27 22:17:35 +02:00
couriersud
994263eaf9 Add rand() function to pfunction expression parser. Use this to simulate
E-B noise in Cheeky Mouse and fix the "cheese" choose. [Couriersud]
2017-05-27 14:28:53 +02:00
couriersud
ac13946ffb Change pstring to use std::string as storage container.
This removes all allocation code from pstring. const_iterator is
consequently now based on pstring::const_iterator. 
Removed pstring_buffer. This was class wasn't a good idea.

Vas was right: This change did not impact runtime performance. Startup
performance (string intensive) increased. (nw)
2017-03-30 22:06:03 +02:00
Vas Crabb
5e8fefbb12 Turn psring iterator into a real forward iterator that works with standard algorithms.
There are a few changes to achieve this:
* Rename to const_iterator since it's immutable
* Typedef iterator to const_iterator for now as there's no mutable iterator
* Add default constrcutor and operator-> required by concept, const-qualify operators
* Remove operator+ and operator+= since it's not a random-access iterator (use std::next and std::advance instead)
* Return reference/pointer to a proxy rather than a code_t value from opertator*/operator->

The final change is required to meet the requirement that operator* for
two equivalent forward iterators return an equivalent reference.  The
pstring doesn't actually contain a sequence of code_t, so there's no way
to return a reference to code_t directly.  Instead, a reference to a
proxy object aliased on the string storage is returned.  The proxy is
implicitly convertible to code_t.  The most noticeable side effect is
that auto c = *s.begin() or for (auto c : s) won't work.  You need to do
for (auto &c : s) or for (code_t c : s) instead.
2017-03-30 15:51:14 +11:00
Couriersud
3c49610274 More cppcheck fixes. (nw) 2017-03-05 16:19:59 +01:00
couriersud
572ca8100f Reorder include order to comply with best practices. (nw) 2017-02-10 21:53:02 +01:00
couriersud
6d2354264a Do not derive other classes from std::vector. More cleanup. (nw) 2017-01-27 15:22:18 +01:00
smf-
1756a54c74 fix for visual studio (nw) 2017-01-26 12:35:48 +00:00
couriersud
25152bd69a Netlist refactoring:
- Refactored netlist pmf code.
- Small optimization for diode calculations. 
- Minor refactoring across the board. (nw)
2017-01-25 22:17:47 +01:00
couriersud
093bda0193 Added infix notation parsing to the function parser. (nw) 2017-01-25 22:17:46 +01:00
couriersud
ca11021d73 Netlist:
- refactored reverse polish notation evaluator into own source files.
- added function parameter to current and voltage sources VS and CS.
  You can now use those to e.g. produce a sine wave.
- Changed code to allow devices to optionally be treated as dynamic or 
  timestepping devices.
[Couriersud]
2017-01-17 01:35:16 +01:00