If I choose r=0.123 then this error message is given:
ERROR: repeat start time value 0.123 for pwl voltage source must be smaller than final time point given!
That's ok, but when I choose r=exact_last_point then no error is given and simulation never ends.
Basically condition for that error message should be changed from t > last to t >= last
or it should be make to work with last time too (same as r=0).
ngspice-36
It is reproducible in version 40, but not pre-master. It seems likely to have been fixed by:
That change contained a PWL-specific bug that was supposed to be fixed by 79c69e064435f6b6f8950804e0f5d3fbbe0cd708, but this test circuit shows that it is still there when the R parameter is used. So another change is needed.
In fact, that change is largely irrelevant, except that it did remove the loop that becomes endless when the repeat starts at the last time-point. The best fix seems to be to treat that as an error, as suggested.
Fixed as suggested: 0616965a6795ee8ac4ec7628a2685f4eee5bc55e.
Fix included in ngspice-41.