Product Documentation
Spectre AMS Designer and Xcelium Simulator Mixed-Signal User Guide
Product Version 22.09, September 2022

Using the Save-and-Restart Feature

In mixed-signal designs, you can save a snapshot of a simulation and restart after making changes to simulation parameters and models. When you save a simulation with process-based save/restart, you create a snapshot of the entire simulation process state (memory, file pointers, and so on), including all integrated C/C++ code, third-party applications, system function $save in SV/Verilog/VHDL module, external codes such as System C in the design, all allocated stacks, heaps to disk.

After you save the simulation, you can either do a cold restart, or a warm restart.

A cold restart refers to a situation in which the simulator is (re-)invoked with the saved snapshot. This approach provides an opportunity to change certain simulator invocation option settings.

A warm restart refers to a situation where the simulation runs in the same directory as the saved simulation. Essentially, the restarted simulation is presented as a continuation of the existing session. Since the simulator is not explicitly re-invoked, there is no opportunity to change any simulator invocation option settings. They remain the same as they were at the time of the save operation. Warm restart is most commonly used for debugging purpose.

For AMS designs using the analog solvers such as Spectre solver, APS solver, or XPS-MS solver, you can use save-and-restart either in non-interactive mode (command-line) or in Tcl mode.

You can also use the save-and-restart feature in mixed-signal designs containing SystemC models. The use model is the same in terms of the usage of the Tcl commands save and restart. However, in the Tcl restart flow for SystemC, one difference from the traditional save-and-restart feature is that the analog netlist/model files are re-parsed and the analog circuit is re-elaborated so that you can update these files prior to specifying the restart Tcl command, and expect these changes to take effect in the restart simulation.

The save-and-restart feature for mixed-signal designs with SystemC does not work on SLES11.

Process-Based Save-and-Restart for Mixed-Signal Designs

You can use the process-based save-and-restart approach for AMS and DMS simulations. The approach is the same in terms of the usage of the Tcl commands save and restart. However, the Tcl restart flow for process-based save-and-restart differs from the traditional mixed-signal save-and-restart feature. In the process-based save-and-restart approach, during simulation restart, a new xmsim process is invoked, and the simulation state is restored to exactly the state when the save occurred.

You can enable process-based save-and-restart in the checkpoint enable mode and process save mode.

In the checkpoint enable mode, during the restart process, the original analog solver thread is terminated. The tool then relaunches a new analog solver, and the following processing are performed:

To enable checkpoint enable mode, you must use the the -checkpoint_enable command-line option with xmsim/xrun.

For AMS design simulations, it is recommended that you use the process save mode.

In the process save mode, the threads are handled by checkpoint package and multiple threads are supported. And, the analog engine running in child threads can be recovered. However, in the checkpoint enable mode, the analog engine needs to be restarted and re-initialized.

To enable the process save mode, you must use the -process_save command-line option with xmsim/xrun.

By default, it is recommended to run the simulations in the 64-bit mode.

Examples

The following examples show how you can enable process save mode save-and-restart flow in both a warm restart and cold restart:

Warm restart:
xrun top.vams receiver.vams amscf.scs -input probe.tcl -amsconnrule CR_full -clean -process_save

The following example details the probe.tcl file used:

-----------probe.tcl -----------------------------------
database -open waves -into waves.shm -default
probe -create -all -depth all -waveform -database waves run 2ns
scope -describe top
scope -describe top.RE1
force top.RE1.scalar_out = 1’b0
value top.scalar_out top.RE1.scalar_out
save -overwrite save1
run 2ns
release top.RE1.scalar_out
value top.scalar_out top.RE1.scalar_out
run 2ns
restart save1
value top.scalar_out top.RE1.scalar_out
run 2ns
exit

Cold restart:

xrun top.vams receiver.vams amscf.scs -input save.tcl -amsconnrule CR_full -clean -process_save

The following example details the save.tcl file used:

-------------------save.tcl--------------------
database -open waves -into waves.shm -default probe -create -all -depth all -waveform -database waves run 2ns
scope -describe top
scope -describe top.RE1
force top.RE1.scalar_out = 1’b0
value top.scalar_out top.RE1.scalar_out
save -overwrite save1
run 2ns
release top.RE1.scalar_out
value top.scalar_out top.RE1.scalar_out
run 2ns
exit

The following is an example of the .vams and amsd control files that are:

---------------------------top.vams-----------------------
`timescale 1ns/1ps
`include "disciplines.vams"
module top();
electrical scalar_in;
electrical scalar_out;
electrical [1:0] array_in;
electrical [1:0] array_out;
///instantiation/////
receiver RE1 (scalar_in,scalar_out,array_in,array_out);
analog begin
V(scalar_in) <+ 1.4;
V(array_in[1]) <+ 1.8;
V(array_in[0]) <+ 0.2;
end
endmodule
------------------receiver.vams-----------------------------
module receiver (scalar_in,scalar_out, array_in,array_out);
input scalar_in;
output scalar_out;
input [1:0] array_in;
output [1:0] array_out;
logic scalar_in,scalar_out;
logic [1:0] array_in,array_out;
assign scalar_out = 1’b1;
assign array_out= 2’b10;
endmodule
---------------amscf.scs---------------
Simulator lang=spectre
Tran tran stop=20ns

And, the following command invokes the restart command for a cold restart:
xrun -r save1 -input restart.tcl -process_save
Where, the restart.tcl file contains:
------restart.tcl------------------------
value top.scalar_out top.RE1.scalar_out
run 2ns
exit

Related Topics



 ⠀
X