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

Waveforms

You can use the SimVision Waveform window to display and analyze waveforms.

This section explains how to open a database, how to probe signals, and how to open the SimVision Waveform window.

The objects that you want to probe to a database must have read access. Analog objects have read access, but, by default, Verilog-AMS digital objects in the design do not have read access. Use the -access +r option or the -afile access_file option when you elaborate the design to provide read access.

Creating a Database and Probing Signals

You can open a database, probe signals, and save the results in the database by typing Tcl commands at the prompt or by using the graphical user interface. 

You also can use a set of system tasks from the digital context to open an SHM database, probe signals, and save the results. You must type these system tasks in the Verilog-AMS code prior to simulation. The system tasks are

System task

Description

$shm_open();

Opens a simulation database.

$shm_probe();

Selects signals whose simulation value changes will enter the simulation database.

$shm_close;

Closes a simulation database.

Example:

initial
    begin
         $shm_open("waves.shm");
         $shm_probe();
         #1 $stop; // stop simulation at time 1
    end


When you send signals to the Waveform window and click Run, SimVision creates a probe for every signal in the Waveform window. In this way, you can quickly and easily probe objects.


Opening a Database with $shm_open

Use the $shm_open system task from a digital context to open an SHM database. You cannot use a database created in this way to save data for analog objects.

Syntax:

$shm_open ( [" db_name "],[ is_sequence_time ],[ db_size ],[ is_compression ] );
Where,
"db_name" specifies the filename of the simulation database. If you do not specify the database name, a database called waves.shm is opened in the current directory.
is_sequence_time dumps all value changes to the database.

By default, when probing to an SHM database, the simulator discards multiple value changes for an object during one simulation time and dumps only the final value at the end of that simulation time. Specify 1 for the is_sequence_time argument if you want to dump all value changes to the SHM database. For example,

$shm_open("mywaves.shm", 1, , ) ;
db_size Specifies the maximum size (in bytes) of the transition file (.trn file).

The simulator maintains the size limit by discarding the earliest recorded values as new values are dumped, such that the database always contains the most recent values for each probed object.

When the size limit is exceeded, the waveform window displays an unknown value for each object from the beginning of the simulation to the time of the first non-discarded value.

The SHM database uses about 2.5Mb of disk space, even if you specify a lower limit. However, the database size will not exceed the limit if the limit is greater than 2.5Mb. For example,

$shm_open("mywaves.shm", 1, 250000,);
is_compression Compresses the SHM database to reduce its size. The default setting is 0. Specify 1 to compress the database file. For example,

$shm_open("mywaves.shm", 1, , 1);

Probing Signals with $shm_probe

The syntax for the $shm_probe system task, which can be used only on digital objects and must be used from a digital context, is

$shm_probe( scope0 , node0 , scope1 , node1 , ...);

scope refers to a scope in the hierarchy, and node refers to a node specifier.If scope is omitted, the default is the current scope. If node  is omitted, the default is all inputs, outputs, and inouts of the specified scope.

The word node, as used here, refers to nodes in a hierarchical structure; it has nothing to do with the word as it is used in analog simulation. A node can be one of the following:

Node

Signals That Enter the Database

"A"

All nodes (including inputs, outputs, and inouts) of the specified scope

"S"

Inputs, outputs, and inouts of the specified scope, and in all instantiations below it, except inside library cells.

"C"

Inputs, outputs, and inouts of the specified scope, and in all instantiations below it, including inside library cells

"AS"

All nodes (including inputs, outputs, and inouts) of the specified scope, and in all instantiations below it, except inside library cells)

"AC"

All nodes (including inputs, outputs, and inouts) in the specified scope and in all instantiations below it, even inside library cells)

For example, the following system task specifies all nodes in the current scope:

$shm_probe("A");

The following system task specifies all inputs, outputs, and inouts in the alu and adder modules:

$shm_probe(alu, adder);

The following system task specifies all inputs, outputs, and inouts in the current scope and below, excluding those in library cells; as well as all the nodes in the top.alu module and below, including those in library cells.

$shm_probe("S", top.alu, "AC");

Opening the SimVision Waveform Window

When working with waveforms, there are two use models:

Using the Waveform Window to View a Post-Simulation Database

When you use SimVision to view a post-simulation database, you are using it in PPE mode. For more information, see the SimVision User Guide.

To view the waveforms using SimVision after the simulator creates the database, do the following:

  1. Open the viewer by typing
    simvision -waves
  2. Choose File - Open Database.
  3. In the Open Database browser, navigate to the .trn file for your data.
  4. Click Open.
  5. In the Waveform window, choose Windows - New Design Browser.
  6. In the Design Browser, select the signals you want to display.
  7. Click Send selected object(s) to target waveform window to add the signals to the Waveform window.

Using the Waveform Window for Interactive Waveform Display during Simulation

To view the waveforms as the simulation progresses, do the following:

  1. Preselect the signals you want to view.
  2. Run the simulation.

If you do not preselect objects, you can use the Design Browser to probe signals and add them to the Waveform window.

Related Topics



 ⠀
X