Hi,
-
QSPICE sometimes ignores the last point in a PWL repeat statement.
But produces:
If the last time/value point in a PWL repeat sequence has the same value as the previous point, QSPICE ignores that point. In the sequencepwl repeat for 3 0 1 1 2 2 1 5 1 endrepeat
the last point is intended to space the repeated pulses out.
The PWL sequence should result in:
-
A space before a closing parentheses causes the PWL expression to fail
The statementpwl repeat for (3 0 1 1 2 2 1 5 1 ) endrepeat
fails with: Fatal error: Trouble parsing “PWL REPEAT FOR…ENDREPEAT” syntax.
If the space is removed it works. -
Parameters in a PWL Repeat expression cause a fatal error
Given parameters
.param frequency = 100
.param period 1/frequency
.param mark 0.25
.param t_rise 100µ
.param t_fall 200µ
.param t_high {mark * period-t_rise}
.param t_low {(1-mark) * period-tfall}
The expressions
pwl repeat for 3 0 0 +t_rise 1 +t_high 1 +t_fall 0 +t_low 0 endrepeat
,
pwl repeat for 3 0 0 +(t_rise) 1 +(t_high) 1 +(t_fall) 0 +(t_low) 0 endrepeat
,
pwl repeat for 3 0 0 +{t_rise} 1 +{mark*period-t_rise} 1 +{t_fall} 0 +{(1-mark)*period-t_fall} 0 endrepeat ; Works in LTSpice
all fail with the exception Fatal error: Trouble parsing “PWL REPEAT FOR…ENDREPEAT” syntax. -
Not supported
The author of QSPICE is not obliged to implement any of the other undocumented PWL statement forms that LTspice does; https://ltwiki.org/index.php?title=Undocumented_LTspice but it would be help a lot in porting LTspice simulations across to QSPICE, which is what I was busy with when I came across these issues. Of course, a lot of these constructs could be replaced with C++ or Verilog models