Menu

#564 parameter in AGAUSS function

v1.0 (example)
closed-fixed
numparam (1)
5
2021-12-10
2021-11-29
stefan
No

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

Discussion

  • Holger Vogt

    Holger Vogt - 2021-11-29

    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

     
  • Holger Vogt

    Holger Vogt - 2021-11-29
    • status: open --> open-accepted
     
  • Holger Vogt

    Holger Vogt - 2021-12-09
    • status: open-accepted --> open-fixed
     
  • Holger Vogt

    Holger Vogt - 2021-12-09

    I have pushed a fix to ngspice git branch pre-master.

     
  • stefan

    stefan - 2021-12-09

    I have tested on my mismatch simulation testbench, everything works again!
    Thanks

     
  • Holger Vogt

    Holger Vogt - 2021-12-10
    • status: open-fixed --> closed-fixed
     
  • Holger Vogt

    Holger Vogt - 2021-12-10

    I have pushed a fix to ngspice git branch pre-master.

     

Log in to post a comment.

MongoDB Logo MongoDB