Commit Graph

110 Commits

Author SHA1 Message Date
couriersud
88edd7c665 netlist: code cleanup and development stage tristate [Couriersud]
Code cleanup to better separate the following stages:

- parsing
- setup
- run

In addition preliminary native tristate support was added. Not yet
production ready, please don't use it.
2020-05-15 13:09:22 +02:00
couriersud
b2c40086e6 netlist: Add two noise sources. [Couriersud]
The two sources act as voltage sources, though noise may also be
injected as conductivy or current noise.

SYS_NOISE_MT_U: Mersenne Twister uniform noise
SYS_NOISE_MT_N: Mersenne Twister normal noise

nld_sys_noise is templated:

	using NETLIB_NAME(sys_noise_mt_u) =
		NETLIB_NAME(sys_noise)<plib::mt19937_64,
plib::uniform_distribution_t>;

Thus the approach is scalable. The implementation is state save aware,
and thus reproducible results are guaranteed.

An example use case is provided as well, see examples/noise.cpp.
2020-05-03 17:23:50 +02:00
couriersud
9dd0b48b3e netlist: add 393 to netlist.lua (nw) 2020-05-01 10:23:08 +02:00
couriersud
13f6e92cec netlist: Add the NE566 as a macro device. [Couriersud]
The device can be found in nlm_other.cpp.
Removed nld_ne566.*
Added SYS_SW, SYS_SW2 and SYS_COMP. These are single switch,
alternating switch and a analog comparator with digital outputs.
Renamed RES_SWITCH to SYS_SW.
Added example ne566.cpp in netlist/examples.
2020-05-01 10:04:22 +02:00
couriersud
184c198a88 Fixed indenting in netlist.lua. (nw) 2020-04-29 16:00:35 +02:00
couriersud
c782a0ef33 netlist: add NE566 to netlist.lua. (nw) 2020-04-29 14:38:58 +02:00
Vas Crabb
8a923f9361 srcclean and manual cleanup (nw) 2020-04-26 12:04:54 +10:00
couriersud
0054862e3c netlist: compile time improvement and code maintenance. (nw)
Added a define NL_USE_ACADEMIC_SOLVERS and disabled it in the build.
This will not compile in solvers which are either illustrative or only
perform for large sparse matrices like GMRES.
2020-04-19 16:08:43 +02:00
couriersud
5b6013caea netlist: improve performance up to 65% on audio netlists. [Couriersud]
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.
2020-04-13 21:32:00 +02:00
Vas Crabb
a7fec751ed srcclean, manual adjustments (nw) 2020-01-26 12:39:27 +11:00
couriersud
42d351a4eb netlist: New devices and some fixes. [Couriersud]
- add CD4006 and CD4070 devices
- add TL084 opamp model
- Clock now supports proxies, i.e. can be connected to
  analog devices.
- Fixed netlists using CLOCK
- added some comments
- removed a forgotten header file.
2020-01-25 15:26:59 +01:00
Vas Crabb
e64edf6c71 srcclean and indentation cleanup (nw) 2019-11-24 13:52:11 +11:00
MooglyGuy
6d9e191488 -netlist: Added 7442 4-Line BCD to 10-Line Decimal Decoder. [Ryan Holtz] 2019-11-23 13:52:24 +01:00
MooglyGuy
2aa304ebc7 -netlist: Added 7492 Divide-by-12 Counter. [Ryan Holtz] 2019-11-23 12:43:30 +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
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
Vas Crabb
32868b8e2a srcclean (nw) 2019-10-26 10:40:50 +11:00
couriersud
db318046c4 Netlist: code maintenance and bug fixes. (nw)
- 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
2019-10-17 10:21:00 +02: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
cc8114f394 netlist: less cpp - more headers (nw)
- move more code in headers - delete some cpp files.
2019-09-29 00:31:30 +02:00
Vas Crabb
626b566fee srcclean (nw) 2019-05-26 13:10:03 +10:00
couriersud
8eb674abc0 Added nld_generic_models.h to netlist.lua. (nw) 2019-03-31 23:49:03 +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
39a7c420b1 netlist: add MOSFET model. [Couriersud]
- added MOSFET model. Currently capacitances are not modelled.
  This is a 3-pin model (Bulk connected to Source) with provisions to
  extend it to 4-pin at a later stage.
- Add a capacitor generic model which is charge conserving.
  Switch netlist to use this model instead of constant capacity model.
- Start putting constants into a central place.

Please expect minor timing differences due to a different numerical
path.
The cmos inverter example illustrates the analog implementation of a
cmos inverter gate. These were used a lot back in the 70s/80s to
generate sinus waves. The model should also be able to better emulate
4066 analog switches.
The addition of a relatively simple capacitor model is planned at a
later stage.
Expect everything from the MOSFET model at the current stage. Wrong
results as well as convergence issues and crashes.
2019-03-25 21:45:37 +01:00
couriersud
672f9b092a Move ptime struct into plib namespace and fix relative includes. (nw) 2019-02-23 18:54:27 +01:00
cam900
9e495a17eb
scripts/src/netlist.lua : Fix spacing 2019-02-14 06:48:56 +09:00
couriersud
fb685c05b9 netlist: memory allocation clean-up. (nw) 2019-02-13 22:37:07 +01:00
Sergey Svishchev
737093be1e netlist wip: 7474, 7497, test driver 2019-01-07 22:33:54 +03:00
Felipe Corrêa da Silva Sanches
e88ec6a7a5 A large portion of the Atari Gran Trak 10 schematics (1974)
implemented on MAME using the netlist subsystem.
2018-07-28 11:37:12 -03:00
Vas Crabb
e892661905 srcclean (nw) 2017-05-28 13:40:48 +10:00
Vas Crabb
2d4ba2471d netlist: add a crude TTL schmitt trigger model and hook up in 1B11142
sound board, completing the tromba circuit

(nw) I'm not sure whether the model works properly or not, but in the
circuit where it's used, I don't think it can work properly with the
current TTL output model.  A capacitor is charged by the Q output of a
74LS74 flipflop (U3A) until the voltage passes the Schmitt trigger's
threshold, causing it to reset the flipflop.  However, the positive
trigger voltage of the Schmitt trigger is 1.6V, but our TTL output model
has a high output voltage of 1.0V (see nl_base.cpp:89).  I realise the
simplified model of TTL logic with high impedance inputs and outputs
behaving as though thery're loaded is convenient and fast to simulate,
but it's not detailed enough for applications like this where
7400-series chips are used in analog circuitry.  This is what held me up
last time I tried adding a netlist for this sound board.
2017-05-27 18:44:23 +10:00
couriersud
bc29593982 Netlist refactoring:
- OPENMP refactored. All OPENMP operations are now templatized in pomp.h
- We don't need thread-safe priority queue. Event code updating analog
outputs now runs outside the parallel code. 
(nw)
2017-05-27 00:11:14 +02:00
Vas Crabb
8f15315a52 srcclean (nw) 2017-02-19 11:40:55 +11:00
R. Belmont
7b193346a8 Merge pull request #2068 from JoakimLarsson/prodigy_display
Prodigy display
2017-02-17 21:59:51 -05: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
Joakim Larsson Edstrom
520e693dc2 prodigy: added new devices to script files 2017-02-17 09:05:30 +01:00
couriersud
9a71daa2e0 Make windows builds of nltool and nlwav understand unicode.
nltool and nlwav now use wmain, i.e. UNICODE main on windows. (nw)
2017-02-10 21:53:01 +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
couriersud
5c88873a87 Cleanup of includes. (nw) 2017-01-27 15:22:17 +01:00
Vas Crabb
edf64df1db srcclean (nw) 2017-01-22 15:37:37 +11: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
couriersud
674077f89f Prepare source for consistent error message usage. (nw) 2017-01-14 16:35:57 +01:00
couriersud
9d3d07b771 Move netlists into macro folder. (nw) 2017-01-09 00:28:31 +01:00
couriersud
02c3f45bff Fix clang "-Wno-weak-vtables" warnings in netlist source. Refactored
code along the way. (nw)
2017-01-05 01:43:31 +01:00
couriersud
78ef96336e Added SIGFPE enabling code to plib/pexception.*. Moved plib exceptions
into these files as well. The code uses <cfenv> which is part of c++11
standard. Non-standard glib extensions are currently only used on linux
and (i386 or x86_64). (nw)
2017-01-04 18:01:22 +01:00
couriersud
63f4e52dae Moved proxy code into separate file. (nw) 2016-12-28 13:48:48 +01:00
MooglyGuy
fbb8ee0fe8 -netlist: Added 82S123 256-bit (32x8) TTL bipolar PROM. [Ryan Holtz] 2016-12-24 22:09:59 +01:00
therealmogminer@gmail.com
9c4c4d0a5b -netlist: Added 82S126 4kbit (512x8) TTL bipolar PROM. [Ryan Holtz] 2016-12-23 23:29:45 +01:00