Commit Graph

1065 Commits

Author SHA1 Message Date
Holger Vogt 4d2e8a012b Prevent crash if file cannot be opened. 2025-06-13 00:11:09 +02:00
Holger Vogt 073acb5a16 Fixes a bug introduced by
317378085 ("Tidy code in get_number_terminals(), removing unneeded copying.", 2025-02-25)
2025-06-13 00:11:08 +02:00
Brian Taylor 5d48d66976 Fix some compiler warnings when -Wextra is added to CFLAGS. 2025-06-13 00:11:08 +02:00
Giles Atkinson db92688f54 Fix Bug #750 - "VDMOS Model Naming Rules in NGSPICE Cause Confusion."
Recognise VDMOS as a special keyword only as the third token in a
.model line.  A new function, skip_token(), included in the change
allows simplification of some existing code.
2025-04-29 11:37:20 +02:00
Holger Vogt f4963b1ada MS Windows: Get a canonical paths name: Important if
path length exceeds MAX_PATH, might happen when using  PDKs

Patch provided by  kreijstal
2025-04-12 18:12:54 +02:00
Holger Vogt c264b71e22 re-enable adding variables (path names) to list variable "sourcepath" 2025-04-10 23:59:22 +02:00
Holger Vogt 3bf94321e6 Improved error message, not using internal 'circbyline' 2025-04-10 23:51:34 +02:00
Giles Atkinson 83d3890490 Fix a bug where a node name is mis-identified as the model for
an OSDI device and remove a limit on node count.
Problem was reported by user Sam in ngspice-users.
2025-03-01 13:45:01 +01:00
Giles Atkinson 317378085b Tidy code in get_number_terminals(), removing unneeded copying. 2025-03-01 13:44:50 +01:00
Holger Vogt d7cb5c92ba Add a section without source info to the debug output.
Truncate .model lines in this section, as .model lines with
several hundred parameters may mask the relevant information.
2025-02-09 19:54:08 +01:00
Holger Vogt b3460a7d23 Allow m parameter for B source with current output
Fixes bug no. 734
2025-01-17 14:08:17 +01:00
Holger Vogt 212660c7e9 Add to debug-out.txt an output without source file information.
Thus cluttering the view is reduced.
2025-01-10 15:15:58 +01:00
Holger Vogt 539ade0f38 If C= or Q= is omitted in the instance line of a behavioral capacitor,
select as default the C= formulation, not the Q= formula..
2025-01-10 10:59:56 +01:00
Holger Vogt ce8480c690 Enable improved error message with nested .include. 2024-12-28 14:43:01 +01:00
Holger Vogt c7ee676e3d Improve the error message by hinting to the source of the error. 2024-12-28 14:42:49 +01:00
Holger Vogt a4e443fcce precautionary prevent passing instances which internally have got
upper case lettering. Removes a crash reported in
https://gitlab.com/kicad/code/kicad/-/issues/18648.
2024-12-27 11:18:00 +01:00
Holger Vogt ffde17441b Don't quote the subcircuit name in an X line 2024-12-27 11:15:09 +01:00
Holger Vogt 1e4a6ac8b8 avoid memory leak by appending, not prepending the word 2024-12-15 10:29:32 +01:00
Holger Vogt a6ad2470f1 Add a flag compmod to struct card.
Set compmod to 1 if netlist line is included by command 'incpslt'
Guard special newcompat.hs sections by compmod
2024-12-15 10:29:23 +01:00
Holger Vogt 8b5a046cdb Remove again, not needed 2024-12-15 10:26:20 +01:00
Holger Vogt deb3cd9809 Replace all BOOLEAN, BOOL, _Bool by bool
Remove all #undef bool (set in conjunction with #iclude <Windows.h>)
2024-12-15 10:25:28 +01:00
Holger Vogt 660b183ad0 Revise check for '.probe alli' and event nodes:
Bail out, don't run any sim, don't change variable
'auto_bridge'.
2024-12-06 22:49:40 +01:00
Holger Vogt 2db9533380 Enable strings as parameters across subckt boundaries
by keeping the quotes and excluding {} around the string token.
2024-12-06 22:48:15 +01:00
Holger Vogt a45c1500a6 Remove 512 char limit of sourcepath variable.
Make attaching new path more efficient.
2024-12-06 22:43:00 +01:00
Holger Vogt 793fca6e2a If preprocessing is skipped, we still need the number of lines in the deck. 2024-11-02 22:45:45 +01:00
Holger Vogt d5f0c6598f Fix commit 09685dde1
("Set lower case for variables or vectors in command 'echo'.
Tokens starting with '$' will get lower-casing.", 2024-09-07)

Don't use s as name for temporary string, as s has been set
already and is used later.
2024-11-02 22:39:03 +01:00
Holger Vogt b62528d7e5 Set lower case for variables or vectors in command 'echo'.
Tokens starting with '$' will get lower-casing.
2024-11-02 22:38:49 +01:00
Holger Vogt 8e8716abc7 Fix warning message 2024-11-02 22:37:12 +01:00
Holger Vogt c2c35b56a4 More on verbose error and warning messages 2024-11-02 22:36:46 +01:00
Holger Vogt c33fd66a21 Make error messages more verbose:
add line number and source file name.
2024-11-02 22:36:11 +01:00
Holger Vogt 295be20859 Remove sourceinfo upon shared ngspice reset.
Remove memory leaks.
2024-11-02 22:28:21 +01:00
Holger Vogt 14bb63490c Plug a memory leak 2024-06-22 16:33:53 +02:00
Brian Taylor d01868b725 Cleanup gcc compiler warnings. 2024-06-22 14:23:50 +02:00
Holger Vogt b1795dbcf2 add path or filepath (without file name) to variable sourcepath,
when calling command 'source'
2024-06-22 14:23:41 +02:00
Holger Vogt 74fc096bfd Enable coupling of more than 2 inductots in a single line:
K1 L1 L2 L3 L4 L5 0.99
2024-06-22 14:20:33 +02:00
Holger Vogt ee39d678b7 Improve comment 2024-06-22 14:20:01 +02:00
Holger Vogt ace47103e7 Search path for .lib and .include has been enhanced to read complete
or partial paths from environmental variables. The env variable
names have to start with '$' as the first character after the .inc
or .lib token. Two consecutive env variables are possible. They are
read each until directory separator '/' or '\\', or if none is found,
until the end of the line. In this case the filename has to be included
in the env variable. A .lib line may look like
.lib "$ENVS1\$ENVS2/libraries\sky130_fd_pr\latest\models\sky130.lib.spice" tt

If an env variable is read successfully, a ngspice variable with
the same name (without leading '$') and contents is defined for
use in a .control section.
2024-06-22 14:19:48 +02:00
Holger Vogt 2f5b869979 Issue this warning only when 'set ngdebug' is given. 2024-05-14 16:32:45 +02:00
Holger Vogt b660e75504 Save path to .include file, add it to the search paths
for loading the next .include file.

If input directory dir_name is not set when loading .include files,
set it to the first .include found.

Both instruction add to the search paths for file to be inluded
and are valuable when the netlist is sent by circbyline without
input file involved.
2024-05-14 16:32:27 +02:00
Holger Vogt 3f2673a2be Clear the variable before checking anew if it is to be set. 2024-05-14 16:31:57 +02:00
Holger Vogt 97d9f38421 Add (enhanced) patch by Giles Atkinson
Add controlled_exit() to errors when parsing functions.
Add verbose error messages, including line number and
name of the source file.

.lib file handlinmg with its recursive structure probably needs
testing and improvements.

More error messages may need this update.
2024-05-14 16:30:36 +02:00
Holger Vogt 862aa27713 Add linum_orig and linesource to commented out *include line 2024-05-14 16:30:27 +02:00
Holger Vogt 63d496b564 New parameter char *linesource for fcn insert_new_line
Make Fcn inp_read in inpcom.c static
2024-05-14 16:29:51 +02:00
Holger Vogt c4cbc40a3b Add file_name to fcn inp_read
Add wordlist sourceinfo to store input sources
path/file, internal, etc.)
debug_out.txt adds line info (var. sourcelineinfo)
Add sourcelineinfo to wordlist sourceinfo and to each new line.
When adding lines due to compatibility handling, use existing
linenum_orig and linesource.
2024-05-14 16:29:34 +02:00
Giles Atkinson b2c0f85c6d Prevent lines beginning '#' in .include files from being treated
as device lines.
2024-05-01 10:55:26 +02:00
Holger Vogt a48b1f8f46 allow compiling with CIDER deselected 2024-05-01 10:32:54 +02:00
Holger Vogt 39b5ea0d3f no lower casing for file input paths 2024-05-01 10:32:23 +02:00
Holger Vogt e561249e9b fix a bug in the ={par({...})} function.
The replacement did not happen correctly.
2024-03-29 17:19:48 +01:00
Holger Vogt adb38ecb17 Upon error, bail out when strict_error is set. 2024-03-10 21:58:56 +01:00
Holger Vogt a0bddf872d Fix dd7b9ff27
("Avoid memory crash when reading old VDMOS models.
Enable both old and current model format.",
2023-12-30)
2024-01-15 11:10:50 +01:00