I have some old testbenches that do not run anymore, i have reduced the problem to the following minimal example:
test parameters in agauss() function
.param nominal=100k var=100
v1 1 0 5
r1 1 0 r='agauss(nominal, var, 1)'
.control
op
run
print i(v1)
quit
.endc
.end
Above example does not run, i get following error due to 'var' parameter in agauss() function:
Circuit: test
Original line no.: 6, new internal line no.: 7:
Syntax error: letter [{]
Original line no.: 6, new internal line no.: 7:
Expression err: {var},1)}
Copies=6 Evals=8 Placeholders=1 Symbols=2 Errors=2
Numparam expansion errors: Run Spice anyway? y/n ?
n
Replacing var with it's actual value in agauss() fixes the problem.
I am not sure if this is a regression or ngspice has always rejected variables
in the second agauss parameter. Parameters are accepted in the first position as shown above.
The same problem happens if the agauss expression is placed in a .param line.
I don't know if this behavior is intended, if this is the case i will change my test cases.
Thank you!
Stefan
Stefan, thanks for your input.
It is a regression, caused by patch
9221df234 ("Patch to allow (and ignore) leading or trailing commas when putting {} around tokens. Tested with PWL voltage source.", 2021-08-18)
I will take care
Holger
I have pushed a fix to ngspice git branch pre-master.
I have tested on my mismatch simulation testbench, everything works again!
Thanks
I have pushed a fix to ngspice git branch pre-master.