Hello
I have convergence problem with picewise voltage source.
Here is my code:
Code:module SUPPLY_SRC (OUT);
output OUT;
voltage OUT;
parameter real t1 = 1m, t2 = 2m, t3 = 5m, t4 = 7m, t5 = 10m;
parameter real v1 = 0.0, v2 = 3.0, v3 = 3.0, v4 = 0.0, v5 = 0.0;
real offset, slope, a0;
analog begin
@(initial_step) begin
offset = 0.0;
slope = 0.0;
a0 = 0.0;
end
@(timer(t1)) begin
slope = (v2-v1)/(t2-t1);
offset = $abstime;
a0 = V(OUT);
$discontinuity(1);
end
@(timer(t2)) begin
slope = (v3-v2)/(t3-t2);
offset = $abstime;
a0 = V(OUT);
$discontinuity(1);
end
@(timer(t3)) begin
slope = (v4-v3)/(t4-t3);
offset = $abstime;
a0 = V(OUT);
$discontinuity(1);
end
@(timer(t4)) begin
slope = (v5-v4)/(t5-t4);
offset = $abstime;
a0 = V(OUT);
$discontinuity(1);
end
V(OUT) <+ a0 + slope*($abstime - offset);
end
endmodule
Simulation reach 1ms, and then convergence error appears:
Error found by spectre at time = 1 ms during transient analysis `amsAnalysis'.
Matrix is singular (detected at `TB.U1:AUT_flow' and `TB.vdd').
Solution at last successful step (at 1 ms), and last Newton iteration (at 1
ms):
I(TB.U1:AUT_flow): 0 A 0 A
V(TB.vdd): 0 V 0 VAnalysis `amsAnalysis' terminated prematurely due to error.ncsim: *E,RNALER: Simulation terminated due to analog error.When I change contibution expression
V(OUT) <+ a0 + slope*($abstime - offset);
to be as follows
V(OUT) <+ slope*($abstime - offset);
simulation terminates, but the signal form isn't what I need.
For discontinuity function I used 1 as argument because it's 1st derivative that breakes, not signal itself.
Am I rigtht in my supposition and what could be a reason of such error?
Thank you in advance.
Pavel.
P.S. In error message I changed intentionnally the name of signal from OUT to AUT, otherwise smily appears intstead:
UT.