The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Apr 25th, 2024, 7:41am
Pages: 1
Send Topic Print
how to change accuracy DURING transient run? (Read 4107 times)
cheshire_cat
New Member
*
Offline



Posts: 4
Colorado Springs
how to change accuracy DURING transient run?
Jan 23rd, 2004, 9:41am
 
Hello,

I have come across an issue that I have not seen addressed.

I am simulating an oscillator in spectre. I would like to simulate it for 100 us. For the first 50 us I would like moderate accuracy. For the remaining 50 us I would like conservative accuracy.

How do I do this?

This really comes down to an issue of speeding up the simulation time. I see changing the accuracy as the main means, but there are some choices:

1. Find out how to run portions of the transient in moderate and conservative. I have used writefinal and readic, but that does not work as I desire -- if at all. There are many errors and jacobian matrix issues. How about restart or checkpoints?

2. Disable writing of data for a portion of the simulation (through the outputstart hold-off time). This knocks time off the simulation, but I feel there must be a better way -- especially if the change of accuracy solution saves even more time.

3.  ??

I have contacted Cadence tech support and they are currently pondering this issue.

Any ideas or suggestions? If anyone else has any related tips on how to run oscillators quickly and accurately, please speak up. I have thought about periodic steady-state (pss), but that still requires the transient to run.

-CC

P.S. If I hear a solution from Cadence, I will post it here.
Back to top
 
 
View Profile   IP Logged
cheshire_cat
New Member
*
Offline



Posts: 4
Colorado Springs
Re: how to change accuracy DURING transient run?
Reply #1 - Feb 11th, 2004, 7:19am
 
FOLKS: Here is the solution. I had been trying something very close, just had one thing wrong. But it works well to change the accuracy between the runs. This works well for an oscillator simulation. Note: you do not need to set the start time as it says... it can remain at 0 if you want.

-CC

************************


*Title: How to run a transient analysis from 0-200ns, then 200ns-400ns, and so on

*Problem:

You want to run a transient analysis from 0-200ns,
and then from 200ns to 400ns, and so on. How can you do this?

*Solution:

You can use the combination of "writefinal" and "readic"
in the transient Options form to run the transient analysis
from 0-200ns and then from 200ns-400ns.

During the 0-200ns simulation, write the final transient
timepoint to a file called spectre_200.fc.  Use this file
as the initial conditions for the transient analysis
initial transient solution during the 200ns-400ns simulation.

- In the Analog Simulation window, select Analyses->Choose.
- In the Choosing Analyses form, select tran and set the stop time to 200ns.
- Click on the Options button at the bottom of the form. The transient
 Options form will pop up.
- In the "write final" field, enter spectre_200.fc and OK the forms.
- Run the simulation.  The final transient timepoint is saved to the file
 spectre_200.fc. You can use this file as the initial conditions for the
 transient analysis initial transient solution during      the 200ns-400ns
 simulation.
- Next, in the transient analysis form set the stop time to 400ns.
- In the transient Options form, set
    start = 200ns
    readic =  spectre_200.fc
    write final = spectre_400.fc.
- OK the forms and run the simulation. The simulation will run from
 200ns-400ns using spectre_200.fc as the initial condition file.

You can repeat this process if you want to also do a transient analysis
from 400ns-600ns.


======================= end =====================


Back to top
 
 
View Profile   IP Logged
August West
Community Member
***
Offline

I'll get up and fly
away

Posts: 71

Re: how to change accuracy DURING transient run?
Reply #2 - Feb 11th, 2004, 8:36am
 
The writefinal/readic approach will work, you just have to be careful with your sources. Consider the case where there are two sources driving your circuit, one that produces a step that stabilizes after 100 ns and the other that produces a sinewave with a 300ns period. Now assume that you run to 1us and write the state of the circuit to a file. If you now rerun the simulation from t=0 and use readic to start the circuit in the previously saved state, you will have problems because you are trying to force the circuit into an unnatural state because the sources at t=0 produce different values than they did at t=1us.

There are two ways to address this. One, you can simply set the start time to t=1us, as you found out. Alternately, you can adjust the sources on subsequent runs so there initial value corresponds the their value when you recorded the state.

Another approach to increasing accuracy at a particular point in time is to include a Verilog-A module whose only purpose is to shrink the time step. This is not the same as tightening the tolerances, but can be quite effective as long as your timesteps do not vary widely over the course of a single cycle (if they do, then forcing small time steps will still work but can be very expensive). To do so, use something like this ...

module limit_timestep();
parameter real tstart;
parameter real maxstep;
analog begin
 if ($abstime > tstart) begin
   $bound_step(maxstep);
 end
end
endmodule
In Spectre you can get the same effect by adding a disconnected sinusoidal source into your circuit that starts producing a high frequency sine wave at the point where you want more accuracy. Don't use a pulse, as it causes the simulator to use backward euler integration at the sharp corners, which tends to degrade accuracy. Given a choise, the Verilog-A approach is the best as it is the most direct and gives the finest degree of control.

Be aware that this idea of running for a while then tightening tolerances may not give you the accuracy you seek if your circuit exhibits long time constants (which is often the reason for the long initial simulation). The reason is that the error in the results that exists at the end of the long initial simulation interval will take a long time to decay because of the long time constants.

-August West
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.