Bug: PWL file=*.wav prevents .func resolution in behavioral source
I found what appears to be a parsing issue involving:
- A voltage source using a WAV file as PWL input
- A behavioral source
- A user-defined
.func
The behavioral source and function work correctly when the voltage source uses chirp or other directive sine etc… Replacing the source with PWL file=sweep.wav:1 causes QSPICE to report that the function does not exist.
QSPICE version/build: July 23
Working case
* this_works.qsch
V1 1 0 chirp 1 0 20 3 2K log
B1 out 0 V=foo(v(2))
R1 2 0 1K
V2 2 1 0
.tran 500m
.func foo(X)=x**2
.end
* this_works_too.qsch
V1 1 0 PWL file=sweep.wav:1
B1 out 0 V=v(2)
R1 2 0 1K
V2 2 1 0
.tran 500m
.end
This netlist runs successfully.
Failing case
* Failing.qsch
V1 1 0 PWL file=sweep.wav:1
B1 out 0 V=foo(v(2))
R1 2 0 1K
V2 2 1 0
.tran 500m
.func foo(x)=x**2
.end
The output window reports:
Fatal error: Error: no such function 'foo'
The problem occured while parsing the line:
B1 OUT 0 V=FOO(V(2))
It appears that using a WAV-backed PWL voltage source prevents the .func declaration from being recognized by the behavioral source.
The WAV source itself works when the behavioral expression does not call the user-defined function.
Can anyone confirm whether this is reproducible?
