The implementation also supports nesting.
Opamp emulation now is as easy as
/* Opamp wired as impedance changer */
SUBMODEL(op, opamp)
NET_C(op.GND, GND)
NET_C(op.PLUS, clk)
NET_C(op.MINUS, op.OUT)
The missing bit now is a central submodel repository. I'll start a discussion soon on the list.
nl_examples/opamp.c is an example of a impedance changer stage followed by a 1:2 amplifier stage.
System size (= number of voltage levels to be calculated) is between 20 - 30.
Using a simple, yet better opamp model than usually implemented in the old discrete core, I get
./nltool -f nl_examples/opamp.c -t 30
startup time ==> 0.002
runnning ...
30.000000 seconds emulation took 0.438599 real time ==> 6839.96%
Which leaves quite some buffer to emulate even complex mixing and filtering stages in real-time :-)
- Working Ebers Moll model. That's a significant step ahead.
- Simple 2x2|RHS SPICE stamps now supported by two terminal devices.
This was implicitly contained in the design, but set_mat now shows how
a two-terminal device fits into a SPICE approach.
- Introduced direct solvers for net groups with 1 or 2 nets.
- Introduced specialized solvers for N=1,2,3,4,5 by using templates.
- nice performance increase for BJTs
The examples have a ".c" suffix. In eclipse, I get automatic syntax parsing and error notifications. The parser treats "#" preprocessor defines/includes just as comments.
All of these examples can be run through nltool:
./nltool -f nl_examples/opamp.c -t 1 -l OUT
runs the opamp example for 1 second of emulation time and logs the terminal named "OUT" to "netlist_log_OUT.log".
I'll post a simple script to the list to visualize those logs using gnuplot.