The Tcl save command creates a snapshot of the current simulation state. You can then use the restart command to load the saved snapshot and resume simulation.
You may only issue the save command when the simulator is at certain points in its execution cycle.
- The simulator cannot be in the middle of executing procedural statements. To run the simulation to the next point at which the
savecommand will work, use therun-cleancommand.
- For mixed-signal designs, the simulator must have accepted at least one transient time step.
If your files are very large, you might encounter a limit on the size of a file. If a library database exceeds this limit, you cannot add objects to the database. If you save many snapshot checkpoints to unique views in a single library, this file size limit could be exceeded. If you reach this limit, you can:
- Use
save -overwriteto overwrite an existing snapshot. For example,xcelium> save -simulation -overwrite snap1
- Save snapshots to a separate library. For example,
mkdir xcelium.d/snaplib
xmsim -f xmsim.args
xcelium> run 1000 ns
xcelium> save -simulation snaplib.snap1
xcelium> run 1000 ns
xcelium> save -simulation snaplib.snap2
- Remove snapshots using the
xmrmutility. For example,xmrm -snapshot worklib.snap1
save Command Syntax
save -simulation <snapshot_name>
[-overwrite] -environment [filename]
-commands [filename]
save Command Options
This section describes the options that you can use with the Tcl save command.
|
Creates a snapshot of the current simulation state. The snapshot also contains the analog control options in effect at the time of the save. This option is the default. You must specify a snapshot name with the
The snapshot name must be a simple name containing only letters, numbers, and underscores. By default, the saved snapshot is saved either in the library you specify or in the work library (if you do not specify a library). |
|
Overwrites an existing snapshot. |
|
Creates a Tcl script that captures the current breakpoints, databases, probes, aliases, and predefined Tcl variable values. The The state of the Tcl debug environment is not part of the simulation that is saved in a snapshot. To save the debug environment, you must issue a separate For example:
or
These scripts are meant to be sourced into an empty environment (that is, an environment with no breakpoints, no probes, no databases). If you start the simulator, set some breakpoints and probes, and then source a script that contains commands to set breakpoints and probes, the simulator will probably generate errors telling you that some commands in the script could not be executed. These errors are due to name conflicts. For example, you may have set a breakpoint that received the default name "1", and the command in the script is trying to create a breakpoint with the same name. You can, of course, give your breakpoints unique names to avoid this problem. You can also edit the scripts to make them work the way you would like them to work. |
|
|
save Command Examples
The section includes the examples of how the save command in the following scenarios:
How to Save a Snapshot of the Current Simulation State
The following command saves the simulation state in lib . cell :ckpt1, where lib is the name of the current work library, and cell is the cell name of the currently loaded snapshot.
xcelium> save -simulation :ckpt1
The following command saves the simulation state in lib .top:ckpt1.
xcelium> save top:ckpt1
The following command saves the simulation state in lib .ckpt1: view_name, where view_name is the view name that is currently being simulated.
xcelium> save ckpt1
How to Use the save -environment Command
The following example illustrates how to use the save -environment command.The right column annotates the behavior of each command.
|
Commands |
Notes |
|---|---|
|
|
Start the simulator. |
|
|
Set a line breakpoint, an object breakpoint, and create a probe. The probe command creates a default SHM database. |
|
|
|
|
|
|
|
|
Save the debug settings in a file called |
|
|
Look at the file contents. |
|
|
Exit from the simulator. |
|
|
Restart the simulator. |
|
|
The new session has no breakpoints. |
|
|
Source the |
|
|
Show the status of breakpoints, probes, and databases. |
How to Use save, restart, and analog
You can use the save, restart , and
analog
commands during transient analysis of a mixed-signal simulation in interactive mode (under -tcl or -gui). In non-interactive mode or if there is other analysis after the transient analysis specified analog control file, these commands are ignored when the simulation has reached the analog stop time of the transient analysis.
The analog -stop option is ignored with a warning message when .probe is used in the analog control file.
The following example illustrates how to use the save, restart and analog commands in interactive mode. The right column annotates the behavior of each command.
|
Commands |
Notes |
|---|---|
|
|
Open a default SHM database called |
|
|
Probe all signals in the current scope. |
|
|
Create a breakpoint at absolute time 200ns. |
|
|
Run until 200ns. |
|
|
Examine the tolerance values and stop time. |
|
|
Save the first snapshot |
|
|
Lengthen the simulation. |
|
|
Change the |
|
|
Examine the new values. |
|
|
Create another breakpoint. |
|
|
Run until 400ns. |
|
|
Save the second snapshot. |
|
|
Reload the first snapshot. |
|
|
Check that tolerance values and stop time are the same values you had originally... |
|
|
...and that you are back at 200ns in the simulation. |
|
|
Now reload the second snapshot. |
|
|
Check for the changed |
|
|
Run to 400ns, again! |
|
|
Run another 200ns. |
|
|
Switch back to the first snapshot. |
|
|
Check where you are. |
|
|
Run until analog stop time. |
|
|
At analog stop time, you can still lengthen the simulation. |
|
|
Run until analog stop time. |
|
|
At analog stop time, you can still restart a snapshot. |
|
|
Exit and complete the simulation. |
