Using ngbehaviour=hsa in ngspice 45+ causes multiple errors:
In netlist previously the following was an acceptable voltage source:
v1 1 0 20
v2 2 0 DC 20
v3 2 0 DC=20
Now when using "ngbehaviour=hsa" only "v3" works, this shouldn't be affected by hsa as per documentation the "a" indicates that this only applies for the PDK so this shouldn't affect circuit netlist.
Sky PDK now doesn't work with ngbehaviour=hsa:
Although previously it worked with and without "ngbehaviour=hsa" the pdk recommends using "hsa" compatibility mode, and since error I experinced with dc voltage I figured that probably this was a bug in the new nggspice version.
The command
set ngbehaviour=hsadoes not have any effect, as the correct command is
set ngbehavior=hsaYour example
will lead to an error as you cannot put two voltage sources in parallel (see node 2).
The manual is a bit confusing in that both the US (behavioral) and UK (behavioural) spellings are used. Perhaps we should change the documentation to use "behavioral" everywhere to match the keyword.
@h_vogt
The errors you pointed out are not what I meant, I must have mistyped
Here is a better netlist:
Here is .spiceinit:
Here is ouptut without .spiceinit:
Here is output with .spiceinit:
Ignore the incomplete or empty netlist error, as the same bug occurs with complete netlist.
The error only apears when using parameters
O.k., now I do understand.
The ngspice manual (in chapter 2.11) suggest to putting parameters, which should be substituted, into braces {} or single quotes ' '.
v1 1 0 {dc_bias}
v2 2 0 DC {dc_bias}
v3 3 0 DC={dc_bias}
There is a function inp_quote_params() to add {} or ' ' to unquoted parameters.
With my commit
1aa3fa22f ("No quoting of potential params when comnpatmode is set to hs.", 2026-02-23)
this has been excluded if compatmode hs is set, as it leads to errors in some PDK.
I'll have to check what to do.
Okay great,
but shouldn't this only affect PDKs and not actual circuit as the use of hsa, should only affect PDK, also check if this is the reason sky PDK doesn't work with hsa.
and Generally using params with and without {}/'' causes unforseen bugs.
Please read again the chapter 12.14.1 Compatibility mode, as it is just the other way round.
What are the "unforseen bugs"?
All my tests with Skywater and IHP PDKs are o.k.
Please also have a look at chapter 4 of the manual. Nowhere it is stated that
v3 2 0 DC=20is o.k.. If this is working, it is pure chance and may change without notice.
@h_vogt
I have done some debugging and found out the reason hsa didn't work for me with, sky.
It turns out it doesn't have to do with the sky but the "bugginess" I was taking about.
If I have a mosfet defined as ex:
The previouse example code will run with both hsa and no hsa in ngspice44, but in ngspice45+ this will only work without hsa enabled, as the following two will cause errors:
as the output in termal signfies that the following substion takes place
So this Causes an error.
another error that apears is the following attached : ( I can only add 1 attachemnt and not add pictures for some reason):
when I use SPICE_USERINIT_DIR with path where attachment has .spiceinit, and other files given by sky
I get the outptut:
Mutlitple definitoins of ........
repeated for each device inside libary, this is unexpected behaviour, as it should only look for .spicinit and ignore rest of files.