Commit Graph

96 Commits

Author SHA1 Message Date
couriersud
1c191433ee netlist: improved and fast LM3900 model.
LM3900 model 3 only has half the number of BJTs compared to model 1
but delivers comparable results for Money Money.
Model 3 follows the datasheet.
I left code for Model 0 and 2 in for educational reasons.
2019-04-12 00:44:23 +02:00
couriersud
bd365f5eab Adjusted LM3900 model, fixed clipping in zaccaria. 2019-04-12 00:44:22 +02:00
couriersud
a4f59176e4 netlist: Add more SPICE elements to the conversion code. 2019-04-12 00:44:21 +02:00
Vas Crabb
f70f31731c (nw) suppress side effects, standardise #include guards 2019-04-12 01:49:57 +10: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
couriersud
140dc2237e netlist: TYPE=2 opamp model and MB3614 fixes.
- Untie diode code
- Fix some typos
- add TYPE=2 opamp model which omits output voltage limitation
  Useful for determining causes of non-convergence
- Fix MB3614 opamp parameters to match datasheet
2019-04-07 19:08:33 +02:00
couriersud
980dbcc693 Netlist: Add global parameter to disable semi-conductor capacitance
modelling. [Couriersud]

Added global NETLIST.DEFAULT_MOS_CAPMODEL parameter. Setting this to
zero disables using capitance modelling in mos models.
On a per mos device basis this can be achieved by adding CAPMODEL=0 to
the model definition, e.g. MOSFET(X, "NMOS(CAPMODEL=0)")
Improve MOSFET convergence by using log-stepping.
2019-03-31 22:34:06 +02:00
couriersud
6d17870736 netlist: Timing bug fix. Affects regression tests. [Couriersud]
This fixes a rounding issue in the ptime code. This bug surfaced when I
tested netlist with picosecond resolution in ptime.
This will have a small impact on every driver using netlist. For
breakout, it required to adjust the color overlay.
2019-03-29 19:44:50 +01:00
couriersud
e4ff0d3322 netlist: Improved MOS transistor model. [Couriersud]
This is a significant improvement to the MOS transistor model. It adds
modelling of the Meyer capacitance model.
This is a somewhat academic addition since the effects occur on a
nanosecond time scale and have a huge impact on performance. I plan to
make the capacitance model selectable. Both on a model level as well as
by introducing a global solver parameter.
The model delivers comparable results to LTSpice.
2019-03-29 19:40:39 +01: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
46762510c9 netlist: Added B-E and B-C capacitance to EB model. [Couriersud]
Despite the overhead - two devices more per transistor - this addition
significantly reduces computing time on switching conditions by reducing
the needed Newton-Raphson loops dramatically.
2019-03-17 23:42:08 +01:00
couriersud
43c6cad7dd netlist: Add UJT example for 2N6027. 2019-03-17 15:10:15 +01:00
couriersud
6a770d7086 Doxygen work. How the heck can one enforce a consistent device
documentation? (nw)
2017-02-05 17:19:51 +01:00
couriersud
ee8fed61c2 Some documentation work.
Along the way, set default models for devices missing them. 
Fix standalone makefile to work in mingw environment. (nw)
2017-02-05 17:19:49 +01:00
couriersud
e02d8cad2b Fixed a number of issues:
- Fixed crashes on terminals without nets (i.e. connected to a rail)
- Reviewed "FIXMEs" and corrected some minor ones.
- Made m_cur_analog protected. 
- Fixed pmf delegates to work with msvc.
- More optimizations to the solver code.
- Started work on a better signal pipeline in nlwav
- Only generate documentation for entities which are documented.
[Couriersud]
2017-01-31 22:37:25 +01:00
couriersud
093bda0193 Added infix notation parsing to the function parser. (nw) 2017-01-25 22:17:46 +01:00
couriersud
5cd17c361f Fix seldom used conditional build options.
- Fixed OPENMP compile
  For congo bongo, using Solver.PARALLEL=1 significantly increases
  performance from 270% to 380%. However, this has to be taken
  with a grain of salt. Enabling this on predominantly logic netlists
  can severly kill performance.
- Increased readability of timed queue code.
2017-01-12 23:20:23 +01:00
couriersud
c8c7e9a770 Fix timing issue in CD4538. Add "pow" (power) to the function model.
Minor documentation updates. Slight improvement of gorilla sound. (nw)
2017-01-12 23:20:22 +01:00
couriersud
5b4026d13f - setup_t is owned by netlist_t. Stop being complicated.
- Remove gnd() method. 
- Further simplification.
- Fix potential reset and initialization issues. (nw)
2017-01-12 23:20:21 +01:00
couriersud
e26e327ef9 Rename misleading solver parameters. (nw) 2017-01-08 17:31:25 +01:00
couriersud
d790daa2a7 Remove parameter GS_THRESHOLD. It is now outdated. (nw) 2017-01-08 17:31:24 +01:00
couriersud
f1135f7c4c Work on congo bongo. (nw) 2017-01-06 01:31:34 +01:00
couriersud
6c4236976a Update to input definition file. (nw)
Create congo bongo sounds with 

./nltool -c run -t 10 -i nl_examples/congo_bongo.csv -f
nl_examples/congo_bongo.c -l RO.1

and convert to wav with

./nlwav -i log_RO.1.log -o t.wav

Sounds played are:

GORILLA, BASS_DRUM,CONGA_H, CONGA_L, RIM0 and again GORILLA.
2017-01-04 18:01:18 +01:00
couriersud
4ee3f42d36 Fix bug in 74123. (nw) 2016-12-27 19:36:04 +01:00
couriersud
522362e2d2 Add some files to nl_examples. (nw) 2016-12-24 01:01:17 +01:00
couriersud
caafc0f782 Netlist improvements:
- nltool now accepts -Ddefine=value to pass on to netlists
- improved option handling and added "dummy" options to add grouping and
  examples in help output.
- improved --cmd=listdevices output
- Fix dynamic timestepping. This will work with breakout using real
  capacitor modelling instead of delay devices. Really slow, but very
  useful to calibrate timings.
- Fix an awful bug in timing for delay devices.
- Switched to clang 3.8 and made code compile with
  -Weverything -Werror -Wno-old-style-cast -Wno-padded -Wno-weak-vtables
  -Wno-missing-variable-declarations -Wno-conversion -Wno-c++98-compat
  -Wno-float-equal -Wno-cast-align -Wno-global-constructors
  -Wno-c++98-compat-pedantic -Wno-exit-time-destructors
  -Wno-format-nonliteral -Wno-weak-template-vtables
  This was a helpful exercise since it brought forward some 
  serious issues with implicit constructors. 
[Couriersud]
2016-07-01 02:09:14 +02:00
couriersud
81880659d2 - More code cleanup.
- Dead code removal and minor refactoring.
- Simplify. Align naming with stl. Fix somed pedantic warnings.
- More STL compatability.
- Remove ATTR_HOT and ATTR_COLD. Refactored netlist_time. 
- Fix long standing workaround which would ignore policy of change-only"
propagation.
- Rewrote for loops to use auto : semantics.
- Truthtable cleanup. (nw)
- Get rid of nl_math. Remove nl_util.h and moved contents to
plib/putil.h.
- Fix standalone build. Refactor ptypes.h. 
[Couriersud]
2016-06-07 21:44:15 +02:00
couriersud
1d7b7f59dd Implemented dynamic loading of precompiled solver code. [Couriersud] 2016-04-23 13:54:32 +02:00
couriersud
2762b9f5ac Merge me later 2016-04-18 18:31:49 +02:00
couriersud
d9df811529 Significant speed improvement:
- added a new solver using compressed row format
- fixed sorting

As a result, netlist performance on kidniki nearly doubled. The
performance increase is mainly due to the fact that sorting decreases
the number of operations for gaussian elimination of the kidniki matrix
from ~7800 to 707. In addition, compressed row format improves L1 usage. 
[Couriersud]
2016-04-15 02:09:41 +02:00
couriersud
cd0441b678 Recover from creating solvers by copy paste. Move common code were it
belongs. (nw)
2016-04-15 02:09:41 +02:00
couriersud
4f1ca77643 Moved solver members to proper place. Minor code changes. (nw) 2016-04-15 02:09:26 +02:00
couriersud
b13e02f975 Align with standalone-build. 2016-04-09 12:44:41 +02:00
couriersud
bc936dbc26 Added m62(kidniki) to nl.lua. Started some experiments around parallel
solving of linear equations. This code is not active. Fix kidniki audio
performance. [Couriersud]
2016-04-08 03:30:11 +02:00
couriersud
8eec0786b5 Added woodbury solver to netlist. [Couriersud] 2016-03-29 01:59:51 +02:00
couriersud
628cef3d97 Added some notes about Sherman-Morrison. 2016-03-28 13:48:28 +02:00
couriersud
8c69d3ad15 Fix crash in stat output when no calculations were run 2016-03-28 13:48:27 +02:00
couriersud
93414a8bd7 Fix pivoting and float usage. 2016-03-28 13:03:50 +02:00
couriersud
9d2f61ee92 netlist:
- more code optimization
- hide matrix_solver_t implementation
- use netlist_time for time deltas
2016-03-27 15:41:42 +02:00
couriersud
1a36bfd0eb Fix kidniki sound speed. Make more class members private. 2016-03-26 16:17:39 +01:00
couriersud
489e2919db Netlist: code maintenance
- rename netlist_analog_t to analog_t 
- straighten object model
- reduce access to member variables
- use pvector<analog_net_t::list_t> for groups.
- simple coverity fixes.
2016-03-23 22:03:26 +01:00
couriersud
41c8a9f6fa netlist updates:
- First steps to move towards c++11.
- Base plist on std::vector
- Replace pstack with std::stack
- Remove pnamed_list
- use c++ "for each" in a number of places
- Fixed two "time bombs"
[couriersud]
2016-03-14 20:24:29 +01:00
Miodrag Milanovic
823b8cbc1c Add license to files that were not part of build or are containing data to build sources for cpu emulation (nw) 2016-03-05 10:29:28 +01:00
couriersud
1d875f33fe Increase performance from 53% to 69% for matrix size around 30x30. These
matrices are e.g. used in congo bongo without optimisation. (nw)
2015-08-21 01:35:30 +02:00
couriersud
eacd7ef4b2 Converted USE_PIVOT into runtime option PIVOT. Fixed some issues for
nl_double == float. (nw)
2015-08-21 01:35:29 +02:00
couriersud
7b15a99c4b utf8 support for pstring. Opted for a scalable solution which should be
easily extensible to utf16 and utf32 as well. All position related
operations now operate on char code positions instead of byte positions.
[Couriersud]
2015-08-10 22:35:18 +02:00
couriersud
9526556bf8 Improve MB3614 parameters. Changed some opamps to type "idealized" (type
1) in Congo Bongo netlist and got 50% speed improvement.
2015-07-29 23:15:43 +02:00
couriersud
f17cd2d9ca Added a input control file for congo bongo netlist.
This file is a standard csv file specifing times and values of parameter
modifications for specified devices. This file triggers the various
sound inputs using a 10ms impulse.

Use

 ./nltool -f nl_examples/congo_bongo.c -t 8 -l RO.1 -i
nl_examples/congo_bongo.csv
 
to create a netlist log file of the congo bongo mixer stage.

Use

./nlwav -i netlist.log_RO.1.log -o tt.wav -a 17000

to create a wav file tt.wav from the log file using an amplification
factor of 17000.

[Couriersud]
2015-07-26 23:34:01 +02:00