Savestate - Recover (savestate)
Description
Savestate-Recover is a transient analysis feature. It is a replacement for Checkpoint-Restart capability.
The Checkpoint-Restart capability saves only the circuit solution for the timepoint at which the simulation is interrupted. Because there is no history information saved for the circuit, glitches, convergence issues, and inaccuracies can result when the simulation is resumed. The Savestate-Recover feature saves the complete state of the circuit, avoiding these issues.
Savestate-Recover provides the following functions:
- You have the option to save circuit information at set intervals or at multiple points during transient analysis. If the simulation halts unexpectedly, you can restart transient analysis from any saved timepoint.
- You can experiment with different accuracy settings over different transient time periods to obtain the optimal speed/accuracy trade-off.
Requirements for Savestate-Recover
When the simulation is restarted:
- Netlist topology must not be changed. Topology changes or the removal/addition of nodes in the restore file causes a fatal error.
- You may edit any netlist parameter as long as the circuit topology remains the same.
- The stop time of Transient analysis must be larger than the timepoint corresponding to the savestate file.
- Saved state file is binary and platform dependent.
- Savestate-Recover works only for transient analysis and the transient analysis must not be within a Sweep or Monte Carlo analysis.
Use Model
-
Savestate
Savestate is enabled/disabled by using thespectrecommand, as follows.spectre [+savestate ] [-savestate ] ...
where:-
+savestate- Enables Savestate. You may use+ssas an abbreviation for+savestate. -
-savestate- Disables Savestate. You may use-ssas an abbreviation for -savestate.
By default, savestate is on, and checkpoint is off. -
-
Define saved time points and state file in the
transtatement. For example:DoTran tran stop=stoptime [ [saveperiod=time] | [saveclock=clock_time] | [savetime=[time1 time2...]] [savefile=file.srf]
where:-
saveperiod,saveclock, andsavetimedefine the time points to save the states.-
If
saveperiodis given, Spectre generates a saved state file periodically based on the transient simulation time. Only the last saved state file is kept. -
If
saveclockis given, Spectre generates a saved state file periodically based on real time (wall clock time). Its default value is 1800 seconds (30 minutes). -
If
savetimeis given, Spectre generates a saved state file on each specified time point.
-
If
-
savefiledefines where the saved states are written.
If multiple save time points are given, That is,analysisName tran stop=stoptime savetime=[time1 time2 ...] savefile=filename
the saved state file isfilename_at_time1,filename_at_time2, and so on.
Besides saving the state based on saveperiod or saveclock or savetime, if savestate is enabled, Spectre automatically saves the states to a file when an interrupt signal likeQUIT,TERM,INT, orHUPis received for the first time. If interrupt signals are received more than once, Spectre quits immediately.
Thesaveclock,saveperiod, andsavetimeparameters should not be specified at the same time.
If more than one parameter is specified, Spectre reads them in the following order:saveperiod
savetime
saveclock
-
-
Recover
There are two ways to recover the simulation from the saved state file. The first is to define the recover file using thespectrecommand. The second is to define the recover file in atranstatement.
Defining the recover file in thetranstatement is strongly recommended, especially if there are multiple analyses statements in the netlist. -
Recover from command line
spectre [+recover[=filename]] [-recover] ...
where: -
Recover from the
transtatementanalysisName tran recover=filename ...
By default, recover is disabled. -
Output Directory on Recovering
When recovering from a saved state in a Spectre run by using+recover=state_filein a command-line option, a new raw directory is created to avoid overwriting the previous simulation results. However, ifrecover=state_fileis given in atranstatement, the default raw directory is used.
When definingrecover=state_filein atranstatement, use a different tran name to avoid previous simulation results to be overwritten by the recovered results.
When a new raw directory is created, the raw directory name is the same as the default raw directory, except that an index (starting from 0) is suffixed to raw, such as*.raw#, where#is 0, 1, 2, and so on.
For example, in the first run, enter:spectre input.scs
Spectre saves the simulation state in a file on a time point. By default,input.rawdirectory is created.
When Spectre runs in recover mode:spectre +recover=saved_state_file input.scs
a new raw directory namedinput.raw0is created. The index of the raw directory is increased by one at each successive recover run. Another use model is that you define multiple transient-analysis runs in a netlist. In the first transient-analysis run, Spectre saves the simulation state on a time point.
In the next transient analysis run, simulation is continued from the saved time point. For example:tran1 tran step=1ps stop=200ns savetime=[50ns] savefile=tran1_save
tran2 tran step=1p stop=400ns recover=tran1_save_at_50.00ns
In this case, the default raw directory is used.
For more information, see Recovering From Transient Analysis Terminations section in the Spectre Classic Simulator, Spectre APS, Spectre X, and Spectre XPS User Guide.
Return to top