Commit Graph

6613 Commits

Author SHA1 Message Date
Giles Atkinson 2406846a21 Extend the output and partial derivatives of the output from the 2/3-D
table lookup models (XSPICE) continuously outside the defined
rectangle or cube, as it may help convergence and avoid ambiguity caused
by rounding at the boundaries.  See bug #591 "Wrong 2D table model output".
The value is that of the nearest point in the region while the reported
derivative is ramped to zero outside the boundaries.
Also fixes incorrect output at the upper limit in each dimension.
2022-07-24 12:23:15 +02:00
Giles Atkinson ec725c3814 Fix memory leak by moving the state transition table to a STATIC_VAR
whose memory can be recovered by a call back.  Also make cfunc.mod
less ugly.
2022-07-24 12:23:05 +02:00
Holger Vogt 44930ebcb1 Function guess_type may yield the wrong type, because
it does not cover all of the the many, many options possible.
This commit fixes bug597, where [current] was interpreted as
capacitance.
2022-07-24 12:17:29 +02:00
Holger Vogt eee07be10d Improve (a little) the plotting of digital data with plot option digiplot:
Repair scaling on MS Windows:
Suppress y axis lettering and unit:
Allow or dis-allow grid.
2022-07-20 15:11:51 +02:00
Holger Vogt 758ecd1d60 tabs to spaces 2022-07-18 23:29:59 +02:00
Holger Vogt 298eb556cd Make error message more verbose: Instead of only "no such parameter on this device",
give name of bad parameter and respective line in netlist.
2022-07-18 23:28:51 +02:00
Holger Vogt d61682360e Prevent crash when ca or d are not defined. May happen when
.endc is missing.
2022-07-18 23:23:55 +02:00
Holger Vogt b04e3dd89f WinGUI: Add a button 'Stop' to stop a simulation in intercative
or control mode. ngspice enters interactive mode and waits for user
commands. Simulation result vectors are available up to the
(time) point of stopping. Simulation may continue by command
'resume', however now in interactive mode, a control flow stays
interrupted.
2022-07-16 17:27:38 +02:00
Holger Vogt d57909eef1 Re-format cktdojob.c 2022-07-16 17:24:41 +02:00
Holger Vogt 6ee4db9af4 Correct comment: Command circbyline is not involved,
we are sending the netlist as an array.
2022-07-16 17:23:59 +02:00
Holger Vogt 8d91f44026 Suppress I/O redirection for command 'circbyline'.
This enables sending commands like
circbyline btest testnode 0 v=((v(in1) - v(in2)) < 0.1 ? 0.111 : v(in1))
2022-07-16 17:23:11 +02:00
Holger Vogt e3b13e0494 Consecutive tran and ac simulation may lead to gross errors
when TC or scale is used on the instance line of C and L.
Reason is the missing reset when CKTtemp is called once during each
simulation command. TC or scale is then applied again and again,
a reset is missing.

This patch adds a reset, i.e. the capacitance or inductance is
reset to its instance value in a call to *temp. It fixes bug#594.

Command 'alter' has been tested.

Resistance has not been tackled by this bug, because the line
here->RESconduct = here->RESm / (here->RESresist * factor * here->RESscale);
differs from
here->CAPcapac = here->CAPcapac * factor * here->CAPscale;
in that there is no accumulation of correction factors with here->RESconduct
2022-07-08 09:32:34 +02:00
Holger Vogt 72cfc681e5 Move evaluation of statistical functions inside of a B source
to after numparam expansion, thus allow parameters in functions agauss etc.

Replace gettok by new gettok_np to ignore characters ( ) ,
which may be left over after parameter expansion.

This fixes bug 593.
2022-07-06 18:54:34 +02:00
Holger Vogt 905b1eae8c Remove inner couple {...} from {{...}} only when instance is not
a behavioral source which will be translated to a B source.
2022-07-06 18:46:47 +02:00
Holger Vogt 86dedbd1f5 Add a new function char* gettok_np(char** s)
which finds a token, while scanning over (), like
they were white spaces. It also proceeds with s while
still finding (), (which gettok_noparens does not do).
2022-07-06 18:43:48 +02:00
Holger Vogt 474a1e47b8 Avoid jump in phase when crossing 90° boundaries.
Code similar to cx_cph in cmath1.c
2022-07-03 11:28:00 +02:00
Brian Taylor ec6938ed70 There needs to be 2 variants of d0_gff. One for d_dlatch, the other for d_srlatch. 2022-07-01 15:55:26 +02:00
Brian Taylor 6418fe75b7 Clean out dead code in model processing. 2022-07-01 15:55:15 +02:00
Brian Taylor 4c2152c74f Add support for srff. 2022-07-01 15:55:06 +02:00
Brian Taylor b64f684a62 Remove debug code. 2022-07-01 15:55:00 +02:00
Brian Taylor 4d9f834f5e Remove invalid check. 2022-07-01 15:54:45 +02:00
Brian Taylor ca26dc2585 Add optional debug code to check for name collisions. Connector nodes between gates now have a con_ prefix. 2022-07-01 15:54:35 +02:00
Brian Taylor 933b13d544 Prevent multiple d_zero_inv99 models per subckt. 2022-07-01 15:54:27 +02:00
Brian Taylor 5f9146b40a Follow convention, use eq() macro. Show replacement cards when ngdebug=TRUE. 2022-07-01 15:54:18 +02:00
Brian Taylor a7b6cb9af7 Create pin and port lists only when variable ps_pins_and_ports is set != 0. 2022-07-01 15:54:08 +02:00
Brian Taylor 01e988d604 Remove optional:, params:, text: before generating a ports list. 2022-07-01 15:53:56 +02:00
Brian Taylor 9b390c1ca9 Retain the param: section after removing the optional: section from a Pspice subckt declaration. 2022-07-01 15:53:47 +02:00
Brian Taylor 69ef28de4a Add more comments. Move incompatible input name checks to add_..._inout_timing_model() functions for dff, jkff, dltch. 2022-07-01 15:53:19 +02:00
Brian Taylor 3ca14e44ed Add counter test. Check for usage of $d_lo, $d_hi, $d_nc usage with dff, jkff, dltch which will not translate to Xspice. 2022-07-01 15:53:02 +02:00
Brian Taylor ff3a704710 Get rid of -Wpedantic warnings. 2022-07-01 15:52:39 +02:00
Brian Taylor 79625f10f5 Remove debugging asserts. 2022-07-01 15:52:14 +02:00
Brian Taylor 55a5c0cb0a Generate lists of subckt ports indicating direction (in, out, inout.) 2022-07-01 15:52:01 +02:00
Brian Taylor d41bff8373 Stopped memory leak in continuation cards when removing old cards. 2022-07-01 15:51:53 +02:00
Brian Taylor fff87ebb81 Slight cleanup. Some work ensuring that generated names do not collide may be necessary. 2022-07-01 15:51:37 +02:00
Brian Taylor 93d067775f For debug tracing, list the cards before and after udevice replacements. 2022-07-01 15:51:24 +02:00
Brian Taylor de2dc6f1d5 Add pullup/down. Skip spurious '*' line. 2022-07-01 15:51:12 +02:00
Brian Taylor 0513fb5c8f Add support for oa/oai compound gates. 2022-07-01 15:50:46 +02:00
Brian Taylor 63cec9668c Fix a memory leak. Cleanup the code a bit. All-digital Pspice subckts with U* devices for most used gates/ff can be handled. More extensive test cases are necessary. Also, interfacing subckts with analog ports is not implemented. 2022-07-01 15:50:34 +02:00
Brian Taylor 701ed7beb0 Replace Pspice U* and .model cards with their Xspice equivalent statements. There are still memory leaks which will be plugged next. The .subckts have only digital ports, which will need to addressed for mixed A/D designs. 2022-07-01 15:50:22 +02:00
Brian Taylor e27881fe44 Add translation of ao/aoi compound gates. 2022-07-01 15:49:52 +02:00
Brian Taylor 4de648c8de Trial run at scanning cards for Pspice U* devices and models. #define INTEGRATE_UDEVICES to turn it on. No new cards are created yet, just lots of debugging info. 2022-07-01 15:49:39 +02:00
Brian Taylor 4d52539765 Add brief usage notes and makefile. asserts will need to be removed after integration is complete. 2022-07-01 15:49:24 +02:00
Brian Taylor 3e86af3989 Add default zero delay models d0_gate, d0_eff, d0_gff, d0_tgate. Use tprintf. 2022-07-01 15:49:09 +02:00
Brian Taylor 5b332a1aba Initial files for translating Pspice u.. instances and timing models into Xspice equivalents. Standard gates, tristate gates, dff, jkff, dlatch are supported. Compound gates and pullup/down are not done. Makefile and frontend/inpcom.c changes have not been finished. These modifications will be needed to complete integration. 2022-07-01 15:48:43 +02:00
Holger Vogt 8ff547c5da No error message when Optran returned 0 2022-06-30 20:03:58 +02:00
Holger Vogt c9a864933b re-format indmask.c 2022-06-26 11:43:18 +02:00
Holger Vogt 8023402db8 Add missing parameter retrival 2022-06-26 11:40:10 +02:00
Holger Vogt a2d7c342dd Asl Lundin's correction only when suitable modelparameters are given. 2022-06-26 11:39:43 +02:00
Holger Vogt 5e60ef4644 Make warning message on missing init file more verbose. 2022-06-22 22:02:09 +02:00
Holger Vogt 5e1e2bb4b7 remove typo 2022-06-22 22:01:34 +02:00
Holger Vogt 33ec8dfc25 Write out the current in the old fashion
1	v1#branch	current
when keep#branch is set in .spiceinit.
To make the raw file compatible with ICCAP.
2022-06-22 15:32:40 +02:00
Holger Vogt 7d2ea36fdf Add a warning when Lundin's correction factor is not
calculated because the geometries are too small (< 1um).
2022-06-22 15:31:17 +02:00
Holger Vogt 8d2a6c2405 Add coil diameter dia to the inductor parameters.
dia (diameter) takes preference over csect (cross section)
2022-06-22 13:26:57 +02:00
Holger Vogt 10d4b34ec5 Add Lundin's geometry correction to the
inductance formula
2022-06-22 12:59:37 +02:00
Holger Vogt 5f0035ca91 Fix a bug in the inductance formula. 2022-06-20 14:22:55 +02:00
Holger Vogt 6818b52a87 Exit when executing the input fails,
if -o option (log file) is set and not in interactive mode.
Enables running the paranoia suite without hanging if
something goes wrong.
2022-06-19 17:29:05 +02:00
Holger Vogt d02f2feee4 If the 'source' command fails, fall back to the input
only if in interactive mode. Otherwise exit.
2022-06-19 17:25:32 +02:00
Holger Vogt 1da6cc249e Limit the number of messages 'Warning singular matrix: ...' to 6,
if not 'set ngdebug'
2022-06-18 19:56:12 +02:00
Holger Vogt 89fcc20570 Make error message more verbose:
State explicitely when transient op has failed.
2022-06-18 17:05:05 +02:00
Holger Vogt f78adce641 Prevent a crash when line is empty 2022-06-18 17:04:20 +02:00
Holger Vogt eaf8977ba2 Allow 'nulltype', which returns NULL pointer.
Thus prevent a crash in cieq.
2022-06-18 01:06:42 +02:00
Holger Vogt dea9de72dc Rename the internal circuit nodes generated by .probe
to probe_int_xxx to make it probe specific.
Don't save these nodes.
2022-06-18 00:29:48 +02:00
Holger Vogt facbf3b524 Don't save the internal device node collCX, added
for a new quasi-saturation model of bjt
2022-06-18 00:26:33 +02:00
Holger Vogt 1dda42c1a2 When plotting the phase, standard now is "Radiant".
Only with 'set units=degrees" we plot with unit Degree.
2022-06-14 23:14:39 +02:00
Holger Vogt 53e25b735a This is a fix to bug report 589 by Bohdan Tkhir:
Remove only mfg=something, icrating=, vceo=, type=,
not any combination of text like net_type=... .
Restrict this removal to compatibility modes ps or lt.
2022-06-10 15:35:21 +02:00
Holger Vogt f0789ce3e4 not only de-allocate the vector, but also remove it from the list.
This is to prevent a crash when after simulating with a buggy input like:
save all @q1[nonesense] (non-existing parameter) a command 'print all'
is given.
2022-06-10 15:31:52 +02:00
Giles Atkinson 935ed58ce6 Fix bugs found while investigating Bug #585 (convergence failure only
on Linux).  In dctran.c make it impossible for a transient simulation
to run far past its end time and fix an infinite loop attempting to remove
the automatically-inserted ending breakpoint.  In outitf.c fix memory
corruption if the simulation does over-run (change suggested by Holger Vogt).
2022-06-08 16:33:43 +02:00
Holger Vogt 519cb8392c dc sweep fails after transient sim:
keep MODEDCTRANCURVE as provided by commit
7d8236766 ("b3ld.c, b4ld.c, b3v32ld.c: enable capacitance calculation during dc sweep", 2012-10-03)
Instead exclude current integration when MODEDCTRANCURVE is selected.
Unify setting ChargeComputationNeeded in b4vdld.c,
make it as in other b4xxld.c.
2022-06-06 16:27:06 +02:00
Holger Vogt 78728d19ad Add multiplier flag 'm' to behavioral capacitor and inductor 2022-06-01 16:54:12 +02:00
Holger Vogt f16f24d6e8 Prevent crash by checking that the scale vector frequency in ac mode
is a complex vector.
2022-05-29 00:03:36 +02:00
Holger Vogt 75a6392b43 VIN 3 0 PULSE (-1 1 2NS 2NS 2NS 50 NS 100 NS) is now standard
(missing dc value).
So revert the warning message:
VIN 3 0 dc 0 PULSE (-1 1 2NS 2NS 2NS 50 NS 100 NS) yields
a note message (not a warning)
2022-05-19 12:04:44 +02:00
Holger Vogt fa7ca4ad33 Update copyright info to 2022 2022-05-16 16:30:44 +02:00
holger 72d3f12ab5 add new header spardefs.h to noinst_HEADERS 2022-05-16 16:30:26 +02:00
holger 6b06b8ca0d add *.h to the source files
to allow 'make dist' distributing them
2022-05-16 16:30:17 +02:00
Holger Vogt 1140af3e8b Prepare ngspice-37 2022-05-16 16:30:09 +02:00
Holger Vogt 8f4e712a11 Preliminary fix to enable the core model with hysteresis.
Make error message more verbose.
2022-05-16 16:29:08 +02:00
Giles Atkinson fbebfb708c Two memory leaks found interactively with valgrind with safe fixes. 2022-05-10 08:29:54 +01:00
Giles Atkinson 4fd0a68fb2 Fix memory leak found by valgrind/paranoia. 2022-05-10 08:25:28 +01:00
Giles Atkinson 55e8975124 Suppress warning from gcc 10.2.1. 2022-05-09 10:51:18 +02:00
Giles Atkinson 11d6c41a7d Fix memory leaks found by valgrind in the paranoia script. 2022-05-08 17:59:20 +02:00
Giles Atkinson b26be81444 Fix XSPICE memory leaks found by valgrind. 2022-05-08 17:59:11 +02:00
Giles Atkinson 44c68183e8 Further change for #578 "Crash while plotting single complex vector".
Move the check on vector lengths to ensure all cases are covered.
2022-05-03 17:00:11 +02:00
Holger Vogt 074a2a6f11 Fix bug 581, reported by Adam Denton 2022-05-02 20:32:21 +02:00
Holger Vogt 60d349589d Merge branch 'pre-master' of ssh://git.code.sf.net/p/ngspice/ngspice into pre-master 2022-05-02 11:27:01 +02:00
Holger Vogt aeef25efaf Enable compiling the shared ngspice library with S-parameters enabled 2022-05-02 11:26:32 +02:00
dwarning 4a6f61ad5a more logical setup for absurd parameter input 2022-05-02 09:19:08 +02:00
dwarning d692669bb9 prevent crash for absurd parameter input 2022-05-01 17:55:56 +02:00
Holger Vogt 6328f7ac13 Don't use bitwise operators, but logic operators 2022-04-30 23:39:24 +02:00
Holger Vogt c094f2e979 Avoid circular redundant function declaration.
Include vsrcext.h only via vsrcdefs.h, so VSRCinstance is defined.
2022-04-30 23:17:46 +02:00
Holger Vogt 78ffba59d4 Remove unused (preliminary) 2022-04-30 16:58:24 +02:00
Holger Vogt 1576783017 add some missing prototypes 2022-04-30 16:58:01 +02:00
Giles Atkinson e6bbbefa10 Suppress warnings from function pointer casts seen with gcc 10.2.1. 2022-04-30 15:26:57 +02:00
Holger Vogt 01266e48ea Merge branch 'pre-master' of ssh://git.code.sf.net/p/ngspice/ngspice into pre-master 2022-04-29 23:33:42 +02:00
Holger Vogt cf62c69aef remove numerous unsigned int vs. int warnings
by setting all variables to type int.
Remove redundant function declarations by remmoving some includes
in span.c and vsrcdefs.h
In tmalloc convert int to size_t
2022-04-29 23:22:05 +02:00
dwarning bc0f1a7a02 simplification of hicum2 model switches selfheat and nqs 2022-04-29 20:43:33 +02:00
dwarning 6dd5c5ad25 #bug 580: prevent crash in case of hicum2 default parameter set 2022-04-29 18:40:19 +02:00
dwarning 43e7c1eb17 #bug 580: prevent crash in case of hicum2 default parameter set 2022-04-29 18:33:48 +02:00
Holger Vogt ea0cdbd6d7 Set {} to remove compiler warning (VS) 2022-04-29 14:32:11 +02:00
dwarning 8361cd8915 correct pnp type bipolar transistor current convention 2022-04-29 11:07:56 +02:00
Holger Vogt 1edc6b8a51 Fix a bug: remove excess ')' 2022-04-29 09:43:16 +02:00
Holger Vogt 86b22083f4 If XSPICE is not selected, still send CKTspDump(ckt, freq, spPlot),
but without ipc (spPlot instead of undefined acPlot)
2022-04-29 07:21:39 +02:00
Holger Vogt 52d0e69710 Add a note that wrs2p currently is limited to two ports only. 2022-04-28 14:14:13 +02:00
Holger Vogt 1d8dacedaa S-parameters: Replace S11 by S_1_1 etc. to avoid ambiguity
when more than 10 ports are measured.
Update to S-parameter script and command wr2sp
2022-04-28 11:58:21 +02:00
Holger Vogt dcf9c1027a Add new flags to command devhelp:
-type (show parameter types)
-flags (show parameter flags)
Patches provided by Mikolaj Wielgus
2022-04-27 08:46:26 +02:00
Giles Atkinson ce81dd7fd9 Rename a variable so that it does not clash with one in outer scope. 2022-04-25 21:12:57 +02:00
Holger Vogt f12f31bed6 Searching for params: as plain identifier 2022-04-25 16:26:30 +02:00
Holger Vogt 7924af7f22 Remove the special handling of X... device names.
Subcircuit devices are saved with leading X in their names.
2022-04-25 15:18:25 +02:00
Giles Atkinson dd7ec4470d Fix Bug #577 "Zooming iplot drops vectors" and three crashes when
the iplot window is closed during simulation.
2022-04-25 13:53:41 +02:00
Holger Vogt 28a39a51d6 Search for "off" token in device instance lines not with
C standard fcn strstr, but with search_plain_identifier().
Thus allow model names that contain "off" (like offset)
2022-04-25 13:38:37 +02:00
Holger Vogt 7703c2d370 Add a function itoa10 and use it
instead of non-standard itoa.
2022-04-25 13:35:23 +02:00
Holger Vogt 4aa5d784ec When calculating power, we need to exclude thermal nodes
of devices like diodes (d) and MOS (m)
2022-04-25 11:35:29 +02:00
Holger Vogt 458b6cf776 Add flag 'power' to fcn setallvsources()
Add code to calculate the power dissipation in a device
(top level instances, including X (subcircuit) invocations).
2022-04-23 20:07:52 +02:00
Holger Vogt 761da8ad0e revert polarity of current mesurements:
current positive when flowing into device, e.g.
Ic, Ib of a positively biased npn.

Add current measurement for all nodes of a device,
e.g. .probe i(Q1) will measure Ic, Ib, Ie (and Is)
2022-04-22 17:46:55 +02:00
Giles Atkinson 2b1433e968 Fix numerous gcc warnings of duplicate declarations. 2022-04-21 15:48:58 +02:00
Giles Atkinson 724cf4e638 Fix Bug #402 "Crash related to aliases". Do not return freed pointer. 2022-04-21 15:48:50 +02:00
Holger Vogt 2aa950fe9c Remove a conflict between the text variable substitution like
set text = "mytext"
set newtext = new.{$text}
echo $newtext
and the command circbyline, which may have to process strings
containing braces {...} without any change to the string.

Do not call cp_doglob() when command circbyline is executed.
2022-04-19 23:26:26 +02:00
Holger Vogt 7985b05aec make comment more verbose 2022-04-19 23:22:17 +02:00
Holger Vogt ae221a70c2 Remove a typo: runable --> runnable 2022-04-15 10:52:56 +02:00
Holger Vogt cd01f4949e Make error message more verbose 2022-04-11 12:05:54 +02:00
Holger Vogt 9deb9f51d8 In case of resistor valuues r150 (r + integer number),
return 150
R2 n1 n2 r150

In case of r23mod return error = 1 and val = 0, so
r23mod may be read as a model, not an instance parameter
R3 n3 n4 r23mod
2022-04-06 16:01:45 +02:00
Giles Atkinson bf7efb18f9 Fix two crashes caused by trying to plot after circuit parsing failed. 2022-04-06 10:24:23 +02:00
Giles Atkinson e16564edf7 Make "nogrid" plotting option work. The deleted code was in the original
commit, so the reason for it can not be traced.
2022-04-06 10:24:16 +02:00
Holger Vogt df9859a5d0 function deriv: This is just a preliminary fix: prevent a crash
when base > 0.

But when is base supposed to be > 0 ? More invetigation is needed.
2022-04-06 10:13:52 +02:00
Holger Vogt 744eaece69 Patch to avoid false reads and writes due to inconsitent
structs SPAN and NOISEAN.
Prevent using non-initialized variables.
2022-04-04 17:41:28 +02:00
Holger Vogt e33ebe5636 Compile only when RFSPICE is selected in config.h 2022-03-30 15:54:35 +02:00
Holger Vogt d903eb45cd Linking failed on openSUSE Linux gcc:
make the inline functions static to allow linking
2022-03-29 17:50:00 +02:00
Holger Vogt 95e1eaf396 Provide access to the necessary structs like cplx 2022-03-29 16:22:49 +02:00
Holger Vogt 39f43a1b1d add missing noisesp.c 2022-03-29 16:00:10 +02:00
Holger Vogt 8bdcc94b95 Patch suggested by Alessio Cacchiatori at
https://sourceforge.net/p/ngspice/discussion/127605/thread/7a2655c86f/
2022-03-29 15:30:39 +02:00
Alessio Cacciatori abd5b5ea04 S-parameters in ngspice
With this commit the patch provided by Alessio Cacchiatori the S-parameter is completed:
Noise simulation added with C matrix output
Y and Z matrix output enabled

To allow compiling with gcc, the dense.h inline functions have been put into denseinlines.h
2022-03-29 09:06:10 +02:00
Holger Vogt 86132f445d We start not at 0, but use the mean value (given in PARAM2) as
start value
2022-03-28 18:00:14 +02:00
Vadim Kuznetsov e52ea6109a Patch allowing call to S parameter simulation also from .control section by using command 'sp' 2022-03-27 10:40:12 +02:00
Holger Vogt ae3d171d91 Prevent a segfault when the parameter to command 'repeat' is given,
but cannot be evaluetd to a number.
2022-03-21 16:53:37 +01:00
Holger Vogt 714aae3d2f .probe: replace (all) by alli (we only measure all currents) 2022-03-14 10:56:16 +01:00
Holger Vogt dd2eb6c652 Make function search_plain_identifier non-static
Declare info on the compatibility mode as a 'Note'.
2022-03-14 10:54:47 +01:00
Holger Vogt dec3fd0fd9 adding expressions in {} as pwl parameters
not complete, still requires caring about the FIXME above.
2022-03-13 11:39:06 +01:00
Holger Vogt 509c2347cc Remove the "type" declaration from a .model line 2022-03-13 11:24:33 +01:00
Holger Vogt 8dc34b31a2 If XSPICE is not selected, still send CKTspDump(ckt, freq, spPlot),
but without ipc (spPlot instead of undefined acPlot)
2022-03-11 23:34:14 +01:00
Holger Vogt d14ea924b3 Use #ifdef XSPICE to exclude findvec_alle() if
XSPICE is not selected.
2022-03-11 23:32:25 +01:00
Holger Vogt b0a54137a9 exclude 'type=xxx' from model declaration 2022-03-11 23:31:26 +01:00
dwarning e3b6deaf56 remove duplicate pointer allocation 2022-03-06 23:12:34 +01:00
Holger Vogt 31a0f3eaf6 d_pwm: Add a hybrid oscillator (analg control in, digital out) with PWM
(pulse width modulation) capability, oscillation frequency is a parameter.

The model has been derived from the d_osc example.
2022-03-04 11:43:18 +01:00
Holger Vogt f21255ef1b Fix regression bug #579
Accept numbers to ac statement in voltage (current) sources
also given as parameters.
2022-02-22 20:39:20 +01:00
Holger Vogt 20d5919e59 Terminal setting to X11 fails in macOS, and is not required
on Linux.
Setting terminal here is redundant, so remove this setting.
2022-02-22 15:22:21 +01:00
Holger Vogt 12a93c9fe6 Update to plotting of event nodes:
Distance is now 1.5, scaling and cutouts are possible
(with some lack of precision).

Still missing: y axis labeling (no numbers, but node names).
2022-02-21 20:19:56 +01:00
Holger Vogt 342a16d6e1 Add a flag 'alle' (all event nodes) to the plot command (and maybe others).
All event nodes with length greater than 1 are translated to vectors
with a common scale (named step) and are assembled in a new plot
named 'digital'. They may be plotted or otherwise used in a
.control section.
2022-02-21 20:16:20 +01:00
Holger Vogt 0557bc60bf Prevent crash if nsp is evaluated to 0 2022-02-21 16:56:16 +01:00
dwarning 20abe9ca38 white spaces 2022-02-20 14:55:10 +01:00
Holger Vogt 917dab9da7 new flag 'digitop' for the 'plot' command:
Plot digital (event nodes) vertically, separated by 0.1
The grid is adapted acordingly.
set xbrushwidth=3 will yield good results.
2022-02-19 17:25:57 +01:00
Holger Vogt 7130097710 Prevent crash when no simulation has been run and
asking for plotting an event node
2022-02-19 17:23:36 +01:00