Commit Graph

945 Commits

Author SHA1 Message Date
Brian Taylor 528c50dc46 Retain the param: section after removing the optional: section from a Pspice subckt declaration. 2022-10-07 12:53:41 +02:00
Brian Taylor bc8d67d5fa Generate lists of subckt ports indicating direction (in, out, inout.) 2022-10-07 12:51:33 +02:00
Brian Taylor 1fb533a3d4 Stopped memory leak in continuation cards when removing old cards. 2022-10-07 12:51:18 +02:00
Brian Taylor 219ca23635 For debug tracing, list the cards before and after udevice replacements. 2022-10-07 12:50:51 +02:00
Brian Taylor 18e17cefdf Add pullup/down. Skip spurious '*' line. 2022-10-07 12:50:30 +02:00
Brian Taylor 7b5c780043 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-10-07 12:49:46 +02:00
Brian Taylor 96a1b528fd 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-10-07 12:49:29 +02:00
Brian Taylor a2fd346b1a 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-10-07 12:48:51 +02:00
Holger Vogt 1e304c6e53 Prevent a crash when line is empty 2022-10-07 11:34:39 +02:00
Holger Vogt eb79e91175 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-10-07 11:32:56 +02:00
Holger Vogt 838ad2b10c Add multiplier flag 'm' to behavioral capacitor and inductor 2022-10-07 11:30:25 +02:00
Holger Vogt b6abcb0436 Searching for params: as plain identifier 2022-04-26 10:37:19 +02:00
Holger Vogt 0be163d8d8 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-26 10:36:24 +02:00
Holger Vogt 4cc6222230 Make function search_plain_identifier non-static
Declare info on the compatibility mode as a 'Note'.
2022-04-25 21:29:25 +02:00
Holger Vogt 696736b2b3 adding expressions in {} as pwl parameters
not complete, still requires caring about the FIXME above.
2022-04-25 21:28:52 +02:00
Holger Vogt 242a1d796a Remove the "type" declaration from a .model line 2022-04-25 21:28:32 +02: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 0eb272243f Enable RKM notation also for inductors (e.g. 1u2 for 1.2u) 2022-02-07 16:00:29 +01:00
Holger Vogt 632f8c033d Make numoparam error messages more user friendly.
Add line number of netlist to the message.

Original line number added to new lines in inpcom.c.
Internal error messages only when 'ngdebug' is set
2022-01-15 13:43:26 +01:00
Holger Vogt c4e94cd59b safeguard against a crash when the s line is buggy 2022-01-12 15:16:06 +01:00
Holger Vogt b636017359 add function prototype
for insert_new_line()
2021-12-13 22:09:17 +01:00
Holger Vogt 422719200e re-enable parameters in agauss function
fixes bug #564 reported by Stefan Schippers

If nested braces {..{  }...} have been created,
replace the inner { } by ( )
2021-12-13 21:49:18 +01:00
Holger Vogt b749e62e31 Make error message more verbose 2021-12-13 21:48:29 +01:00
Holger Vogt 9dff15507d .probe: Add call to function inp_probe() which resides
in inpc_probe.c.

Make function insert_new_line() non-static

Enable detecting the number of nodes in x-lines
(calls to subciruits) in function get_number_terminals()
2021-12-13 21:47:27 +01:00
Holger Vogt 3f3936c728 Remove memory leaks 2021-12-13 21:34:07 +01:00
Holger Vogt d6038ea43c Redo the transformation vswitch -> pswitch
Parsing takes default values into account, when
parameter is missing.
S vswitch --> pswitch code model
S_ST vswitch (with hysreresis) --> SW switch
S iswitch --> aswitch code model
S_ST iswitch (with hysreresis) --> CSW switch

Use string handling for replacements: allow parameter
equations in .model lines.
2021-10-29 16:37:19 +02:00
Holger Vogt a87b237bff is_a_modelname() to detect a model 1N4148, if compt LT is set.
Rewrite is_a_modelname(), when LT is set: only check element lines
beginning with r and c for RKM notation of a number.

So don't use a RKM number (e.g. 4k7) for naming a resistor model.
2021-10-05 18:01:53 +02:00
Holger Vogt 6f6f2b8996 Remove double assigment to s[1]
Assignment Is either done in the loop or by *y = '\0';
2021-09-29 20:31:22 +02:00
Holger Vogt df5e7e36f6 When checking for µ, truncated the line, when shifted.
Enable R470, when newcompat LT is selected.
2021-09-29 20:30:53 +02:00
Holger Vogt 3dcc36c1c3 ngspice input deck may contain special characters like µ (mu).
Detect mu for ANSI and UTF-8 and translate it to u.
2021-09-29 20:30:35 +02:00
Holger Vogt 601287e949 Check V and I lines for dc and ac.
Allow ac without parameters, a default is set to ac ( 1 0 )
2021-09-29 20:28:15 +02:00
Brian Taylor 81df6ed772 Retaining the mixed case of Cider quoted string valued parameters. Limit searches for ic.file to D*, M*, and Q* device instantiation lines. Cider model (numos, numd, nbjt) detection is limited to .model lines. Continuation lines which do contain these tokens are not checked, but this should rarely happen. All of the examples/cider circuits meet these assumptions. Memory errors have been removed. 2021-09-29 20:27:29 +02:00
Holger Vogt 3599c189b6 re-enable lower-casing of tokens beginning with 'cd',
except for command 'cd' which is usually followed by a space.
2021-09-29 20:27:05 +02:00
Brian Taylor abad190b38 Don't search for ic.file within comments. 2021-09-29 20:23:26 +02:00
Brian Taylor b3a99f0c6c Do not use non-portable strcasestr. 2021-09-29 20:23:08 +02:00
Brian Taylor 663a79dea8 Fix NAN error in numd2 area report and crashes when a doping file is missing. Update examples/cider so that the test circuits all run; add case sensitivity tests for rootfile and ic.file parameter strings enclosed in a single pair of double quotes. 2021-09-29 20:22:56 +02:00
Holger Vogt 9221df234c Patch to allow (and ignore) leading or trailing commas
when putting {} around tokens. Tested with PWL voltage source.

Patch has been suggested by Liqian Zhang
2021-09-29 19:58:36 +02:00
Holger Vogt 9cc9c56cad Don't write past '\0', fixes a bug in commit
1c5e0d11d ("If there is a XSPICE code model .model line with
file input, keep quotes and case for the file path.", 2021-07-15)
2021-07-18 11:19:51 +02:00
Holger Vogt b7473a33a0 Check for double '{', replace the inner '{', '}' by '(', ')'
in .subckt or .model (which both may stem from external sources)
2021-07-18 10:29:16 +02:00
Holger Vogt 1c5e0d11dd If there is a XSPICE code model .model line
with file input, keep quotes and case for the file path.
2021-07-16 10:52:54 +02:00
Holger Vogt 15a3ed87c0 Enable the m parameter in E, G, B, R behavioral source/devices 2021-07-16 10:52:21 +02:00
Holger Vogt ae72677cc2 Remove a false read when curr_line has
already been invalidated.
2021-07-05 19:43:25 +02:00
Holger Vogt 0f25c25c7e Remove a memory leak
Make inp_rem_levels non-static
and use it to remove 'root' after it has been used.
2021-07-05 19:42:14 +02:00
Holger Vogt 93ddc7a3eb Enhancement for E source with table, convert to B source with pwl:
Add G source
Allow 'table' also being part of a parameter name like 'table_something'
2021-07-05 14:32:34 +02:00
Holger Vogt 76eac5aa0f Make error message more verbode 2021-07-05 14:30:35 +02:00
Holger Vogt a4be66b9b0 Prevent crash if there is bad syntax in h, g, e, or f line 2021-07-05 14:30:26 +02:00
Holger Vogt 31fbf910af Crash when trying to delete root and netlist:
Revert the order of deletion: Firstly the root, then the netlist.
2021-07-05 14:30:08 +02:00
Holger Vogt 858689d206 Make syntax check for nesting of .subckt ... .ends more verbose:
Try to find out where .subckt/.ends may be doubled, or missing.
2021-07-05 14:29:50 +02:00
Holger Vogt 52b5e218c7 Add '\f' to characters to be replace by '+'
during the syntax check of an netlist input file.
2021-07-05 14:29:35 +02:00
Holger Vogt dcde7b590e Don't put brackets around dtemp and temp, when they denote
instance parameters and thus are on the left hand side of '='
2021-07-05 14:28:39 +02:00