Xa User
Xa User
Contents
New in This Release . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14
Related Products, Publications, and Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Customer Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3
Feedback
Contents
4
Feedback
Contents
5
Feedback
Contents
6
Feedback
Contents
7
Feedback
Contents
8
Feedback
Contents
9
Feedback
Contents
10
Feedback
Contents
11
Feedback
Contents
12
Feedback
Contents
Running the Vector File Simulation Using the period Syntax . . . . . . . . . . . . . . 355
Running the Vector File Simulation Using the stop_at_error Syntax . . . . . . . . 356
Using a VCD File in a Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
Running a MOSRA Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
13
Feedback
You might also want to see the documentation for the following related Synopsys and
third-party products:
• Cadence® Spectre® Circuit Simulator
• Cadence® Virtuoso® Analog Design Environment
• Eldo®
• PrimeSim™ HSPICE®
• IC Validator™
• OASIS® (Open Artwork System Interchange Standard)
• StarRC™
• VCS®
Conventions
The following conventions are used in Synopsys documentation.
Convention Description
Courier bold Indicates user input—text you type verbatim—in examples, such
as
prompt> write_file top
Convention Description
Edit > Copy Indicates a path to a menu command, such as opening the Edit
menu and choosing Copy.
Customer Support
Customer support is available through SolvNetPlus.
Accessing SolvNetPlus
The SolvNetPlus site includes a knowledge base of technical articles and answers to
frequently asked questions about Synopsys tools. The SolvNetPlus site also gives you
access to a wide range of Synopsys online services including software downloads,
documentation, and technical support.
To access the SolvNetPlus site, go to the following address:
https://solvnetplus.synopsys.com
If prompted, enter your user name and password. If you do not have a Synopsys user
name and password, follow the instructions to sign up for an account.
If you need help using the SolvNetPlus site, click REGISTRATION HELP in the top-right
menu bar.
1
Introducing the PrimeSim XA Tool
This chapter describes the PrimeSim XA tool and basic simulation setup information.
2
Getting Started
This chapter provides the basic information you need to start using the PrimeSim XA
simulator.
export SNPSLMD_LICENSE_FILE=pointer_to_license_paths
In Bash shell:
export PRIMESIM=1
For example,
% setenv PRIMESIM 1
% xa netlist.sp
or
% xa netlist.sp -primesim 1
Table 1 lists the shell environment variables that control the token-based license mode and
license queuing.
Table 1 Variables for Controlling Token-Based License Mode and License Queuing
PRIMESIM_WAIT_LICENSE_TIMEOUT value This variable controls the timeout period for license
queuing. The value is in minutes and cannot
exceed 43,200 minutes (30 days). The range is [1,
43200] in minutes. The default period is 2 minutes.
Non-positive integer values will result in an error.
The following example sets the queue timeout
period to 30 minutes:
% setenv PRIMESIM_WAIT_LICENSE_TIMEOUT 30
Table 1 Variables for Controlling Token-Based License Mode and License Queuing
(Continued)
setenv XA_WAIT_LICENSE 1
export XA_WAIT_LICENSE=1
When the wait license feature is enabled, the PrimeSim XA tool queues indefinitely
for an available license keys. To time out the license wait feature, set the
XA_WAIT_LICENSE_TIMEOUT environment variable. The specified value is in minutes. For
example:
• In C-Shell:
Examples
The following example sets the license path to /usr/cad/license.dat:27000@cdl1 and puts
the PrimeSim XA tool on queue for the next available keys when license keys are not
available.
setenv SNPSLMD_LICENSE_FILE /usr/cad/license.dat:27000@cdl1
setenv XA_WAIT_LICENSE 1
or
export SNPSLMD_LICENSE_FILE=/usr/cad/license.dat:27000@cdl1
export XA_WAIT_LICENSE=1
The following example enables the wait license feature and sets a timeout period to 120
minutes (2 hours). When license keys are not available after 2 hours, the wait license
feature is disabled.
or
export SNPSLMD_LICENSE_FILE=/usr/cad/license.dat:27000@cdl1
export XA_WAIT_LICENSE=1
export XA_WAIT_LICENSE_TIMEOUT=120
export PATH=XA_INSTALL_DIR/bin:$path
For example:
set path = ( /tools/synopsys/XA-version/bin $path )
or
export PATH=/tools/synopsys/XA-version/bin:$PATH
export XA_TMP_DIR=user_defined_tmpdir
For example:
setenv XA_TMP_DIR /tmp
or
export XA_TMP_DIR=/tmp
export XA_STATUS=0|time_interval_in_seconds
When set to 0, it disables the PrimeSim XA status update to stderr. When set to a positive
integer, the PrimeSim XA tool updates the simulation status to stderr at the specified time
interval in seconds. The default is 10.
The following example instructs the PrimeSim XA tool to update the simulation status
every 20 seconds.
setenv XA_STATUS 20
or
export XA_STATUS=20
Specify the name of the top-level netlist file and the command line options. The PrimeSim
XA tool invokes the simulator to perform transient simulation. For a detailed description
about the supported netlist formats and command line options, see the following
Specifying Netlist Format and Using Command Line Options sections.
The PrimeSim XA tool provides a different version of simulator (called ssl2 in this
document) for designs with different requirements on performance and accuracy, such as
post-layout designs in advanced process technology. For more information about how to
run PrimeSim XA simulator version II, see Running Simulator Version II.
The PrimeSim XA tool provides commands to control simulation performance for better
simulation speed and accuracy and model complexity tradeoffs. For example, you use the
set_sim_level command to control simulation speed and model complexity by setting a
simulation level. See Setting Simulation Levels and Simulation Accuracy and Speed for
Analog Mixed-Signal Designs for more details.
Example
The following example reads the input.sp netlist file, specifies the directory name for
saving output files, and uses the prefix of the input netlist file name as the prefix for the
output files.
xa input.sp -o ./OUTPUT_DIR -outfilefmt hspice
When simulation is complete, the tool saves the following output files in the /OUTPUT_DIR
directory:
• OUTPUT_DIR/input.fsdb
• OUTPUT_DIR/input.log
• OUTPUT_DIR/input.meas
Note:
This user guide describes how to simulate and analyze your circuit design with
PrimeSim HSPICE netlists. For more information on how to run PrimeSim XA
simulation with Spectre and Eldo netlists, see Appendix A, “Spectre Netlist
Compatibility” and Appendix B, “Eldo Netlist Compatibility”.
This section contains the following topics:
• Specifying Netlist Format
• Using Command Line Options
• Running Simulator Version II
• Setting Simulation Levels
• Simulating SRAM or Flash Designs
• Minimum Resistor Threshold
Eldo -eldo
Spectre -spectre
To control the case sensitivity of the specified netlist, set the -case upper|lower|
sensitive command line option. The -case command line option is equivalent to the
set_sim_case option.
-active_net_flow Enables the back-annotation active net flow with the default
settings. For more information about the active net flow, see the
set_active_net_flow command. Note that this command line option
takes precedence over the set_active_net_flow command.
-arch COMPATIBLE Switches to one more compatible math lib used instead of default Intel
math lib.
-c command_file Specifies the name of the command file. You can specify the
PrimeSim XA commands in the command file and use the -c
command line option to include this file for simulation. You can specify
multiple command files with multiple -c command line options.
-D<x> Defines string x and runs the C preprocessor. This command line
option is only valid for Eldo and Spectre netlist formats.
-D<x=y> Defines string x as y, and runs the C preprocessor. This command line
option is only valid for Eldo and Spectre netlist formats.
-dcintr [iteration] Invokes DC interactive mode when the DC engine reaches the
specified iteration. If iteration is not specified, use Ctrl-C to enter
interactive mode in DC.
-I [dir] Searches the dir directory for included files. If dir is not specified, the
current run directory is set.
-intr [time[unit]] Invokes the interactive mode during transient at the specified time.
If you do not specify a time value, you must use Ctrl-C to enter
interactive mode in transient.
-mt num_of_core|max Enables multicore simulation with the specified number of cores.
Use the max keyword to specify the maximum number of cores in the
machine to run multicore simulation. This command line option takes
precedence over the set_multi_core command.
For more information about running a multicore simulation, see
PrimeSim GPU and Multicore Simulation.
-sim_mode 0|1 Enables high performance simulation algorithms for analog and
mixed signal designs. This command line option is equivalent to the
set_sim_mode command.
For more information about running a simulation on analog
mixed-signal designs, see Analog Mixed-Signal Simulation.
-ssl2 Invokes simulator version 2 for simulation. For information about how
to use this command, see the Running Simulator Version II section.
-t time[unit] Overwrites the transient analysis time specified in the netlist. The unit
can be ms, us, ps or ns. If unit is not specified, the default is ns.
-U<x> Undefines string x and runs the C preprocessor. This option is only
valid in the Eldo and Spectre modes.
-v [ersion] Prints binary information, including tool name, binary name, platform
version, build time and date, and build identification number.
Licensing
Saving/Restoring Simulation
-restart_type type Specifies the type of saved state to use with the -auto_restart
option.
Supported types:
• OP: (Default) Uses a snapshot that contains operating point (OP)
information.
• image: Uses an image-based snapshot.
By default, the tool checks for an OP-based snapshot to restart a
simulation. When used with the -enable_isnapshot_feature option,
the tool restarts a simulation based on an image-based snapshot. If no
snapshot is available, PrimeSim XA proceeds the simulation from the
first time point (time 0) with a warning message.
-restore_type type Same as -restart_type. Specifies the type of saved state to use with
the -auto_restore option.
Supported types:
• OP: (Default) Uses a snapshot that contains operating point (OP)
information.
• image: Uses an image-based snapshot.
By default, the tool checks for an OP-based snapshot to restore a
simulation. When used with the -enable_isnapshot_feature option,
the tool restores a simulation based on an image-based snapshot.
If no snapshot is available, the PrimeSim XA tool proceeds the
simulation from the first time point (time 0) with a warning message.
Output
-disable_rawimage Disables generation of a .rawimage file. For more information, see the
set_disable_rawimage command.
-o [outpath/]outfile Specifies the name of the directory and prefix name of the output files.
outpath is the name to the output directory path and outfile is the
prefix name of the output files. If outpath is not specified, the default
is the current run directory. If outfile is not specified, the default is
controlled by the -outfilefmt command line option.
-outfilefmt hspice | xa Specifies the output file prefix name if the prefix name of the output
files is not specified with the -o command line option. If it is set to
hspice, the prefix is named after the prefix of the input file name. If it
is set to xa, the prefix is xa. The default is xa.
-wavefmt format Specifies the format of the output waveform file. See the Supported
Waveform File Formats section for more information.
-wavedir directory_name Dumps waveforms in the specified directory different from the output
directory defined by the -o option.
-wavefile waveform_file Lets you specify new measurements (such as new or edited .MEASURE
statements) and rerun a simulation based on the results of an existing
fsdb or wdf file. This option can improve performance by skipping
the simulation steps not related to the new measurements. See the
meas_post command description for more information.
Help
-webhelp Opens a full online help collection in a web browser. Click How to Use
-webhelp optiononline help, openingHelp system, opening
Help in the lower left corner of the Help window for details about how
to use Help features such as the Help icons, Search, and Bookmarks.
-h[elp] Prints the list of command line options with brief descriptions.
-dp [#workers] Invokes distributed processing (DP) and specifies the number of
workers. The workers can be distributed on one multiple-core machine
or multiple machines across a network. If #workers is not specified,
the PrimeSim XA tool assigns the workers to all available cores in
the master machine. When running -dp with -dpconfig on multiple
machines across the network, you must specify #workers.
To stop and end a simulation after you have started a simulation with
-dp, press Ctrl-C.
The PrimeSim XA tool supports the following features for distributed
processing:
• Monte Carlo
• .ALTER blocks
• .DATA blocks
• .TEMP sweep
• Eldo .STEP parametric sweep
-dpconfig config_file Specifies the configuration file for DP. If you do not specify this
option, DP distributes the processes of all workers to only the master
machine.
-dplocation TMP|NFS Specifies the location for all the results files generated by the DP
simulation:
• TMP (default): Results go to the /tmp folder, and are then moved to
the -o PrimeSim XA output working directory after the whole DP
simulation from all the workers is completed.
• NFS: Results files go directly to the -o PrimeSim XA output working
directory once they are generated.
-dpworkerchk Specifies the DP worker monitor level. Default is all. This option
none|mem|load|disk|all applies to -dp -dpconfig flow.
• none: No feature is monitored.
• mem: Memory monitor. Master drops the worker if the worker hosts
memory consumption is too high. The lower threshold of available
physical memory is controlled by .OPTION DP_MEMFREE.
• load: CPU load monitor. Master drops the worker if the worker
host’s CPU load is high. The upper threshold of the load average of
one worker CPU core is controlled by .OPTION DP_LOADAVG.
• disk: Disk monitor. Master drops the worker if the worker’s
CDPL scratch disk usage is too high. Master stops the whole DP
simulation if the DP master output disk usage is too high. The lower
threshold of the available working (scratch) disk space is controlled
by .OPTION DP_DISKFREE.
• all: (default) Memory, load, and disk usage are all monitored.
Note:
Multiple monitoring types for memory, load, and disk options are
supported by combining two options with “+” syntax. For example:
-dpworkercheck mem+load
-merge Merges all separated distributed processing output log files (*.log)
into one file, similar to a single core run. Note that this process is time
consuming if log file size is large.
When you use this argument in the PrimeSim HSPICE tool, it merges
the log file as well as the tr0 waveform file. The PrimeSim XA tool
only merges the log file. But the PrimeSim XA tool can generate a
wrapper file for the wave viewer to load all the separate waveform files
at once.
-ra argument Invokes Phase II simulation of EMIR analysis. See the Performing
Power Net EMIR Analysis - Analysis Stage section in the PrimeSim
EMIR Reference Manual.
-radp processes Specifies the number of processes that are used for processing nets
in parallel on phase II EMIR simulation. For more information, see the
EMIR Pipeline Processing section in the PrimeSim EMIR Reference
Manual and the set_ra_option command description.
-radp_config Specifies the CDPL hosts configuration file. For more information,
cpdl_config_file_name see the EMIR Pipeline Processing section in the PrimeSim EMIR
Reference Manual and the set_ra_option command description. See
Common DP Library User Guide for the cdpl_config_file syntax.
-ralayout argument Generates the violation map for EMIR analysis. See the Power Net
EMIR Analysis section in the PrimeSim EMIR Reference Manual.
-rp argument Specifies report generation for static power net resistance analysis.
See the Static Resistance Check section in the PrimeSim EMIR
Reference Manual.
If you do not specify the -ssl2 command line option, the PrimeSim XA tool runs ssl1
simulation. The .log file indicates whether the simulation is run with the ssl1 or ssl2
simulator.
• Run the simulation with the XA_SSL2 UNIX environment variable. If this variable is set,
then all PrimeSim XA simulations use ssl2 by default. For example:
setenv XA_SSL2 1
xa netlist_file -c cmd_file -o output_prefix
Note:
There is no equivalent ssl1 command line option. If you enable the XA_SSL2
variable, the only way to run ssl1 simulation is to disable the variable.
Syntax
Here is the syntax for the set_sim_level command:
• -level level
Specifies the pair of time and level to enable accuracy changes in the middle of a
transient simulation.
◦ 1 for a functional verification of digital circuits. Level 1 is not supported if PrimeSim
XA is run with the -ssl2 option.
◦ 2 for a functional verification of digital circuits, more conservative than level 1. Level
2 is not supported if PrimeSim XA is run with the -ssl2 option.
◦ 3 for pure digital designs (functional, timing, and power simulations)
◦ 4 for analog/mixed-signal verification mode
Some of the PrimeSim XA commands provide equivalent options to set with the .option
command in the netlist, such as .option skip_circuit_block. Some PrimeSim XA
commands, such as set_dc_option, can be used only in the command script file.
You can find details of the PrimeSim XA commands in the PrimeSim™ XA Command
Reference as well as information on command syntax definitions and so on. For a list
of command line options supported in the PrimeSim XA tool, see Using Command Line
Options.
See Also
• Using XA Commands in a Command Script File
• Using XA Commands Within the Netlist
• Using XA Commands During Interactive Debugging Mode
Case Sensitivity and Wildcards
All commands and their arguments are case-sensitive—even those commands placed
within PrimeSim HSPICE and Eldo netlists. Command arguments that refer to netlist
identifiers are treated as case-insensitive in PrimeSim HSPICE and Eldo format netlists,
and as case-sensitive in Spectre format netlists.
The PrimeSim XA commands and netlist statements support wildcards to match instance
and node names during simulation. Each of the commands and options might have
different wildcard usages. The case sensitivity of the wildcard matching is set according to
case sensitivity of the netlist where the names are defined. See the individual command
for options that support a wildcard for more information.
For examples of running PrimeSim XA commands with wildcards, see the Using Wildcards
section in PrimeSim XA Command Reference.
The behavior of a wildcard in the PrimeSim XA tool might be different from the PrimeSim
HSPICE, Eldo, and Spectre tools. The use of wildcards in the PrimeSim XA tool is an
enhanced feature for FastSPICE applications.
For more information about PrimeSim XA compatible Spectre and Eldo commands and
options, see Appendix A, “Spectre Netlist Compatibility” and Appendix B, “Eldo Netlist
Compatibility”.
When both design.sp and design.sp.gz exist, the PrimeSim XA tool always selects the
exact match file first, if it exists. For example:
• If .include design.sp is in the netlist, then the PrimeSim tool selects design.sp.
• If .include design.sp.gz is in the netlist, then the PrimeSim tool selects
design.sp.gz.
• If .include design.sp is in the netlist and only design.sp.gz exists, then the
PrimeSim tool selects design.sp.gz.
Note:
The PrimeSim XA tool does not support the S-parameter and RLGC file input
types in the .gzip file format.
• Image-based snapshot: Captures the current state of the simulation. Use this
snapshot type when you want to resume simulations where the snapshot was taken.
This allows you to fast-forward to an interesting portion of a simulation or record
checkpoints in cases where the simulation runtime is long, thus maximizing the
bandwidth utilization by seamlessly restarting the aborted simulation.
PrimeSim XA resumes simulation as though the run was completed by one single
continuous job. You cannot modify the netlist or simulation setup in the restarted run.
Other limitations in the compute environment may apply.
To reuse an image-based snapshot, you must specify the
-enable_isnapshot_feature command line option together with a restore command
line option, such as -restore, -auto_restore and so on.
This section provides information about how to capture a snapshot of the current state
of the simulation and rerun the simulation with the saved snapshot, as described in the
following topics:
• Saving a Simulation
• Restoring a Saved Simulation
Saving a Simulation
To capture the current state of the simulation, run the set_save_state command and
specify the necessary options, such as the type of snapshot to save, the time or time
period to record the checkpoints, the name of the saved snapshot, and so on.
For example:
set_save_state -period 25% -save_on_kill 1 -type image
For a detailed description about the command options, see the set_save_state
command page in PrimeSim XA Command Reference.
Output Files
The set_save_state command generates two files, one with a .time.ic extension and
one with a .time.ic.sup extension for each saved time you specify with the -time or
-period option. You can then use the -restore or -restart command line option to start
a simulation using the saved state.
The PrimeSim XA tool creates two files that contain the saved data: XA/xa.1e-07.ic and
XA/xa.1.4e-06.ic.
To specify the name of the saved snapshot, use the -file option of the set_save_state
command.
For a detailed description about these command line options, see the Using Command
Line Options section.
Example 1
The following example resumes a simulation from the specified image-based
snapshot_file. If the file does not exit, PrimeSim XA issues an error message.
xa netlist.sp -enable_isnapshot_feature -restore snapshot_file
-restart_type image
Example 2
In the following example, PrimeSim XA automatically resumes a simulation from the
most recent image-based snapshot that it can find. If the restarted simulation completes
successfully, PrimeSim XA removes the snapshot being used or the one that is generated
by the set_save_state command. If a snapshot does not exist, PrimeSim XA proceeds
normally from time 0 with a warning message.
xa netlist.sp -enable_isnapshot_feature -auto _restart -restart_type
image
Example 3
The following example automatically resumes a simulation from the most recent OP-based
snapshot that it can find. If an OP-based snapshot does not exist but an image-based one
does, PrimeSim XA proceeds with the latter with a warning message. When the restored
simulation completes successfully, PrimeSim XA removes the snapshot being used or the
one that is generated by the set_save_state command.
xa netlist.sp -enable_isnapshot_feature -auto_restart
If neither snapshot exists, PrimeSim XA proceeds normally from time 0 with a warning
message.
Example 4
When restoring a simulation with an OP-based snapshot, you can rerun the simulation
with a new configuration file and specify the prefix for the output file. To do this, run the
following command:
xa netlist.sp -restore XA/xa.1e-07.ic -c restore_cfg -o XA/xa_restore
If you use the same output prefix as for the saved run, the prefix is appended with the
saved time:
xa netlist.sp -restore XA/xa.1e-07.ic -c restore_cfg -o XA/xa
Output Files
The PrimeSim XA tool generates the following output files when simulation process is
complete. Different analysis flows generates different types of log files. All output files
are updated for each simulation. Use the -ga command line option to enable gzip file
compression of the output files.
The following table lists the netlist file formats that are supported in the PrimeSim XA tool.
Table 6 Supported Netlist File Format and Command Line Options
*.mc, *.mc.csv, Output files from Monte Carlo Analysis when you use the
*.mc_params set_monte_carlo_option command. See the PrimeSim XA
Command Reference for the details of this command and the
output files it creates. To gzip compress output results, use the
-gz option.
Table 6 Supported Netlist File Format and Command Line Options (Continued)
or
.option xa_cmd="set_waveform_option -format wdf"
The PrimeSim XA tool supports the post native-SPICE netlist option to specify the
waveform format in PrimeSim HSPICE and Eldo.
.option post=out
off to the closest grid. The default voltage resolution is 1 uV, and the default current
resolution is 1 pA.
• Writing Buffered Simulation Progress to the Output File
Use the -flush option to write the buffered data to an output file during simulation.
The default setting is 10%, meaning that the tool writes the simulation progress to the
output file every 10% of the simulation transient end time.
The following example updates the waveform file every 100 ns of simulation time.
set_waveform_option -flush 100ns
The following example updates the waveform file every 10% of the simulation time.
If the transient end time is 2us, in this example the PrimeSim XA tool updates the
waveform file after at least every 200 ns.
set_waveform_option -flush 10%
When the -disk_full option is specified, the PrimeSim XA tool stops with a disk full
error if the disk space is detected to be less than the specified threshold.
In the following example, the PrimeSim XA tool issues a warning when the disk space
is less than two GB and stops when it is less than one GB.
set_waveform_option -disk_full 1000
waveform partitioning based on time (such as, probe window, transient time or wall
time), an error message is issued.
For example, if you specify the following commands in one simulation run:
set_waveform_option -tran_time_period 100
In PrimeSim XA, split waveform data using one of the following methods:
◦ Waveform splitting by file size
To split a waveform file when its size reaches a given value, use the following
command:
set_waveform_option -size max_file_size_MB
▪ To write waveform data into multiple files without saving the simulation state, use
the following command:
set_waveform_option -tran_time_period time
▪ To write waveform data into multiple files without saving simulation state, use the
following command:
set_waveform_option -wall_time_period period_in_hour
The following example partitions waveforms based on the period of transient time of 4us
using distributed processing with two cores:
set_waveform_option -parallel_dump 2 -tran_time_period 4u
3
PrimeSim HSPICE Netlist Compatibility
The PrimeSim XA tool is fully compatible with the PrimeSim HSPICE syntax, elements,
device models, simulator commands, and netlist options; however, some exhibit different
default behavior in the PrimeSim XA tool. Several additions and enhancements have been
implemented in the PrimeSim XA tool to support many native PrimeSim HSPICE features,
options, models, and netlist elements.
This chapter details the enhancements, limitations, and variations compared to the default
PrimeSim HSPICE syntax, behavior, and options, as described in the following topics:
• Running PrimeSim XA With the PrimeSim HSPICE Netlist Format
• Syntax and Behavior Variations
• PrimeSim HSPICE-Compatible Netlist Commands
• PrimeSim HSPICE-Compatible Control Options
• Built-In Functions
• Elements
• Device Models
• Transient Analysis
• Violation Checks Using HSPICE .BIASCHK Statements
• Bisection Methodology and Behavior Variations
• PrimeSim HSPICE-Encrypted Netlist Format
• Post-Layout Simulation Galaxy Parasitic Database (GPD)
See the Running the Simulator section for details about the other command line options.
The PrimeSim XA tool interprets the first word of every line that begins with a period
character (.) as a statement. Unrecognized netlist statements are ignored, and a warning
is issued. The PrimeSim XA tool supports the following HSPICE netlist statements:
• .APPENDMODEL
• .ALTER
• .CFL_PROTOTYPE
• .CONNECT
• .DATA … .ENDDATA
• .DEL LIB
• .DOUT
• .ELSE
• .ELSEIF
• .END
• .ENDDATA
• .ENDIF
• .ENDS
• .ENDL
• .EOM
• .GPD_INC
• .GLOBAL
• .IC
• .IF
• .INCLUDE / INC / INCL
• .INSTVALID
• .IVTH
• .LIB
• .MACRO
• .MALIAS
• .MEASURE / MEAS
• .MEASURE (AVG, EM_AVG, INTEG, MIN, MAX, PP, and RMS)
• .MEASURE (Continuous Results)
• .MEASURE (Derivative Function)
• .MEASURE (Equation Evaluation/Arithmetic Expression)
• .MEASURE (FIND and WHEN)
• .MEASURE (Integral Function)
• .MEASURE (Rise, Fall, Delay, and Power Measurements)
• .MODULE … .ENDMODULE
• .MODEL
• .MOSRA
• .NODESET
• .OP
• .PAT
• .OPTION / OPTIONS
• .PARAM / PARAMETER / PARAMETERS
• .PRINT
• .PROBE
• .PROTECT / PROT
• .SAVE
• .SUBCKT
• .TEMP / TEMPERATURE
• .TITLE
• .TRAN / TR
• .UNPROTECT / UNPROT
• .VEC
Table 8 lists the supported and enhanced PrimeSim HSPICE simulation statements in the
PrimeSim XA tool but have different syntaxes or behaviors with the PrimeSim HSPICE
tool.
Table 8 Supported PrimeSim HSPICE Netlist Statements With Different Behaviors
in PrimeSim XA
Statement Description
The PrimeSim XA tool supports the following PrimeSim HSPICE Compatible Control
Options:
• .OPTION AUTOSTOP
(The alias AUTOST is not supported in PrimeSim XA)
• .OPTION ASPEC
• .OPTION BSIM4PDS
• .OPTION CAPTAB
• .OPTION CFLFLAG
• .OPTION CMIFLAG
• .OPTION CMIUSRFLAG
• .OPTION CMIPATH
• .OPTION CSHUNT
• .OPTION DCAP
• .OPTION DEFAD
• .OPTION DEFAS
• .OPTION DEFL
• .OPTION DEFNRD
• .OPTION DEFNRS
• .OPTION DEFPD
• .OPTION DEFPS
• .OPTION DEFW
• .OPTION DUMPCFL
• .OPTION DP_DISKFREE
• .OPTION DP_MEMFREE
• .OPTION DP_LOADAVG
• .OPTION DP_MASTER_WAITTIME
• .OPTION DP_TASK_MAXATTEMPT
• .OPTION ETMIUSRINPUT
• .OPTION EXPLI
• .OPTION GENK
• .OPTION GEN_CUR_POL
• .OPTION GEOSHRINK
• .OPTION GMAX
• .OPTION GMIN
• .OPTION GMINDC
• .OPTION IGNORE_MALIAS
• .OPTION IVTH
• .OPTION IVTH_MODEL
• .OPTION KLIM
• .OPTION MACMOD
• .OPTION MEASDGT
• .OPTION MEASFAIL
• .OPTION MEASFILE
• .OPTION MEASFORM
• .OPTION MIXED_NUM_FORMAT
• .OPTION MODMONTE
• .OPTION MONTECON
• .OPTION MODPARCHK
• .OPTION OPTS
• .OPTION NUMDGT
• .OPTION PARHIER
(The alias PARHIE is not supported in PrimeSim XA)
• .OPTION PROBE
• .OPTION POST
• .OPTION POST_VERSION
• .OPTION PUTMEAS
• .OPTION S_RATIONAL_FUNC
• .OPTION SAMPLING_METHOD
• .OPTION SEARCH
• .OPTION SCALE
• .OPTION SEED
• .OPTION SCALM
• .OPTION SLOPETOL
• .OPTION SHRINK
• .OPTION SX_FACTOR
• .OPTION SPMODEL
• .OPTION TMIAGE
• .OPTION TMIINPUT
• .OPTION TMIFLAG
• .OPTION TMISAVE
• .OPTION VAMODEL
• .OPTION TNOM
• .OPTION WACC
• .OPTION WARNLIMIT
• .OPTION WL
• .OPTION XMULT_IN_EXP / M_IN_EXP
• .OPTION XDTEMP
Table 9 lists the supported PrimeSim HSPICE simulation control options that exhibit
different syntaxes or behaviors with the PrimeSim HSPICE tool.
cshunt=value The default value for the PrimeSim XA tool is 1e-20 farads,
which differs from the default value of 0 in the PrimeSim
HSPICE tool.
gmin=value The PrimeSim XA tool uses this option only during the DC
operating point stage to get initial conditions. In the PrimeSim
HSPICE tool this option affects the transient simulation.
Built-In Functions
An expression is an equation consisting of a number, parameter, waveform, built-in
functions, or arithmetic operations (+, -, *, /), contained within matching single or double
quotes. The quotes may be omitted if the expression starts with an alphabetic character
and does not contain white space. Table 10 lists the PrimeSim HSPICE built-in functions
that you cannot redefine. See the PrimeSim HSPICE User Guide: Basic Simulation and
Analysis for more information.
ABS() ACOS()
AGAUSS() ASIN()
ATAN() AUNIF()
CEIL() COS()
DB() COSH()
EXP() FMOD
GAUSS() FLOOR()
INT() LN()
LOG() LOG10()
LIMIT() MAX()
NINT() MIN()
POW() PWR()
ROUND() SGN()
SIN() SIGN()
SINH() TAN()
SORT() TANH()
UNIF()
Elements
The syntax for each element is compatible with PrimeSim HSPICE. For details about each
element, see related topics in PrimeSim™ HSPICE® User Guide: Basic Simulation and
Analysis.
Table 11 lists the PrimeSim HSPICE elements that are supported in the PrimeSim XA tool.
C Capacitor
D Diode
I Current Source
J JFET
K Mutual Inductor
L Linear Inductor
M MOSFET
Q BJT
R Resistor
V Voltage Source
W Transmission Line
X Subcircuit Instance
The precedence order is that the instance statement overwrites the model and option
statements. The model statement overwrites the .OPTION statement.
Device Models
The following tables list the model APIs and device models that are supported in the
PrimeSim XA tool. These APIs are fully compatible with the PrimeSim HSPICE tool. For
a detailed description on these models, see the related topics in PrimeSim™ Continuum
Reference Manual: MOSFET Models and PrimeSim™ Continuum Reference Manual:
Device Models.
These APIs and device models are:
• Custom Common Model Interface (CMI)
• MOSFET Reliability Analysis (MOSRA)
• TSMC Model Interface (TMI)
• Si2 Compact Model Coalition Model Interface - Open Model Interface (OMI)
Table 12 Supported HSPICE Diode Models
2 Fowler-Nordheim Diode
4 JUNCAP Model
Table 13 lists the supported HSPICE BJT models in the PrimeSim XA tool. Refer to the
BJT Models section in PrimeSim Continuum Reference Manual: Device Models for details.
Table 13 Supported HSPICE BJT Models
1 Gummel-Poon Model
2 Quasi-saturation Model
Table 14 lists the supported HSPICE JFET models in the PrimeSim XA tool. For more
information about JFET models, see the JFET and MESFET Models section in PrimeSim
Continuum Reference Manual: Device Models.
Table 14 Supported HSPICE JFET Models
Table 15 lists the PrimeSim XA-supported HSPICE MOSFET models. Refer to the
MOSFET modelsMOSFET models
1 MOS Level 1
2 MOS Level 2
3 MOS Level 3
70 BSIMSOI4 Model, versions 4.0, 4.1, 4.2, 4.3, 4.3.1, 4.4, 4.5,
4.6, 4.6.1, 100.0.1, and 100.1
83 HiSIMHMG 2.0
84 HiSIM_SOTB 1.2
Table 16 lists the supported HSPICE capacitor models in the PrimeSim XA tool.
Table 16 Supported Capacitor Models
Table 17 lists the supported HSPICE resistor models in the PrimeSim XA tool.
Table 17 Supported HSPICE Resistor Models
Table 18 lists the supported HSPICE MTJ models in the in the PrimeSim XA tool.
Table 18 Supported HSPICE MTJ Models
1 BSIM-MTJ-BDMC 1.0
Transient Analysis
The PrimeSim XA tool supports the following transient analyses:
• Single Point Analysis
• Single Parameter Sweep Analysis
• Multiple Parameter Sweep Analysis
• Using a Parameter Step in Multiple Parameter Sweep Analysis
• Time-Window-Based Analysis
• Monte Carlo Analysis in PrimeSim XA
For a detailed description about transient analysis, see the related chapters in PrimeSim
HSPICE User Guide: Basic Simulation and Analysis.
Argument Description
Argument Description
UIC A keyword that specifies not to compute the initial operating point
during DC, but directly enters transient analysis.
When you use UIC in the .TRAN statement, the node values (at
time=0) are determined by searching for the first value found in the
following order:
1.A value specified by an .IC statement applied to the node
2.A device IC instance parameter on an element (capacitors and
inductors only)
3.A value specified by a .NODESET statement applied to a node
4.If none of the above is set, the tool uses a voltage of zero (0)
Note that forcing a node value of the DC operating point with the
.IC statements might not satisfy KVL and KCL rules. Forcing a node
voltage applies a fixed equivalent voltage source during DC analysis;
and transient analysis removes the voltage sources to calculate the
second and later time points.
Therefore, to correct DC convergence problems, use the .NODESET
statements (without UIC in the .TRAN statement ) liberally when a
good guess can be provided, and use the .IC statements sparingly
when the exact node voltage is known.
Argument Description
var Specifies the parameter for sweep analysis. You can use the TEMP
keyword for temperature sweeping.
Argument Description
np Specifies the number of points for LIN or POI, or the number of points
per DEC or OCT.
Argument Description
Argument Description
UIC A keyword that specifies not to compute the initial operating point
during DC, but directly enters sweep analysis.
When you use UIC in the .TRAN statement, the node values (at
time=0) are determined by searching for the first value found in the
following order:
1.A value specified by an .IC statement applied to the node
2.A device IC instance parameter on an element (capacitors and
inductors only)
3.A value specified by a .NODESET statement applied to a node
4.If none of the above is set, it uses a voltage of zero (0)
Note that forcing a node value of the DC operating point with the
.IC statements might not satisfy KVL and KCL rules. Forcing a node
voltage applies a fixed equivalent voltage source during DC analysis;
and transient analysis removes the voltage sources to calculate the
second and later time points.
Therefore, to correct DC convergence problems, use the .NODESET
statements (without UIC in the .TRAN statement) liberally when a good
guess can be provided, and use the .IC statements sparingly when
the exact node voltage is known.
DATA=dataname Specifies the data name, referenced in the .TRAN statement from a
.DATA statement.
Output analysis files are suffixed with the .s# extension, where # is an incremental
integer, starting from 0, representing the simulation iteration count when using the .DATA
statement. The PrimeSim HSPICE tool differs by combining the analysis results of all
iterations into one single file. The syntax for specifying an array is:
.DA[T[A]] dataname pname1[ ... pnamen]
pval1 [ ... pvaln]
...
pvalm [... pvalmn]
.ENDD[A[T[A]]] [dataname]
The following example defines an array named data1 with two parameters, v_val and
td_val, for multiple parameter sweep analysis.
.PARAM v_val=3.1v td_val=0ns
.DATA data1 v_val td_val
3.1v 0ns
3.1v 1ns
2.5v 2ns
1.1v 3ns
.ENDDATA data1
Note:
You can abbreviate .DATAVAR and .ENDDATAVAR with .DAV and .ENDDAV.
Argument Description
datavarname Defines the name of the .DATAVAR block, which can be one of the
following values:
• N|n specifies a linear (equidistant) mode.
• L|l specifies a logarithmic (constant ratio between two consecutive
values) mode.
• T|t specifies a tabular mode.
• k specifies the number of steps. This must be an integer value.
.setparam Specifies the parameter definitions. You can use the INST and
SUBCKT keywords to apply the parameter definitions to instances and
subcircuits, respectively. Otherwise the parameter definitions apply
globally.
1 1,1v 0u
2 2.1v 1u
3 3.1v 2u
In the following example, the width of the M0 MOS in X1 instance is swept and takes two
values: 1u and 3u.
.DATAVAR mos_width T=2
.setparam inst=X1.M0 W = (1u, 3u).ENDDATAVAR mos_width
.tran 1n 100p sweep datavar=(mos_width)
Mult W r value
1 2u 1k
2 2.2u 1.2k
3 2.4u 1.4k
4 2.6u 1.6k
5 2.8u 1.8k
6 3u 2k
In the following example, the rpoly_rtol subcircuit parameter is swept and take two
values: -0.2 and +0.2.
.subckt rpoly ( p n ) value = val rpoly_rtol = 0 \
rmain p n ' value * ( 1 + rpoly_rtol ) '
.ends
.datavar rtol T=2
.setparam subckt=rpoly rpoly_rtol = ( -0.2, +0.2 )
.enddatavar rtol
.tran 1n 100p sweep datavar=(rtol)
In the following example, the four variations of the resistor value are: 1, 10, 100, and 1000.
.DATAVAR Mult L=4
.setparam inst=X3.R0 r = (1, 1000)
.ENDDATAVAR Mult
.tran 1n 100p sweep datavar=(Mult)
The mathematical expression to calculate the constant ratio for the logarithmic step is:
The following example shows a duplicate parameter defined in the same .datavar block.
.datavar var1 T=2
.setparam p1=(1, 2) p2=(1, 2)
.setparam p1=(5, 6) p3=( 1, 2)
.setparam ins=x1.x2 r1=(1, 2) r2=(1, 2)
.setparam ins=x1.x3 r2=(1, 2) r2=(1, 2)
.setparam ins=x1.x2 r1=(5, 6) r3=(1, 2)
.enddatavar
.tran 1n 100p sweep datavar=(var1)
After checking for duplicate parameters, here is the equivalent .datavar block.
.datavar var1 T=2 .setparam p1=(5, 6) p2=(1, 2) p3=(1, 2)
.setparam ins=x1.x2 r1=(5, 6) r2=(1, 2) r3=(1, 2)
.setparam ins=x1.x3 r2=(1, 2) r2 =(1, 2)
.enddatavar
.tran 1n 100p sweep datavar=(var1)
The following example shows the duplicate parameter defined in two .datavar blocks.
.datavar var1 T = 2
.setparam p1=(0, 1)
.setparam ins=x1.x2 r1=(0, 1)
.setparam subckt=sub1 q1=(0, 1)
.enddatavar
.datavar var2 T = 2
.setparam p1=(0, 1) p2=(0, 1)
.setparam ins=x1.x2 r1=(0, 1) r2=(0, 1)
.setparam ins=x1.x3 r2=(0, 1) r3=(0, 1)
.setparam subckt=sub1 q1=(0, 1) q2=(0, 1)
.setparam subckt=sub2 q1=(0, 1) q2=(0, 1)
.enddatavar
var1:
p1 r1 q1
0 0 0
1 1 1
var2:
p1 p2 r1 r2 r2 r3 q1 q2 q1 q2
0 9 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 1
var1 * var2:
In the following table, the values in bold are chosen after checking for duplicates.
p1 p1 p2 r1 r1 r2 q1 q2 q1 q1 q2 q1 q2
0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 1 0 1 1 1 1 0 1 1 1 1
1 0 0 1 0 0 0 0 1 0 0 0 0
1 1 1 1 1 1 1 1 1 1 1 1 1
This syntax is used to rerun the simulation for all the possible combination of parameters
in one or more .DATAVAR blocks. The sweep syntax can refer to both the .DATAVAR label
and existing .DATA labels.
In the following example, the first data1 block changes the X0.R1 resistor value from 0.5k
to 1.5k ohms in 10 steps (n = 10). For each X0.R1 value, the data2 block changes the
X0.C1 capacitance value from 0.4nF to 0.8nF in 4 steps (n=4).
.datavar data1 n=10
.setparam inst=X0.R1 r= (0.5k, 1.5k)
.enddav data1
Output Files
A .s# extension is added for each combination of the .datavar blocks.
The following example:
.datavar data1 n=3
.setparam inst=X0.R1 r= (0.5k, 1.5k)
.enddv data1
The parameter combination of each simulation is written to the log file together with the
sweep number (#) and information about the output file (meas/waveform) extension. The
following information is reported in the *.log file for each simulation:
.SWEEP DATAVAR (#0) (output extension is .s0.s0) X0.R1=0.5k X0.C1=0.4n
.SWEEP DATAVAR (#1) (output extension is .s0.s1) X0.R1=0.5k X0.C1=0.8n
.SWEEP DATAVAR (#2) (output extension is .s1.s0) X0.R1=1k X0.C1=0.4n
.SWEEP DATAVAR (#3) (output extension is .s1.s1) X0.R1=1k X0.C1=0.8n
.SWEEP DATAVAR (#4) (output extension is .s2.s0) X0.R1=1.5k X0.C1=0.4n
.SWEEP DATAVAR (#5) (output extension is .s2.s1) X0.R1=0.5k X0.C1=0.8n
Time-Window-Based Analysis
PrimeSim XA supports the HSPICE tempvec option to change temperature values during
transient analysis, based on time windows.
To configure window-based temperature values in the PrimeSim XA environment, run the
tempvec option in the following syntax:
.TRAN tstep tstop tempvec=(t1 Temp1 t2 Temp2 t3 Temp3 ...)
However, PrimeSim XA does not support the HSPICE tempstep option, which means the
temperature is constant within the same time window. For example, if you specify:
.tran 1n 200n tempvec=(0n 25 50n 50 100n 100)
The temperature is 25C between 0n and 50n, 50C between 50n and 100n, and 100C from
100n to the end of transient simulation.
Note:
The support of the tempvec option in PrimeSim XA has been implemented
using the PrimeSim XA save and restore feature. That means the following
save-and-restore limitations also apply when you specify the tempvec option in
the PrimeSim XA environment:
• The tempstep option is not supported. When used, a warning is issued.
• The waveforms are split and soft links are created so that the <prefix>.fsdb
file can be loaded and merged. For example, for xa.fsdb, the following files
are created:
◦ xa.fsdb -> xa.temp1.fsdb
◦ xa.fsdb.1 -> xa.temp2.fsdb
◦ xa.fsdb.2 -> xa.temp3.fsdb
When the xa.fsdb file is loaded in WaveView, all 3 files (including xa.fsdb,
xa.fsdb.1 and xa.fsdb.2) are opened.
• Measurement output files are split. There is one measurement file per time
interval (per temperature), using the following naming style:
<prefix>.temp1.meas
<prefix>.temp2.meas
<prefix>.temp3.meas
...
• If a measurement overlaps 2 or more time/temperature intervals, then
the measurement is reported as failed. Only the measurements that can
complete within the time/temperature interval are reported.
Note:
• The biaschk_enable=0 command is supported only when .option
biasfmt=2 is specified.
• Not all the features of the .BIASCHK statement from PrimeSim HSPICE are
supported. The PrimeSim XA tool also supports additional features for the
FastSPICE application.
• The .BIASCHK statement is not supported in Eldo and Spectre netlist
formats.
The output violation report includes violation details, like the element (instance) name,
time, terminals, bias that exceeds the limit, or the number of times the bias exceeds the
limit for an element.
This section contains the following topics;
• Syntax
• Using the set_biaschk Command
• Using the noise Option
• Supported Netlist Options
• Output Formats and Examples
Syntax
This section lists the syntaxes that are supported when you use the .BIASCHK statement in
PrimeSim XA.
• The .BIASCHK type Syntax
The following syntax monitors the bias voltage and current for the specified device
type.
The following syntax monitors the width and length of specified device type.
.BIASCHK type
+ [max=max] [min=min]
+ [simulation=tr] [monitor=l|w]
+ [name=name1,name2,...]
+ [mname=mname1,mname2,...]
+ [tstart=time1] [tstop=time2] [autostop]
+ [except=ename1,ename2,...]
+ [sname=sname1,sname2,...]
+ [interval=tval] [biasname=label]
The following syntax monitors some common instance conditions of the specified
device type.
.BIASCHK type
+ [max=max] [min=min]
+ [simulation=tr] [monitor=param]
+ [name=name1,name2,...]
+ [mname=mname1,mname2,...]
+ [tstart=time1] [tstop=time2] [autostop]
+ [except=ename1,ename2,...]
+ [sname=sname1,sname2,...]
+ [interval=tval] [biasname=label]
.BIASCHK 'expression'
+ [condition=cond_logic_expr]
+ [max=max] [min=min]
Argument Description
Argument Description
device Specifies additional conditions when using the bias check method,
such as min/max for the MOS monitor.
simulation Specifies the simulation type you want to monitor. The supported
analysis types are: op, dc, ac, tr (transient), and all (for op, dc,
ac, and tr). Default is tr .
NOTE: The DC, OP and AC types are supported only in PrimeSim
HSPICE and PrimeSim tools.
Argument Description
monitor=param Monitors the specified instance condition. See Table 20 for a list of
supported functions for accessing device condition.
name=name1,name2 Scopes the device name for bias check. More than one device
name can be specified with a comma (,) as a delimiter. If
type=SUBCKT, the following rules apply:
• name is the instance name and mname is the subcircuit name.
• When both name and mname are defined and if a name is also an
instance name of mname, then only those names are checked.
Otherwise, this statement is ignored.
You can specify name and mname in the same statement, but use
them cautiously.
tstart=time1 Specifies the time window to perform bias check. time1 is start
tstop=time2 time of a time window and the time2 is the end time of a time
window. The default value for time1 is 0 and time2 is the end of
transient time.
interval=tval Prevents reporting intervals that are less than or equal to the time
specified. Default as zero.
Argument Description
biasname=label Specifies the label name of the .BIASCHK statement. When not
specified, the PrimeSim XA tool gives an index as the label.
Use this argument to organize multiple .biaschk commands and
their outputs in final bias check result files, for viewing violation
details in GUI applications.
noise=val Specifies the noise for bias voltage check to filter out some of the
violations for reporting. It does not support bias current check. The
default is 0v. This option filters some of the violations that exceed
the upper threshold value defined by max. See the Using the noise
Option section.
Parameter Description
Parameter Description
Parameter Description
Function Description
Function Description
Examples
This example reports the violation if the voltage on terminal 1 of a capacitor named c10
exceeds the value of 0.1V.
.biaschk c terminal1=n1 max=0.1 name='c10'
This example reports the violation if the voltage difference of net27 and net25 is outside
of the range of 1e-2V and 1V.
.biaschk 'v(net27)-v(net25)' min=1e-2 max=1
This example checks if the drain current of MOSFET is greater than 150uA, the .BIASCHK
statement is enabled to check its vgs bias of all MOSFET. If vgs bias is less than 4, it
reports a violation.
.biaschk mos expr='vgs(*)' condition='id(*) > 150u' min=4
This example checks if v(clock) is greater than 3, the .BIASCHK statement is enabled
to check the value of voltage difference of all the drain terminal of all MOSFET and node
net25. If the value is less than 1, it reports a violation.
.biaschk mos expr='vd(*)-v(net25)' condition='v(clock) > 3' min=1
.cmd set_biaschk
+ biasname = "biaschk1" ["biaschk2", …]
+ enable = 0 | 1
Argument Description
enable = 0 | 1 Controls the enabling flag for the specified .biaschk statements.
Example
In the following example, the bias_mos_1, bias_mos_2, bias_bjt_1, bias_bjt_2 are
selected to be enabled. Then, the set_biaschk command is set twice to disable
bias_mos_1 and bias_bjt_1.
.biaschk biasname=bias_mos_1
.biaschk biasname=bias_mos_2
.biaschk biasname=bias_bjt_1
.biaschk biasname=bias_bjt_2
.cmd set_biaschk biasname = bias* enable = 1
.cmd set_biaschk biasname = bias*_1 enable = 0
If you do not specify noise, the PrimeSim XA tool reports peak1, peak2 and peak3 as
violations in the report. If noise is specified, the PrimeSim XA tool filters the violations with
the following rules:
• If (Vpeakn > max) & (Vpeakn - Vvalleyn < noise), then reported_violation=Vpeakn
• If (reported_violation < Vpeakn+1) & (Vpeakn+1 - Vvalleyn+1 < noise), then
reported_violation=Vpeakn+1
In Figure 2, if Vpeak1=15.5v, Vpeak2=15.7v, Vpeak3=15.4v, Vvalley1=15.4v,
Vvalley2=15.2v and noise=0.8, then only peak2 is reported as a violation.
.OPTION BIASFILE='fileName'
.OPTION BIASFLUSH=auto
.OPTION BIASFMT=0|1|2|cck|off
Argument Description
BIASFILE='filename' Specifies the file name of the violation report. If this option is
not specified, the output file is suffixed with *.biaschk when
BIASFMT=0|2 or *.biaschk.ccksoa when BIASFMT=cck.
BIASFMT=0|1|2| Specifies the output format of the violation report. It can be set to :
cck|off • 0 to generate violation reports in PrimeSim HSPICE-compatible
format.
• 1 to generate violation reports in XA-compatible format.
• 2 to generate violation reports in common SOA format. This is
the common output format for Synopsys simulators, including
PrimeSim XA, PrimeSim HSPICE and PrimeSim.
• cck to generate violation reports in legacy CCK format.
• off to disable violation reporting.
See the Output Formats and Examples section for examples.
Elements that have biaschk out of limit during the transient simulation:
-------------------------------------------------------------------------
-----------------
Input netlist:
.biaschk subckt expr='abs(v(n1,n3))' mname=inv …
.subckt add
x1 … inv
.ends
.subckt inv
m1 …
.ends
Report:
Dev 1: xtop1.x1.m1
Subinfo: add inv
Dev 2: xtop2.x1.m2
Data:
Constraint: ((5-vd) * 10, 3, 6, 0n), TR
Duration: seq=1, t1=1ns, t2=0.2us, span=0.199us
Start: expr=0.163V, t=1ns
End: expr=0.197V, t=0.2us
Min(expr): expr=0.163V, t=1ns
Max(expr): expr=0.693V, t=0.1802us
Total Violation Time: 0.199us
Data:
Constraint: (V1, *, .1)
Duration: seq=1, t1=0s, t2=8ns, span=8ns
Start: expr=5V, t=0s
End: expr=5V, t=8ns
Min(expr)= expr=5V, t=0s
Min(expr)= expr=5V, t=0s
Total Violation Time: 8ns
*
* CCK Command Footer
*
* CCK Command: biaschk
* Tag= 0
* Total Number of devices: 1
*
* CCK Command: biaschk
* Tag= 1
*Scopes:
* Inst=v(net27)-v(net25)
*Constraints: (v(net27)-v(net25), .1e-10, 1) numvd=all
*
Node #1: net27
• Both the PrimeSim HSPICE and PrimeSim XA tools require iteration #1 to pass and
iteration #2 to fail or iteration #1 to fail and iteration #2 to pass. The difference in
behavior comes from the definition of "fail" as follows:
◦ In the PrimeSim HSPICE tool, "fail" means the measurement did not occur, or when
a voltage is not crossing the threshold set by goal at any time during the simulation.
The word "failed" is written to the .mt# file.
◦ In the PrimeSim XA tool, "fail" has the same meaning as in the PrimeSim HSPICE
tool. It also means that the measurement did return a value, but that value did not
satisfy the goal. This convention is useful when you use the greater than or less
than operands.
The PrimeSim XA log file contains the following bisection information:
• Number of bisection iterations run
• Iteration selected as the final result
• Value of the bisection parameter for each bisection iteration
• Value of the bisection measurement for each bisection iteration
• Information related to meeting RELIN and RELOUT options
By default, the PrimeSim XA tool writes out the measurement data from the selected
iteration only to the *.meas file. You can use set_meas_option -bisect_meas all to
create an additional output file with *.bisect_meas suffix that contains the measurement
results for all the bisection iterations.
The following example shows how to set up a bisection simulation with the .TRAN
statement, DelayTime parameter, and .MEASURE statements.
* DFF_top Bisection Search for Setup Time* PWL Stimulus
v28 data gnd PWL
+ 0s 5v
+ 1n 5v
+ 2n 0v
+ Td = "DelayTime" $ Offsets Data from time by DelayTime
+ Model = OptMod
* This measure finds the transition if it exists
.MEASURE Tran MaxVout Max v(D_Output) Goal = 'v(Vdd)'
* Optimization Model
.MODEL OptMod Opt Method = Bisection
Argument Description
For example, the following command performs post-layout simulation with the FF corner
provided in the GPD.
.gpd_inc dir/path_to_gpd FF
For more information about the load_gpd_data command, see PrimeSim™ XA Command
Reference.
4
Vector Stimulus Files
See Also
• Reading the PrimeSim HSPICE Vector File
The PrimeSim XA tool also supports SPICE-specific statements to read in a VEC file. To
incorporate a VEC file into the netlist, use the .VEC statement in either PrimeSim HSPICE
or Eldo netlist format, and the vec_include or vcd_include statements for 3rd-party
netlist format.
A VEC file consists of the following parts:
• Tabular Data Section
• Vector Pattern Definition Section
• Waveform Characteristics Section
Argument Description
The set of values for a particular signal is a vector, which appears as a vertical column in
the tabular data section. Rows in this section must appear in chronological order, because
row replacement carries sequential timing information. If the tabular data section is not
specified in a vector file, the PrimeSim XA tool terminates the simulation with an error
message.
You can use Verilog-sized format to specify multiple bits at once. The syntax is:
[size]'[base][number]
Argument Description
base The base format. The base can be B for binary, O for
octal, and H for hexadecimal.
• tunit
• vref
For FastSPICE applications, the PrimeSim XA tool supports the following statements that
are not supported in the PrimeSim HSPICE tool:
• period and tskip
• mcheck_windows
• vchk_ignore
• stop_at_error
radix
The radix statement must be the first non-comment line. It specifies the number of bits
associated with each table vector column. The integers may be concatenated or separated
by white space for clarity. The file must contain exactly one radix statement.
The syntax is:
When more than one bit is used in a column, the logic values can be represented by a
hexadecimal number (see Table 22). The bit order is: most-significant to least-significant.
Table 22 Range of radix Value
1 0-1
2 0-3
3 0-7
4 0-9, A-F
The following example illustrates two 1-bit vectors, followed by one 2-bit vector, and one 4-
bit vector.
radix 11 2 4
vname
The vname statement defines the name of each vector. Each vector drives the node with
the same name in the schematic netlist. If the number of bits is more than one in the
radix statement, you can use [starting_index:ending_index] to specify a range of
vectors or a bus. The vname statement must be specified in the PrimeSim XA tool, but is
optional in the PrimeSim HSPICE tool.
The syntax is:
The following example defines names va vb for two 1-bit vectors, vc0 vc1 for one 2-bit
vector, and vd[0] vd[1] vd[2] vd[3] for one 4-bit vector.
radix 11 2 4
vname va vb vc[0:1] vd[[0:3]]
The following example uses < > as bus delimiters and [ : ] to define 4-bit vector, vin<6>
vin<7> vin<8> vin<9>.
radix 4
vname vin<[6:9]>
io
The io statement defines the type of each vector. I defines input; O defines output; B
defines bi-direction; and U defines an unused vector. There must be one definition for each
column in the radix statement. The keywords may be concatenated or separated by white
space for clarity.
The syntax is:
io [I|O|B|U]1 … [I|O|B|U]n
State Description
Every bidirectional vector needs the enable or option CBC statement to control
the direction of the vector. These statements specify the condition that controls the
bidirectional vector to behave as input or output for the specified condition. See the
enable statement or the option CBC statement for details about how to define the
direction of the bidirectional vector. If you do not specify an enable or option CBC
statement, the PrimeSim XA tool sets all bidirectional vectors as input vectors, while the
PrimeSim HSPICE tool errors out.
The following example specifies va and vc[0:1] as inputs, vb as bidirectional, and
vd[[0:3]] as outputs.
radix 11 2 4
vname va vb vc[0:1] vd[[0:3]]
io i b i o
enable
Every bidirectional vector needs a control signal. The enable statement specifies the
control signal for a bidirectional vector. The control signal ensures the bidirectional vector
behaves as an input or output for the specified condition.
The syntax is:
Argument Description
The following example indicates that the bidirectional vector vb becomes output when va
is high and the bidirectional vector vc[0:1] becomes output when va is low. The enable
statement does not apply to the input or output vector.
radix 11 2 4
vname va vb vc[0:1] vd[[0:3]]
io i b b o
enable va 0 1 0 0
enable ~va 0 0 3 0
option CBC
The context-based control (CBC) option specifies the direction of bidirectional vectors
based on the characters used in the tabular data section. If the value is 0, 1, or Z, a
bidirectional vector is an input; if the value is H, L, U, or X, a bidirectional vector is an
output. The syntax is:
option cbc
tunit
The tunit statement defines the time and unit for a time-related statement and absolute
time in the tabular data section of the PrimeSim HSPICE VEC file. See Table 25 for the
keywords that specify the units.
If time is not specified, the default is 1. If unit is not specified, the default is s. If the
tunit statement is not specified, the default is 1ns.
Unit Description
fs Femtosecond
ps Picosecond
ns Nanosecond
us Microsecond
ms Millisecond
vref
The vref statement specifies the reference voltage name for each input or bidirectional
vector when in input mode.
The syntax is:
Argument Description
mask_argument Enables the vref only for selected vectors. For detailed
syntax descriptions, see the Specifying Masking
Patterns section.
The following example specifies vss as the reference node for va and vb, and vc[0:1].
radix 11 2 4
vname va vb vc[0:1] vd[[0:3]]
io i b b o
vref vss
period t_interval
tskip
The following example shows that the first row of tabular data (11 3 F) is at time 0 ns, the
second row (10 1 8) is at 10 ns, and the third row (01 2 9) is at 20 ns.
radix 11 2 4
vname va vb vc[0:1] vd[[0:3]]
io i b b o
period 10
11 3 F
10 1 8
01 2 9
In the following example, the first column of the tabular data is ignored because the tskip
statement is specified, so the period statement is used to specify the time interval for the
tabular data section.
radix 11 2 4
vname va vb vc[0:1] vd[[0:3]]
io i b b o
period 10
tskip
0.0 11 3 F
11.0 10 1 8 15.0 01 2 9
mcheck_windows
The mcheck_windows statement defines the time windows for output vector checking.
You can specify multiple output vector checking windows in one command or multiple
commands in a VEC file. This command compares the actual simulation outputs and
vector outputs only at the specified time windows.
mcheck_windows start_offset=start_offset_value
stop_offset=stop_offset_value steady=0|1 [period_time=period_value]
[twindow= start_time {,stop_time ,start_time} [,stop_time]]
[mask_argument]
Argument Description
period_time=period_value Specifies the strobe time for output vector checking. The
default if this argument is the output vector checking
performed at the strobe time specified in the PrimeSim
HSPICE VEC file. When period_val is specified, the
starting time is based on the start_t defined in twindow
argument.
twindow= start_time Specifies the time window for output vector checking.
{,stop_time ,start_time} You can specify multiple start_t and stop_t to define
[,stop_time] multiple time windows. The default if the twindow
argument is not specified is the start_t and stop_t is
0ns and the end of the transient time. If twindow argument
is specified, at least one start_t is needed.
The following example shows how the mcheck_windows statement is used for output
checking. The period=10 argument specifies the strobe time to be 10ns starting at 120ns
specified by twindow=120 argument. The time windows for output checking of vd[1] is
from 118 ns to 122 ns, 128 ns to 132 ns, and so on. The steady=1 argument indicates that
the output checking passes only if the output state matches the expected state throughout
the time window.
radix 11 2 4
vname va vb vc[0:1] vd[[0:3]]
io i i i o
mcheck_windows start_offset=2 stop_offset=2
+ steady=1 period=10 twindow=120
0.0 0 0 0 X
100 0 1 3 F
110 1 1 1 0
120 0 1 0 0
...
vchk_ignore
The vchk_ignore statement ignores the output vector checking at a time window.
Argument Description
stop_at_error
The stop_at_error statement stops the simulation whenever output vector checking fails.
It means the real simulation outputs and vector outputs during the defined time windows
for masking vectors do not match.
The syntax is:
stop_at_error
Argument Description
Keyword Description
idelay, idelay_r, idelay_f Specifies the delay time only for input vectors, relative
to the absolute time of each row in the tabular data
section. The delay time can be positive or negative.
The default is set to the value specified in the TDELAY
statement.
The IDELAY_R and IDELAY_F commands specify the
rising and falling inputs, respectively, for any given input
vectors.
odelay Specifies the delay time only for output vectors, relative
to the absolute time of each row in the tabular data
section. The delay time can be positive or negative.
The default is set to the value specified in the TDELAY
statement.
slope Defines the rise and fall times for the input vectors to
transition from logic-low voltage (specified in vil) to
logic-high voltage (specified in vih) or from logic-high
voltage (specified in vih) to logic-low voltage (specified
in vil). The value must be greater than zero. The
default is 0.1.
Keyword Description
tdelay Specifies the delay time for input and output vectors
relative to the absolute time of each row in the tabular
data section. The delay time can be positive or
negative. The default is 0.
tfall Specifies the fall time for input vectors to transition from
high-voltage (specified in vil) to low-voltage (specified
in vih). The value must be greater than zero, and less
than one-half of the smallest time period (which is the
time interval of each row in the tabular data section).
The fall time is set to one-half of the smallest time
period, if it is larger than this value. The default is set to
the value specified in the SLOPE statement.
Keyword Description
To use the autostop argument in the vec_include or vcd_include statements, use this
syntax:
vec_include "vector_filename" [autostop=yes|no]
or
vcd_include "vector_filename" [autostop=yes|no]
By default (when set to false|no), the PrimeSim XA uses the end time specified in the
.tran statement. If you set it true|yes, the tool uses the last specified time point in the
vector file as the end time.
When multiple .vec files are specified and any of them contain autostop=true, the
simulator selects the longest time point available in the .vec files and uses it as the end
time.
Note:
The autostop argument can also be used when loading .vcd and .evcd files.
Argument Description
autostop true|false|yes|no Controls the end time of the simulation when using the
vector file as an input.
• true|yes: Uses the last specified time point in the
vector file as the end time.
• false|no (default): Uses the end time specified in
the .tran statement.
[mask_by_bitmap=]vector_bitmap
Note:
The PrimeSim HSPICE tool does not support the mask_by_bitmap keyword.
mask_by_name=vector_name1[..., vector_namen]
The syntax for the mask statement when masking by vector names is:
mask_by_name=mask_name1[..., mask_namen]
You can use the tvec argument to specify time-dependent voltage threshold with either of
the following commands:
• VIH: Specifies logic-high voltage for each input signal
• VIL: Specifies logic-low voltage for each input signal
• VOH: Specifies logic-high threshold voltage for each output signal
• VOL: Specifies logic-low threshold voltage for each output signal
• VTH: Specifies logic threshold voltage for each output signal
For a detailed description about the VIH, VIL, VOH, VOL and VTH commands, see their
command pages in the PrimeSim™ Continuum Reference Manual: Commands and
Control Options.
For input thresholds, the affected signals change according to the given time points. When
a new threshold value applied, signal transition follows SLOPE or TRISE/TFALL defined for
the signal. The definition of TDELAY is also applied to the threshold modification with tvec
argument.
For output signals, voltages are digitized and checked against the expected values in the
vector file. The time-dependent output logic thresholds have the effect on digitization and
violation check in the time windows specified by the tvec argument.
Syntax Example
The following syntax shows how to specify time-dependent logic-high voltages for input
signals using the VIH command:
VIH <voltage> [<mask>] [tvec=(<t1,v1> [,<t2,v2>, …, <tn,vn>])]
where
• <voltage> specifies the default logic-high voltage. When the tvec argument is
specified, this default value is used for the duration that is not defined by the tvec
argument.
• <mask> specifies the name of a signal to which the VIH command applies. When not
specified, the VIH command applies to all input signals.
• tvec defines time-dependent logic threshold in the format of (time_point,
threshold_value). When defining a long sequence of values, separate time points and
threshold values by a space or a comma (“,”). The pair of time point and threshold
value must be placed inside the parenthesis.
◦ <t1, …, tn>: Time points, in the time unit defined in the vector file. When specified,
time points must be listed in ascending order and be aligned with the time points
in the tabular data section in the vector file. Otherwise, an error message will be
issued.
◦ <v1, …, vn>: Threshold values at the specified time points.
Note:
• The time points must not exceed the end time of simulation (tstop) in the
.tran statement in the netlist.
Example 2:
The following VIH statement uses the tvec argument to define the time-dependent
voltages starting from time point 12000. The VIH command sets logic-high voltage value to
3.0 which is the default value to be used from time point 0. The logic-high voltage is 3.0 at
the time point 0, and 2.8 at time point 12000, and so on.
VIH 3.0 tvec=(12000,2.8,13000,3.0,15000,3.3,72000,1.8)
Example 3:
In the following example, the first VIH command sets logic-high voltage to 3.0 for signals
that match the mask 11110. The second VIH command sets the same time-dependent
voltages as in Example 2, but only applies on the signals that match the mask 00001.
Other signals are not time-dependent in the VIH statement.
VIH 3.0 11110
VIH 3.0 00001 tvec=(12000,2.8,13000,3.0,15000,3.3,72000,1.8)
Example 4:
The following VIH statement shows that the time point defined in the tvec argument is
not aligned with the tabular data. The time point of 14000 in the tvec argument does not
appear in tabular data. The tool issues an error message before simulation starts.
VIH 3.0 tvec=(12000,2.8,14000,3.0,15000,3.3)
In the above example, tdelay in the vector file is evaluated as 2 from the top-level
parameter vec_offset. The time values of tabular data are evaluated as 0, 10, 12, 20, 22,
30, 32 and so on.
$date
<date>
$end
$version
VERILOG.XL 1.6b
$end
$timescale
lns
$end
$enddefinitions $end
$dumpvars
0!
b0000 *
b0000 #
0$
b000X %
$end
#10
b0000 #
b0000 *
0!
#12
b000X %
0$
#20
b0001 #
#22
b000X %
#30
b0010 #
#32
b001X %
certain type is applied to a particular vector, the last one takes precedence. A warning is
generated if a conflict arises.
The following example uses the load_vector_file command to load a VCD file to the
PrimeSim XA tool, named adder.vcd, and a VCD control file, named ctl.adder.sig.
load_vector_file -file adder.vcd -format vcd -ctl ctl.adder.sig
#format|#fo bus_notation
Character Description
Table 28 shows an example of the mapping of variable name tA using the #format
statement to various bus notation in the schematic netlist.
Table 28 Variable Mapping Example
Every output vector is converted to the expected output checking statement. During
simulation, the actual simulation outputs are converted to digital states and compared
to the expected output checking statements. A warning is generated if the states differ.
Table 30 shows the four valid states for output vectors supported in the VCD file.
Table 30 Valid States for Output Vectors
State Description
0 Expect simulation output voltage less than the value specified in #vol.
Otherwise, a warning is generated.
1 Expect simulation output voltage greater than the value specified in #voh.
Otherwise, a warning is generated.
Z Default to "Don't care" or Ignored. The behavior can be changed with the
set_vector_option command.
Every bidirectional vector requires the control signal to determine the direction of the
bidirectional vector as input vector or output vector. The syntax is:
Argument Description
Argument Description
in out|condition
The in defines as input vector and the out defines as output vector when the condition is
evaluated true. The condition can be a logic expression of one or multiple input vectors,
output vectors, or internal signals. You can also use the operators in Table 31 to define
the logic expression for the condition; wildcard characters are not supported. Although the
logic expression has no length limit, it is recommended not to split the logic expression
across lines.
Table 31 Supported Operators for Logic Expression
() Braces
~, ! NOT
^ Exclusive OR
|, || Inclusive OR
Precedence is in the order shown in Table 31, from highest to lowest. When specifying the
logic expression, you must use a white space to separate operators and vector names.
The PrimeSim XA tool may interpret (a|b) as a vector name, whereas (a|b) is interpreted
as a logic expression. The following example specifies that the input vectors are adder,
en, and m_dat bus:
#in adder en m_data*
The following example specifies adder, en and m_data bus as input vectors; c as output
vector; and dq as bidirectional vector. Bidirectional vector dq becomes input when both en
and c are logic-low state; otherwise, it is output. It is recommended to use a white space
to separate the operators and the vector names when specifying the control condition for
bidirectional vectors.
#input adder en m_data*
#output c
#bidirectional dq (in ~ (en & c))
#scope scope_name
The scope_name is the hierarchical scope name to the variables used in the VCD file.
The following example shows how you can use the #scope statement in the VCD control
file to map the variable names in the VCD file. It shows the section of VCD file with the
$scope statement:
$scope module adder $end
$var register 1 ! CIN $end
$var register 4 " A [3:0] $end
$var register 4 # B [3:0] $end
$var wire 1 $ COUT $end
$var wire 4 % S [3:0] $end
$upscope $end
To map the variables in the VCD file to the schematic netlist using the full hierarchical
names, specify the following in the VCD control file:
#input adder.CIN
#output adder.S[[3:0]]
To map the variables in the VCD file to the schematic netlist with the #scope statement,
specify the following in the VCD control file:
#scope adder
#input CIN
#output S[[3:0]]
in the VCD file match the node names in the schematic netlist. You must use the #alias
statement when:
• The variable names in the VCD file do not match the node names in the schematic
netlist. Note that VCD file and VCD control file are case-sensitive.
• There are different hierarchy levels between the variable name in the VCD file and the
node names in the schematic netlist.
The syntax is
The VCD_variable_name is the variable name in the VCD file. You must specify
the full hierarchical variable name unless you use the #scope statement. The
schematic_netlist_node_name is the node name in the schematic netlist. If the node
name is not a top-level node name, a full hierarchical node name is needed. You can use
the % character to represent the variable name.
In the following example, the variables are under the adder scope. Here is a section of the
VCD file with the #scope statement:
$scope module adder
$var register 1 ! CIN $end
$var register 4 " AI [3:0] $end
$var register 4 # BI [3:0] $end
$var wire 1 $ COUT $end
$var wire 4 % SO [3:0] $end
$upscope $end
CIN CIN_INPUT
AI AINPUT
BI BINPUT
COUT COUT_OUTPUT
SO SOUTPUT
To map the variable names in the VCD file to the node names in the schematic netlist,
specify the following:
#input CIN
#input AI*
#input BI*
#output COUT
#output SO*
#alias adder.CIN CIN_INPUT
#alias adder.AI[0] AINPUT[0]
#alias adder.AI[1] AINPUT[1]
#alias adder.AI[2] AINPUT[2]
#alias adder.AI[3] AINPUT[3]
#alias adder.BI[0] BINPUT[0]
#alias adder.BI[1] BINPUT[1]
#alias adder.BI[2] BINPUT[2]
#alias adder.BI[3] BINPUT[3]
#alias adder.COUT COUT_OUTPUT
#alias adder.SO[0] SOUTPUT[0]
#alias adder.SO[1] SOUTPUT[1]
#alias adder.SO[2] SOUTPUT[2]
#alias adder.SO[3] SOUTPUT[3]
Argument Description
Table 32 lists supported attribute statements to define for vectors in the VCD file. In cases
where VIH, VIL, VOH, and VOL can be parameters, you need to define the parameter
values in the netlist. For example, when you define the following parameters in the netlist,
.param par_input_high=1.7
.param par_output_high=1.6
.param par_input_low=0.1
.param par_output_low=0.3
Keyword Description
#idelay Specifies the delay time only for the input vectors. The
delay can be a positive or negative number. The default
is 0.
#odelay Specifies the delay time only for the output vectors. The
delay can be a positive or negative number. The default
is 0.
#tfall Specifies the fall time for the input vector to transition
from logic-high state (specified in #vih) to logic-low
state (specified in #vil). The value must be greater
than zero, and a unit must be specified. The default
is set to (0.5 * $timescale) where $timescale is
specified in the header information section of the VCD
file.
Keyword Description
Argument Description
Argument Description
vname1 ... vnamen Specifies the vector names for which the
#ignorewindow is applied.
The following example shows the expected output and actual simulation output waveform.
Here, if no #ignorewindow statement is specified in the VCD control file, the PrimeSim XA
tool reports the false mismatches from 39 ns to 40 ns, 44 ns to 45 ns, 49 ns to 50 ns, and
54 ns to 55 ns. To avoid reporting these false mismatches, specify the #ignorewindow
statement to ignore 0.5 ns before the expected transition, and 0.5 ns after the expected
transition is as follows:
#ignorewindow 0.5ns 0.5ns out
determine the direction of the vector based on the state character. For more information,
see the EVCD Port Direction Rule section.
Although it is optional to specify the direction information when reading in an EVCD file,
you must provide waveform attribute information in the EVCD control file. The command
and syntax of the EVCD control file are identical to the VCD control file. See the Specifying
a VCD Control File section for details. The strength information is not used by the
PrimeSim XA tool.
If you provide the direction information in the EVCD control file (using the #input,
#output or #bidirectional statement), it overrides the EVCD direction rule. See
Table 34 for its logic state for each valid state character when it is defined as input vector
or output vector. When a bidirectional vector behaves as input, it follows the input state
of each state character; when bidirectional vector behaves as output, it follows the output
state of each state character.
Table 34 Logic States for Each Valid Character
? X X (Don’t care)
F Z X (Don’t care)
a 0 X (Don’t care)
b 1 X (Don’t care)
The signals following #defdir use the EVCD direction rule. The signal list can use
wildcards.
5
Probing and Measuring
The PrimeSim XA tool supports many netlist statements and simulation commands to
generate both ASCII and binary waveform files and process measurements from the
simulation results.
All netlist statements are supported in the PrimeSim HSPICE netlist format. Certain
statements or arguments might not be supported in the Eldo netlist format. These netlist
statements can also be used in the Spectre netlist format if the simulation is specified
with the SPICE mode using the simulator lang=spice command. When you specify
simulator lang=spice, the PrimeSim XA tool parses the statements as if they are in the
PrimeSim HSPICE netlist format.
This chapter contains the following topics:
• Probing Statements and Commands
• Measuring Statements and Commands
• PrimeSim XA Enhancements to the .MEASURE Syntax
• External Table Parameter File Interface
Note:
If #disc is out of range of given table, will be error out.
To comment out a line, add the # symbol at the beginning of the line in table file.
Argument Description
The following examples use two-dimensional table data files, cap.table and res.table,
defined as follows:
The cap.table file:
#corner layer width space Cbot Ctop Ccpl
... ...
... ...
.PROBE|.PLOT
[label1 =] expression1 [ ... [labeln =] expressionn]
[subckt=subckt_name]
[except|filter=pattern]
[adonly=0|1]
[matchport=0|1]
limit=limit_value]
[level=level_value]
Or
.PROBE|.PLOT
[label1 =] PAR(expression1) [ ... [labeln =] PAR(expressionn)]
[subckt=subckt_name]
[except|filter=pattern]
[adonly=adonly_flag]
[matchport=port_flag]
[limit=limit_value]
[level=level_value]
Argument Description
expression1 ... expressionn Waveform expression, which must be a node name. See
Table 35.
Note:
The PrimeSim HSPICE tool requires the use of PAR
in equation expressions, while the PrimeSim XA tool
does not require the use of PAR. You should specify the
waveform expression in the quote.
adonly=0|1 When you specify 1, only the nodes that connect to at least
one active device are printed. The default is 0. Note that
this option is only effective when you specify a wildcard in
voltage probes.
Argument Description
The following example shows probing of the gate terminal voltage of X1.mn1 with the Vg()
or V2() signal-access function and assigns it to the gate_voltage label.
.PROBE gate_voltage = Vg(X1.mn1)
or
.PROBE gate_voltage = V2(X1.mn1)
The following example shows the usage of the limit and level arguments. Both
statements probe the voltage of all top hierarchy nodes only. The limit argument applies
to the absolute hierarchy level, and the level argument applies to the relative hierarchy
level where the asterisk symbol (*) is specified.
.PROBE V(*) limit=0
or
.PROBE V(*) level=1
The following example probes the voltage of all node at the top and first hierarchy levels.
.PROBE V(*) limit=1
or
.PROBE V(*) level=2
The following example probes the voltage of the nodes under x1.x2 hierarchy level.
.PROBE V(x1.x2.*) limit 2
or
.PROBE V(x1.x2.*) level 1
Shown in Figure 5, the total current that flows into X1.VDD is equivalent to the sum of the
current flowing into X1.X1A.VDD and X1.X1B.VDD. More specifically, the statement returns
the sum of ISUB(X1.X1A.VDD)+ISUB(X1.X1B.VDD) using the following statement:
.PROBE ISUB(X1.VDD)
The total current that flows into X3.VDD is equivalent to the sum of the current flowing into
X3.X3A.VDD and the drain of X3.M3A. More specifically, the statement returns the sum of
ISUB(X3.X3A.VDD)+I1(X3.M3A) using the following statement:
.PROBE ISUB(X3.VDD)
For the right subcircuit, the top-level nodes, VDD and VSS, are connected to ports P1 and
P2, so the nodes name have been changed. In this case, you can only use the XN()
function:
.PROBE XN(x0,VDD)
The following example prints the voltage of node2, the current flowing into VIN, and the
voltage ratio of OUT and IN; then it assigns the voltage to the label gain.
.OPTION XA_CMD="enable_print_statement -switch yes"
.PRINT V(node2) I(VIN) gain = "V(OUT)/V(IN)"
.LPRINT|.LPROBE
[label1 =] expression1 [ ... [labeln =] expressionn] [subckt=subckt_name]
[except|filter=pattern]
[vl|loth|low=vlth]
[vh|hith|high=vhth]
Argument Description
Argument Description
The following example probes the logic waveform expression of all nodes in the amos
subcircuit; it sets the high threshold as 3.5 volts and lower threshold as 1.5 volts.
.LPROBE V(*) loth=1.5 hith=3.5 level=1 subckt=amos
See Also
• Supported Waveform File Formats
Supported Functions
Here are the supported functions to specify with the .MEASURE statement in PrimeSim XA:
• PARAM Functions
• AVG, MAX, MIN, PP, RMS and INTEG Functions
• FIND, DERIVATIVE, and AT Functions
• FIND, DERIVATIVE, and WHEN Functions
• WHEN Function
• TRIG-TARG Function
• TRAN_CONT Function
PARAM Functions
The syntax for the PARAM function is as follows:
Argument Description
The following example measures the average value of parameters A, B, and C. The
measurement result is assigned to AVERAGE_VALUE.
.PARAM A=5 B=3 C=10
.MEASURE TRAN AVERAGE_VALUE PARAM="(A+B+C)/3"
Argument Description
The following example measures the maximum value of V(a)-V(b) during the time period
of 20 ns and 100 ns. The measurement result is assigned to MAXVAL.
where
Argument Description
The following example measures the derivative value of V(out) at 25 ns. The
measurement result is assigned to SLEW_RATE.
.MEASURE TRAN SLEW_RATE DERIVATIVE V(out) AT=25ns
condition is met. This syntax is used when the right-hand side of the conditional statement
is equal to a constant value:
This syntax is used when the right-hand side of the conditional statement is equal to a
waveform expression:
where
Argument Description
The following example measures the derivative value of v(A) when v(B) is equal to 5
volts at the third rising edge. The measurement result is assigned to DERVA.
.MEASURE TRAN DERVA DERIVATIVE v(A) when v(B)=5 RISE=3
WHEN Function
This function reports the time when a condition is met. This syntax is used when the right-
hand side of the conditional statement is equal to a constant value:
The syntax is used when the right-hand side of the conditional statement is equal to a
waveform expression:
where
Argument Description
Argument Description
This first statement measures the time at which v(A) is maximum during the time period of
0 and 100 ns and assigned to MAXVA. The second statement then measures the time when
V(A)=MAXVA and assigned it to TIME_AT_MAXVA.
.MEASURE TRAN MAXVA MAX v(A) FROM=0ns TO=100ns
.MEASURE TRAN TIME_AT_MAXVA WHEN v(A)=MAXVA
TRIG-TARG Function
This function reports the time difference between the triggered point and the target point.
The syntax is:
There are two syntaxes that specify speca and specb. The syntax for speca is:
AT[=]ta
Or
wa [VAL[=]vala] [TD[=]tda][VLG[=]vlga][VHG[=]vhga]
+[EVENTa[=]cnta]
AT[=]tb
Or
wb [VAL[=]vala] [TD[=]tdb][VLG[=]vlgb][VHG[=]vhgb]
+[EVENTb[=]cntb]
where
Argument Description
Argument Description
The following example measures the time delay between nodes1 and node2. The TRIG
measurement is taken at the second rising edge of node1 after 10 ns when its value is
equal to supply/2. The TARG measurement is taken at the second falling edge of node2
after 10 ns when its value is equal to supply/2. The measurement result is assigned to
TDELAY.
.MEASURE TRAN TDELAY TRIG V(node1) VAL='supply/2' TD=10n RISE=2
+ TARG V(node2) VAL='supply/2' TD=10n FALL=2
If you specify only the VAL argument as follows, the measurement result is the value of m1,
which is a glitch to the signal.
.MEASURE TRAN setup_rise_4_data_delay
+ TRIG v(addr) VAL='0.5*supply' TD='7n' FALL=1
+ TARG v(xsram.mn1.g) VAL ='0.5*supply' TD='7n' RISE=1
To correctly capture the measurement result in the presence of a glitch, use the VAL, VLG
and VHG arguments as follows. The measurement result is the value of m2.
.MEASURE TRAN setup_rise_4_data_delay
+ TRIG v(addr) VAL='0.5*supply' TD='7n' FALL=1
+ TARG v(xsram.mn1.g) VAL ='0.5*supply'
+ VHG='0.9*supply' VLG='0.1*supply' TD='7n' RISE=1
TRAN_CONT Function
The continuous measurement is a .MEASURE statement where TRAN_CONT replaces
the TRAN keyword. When the PrimeSim XA tool runs continuous measurement, the
measurement is performed continuously until the end of the simulation. All measurement
values are reported.
Note:
The TRAN_CONT type is not supported in the Eldo netlist format.
The continuous measurement is limited to the TRIG-TARG, WHEN, DERIVATIVE-WHEN and
FIND-WHEN types of the .MEASURE statement. All other .MEASURE statements are not
supported with the continuous measurement. When a normal measurement depends on a
continuous measurement, the last value of the continuous measurement result is used for
normal measurement reference.
where
Argument Description
Output Files
The PrimeSim XA tool writes the continuous measurement results to a file suffixed with
*_mname.meas or *_mname.mt. Both files have the same format.
The following is an example of an output file for the measure statement:
crossing@1 = 0.
crossing@2 = 2.271034737e-07
crossing@3 = 6.814809009e-07
…
vt2@1 = 1.475989329e-07
vt2@2 = 1.147681340e-06
vt2@3 = 2.147720241e-06
…
period@1 = 1.000082408e-06 trig = 1.475989329e-07 targ = 1.147681340e-06
period@2 = 1.000038900e-06 trig = 1.147681340e-06 targ = 2.147720241e-06
period@3 = 9.999610996e-07 trig = 2.147720241e-06 targ = 3.147681340e-06
…
temp = 25.0000000000
alter# = 1.0000000000
Example
The following example performs a continuous measurement to find all values for v(d[1])
when v(b[3]) is equal to 1.5V.
.MEASURE TRAN_CONT vd1 find v(d[1]) when v(b[3])=1.5
The following example performs a continuous measurement to report every time delay
between v(clk)=1.25V rising edge and v(q)=1.25V falling edge.
.MEASURE TRAN_CONT tdel1 TRIG v(clk) VAL=1.25 RISE=1
+ TARG v(q) VAL=1.25 FALL=1
Note:
The CROSS(), RISE() and FALL() functions do not support the VLG and VHG
arguments to ignore glitch measurement.
The following example designates the time where V(1) is equal to V(2) at the first falling
edge, and assign it to STIME.
.MEASURE TRAN STIME FALL(V(1)-V(2),0,0,1)
The following example designates the voltage of V(3) when V(1) is equal to V(2) at the
last rising edge, and assign the result to TRT.
.MEASURE TRAN TRT FIND(V(3),RISE(V(1)-V(2),0,0,LAST))
Arguments
Argument Description
Note:
To comment out a line in a table, insert a pound sign (#) at the beginning of the
line.
Examples
The following example uses cap.table and res.table, defined as follows:
The cap.table file:
#corner layer width space Cbot Ctop Ccpl
1 3 0.0450 0.030 0.078901 0.06789 0.03456
1 3 0.0450 0.032 0.089012 0.05678 0.02109
1 3 0.0450 0.037 0.090123 0.04567 0.01098
…
In this example, the disc_num function is 2. Corner and layer are of integer index (that is,
do not interpolate), and are considered as discrete number; the input values are 1 and 3.
The cont_num function is 2. Therefore, next two columns (width and space) must be
considered for interpolation, and user’s values are 0.0002 and 0.0252, which is two-
dimensional. The value_col is 1. It denotes the fifth column (Cbot column) is the final
value column.
An example of return bilinear interpolation is shown in Figure 8.
6
Verilog-A Support
This chapter provides an overview of how the PrimeSim XA tool supports the use of
Verilog-A language descriptions for systems and components.
Verilog-A derives from the IEEE 1364 Verilog Hardware Description Language (HDL)
specification for describing behavior in analog systems. The Verilog-A language that
PrimeSim HSPICE supports is compliant with Verilog-AMS Language Reference Manual,
Version 2.3.1.
The Verilog-A implementation in PrimeSim XA supports a mixed design of Verilog-
A descriptions and transistor-level SPICE netlists with a simple use model. Verilog-A
supports most analysis features available in PrimeSim XA for Verilog-A based devices,
including AC, DC, transient analysis, statistical analysis, and optimization.
For more information on Verilog-A support, see the Using Verilog-A topic in the PrimeSim
Continuum Overview.
This chapter contains the following topics:
• Verilog-A Language Support
• Netlist Syntax for Verilog-A in the PrimeSim XA Tool
• Generating Verilog-A Libraries for Reuse in PrimeSim XA Simulation
• Module- and Instance-Based Partitioning: Switching Between Verilog-A and SPICE
Definitions
• Port Mapping
• Passing Parameters
• Passing the M-Factor
• Defining Verilog-A Macros With -va,define Command Line Option
• Verilog-A Output in the PrimeSim XA Tool
• Verilog-A Features Not Supported in the PrimeSim XA Tool
The .hdl res.va statement references this module definition, used for the x1 instance:
module res (a, b);
electrical a, b;
parameter real R = 1.0;
analog begin
V(a,b) <+R * I(a,b);
end
endmodule
The PrimeSim HSPICE tool is case-insensitive, but Verilog-A modules are case-sensitive.
From within Verilog-A modules, a mixed-case name matches a mixed-case name. If
there are no exact matches, Verilog-A matches the same name regardless of case. If two
references exist in the Verilog-A definitions that are case-sensitive (for example, mymodul1
inst1 and mymodul1 Inst1) and they are referenced by case-insensitive statements in
the PrimeSim HSPICE tool, the PrimeSim XA tool displays a warning for any ambiguous
references.
If both an PrimeSim HSPICE subcircuit and a module definition exist with the same
name, the subcircuit definition is used by default. Use set_va_view to switch between
definitions. See the Module- and Instance-Based Partitioning: Switching Between Verilog-
A and SPICE Definitions section for more details.
Where
• *pvalib : Indicates scripts to generate the .pvalib file on the 64-bit platform.
• options: Controls how the .pvalib file is generated. The supported options are:
◦ Ddefine{=<val>}: Adds the specified define statement to the pre-processor table.
◦ -Lpath: Specifies the location of input Verilog-A files.
◦ -Ipath: Adds the specified path to search path for includes.
◦ -f <filename>: Specifies a list of input Verilog-A files.
◦ -p <product-name>: Specifies the product name to be finesim (FineSim) or
hspice (PrimeSim HSPICE).
Example
The following example shows how to generate and reuse the .pvalib file on the .hdl
command line.
1. Generate pre-compiled pVA libraries using the pvalib command.
pvalib resistor.va -o reslib
or
.hdl reslib_8003361L3.pvalib
In the .valog file, the tool reports that the Verilog-A module is successfully loaded from
the pre-compiled pVA library. For example,
> Loading pVA library 'reslib.pvadir/reslib_8003361L3.pvalib' ...
Loaded Verilog-A 'resistor' module ...
> Successfully loaded total 1 Verilog-A module(s)
If the loading is not completed successfully, the tool writes the error message in
the .valog file:
.hdl testlib_8003361L3.pvalib
> Loading pVA library 'testlib_8003361L3.pvalib'...
*ERR* File 'testlib_8003361L3.pvalib' not found.
See Also
• Reusing Compiled Verilog-A Files
Port Mapping
When a module is instantiated from SPICE, the SPICE rules for instantiation and port
connections apply. The ports are connected by position. If the number of connections does
not match, the PrimeSim XA tool displays an error.
If the Verilog-A module has a bus in its port list and the bust is instantiated in a SPICE
netlist, the signals are assigned by position.
SPICE netlist:
X1 a b c d e foo
Verilog-A definition:
module foo (bus, sig1, sig2);
electrical bus [2:0];
electrical sig1, sig2;
Bus assignment:
a -> bus[2]
b -> bus[1]
c -> bus[0]
d -> sig1
e -> sig2
If the bus definitions are reversed to electrical bus [0:2], the bus assignments are
also reversed:
a -> bus[0]
b -> bus[1]
c -> bus[2]
Verilog-A module:
//position mapping
nor1 il (out1, in1, in2);
SPICE subcircuit:
.subckt nor1 zn a b
...
.ends
Note that if a Verilog-A module instantiates a SPICE subcircuit that contains power net
pins, the PrimeSim XA tool displays a port map error.
You can map ports between Verilog-A and SPICE on a scalar-net basis or a vector-port
basis. If the sequentially numbered port names in the SPICE subcircuit are identical to the
Verilog-A port names, you can use the vector port to instantiate Verilog modules. In the
following example, port names a[3] a[2] a[1] a[0] in the SPICE subcircuit will map to
a 4-bit vector port name in Verilog-A.
Verilog-A module:
addr i3 (.a(ai[3:0]), .b(bi[3:0]), .cin(ci), .s(su[3:0]), .cout(co));
SPICE subcircuit:
.subckt addr a[3] a[2] a[1] a[0]
+ b[3] b[2] b[1] cin
+ s[3] s[2] s[1] +s[0] cout
.ends
Passing Parameters
When SPICE instantiates a Verilog-A module, the instance parameters are passed as
named parameters in SPICE fashion.
Verilog-A module with parameters:
module foo (a b);
electrical a,b;
parameter moduleparam=10;
SPICE subcircuit:
X1 a b foo moduleparam=7
The case-sensitivity issues that are described for each netlister in the Netlist Syntax for
Verilog-A in the PrimeSim XA Tool section apply to parameter passing.
Caution:
If a Verilog-A module has a parameter of m or M, it cannot be passed using
the SPICE instantiation, since m is used as the multiplicity factor. If a SPICE
instantiation uses m as a parameter, its value is used to set the system
$mfactor variable.
During the pVA compilation of Verilog-A, a warning message appears in the .valog file:
*pvaW* parameter m is not treated as a mfactor (ddx.va:2)
To define a Verilog-A macro with or without a value, run the -va,define command line
option in the following syntax:
-va,define define_name
-va,define define_name=value
When a macro has been defined, you can use it anywhere in the source description. For
example, to define a macro R-VAL with a value of 2.0, run the following command:
% xa testbench.sp -o outx -va,define R_VAL=2.0
The PVA_MPDIR environment variable creates a new runtime library path, shares the
existing path, or reuses the precompiled Verilog-A code in the existing runtime library.
If you do not want to reuse the pva.so files compiled from the previous run, specify the
PVA_RMRTL environment variable and pvA will always compile the Verilog-A modules
during the run. Setting the PVA_RMRTL environment to 1 clears all intermediate files in
the .pvadir directory before executing the next command.
For example:
setenv PVA_RMRTL 1
To reuse the compiled Verilog-A files in the .pvadir directory, run the following steps:
1. Run the initial simulation. For example:
xa test.sp -o XA_results/test
4. Run the additional simulations that reuse the compiled Verilog-A files from the initial
simulation:
xa test1.sp -o XA/final_results1 &
xa test2.sp -o XA/final_results2 &
xa test3.sp -o XA/final_results3 &
xa test4.sp -o XA/final_results4 &
xa test5.sp -o XA/final_results5 &
Note:
If a Verilog-A model changes or the PrimeSim XA version changes, you need to
rerun steps 1 through 4.
7
Postlayout Simulation Flows
Back-Annotation Flow
The PrimeSim XA tool supports a back-annotation flow that works with the StarRC tool
(Synopsys parasitic extraction tool) and IC Validator LVS tool to simulate a post-layout
design.
Using the post-layout flows provides you with several benefits:
• Controlling the design hierarchically, such as setting different netlist options in different
blocks in the design to achieve the best accuracy/speed tradeoff
• Analyzing the design hierarchically, such as determining the power consumption of
each block in the design
• Increasing the design cycle throughput, such as reusing the same pre-layout netlist
options and analysis statements for the post-layout simulation
• Speeding up the simulation run time and reducing the memory usage by taking
advantage of the hierarchical database
Table 37 explains the terminology used for the post-layout flow in this chapter.
Terminology Description
Ideal schematic netlist Schematic netlist file used as an input file for IC
Validator or other LVS tools containing the original
schematic-based hierarchy.
Ideal netlist Both the ideal schematic netlist and ideal layout netlist.
The main limitation of using the schematic hierarchy-based back-annotation flow is:
• The PrimeSim XA tool currently does not support the merging of the excessive layout
devices to the schematic devices in the schematic hierarchy-based back-annotation
flow, but you can use the layout hierarchy-based back-annotation flow to overcome this
limitation.
Figure 10 shows the layout hierarchy-based back-annotation flow. The advantage of using
the layout hierarchy-based back-annotation flow is:
• There is always a 1:1 matching of the devices between the ideal layout netlist and the
parasitic netlist. Therefore, no mismatches occur during the back-annotation flow.
The limitations of using the layout hierarchy-based back-annotation flow are:
• The ideal layout netlist has a layout-based hierarchy. This hierarchy may differ from
the original design structure (schematic-based hierarchy), depending on the layout
process. Therefore, the processing of debugging and tracing the circuit might be more
difficult.
• Minor modifications may be required for the netlist options and analysis statements
(before being reused) from the ideal schematic netlist to map to the layout-based
hierarchy of the ideal layout netlist file.
Header
Section
Parasitic
Section
Instance
Section
Note:
You can specify the NETLIST_FORMAT:SPEF command in the StarRC tool to
generate a SPEF file.
Figure 12 shows an example of a SPEF file.
Header
Information
Name Mapping
Section
Port
Section
Parasitic
Section
Command Description
When running the back-annotation flow, a pre-layout node might be expanded into
several different nodes in the post-layout simulation due to added parasitic elements. It is
necessary to understand the exact location of the net when there is a mismatch between
the ideal netlist and the parasitic netlist, or when probing a net.
connected to the pins of the nets for which the terminals belong. See the Mismatch
Warning in Back-Annotation Flow section for more information. This is usually seen in
the instances that provide power and stimulus to the netlist, or when the parasitic netlist
contains the information only for a portion of the design.
The rules of precedence for selecting a pin in the parasitic netlist are:
1. If the *|P (nodename ...) statement exists in SPF netlist or the *P nodename …
statement exists in the SPEF netlist, the node with nodename of the first *|P statement
in SPF netlist or the first *P statement in the SPEF netlist is the pin of the net.
2. Otherwise, the pin of the net is chosen by using the set_ba_option
-select_ipin_method value command.
All the following examples are based on this section of the SPF file.
*|NET x0/n4 0.02062PF
*|I (x0/x34/M1:GATE x0/x34/M1 GATE I 1.3e-14 -449.5 11)
*|I (x0/x34/M3:GATE x0/x34/M3 GATE I 2.05e-14 -447 36.25)
*|I (x0/x37/M2:SRC x0/x37/M2 SRC B 0 -474.5 36.25)
*|I (x0/x37/M1:SRC x0/x37/M1 SRC B 0 -474.5 11)
…
This SPF file shows a net named x0/n4. This net is connected to the following terminal of
instances:
• Gate of x0/x34/M1
• Gate of x0/x34/M3
• Source of x0/x37/M2
• Source of x0/x37/M1
If the ideal netlist matches with the connection of the SPF file as shown in Figure 14, there
are no warning messages.
Figure 14 Ideal Netlist Matches With the Connection of the SPF File
These are the most common mismatch issues in the back-annotation flow.
• Net does not exist in the design netlist or is skipped.
• Instance is missing for the non-bulk net.
• Instance does not exist in the design netlist.
Figure 15 Ideal Netlist Does Not Match the Connection in the SPF File
SPF file
x0/n4
x0/x37/M1
x0/x34/M3
The following message is printed in the log file. The PrimeSim XA tool skips the back-
annotation of this *|NET statement.
SPF file
Instance is missing
Ideal Netlist
for the non -bulk net
x0/x37/M2 x0/x34/M1
x0/n4
x0/x37/M1
x0/x34/M3
The following message is printed in the log file. The PrimeSim XA tool reconnects the
instance to the pin of the net, x0/x34/M1:GATE. See the Rules for Selecting a Pin for Each
Net section for details.
❭
❭
❭
Instance does not
exist in the design Ideal Netlist
netlist
x0/x37/M2 x0/x34/M1
x0/n4
x0/x37/M1
x0/x34/M3
The following message is printed in the log file. The PrimeSim XA tool skips the back-
annotation of this *|I statement.
The following message is printed in the log file. The PrimeSim XA tool skips the back-
annotation of this *|I statement.
The following message is printed in the log file. The PrimeSim XA tool skips the back-
annotation of this *|I statement, and the gate terminal of x0.x34.m1 is reconnected to the
pin of the net, X0/X34/M3:GATE. See the Rules for Selecting a Pin for Each Net section.
You can use the map_ba_terminal command to map MYGATE to the supported terminal
name.
A graphical representation of the inverter schematic is shown in Figure 20. In the pre-
layout simulation, all three analysis statements probe the same node.
Figure 21 shows a graphical representation of the parasitic interconnects after the back-
annotation of net out.
In statement 1, .PROBE v(out), net out exists in an SPF parasitic netlist; therefore, the
PrimeSim XA tool follows the rules of precedence described in the Rules for Selecting a
Pin for Each Net section to probe the pin of the net out.
In statement 2, .PROBE v(x1.Z), x1.Z is not specified by the *|NET statement;
therefore, the PrimeSim XA tool probes the node of the first *|I statement that has the
same hierarchy instance as x1.Z (x1/m1:SRC).
In statement 3, .PROBE vs(x1.m2) is an instance-based waveform-naming statement;
therefore, the PrimeSim XA tool probes the source terminal of transistor x1.m2.
When the contents of the subcircuit in the ideal schematic netlist is replaced by the
contents of the newly created ideal netlist, the device names and the node names from the
ideal schematic netlist are no longer available in the database to the analysis statements.
The following new information is saved in the database based on the newly created ideal
netlist:
• The device and instance names in the instance section of the SPF file.
• The node names and instance names specified by the *|NET statement in the SPF file.
The slash ("/") character in the node names and instance names are replaced by the
period (".") character.
The PrimeSim XA tool runs a one-step simulation with two phases in the selective net
back-annotation flow, as shown in Figure 23. The first step is the setup phase, when the
PrimeSim XA tool runs a pre-layout simulation, and detects and reports the active nets.
The second is a simulation phase where the PrimeSim XA tool back-annotates only the
active nets from the parasitic netlist and runs a post-layout simulation. When setup phase
completes, the PrimeSim XA tool automatically starts the simulation phase.
Note:
If the .active_nets.rcxt file already exists and you rerun a simulation with
the same command line arguments with same output name, the first step is
omitted. If you have changed some settings, such as the voltage tolerance of
active net, it may not be taken into account in the PrimeSim XA simulation.
Always check the PrimeSim XA log file for details.
2. Load the active net file generated in Step 1 in the StarRC tool to generate a smaller
and reduced parasitic netlist. The command to load the active net file in the StarRC tool
is:
NET_FILES: filename
The filename is the name of the active net file generated at Step 1.
Note:
You might need to comment out the NETS: * statement in the StarRC
command file. This command forces extraction of all nets.
3. Load the smaller and reduced parasitic netlist into the PrimeSim XA tool for post-layout
simulation. The command to load the parasitic file is:
load_ba_file -file parasitic_filename
8
Sigma Amplification
This chapter describes how to run the sigma amplification simulation in PrimeSim XA.
The PrimeSim XA tool supports sigma amplification simulation in Monte Carlo data mining
post-processing flow. In PrimeSim XA, you run sigma amplification simulation to validate
the robustness of your circuit design and generate design-specific variation corners for
circuit debugging and failure diagnosis.
When simulation is complete, the simulation results are post-processed by performing
datamining on all measures defined in the netlist. The log file and output files generated
during simulation and post-processing stages are fully HSPICE-compatible.
For a detailed description about sigma amplification in the advanced variability analysis
flow, see the Sigma Amplification chapter in PrimeSim™ AVA User Guide.
This section contains the following topics:
• Running Sigma Amplification
• Configuring Inputs for Sigma Amplification
• Variation Analysis With Design-Specific Variation Corners
The my.json file contains the sigma amplification setup parameters to execute the
advanced variability analysis flow. If the .json file is not available, the Advanced Variation
Analysis dialog box is invoked for entering the sigma amplification setup parameters to
create the configuration file (.json). For more information, see Configuring Inputs for Sigma
Amplification.
Output Files
Table 39 lists the output files that are generated when sigma amplification simulation is
completed.
Table 39 Output Files Generated by Sigma Amplification Simulation
File Description
out.pdf, out.wv_plt, and Q-Q plot files in the PDF (*.pdf file), the WaveView (*.wv_plt
out.qq.csv file), and CSV (out.qq.csv file) formats
For more information about running sigma amplification simulation, see the Sigma
Amplification chapter in PrimeSim™ AVA User Guide.
Note:
The following PrimeSim XA configuration command is the legacy Monte Carlo
datamining process with the PrimeSim HSPICE tool. When specified in the
advanced variability analysis flow, the tool issues a warning message and
ignores the command.
set_monte_carlo_option -datamining on
The advanced variability analysis platform only deploys the HSPICE compliant
measurement (.mt) format. When .option measform=0|1|2 is specified in
the advanced variability analysis flow, the tool issues a warning message and
overwrites the setting with the defaults in advanced variability analysis flow.
When finish configuring the advanced settings, close the Advanced Settings dialog
box.
4. In the Advanced Variation Analysis dialog box, click the Save and Launch Simulation
button to save the newly created .json file and run sigma simulation. To save the .json
file without launching the simulation, click the Save and Quit button.
Setting Significance
Chip Level Sigma The higher this value, the higher is the amplification factor.
Component count The higher this number, the higher is the Component Sigma and the
amplification factor.
Statistical Uncertainty The lesser this value, the narrower is the confidence interval and higher
is the amplification factor.
Affordable number of The lower this value, the higher is the amplification factor.
samples
Depending on the configured values of these basic settings, the Sigma Amplification
engine automatically calculates the amplification factor for the Sigma Amplification
simulation.
The design-specific variation corners are saved in the output .ava.dsvc.json file.
To generate design-specific variation corners during sigma amplification analysis and run
variation analysis with the generated design-specific variation corners,
1. Follow the steps in Running Sigma Amplification to run sigma amplification analysis
on a bit cell or a sense amplifier. If you do not have a configuration file, follow the
procedures in Configuring Inputs for Sigma Amplification to configure necessary
settings to create a configuration file, such as specifying the measures and target
sigma value for calculating variation corners and output file formats.
2. When sigma amplification simulation is finished, examine the output *.ava.dsvc.json
file, report file (*. amp_mpp) and Q_Q plot files (*.pdf or *.wv_plt) to identify the critical
corners in your circuit design.
3. Rerun sigma amplification on the instances to investigate with the *.ava.dsvc.json file
generated at Step1.
For a detailed description about sigma amplification simulation, see the related sections in
PrimeSim™ AVA User Guide.
9
Monte Carlo Analysis
Monte Carlo analysis is a common method used to understand the effect of random
process variations on circuit performance. During a Monte Carlo analysis, the simulation is
run a pre-determined number of times with small random variations in design and process
variables. The simulation results are combined and correlated to determine key factors
that might affect performance.
The PrimeSim XA tool supports traditional Monte Carlo analysis for transient simulations
with the PrimeSim HSPICE netlist format. Traditional Monte Carlo defines a random
variable with a distribution function. You can assign a random variable just as in PrimeSim
HSPICE. The PrimeSim XA tool supports the same distribution functions as PrimeSim
HSPICE:
• UNIF(nominal_val, rel_variation)
• AUNIF(nominal_val, abs_variation)
• GAUSS(nominal_val, rel_variation, num_sigmas)
• AGAUSS(nominal_val, abs_variation, num_sigmas)
• LIMIT(nominal_val, abs_variation)
Whenever a parameter defined by one of these functions is assigned, a new unique
random variable is generated. For more information about distribution functions, see
the .PARAM Distribution Function section in the PrimeSim HSPICE User Guide: Basic
Simulation and Analysis.
Monte Carlo simulation indexing in the PrimeSim XA tool is compliant to the PrimeSim
HSPICE tool. The sample of index 1 is the nominal simulation, and the sample of index
2 is the first random simulation. For more information about sample indexing, see the
Monte Carlo Analysis—Flow and Outputs section in PrimeSim HSPICE User Guide: Basic
Simulation and Analysis.
PrimeSim XA provides the set_monte_carlo_option command to specify options for
running traditional Monte Carlo analysis in PrimeSim XA. See the Configuring Options for
Monte Carlo Analysis section for details.
For more information about traditional Monte Carlo simulation, see the Traditional Monte
Carlo Simulations section in PrimeSim HSPICE User Guide: Basic Simulation and
Analysis.
This chapter includes the following topics:
• Configuring Options for Monte Carlo Analysis
• Running Monte Carlo Analysis in PrimeSim XA
• Output Files From Monte Carlo Analysis
• Running Incremental Monte Carlo Simulations
• Setting Instance-Based Seeds
• External Sampling During Monte Carlo Analysis
• Random Variables
• Data Mining Flow
• Auto-Replacing Monte Carlo Samples When Measurements Fail
• Controlling the Read-in of an External File
• Running Monte Carlo Analysis With 3DIC
• Variation Blocks in Monte Carlo Flow
-sample_output Specifies the Monte Carlo sample index in which the output files
of measurement result files and the waveform files are kept in
the output directory.
-mc0_file Creates a .mc0 file which lists all of the random variable values
used in the simulation, and is equivalent to the PrimeSim
HSPICE *.mc0 file.
Example
.tran 1n 100n sweep Monte=2
.opt xa_cmd="set_monte_carlo_option -sample_output all"
Argument Description
For a detailed description about the HSPICE .TRAN command, see the .TRAN / TR
command page in PrimeSim Continuum Reference Manual: Commands and Options.
Note:
• There is only one FE Summary for a single worker, no matter how many
Monte Carlo samples are executed by a given worker.
• For the global variation dependent parameter dump, the PrimeSim XA tool
now only writes out the dependent global parameter without its hierarchical
name, which complies with PrimeSim HSPICE syntax.
• To save disk space, once the -datamining on command is triggered,
only the *.mc0, *.mt and *.log files are kept and compressed in .gzip
format. To disable file compression, use the set_monte_carlo_option
-compress_file none command.
Example 1
The following example enables external sampling during Monte Carlo analysis and writes
out waveform results when analysis is complete.
% xa monte_carlo_netlist -c cmd -o XA_RESULT/xa -gz
.mc0 The random number sample file (.mc0) saves the changes
in all parameter values subject to variation. For a detailed
description of .mc0 file, see the Monte Carlo Analysis—Flow
and Outputs section in PrimeSim HSPICE User Guide: Basic
Simulation and Analysis.
.mc.csv Contains all of the data in the .mc file, except the histogram.
You can read this .csv file in a spreadsheet program.
.meas and .mt Contains all the Monte Carlo sample measurement results.
Monte Carlo analysis always produces this file. It contain only
the measure values, not the Monte Carlo parameter values.
This file uses standard PrimeSim XA measure formatting and
has a .meas extension. If you specify HSPICE formatting in the
set_meas_option command, it has a .mt extension.
When you specify the set_meas_option -format hspice
command, the PrimeSim XA tool must create a measure file
that is syntactically compatible with PrimeSim HSPICE so that
a WaveView histogram can be viewed.
When you choose the HSPICE measure format, the per
sample and summary measure file has a .mt extension rather
than the standard .meas extension.
.mc File
The .mc file contains a measurement summary of the Monte Carlo simulation. It is the
primary output file and reports a summary of the statistical data for each measurement:
• nominal
• mean
• variance
• stddev
• avgdev
• min
• max
• median
• sample number of min
• sample number of max
Table 44 Output files generated when the -sample_output option is specified with the
set_monte_carlo_option command
.m#.meas/mt Measure file with a .meas extension when you specify the standard
PrimeSim XA measure format, or a .mt extension if you specify the
HSPICE measure format with the set_meas_option command.
XA then combines the results from the original and the new runs to provide a complete
statistical Monte Carlo analysis report.
To run an incremental DP Monte Carlo simulation, use the following syntax:
% xa input_netlist -dp n -dpconfig [dp_config_file] \
-dpincremental original_directory -o output_dir
where original_directory is the path to the original Monte Carlo run directory.
When the -dpincremental option is used, PrimeSim XA parses the netlist and checks the
sweep value in the .tran line.
For more information about how to use the incremental distributed processing (DP) feature
to re-run Monte Carlo simulation, see the Automatic Incremental DP Monte Carlo section
in PrimeSim HSPICE User Guide: Basic Simulation and Analysis.
• PrimeSim XA supports incremental Monte Carlo simulations with list based Monte
Carlo samples.
• If the sweep value is greater than the number of samples in original_directory results,
PrimeSim XA starts running Monte Carlo from the last sample in the first run.
• If the sweep value is less than or equal to the number of samples in original_directory
results, PrimeSim XA issues the following error message:
Error: the number of MC samples is not greater than the first run
• The same seed must be used in the original and incremental Monte Carlo runs.
Note:
• During incremental Monte Carlo simulations in DP mode, only .mt, .mc0 and
fsdb.grp files will be merged.
• It is not recommended to change the accuracy settings in the PrimeSim XA
configuration file. Otherwise, an error message will be issued.
• You must use the -dpincremental option with the -dp option. The
-dpincremental option works only with distributed processing.
• You cannot use the same prefix for the output directories in the original and
incremental runs. When the same prefix is used, PrimeSim XA renames the
directory with the suffix _inc, like prefix_inc.
• The list of 3DIC instances and corresponding seeds are only allowed in the top level:
.mts_seed module_label::inst_name=seed_val \
module_label::inst_name=seed_val …
The designated die instance uses the seed value set by .mts_seed for variation and
overrides the seed setting defined in module. The other die instances from the same
module without .mts_seed setting use the seed setting defined in corresponding
module as the default for variation.
• .mc0 file generation:
For each die instance with a .mts_seed setting, the tool generates a separate .mc0
file. The format of the mc0 file is:
inst_name.module_name.mc0
For other die instances from the same module and without a .mts_seed setting,
the PrimeSim XA tool generates a single mc0 file. The format of the .mc0 file is
module_name.mc0.
See Also
• External Sampling During Monte Carlo Analysis
Random Variables
Traditional Monte Carlo simulation defines a random variable with a distribution function.
You can assign a random variable just as in the PrimeSim HSPICE tool.
When using random variables in a .data block, the data block syntax is the same as for
the regular PrimeSim HSPICE data block from .Data to .EndData block format. For
practical usage and parsing performance, the .Data block must be in an external file, not
embedded in the netlist itself.
The PrimeSim XA tool supports the same distribution functions as the PrimeSim HSPICE
tool:
• UNIF (nominal_val, rel_variation)
• AUNIF (nominal_val, abs_variation)
• GAUSS (nominal_val, rel_variation, num_sigmas)
• AGAUSS (nominal_val, abs_variation, num_sigmas)
• LIMIT (nominal_val, abs_variation)
Whenever a parameter defined by one of these functions is assigned, a new unique
random variable is generated. For more information on distribution functions, see the
.PARAM Distribution Function section in PrimeSim HSPICE User Guide: Basic Simulation
and Analysis.
The tool first collects information from the existing measure files and IRV files, and
then performs post-processing to create the following output files: *.ava.annotate,
Examples 2
Same as Example 1, the following example enables the -auto_replace option and sets
the number of maximum attempts for auto-replacing samples as 5. For example, when the
last sample index specified in the .tran statement is 30, PrimeSim XA will try to simulate
up to the Monte Carlo index of 35.
check_measure -label *
set_monte_carlo_option -auto_replace 1 \
-auto_replace_max_attempt 5
Examples 3
Same as example 2, but the following example checks for failed measurements for
measures trise1 and tfall1. If other measures fail, they are not considered.
Examples 4
Same as example 2, but the following example checks for failed measurements for all
measures except trise2 and tfall2.
check_measure -except trise2 tfall2
set_monte_carlo_option -auto_replace 1 \
-auto_replace_max_attempt 5
NOTE:
• The PrimeSim XA tool does not check the range of values in the supplied external file
against the value of option Normal_Limit.
• Independent random variables which are not specified in the data block are assigned
with new random values generated by a new seed.
The module-based seed value affects only the variation defined in the module scope.
The top-level seed setting does not affect the module-based seed value or the variation
inside module. The default value is 1.
• Module-based .option modmonte
.module mod_demo
.option modmonte=0|1
...
.endmodule
The module-based modmonte affects only the models that are defined inside a current
module. The top-level setting does not affect the module-based modmonte setup or
model variations inside a module. The default value is 0.
• Module-based variation control for subcircuits and instances:
.module mod_demo
.variation
option do_not_vary subckts=subckt_list | instances=instance_list
option vary_only subckts=subckt_list | instances=instance_list
.end_variation
...
.endmodule
The module-based variation control options can only affect the subcircuit and instance
defined in the same module. The top-level variation control only affects the top-level
instance and subcircuit, and does not affect the module subcircuit instance.
.Element_variation
.End_Element_variation
.End_Local_variation
.End_Global_variation
.End_variation
Table 45 shows the Variation Block features that the PrimeSim XA tool supports.
Table 45 Supported Variation Block Features
Table 46 shows options inside the Variation Block that the PrimeSim XA tool supports.
Table 46 Supported Variation Block Options
Do_not_vary instances=InstList
Do_Not_Vary Subckts=SubcktList
Do_Not_Print Subckts=SubcktList
Ignore_Variation_Block No
Ignore_Local_Variation No
Ignore_Global_Variation No
Modified_Distribution=scale()
Modified_Distribution subckts =
scale(value, subckt_name)
Modified_Distribution instances =
scale(value, inst_name)
Normal_limit +/- 20
Print_Only Subckts=SubcktList
Vary_only instances=InstList
Vary_Only Subckts=SubcktList
Note:
You can use the Variation Block options inside the Variation Block, or as a usual
PrimeSim HSPICE.option statement. For example, the following format is
valid:
.option Vary_Only subckts=dff
Output Files
The output files are the same as for the traditional Monte Carlo flow. The suffix is different
from the PrimeSim HSPICE tool. The generation of the output files can be monitored by
the set_monte_carlo_option PrimeSim XA command.
If you do not use the set_monte_carlo_option command, no waveform file is generated.
If you want to generate the output file, you need to use set_monte_carlo_option
-dump_waveform 1 -sample_output value. For example:
set_monte_carlo_option -dump_waveform 1 -sample_output all
Monte Carlo simulation indexing in the PrimeSim XA tool is compliant to the PrimeSim
HSPICE tool. The sample of index 1 is a nominal simulation, and the sample of index 2 is
the first random simulation. For more information about sample indexing, see the Monte
Carlo Analysis—Flow and Outputs in PrimeSim HSPICE User Guide: Basic Simulation
and Analysis.
The PrimeSim XA tool generates one output file (.meas/.mt and .fsdb) per sample and one
global .meas/.mt file that comprises all measurement results.
These differences are consistent with the traditional Monte Carlo flow with the PrimeSim
XA tool. They are not specific to the Variation Block support.
Distributed Processing
Distributed processing is supported in the same way as for the traditional Monte Carlo
flow. When you run distributed processing, if a PrimeSim HSPICE license is available
and the PrimeSim HSPICE format is used for measurement (set_meas_format -format
hspice), then a .mpp0 file is generated.
When distributed processing is used, all waveforms are grouped into a grouped file with
the .fsdb@mc.grp extension.
Suppose you have a netlist in your working directory called netlist.sp and you also have
SPICE files in the ./models directory, and the netlist.sp file has:
.lib models/include.sp nom
This relative path does not work with distributed processing. You must use a path relative
to the current directory, such as:
.lib nom .include ./nom .endl
This is valid for both traditional Monte Carlo and Variation Block usage.
Mixed-Signal Simulation
The Variation Block can be used in a VCS AMS simulation in the same manner as the
traditional Monte Carlo flow. The usage is exactly the same. Distributed processing is
supported with the VCS AMS tool.
Running ICSWEEP
When running Monte Carlo analysis, you can reuse the nominal .IC values with the
set_dc_icsweep_option command.
Limitations
The current limitations are:
• Only the options described in this section are supported. All other PrimeSim HSPICE
options are not supported.
• The Variation Block cannot be in a conditional statement.
This syntax is not supported in the PrimeSim XA tool. You must use the '+' continuation
sign:
nmos nm vth0=perturb('vth0_vary')
+ nm tox='get_p(tox_param)' %
• You cannot use two different option lines with vary_only and/or do_not_vary. Only
one option line is allowed. For example, if you specify the following two lines:
.option vary_only instances=x1
.option do_not_vary instances=x1.x8
Only the last line is taken. The first one (vary_only instances=x1) is ignored. The
following rules also apply:
◦ You can use multiple instances or subcircuits in do_not_vary and vary_only.
◦ You cannot mix vary_only and do_not_vary in the same option line.
◦ You cannot mix vary_only, subcircuits and instances in the same option line.
◦ You can mix do_not_vary, subcircuits and instances in the same option line:
.option do_not_vary subckts= instances=
10
PrimeSim GPU and Multicore Simulation
This chapter describes what you need to consider when you run a multicore simulation or
PrimeSim GPU simulation in PrimeSim XA.
See Also
• Configuring the PrimeSim XA License
• PrimeSim GPU
Multicore Simulation
The section contains the following topics:
• Introducing Multicore Simulation
• Running a Multicore Simulation
• Determining the Multicore Benefit
• Factors that Affect a Multicore Simulation
Or you can run the set_multi_core configuration command. The -mt command line
option overrides the set_multi_core command if both are specified.
Whenever the -mt command line option or set_multi_core command is specified,
the PrimeSim XA tool enables multicore partitioning and simulation algorithms. This
is true even when only one core is used. Using the -mt 1 command line option or
set_multi_core -core 1 command is different from not using it.
Most of the new models are threadable when running a simulation, but some old models
may not be threadable. When you use the -check_model option, the PrimeSim XA tool
also reports the percentage of a non-thread safe models.
The following message shows that only 2% of the models are non-threadable.
Warning: 40000 (2%) non-thread-safe instances are used.
process is consuming the processors. This is the most common command to check the
processor activity.
$> top
The following command determines the top four tasks consuming the processors.
$> ps -eo pcpu,pid,user,args | sort -r -k1 | head -5
When you are running a multicore simulation, you see the %CPU to be larger than 100%.
In this example, user1 runs a /home/snps_xa/bin/xa process with 12 cores, which
consumes 1159% of the CPU.
%CPU PID USER COMMAND
1159 12116 user1 /home/snps_xa/bin/xa deck.sp -c -cmd -o xa_result/xa1
-mt 12
1.0 33380 user1 ps -eo pcpu,pid,user,args
0.4 48013 user2 /global/apps/cx_version/platforms/linux64/bin/wv
0.4 19300 user2 /global/apps/cx_version/platforms/linux64/bin/wv
or
$> numastat
11
Analog Mixed-Signal Simulation
Use the PrimeSim XA multicore technology for analog mixed-signal simulation to achieve
higher performance and accuracy for functional blocks and analog components.
The PrimeSim XA tool provides the capability to further adjust the level of accuracy for
foundry library model simulations and FinFET transceivers simulations, as described in the
following topics:
• Simulation Accuracy and Speed for Analog Mixed-Signal Designs
• Foundry Model Library Simulation
• FinFET Transceiver Simulations
• set_sim_mode
Enables high performance simulation algorithms for analog mixed signal designs.
It is recommended that you use the set_sim_mode command along with the
set_sim_level 4
set_model_level 5
set_sim_level 6 -subckt block_name1
set_multi_core -core 8
set_sim_mode 1
The following example sets the set_speed_scale value of 1.5 to scale the engine
tolerance by 1.5X to increase the simulation performance.
set_sim_level 4
set_model_level 5
set_sim_level 6 -subckt block_name1
set_sim_mode 1
set_multi_core -core 8
set_sim_mode 1
set_speed_scale 0 1.5
In the following example, the simulation runs with tighter engine tolerances. The
set_speed_scale command scales the engine tolerance by 0.5.
set_sim_level 4
set_model_level 5
set_sim_level 6 -subckt block_name1
set_sim_mode 1
set_multi_core -core 8
set_speed_scale 0 0.5
Most analog and mixed-signal simulations achieve acceptable results with the
set_sim_level -level 5 -acc 3 setting. Use this setting as a good starting point if
you are not yet familiar with the ssl2 simulation. If you cannot decide which option to use,
run simulations separately with the -level 4 and -level 5 options. If the -level 4
simulation is significantly faster than the -level 5 simulation, use the results from the
-level 4 simulation to quickly identify problems with simulation, testbench or circuit. For
example, if the testbench failed to enable a clock at the 90% point of the transient, the
-level 4 simulation results can identify this more quickly and the corrected -level 5
simulation can be restarted sooner than if you only use -level 5.
The following example turns off time step control and sets a fixed time step value based on
the process node.
set_certification_option -enable 1 -tstep_control 0 -tstep 1e-14
This section describes the steps in the transceiver simulation flow, as discussed in the
following topics:
• Setting Up the FinFET Transceiver Simulation
• Setting RF Options
• Setting Simulation Levels
• Setting Model Levels
• Setting Cores for Multicore Simulation
• Setting DC Options
• Examples
Set the -enable option to 1 to enable FinFET transceiver simulation. Use the -process
option to specify if simulating designs for advanced process technology. For example, to
run FinFET simulation for 16nm designs and above, run the following command:
set_circuit_transceiver -enable 1 -process 0
For process 7nm and below, set the -process option to 1 due to the smaller size of
MOSFET devices. For example,
set_circuit_transceiver -enable 1 -process 1
Note:
You do not need to run the set_circuit_transceiver command for planar
bulk process transceivers.
For a detailed description on the command options, see the set_circuit_transceiver
command page in PrimeSim XA Command Reference Manual.
Setting RF Options
Use the set_rf_option command to control if the critical RF components and blocks in
a transceiver circuit are simulated more conservatively, including tighter circuit partitioning
rules and simulator tolerances for the specified sub-circuit and instances. By default,
the command scales the tolerances by 0.2 for the specified sub-circuit or instances.
For a detailed description on the command options, see the set_rf_option command
page in PrimeSim XA Command Reference Manual.
For more information on the command options, see the set_multi_core command page
in PrimeSim XA Command Reference Manual.
Alternatively, you can specify the number of cores for multicore simulation using the -mt
command line option. For example,
% xa -mt num_cores
Setting DC Options
Use the set_dc_option -analog_level 3 command for simulations that are starting
from a power-up state with clocks and oscillators on. Since there are multiple operational
modes in the power-up state, the starting state is defined by the IC’s set for the simulation,
and the command is used for DC to converge in the presence of running clocks and
oscillators
For power-up simulations, running the set_dc_option -analog_level 3 command is
not necessary. Use the set_circuit_transceiver -powerup 1 command to inform the
simulator that this simulation starts mostly from 0 at time 0, and a power-up sequence
analysis will be run during transient analysis to ramp up all of the supplies and internal
powers.
Examples
Following are the examples for running FinFET transceiver simulations.
16nm Power-Up Simulation
The following example configure setups for a 16 nm simulation.
set_circuit_transceiver -enable 1 -process 0
set_sim_level 4
set_sim_level 5 -subckt block_name1
set_sim_level 5 -subckt block_name2
set_multi_core -core 8
report_operating_point -time t0 -report all -type ic
12
SRAM Design Simulation
This chapter describes how to simulate Static Random Access Memory (SRAM) designs
efficiently with a single, easy-to-use command.
set_sim_level
set_model_level
set_model_option
set_synchronization_level
set_synchronization_option
You convert it to the following setup as a starting point to simulate SRAM designs.
set_sram_characterization 1 -application timing -accuracy 4
set_message_limit 100
load_ba_file cell.spf
set_duplicate_rule -select_subckt last
only try to speed up the simulation performance by lumping more coupling capacitors if the
base setting has met your accuracy requirement.
The number of coupling capacitors and their range of values are heavily based on the
design, process node, and foundry. The PrimeSim XA tool generates a histogram of the
coupling capacitors in the log file. Based on your accuracy and performance requirements,
the rule of thumb is to lump 30% to 40% of the coupling capacitors in the design.
Table 48 Timing Error Percentages
Debugging Tips
You should review the waveforms for the signals of interest in a waveform viewer if you
notice any issues. Here are some debugging tips:
• Initializing Latch Circuitry
• Identifying Floating Nodes
• Probing Sub-Nodes in Post-Layout Simulation
You should always check the PrimeSim XA log file to make sure that the initial conditions
you specified were used for the simulation.
or
probe_waveform_voltage -v x1.net17:f7154
13
Flash Core Cell Models
This chapter provides data about the PrimeSim XA tool support of flash core cells, a non-
volatile memory technology based on a floating gate-device. This model facilitates the
simulation of NOR flash design styles.
For example:
.model flash_model_name flashcell flashlevel=1 \
model_parameter { model_parameter }
The flash model is then appended to a regular MOS model with the .appendmodel
statement:
.appendmodel flash_model_name flashcell mos_model_name mos_type
The append model statement searches for the flash model and MOS model definitions
within the current subcircuit scope or at a hierarchical level. It is recommended that
the flash model, MOS model, and append model all be placed at the same scope. The
following is a correct example:
* Top hierarchical netlist level or within the same .subckt.
.model myflash flashcell flashlevel=1
.model mymos nmos level=1
.appendmodel myflash flashcell mymos nmos
The following table lists the flash model parameters and their default values.
If B2 is defined:
• If no VNWPGM* parameter is set or VNPGMMAX is set, V(B2) < VNWPGMMAX.
• If VNWPGMMIN only is set, V(B2) > VNWPGMMIN.
• If VNWPGMMAX and VNWPGMMIN are both set, V(B2) > VNWPGMMIN.
An erasing event occurs when all of the following conditions are met:
V(D) > VDERSMIN
If B2 is defined:
• If no VNWERS* parameter is set or VNWERSMIN is set, V(B2) >VNWERSMIN.
• If VNWERSMAX only is set, V(B2) < VNWERSMAX.
• If both VNWERSMIN and VNWERSMAX are set, V(B2) < VNWERSMAX.
where b2node_name is the name of the second bulk connection. The delvto parameter is
the initial change in the threshold voltage.
The following example instantiates a cell in a single well process:
M1 d g s b flashmodel w=1u l=1u
In the previous example the cell has been initialized with +2V of VTH change.
Cells can also be initialized with the set_flash_option command. This command overrides
any delvto instance parameter setting in the netlist. For example:
M1 d g s b flash_cell_model w=1u l=1u b2=bulk2 delvto=-2
.opt xa_cmd="set_flash_option -delvto 2 -inst M1"
* M1 is initialized with a threshold voltage change of +2V
*stimuli section
Vng ng 0
+pwl(0.5u 5.5 0.6u 9 1u 9 1.1u 5.5 1.5u 5.5 1.6u -9 2u -9 2.1u 5.5)
Vnd nd 0
+pwl(0.5u 0.9 0.6u 4.5 1u 4.5 1.1u 0.9 1.5u 0.9 1.6u -6 2u -6
2.1u 0.9)
Vns ns 0 pwl(1u 0 1.1u 0 1.5u 0 1.6u 8 2u 8 2.1u 0)
Vnb nb 0 pwl(0.5u -8 0.6u 1 1u 1 1.1u -8 1.5u -8 1.6u 8 2u 8 2.1u -8)
Vnb2 nb2 0 10
The flash model is then appended to a regular MOS model with the .appendmodel
statement:
.appendmodel flash_model_name flashcell mos_model_name mos_type
The append model statement searches for the flash model and MOS model definitions
within the current subcircuit scope or at a hierarchical level. It is recommended that
the flash model, MOS model, and append model all be placed at the same scope. The
following example is correct:
* Top hierarchical netlist level or within the same .subckt.
.model myflash flashcell flashlevel=3
.model mymos nmos level=3
.appendmodel myflash flashcell mymos nmos
The following table lists the flash model parameters and their default values.
where b2node_name is the name of the second bulk connection. The delvto parameter is
the initial change in the threshold voltage.
The following example instantiates a cell in a single well process:
M1 d g s b flashmodel w=1u l=1u
In the previous example the cell has been initialized with +2V of VTH change.
Cells can also be initialized with the set_flash_option command. This command overrides
any delvto instance parameter setting in the netlist. For example:
M1 d g s b flash_cell_model w=1u l=1u b2=bulk2 delvto=-2
.opt xa_cmd="set_flash_option -delvto 2 -inst M1"
* M1 is initialized with a threshold voltage change of +2V
+ VSERSMIN=-10
+ VPWERSMIN=-10
+ VNWERSMIN=-10
*stimuli section
Vng ng 0
+pwl(0.5u 5.5 0.6u 9 1u 9 1.1u 5.5 1.5u 5.5 1.6u -9 2u -9 2.1u 5.5)
Vnd nd 0
+pwl(0.5u 0.9 0.6u 4.5 1u 4.5 1.1u 0.9 1.5u 0.9 1.6u -6 2u -6
2.1u 0.9)
Vns ns 0 pwl(1u 0 1.1u 0 1.5u 0 1.6u 8 2u 8 2.1u 0)
Vnb nb 0 pwl(0.5u -8 0.6u 1 1u 1 1.1u -8 1.5u -8 1.6u 8 2u 8 2.1u -8)
Vnb2 nb2 0 10
14
MRAM Core Cell Models
This chapter provides information about the PrimeSim XA tool support of MRAM core
cells, a nonvolatile memory technology based on magnetic states. These models facilitate
the simulation of circuits with MRAM devices.
Currently, the PrimeSim XA tool supports three MRAM core cell architectures with 0, 1,
and 2 word lines:
• Spin-Torque-Transfer MRAM: MRES0
◦ Bidirectional symmetrical write
◦ Write driver has bidirectional current flow (behaves as a current source AND current
sink)
◦ Parallelizing-direction read
• Dual 'Active' Layer MRAM: MRES1
◦ Contains two 'active' magnetic layers whose polarity can be switched
◦ Symmetrical writing current and time between "0" and "1"
◦ Two-cycle read
• Toggle MRAM: MRES2
◦ Same pulse sequence used to write "0" to "1" or "1" to "0"
◦ Toggle current magnetic state to the opposite state with each execution
Figure 27 STT MRAM 2-Terminal Device (MRES0) and STT MRAM State Sequence and
Current Requirements
iwin - Check when current crosses threshold, the current remains above (or
below) that threshold for a certain period of time (specified by iwin) in order to
cause a switch. If the current falls before meeting the iwin criteria, the exam
time data is reset.
only (i1shi < i1 < i1hhi) first in one direction (shaping the S layer dipole in a fixed
orientation) and then reversing the direction if the i1 (i1hlo < i1 < i1slo) current
(shaping the S layer dipole in the opposite orientation). The difference in resistance
measured between the two read cycles determines the orientation of the H layer and thus
the state of the cell. If the S and H layer dipoles are parallel (or aligned), the measured
resistance will be lower (RMIN) then if the dipoles of the S and H layers were in an anti-
parallel (or unaligned) position (RMAX).
The model also requires a sense line (SL) running in between the two magnetic layers
used to help change the polarity of the magnetic layers as well as help determine
resistance shifts.
Graphically, the DAL MRAM core cell can be represented as a 4-terminal device,
consisting of a bidirectional word line (WL) and a unidirectional sense line (SL) and a two-
state structure (one for each magnetic layer) shown in Figure 28.
Figure 28 DAL MRAM 4-Terminal Device (MRES1) and DAL MRAM State Sequence and
Current Requirements
Note:
These current threshold conditions must always be followed:
ih > is
i1hhi > i1shi > i1slo > i1hlo
Figure 29 Toggle MRAM 6-Terminal Device (MRES2) and Toggle MRAM State Sequence
and Current Requirements
15
Phase Change Memory (PCM) Models
This chapter describes the built-in PCM model and how to simulate circuits with this type
of non-volatile memory.
PCM Model
PCM is a type of non-volatile memory with data storage based on reversible changes of
resistivity. It offers random access, quick read and write times, high endurance, and ease
of integration with standard CMOS processes. The PrimeSim XA tool supports a built-in
model of PCM cells, which offer better ease-of-use and performance compared to more
traditional approaches, such as Verilog-A and macro modeling in full-chip simulation.
PCM is made from a special alloy, which exhibits reversible transformation between a
crystalline, highly conductive state, called SET, and an amorphous, highly resistive state,
called RESET. The resistance difference between these two states can be as large as two
order of magnitude, allowing binary information to be associated with the states (phases)
of the material. The phase transition can be electrically induced by applying current pulses
with sufficient amplitude and duration to melt the material. If the falling edge of pulse
is short, the material is cooled quickly resulting in the high resistance RESET state. If
the falling edge is long enough for gradual cooling, the material is brought to the low
resistance SET state. If conditions for neither RESET or SET states are met, the material
is in one of the intermediate states, allowing for multi-level storage capability.
In the PrimeSim XA tool, the built-in PCM cell is implemented as a nonlinear resistor
model from ST with level=10 and associated parameters to allow for customization of the
PCM cell. This model has the state parameter to keep track of the PCM cell state, which
can change during simulation after a programming cycle. The built-in model parameters
are shown in Table 50.
Table 50 PCM Model Parameters and Default Values
Rs 7K SET resistance
TminSL 100n Minimum duration of the falling edge of the SET pulse
(*)
Model Customization
A built-in model can be customized using the following syntax.
.MODEL R level=10 [param=value]
For example:
.MODEL pcm1 R level=10 Rs=5k Rr=500K
For example:
Rc n1 n2 pcm_mdl state=1
This command initializes the states of all PCM cells inside x1.x2 to 0.
Programming Conditions
A PCM cell may change its phase and resistance when a programming current pulse flows
through it.
RESET Conditions
The state of the PCM cell is reset to 0, where it has the high resistance RR, after the
following conditions of the current pulse are satisfied:
• I > IRth: Level of current pulse must be larger than IRth
• T > TRth: Duration of current pulse must be larger than TRth
• TSL < TmaxSL: Duration of falling edge of current pulse must be less than TmaxSL
• Current falls below IM
SET Conditions
The state of the PCM cell is set to 1, where it has the high resistance Rs, after the
following conditions of the current pulse are satisfied:
• I > ISth: Level of current pulse must be larger than ISth
• T > TSth: Duration of current pulse must be larger than TSth
• TSL < TminSL: Duration of falling edge of current pulse must be less than TminSL
• Current falls below IM
INTERMEDIATE Conditions
The state of the PCM cell is set to -1, where it has the intermediate resistance RI, after the
following conditions of the current pulse are satisfied:
• Not all conditions are met for SET state
• Not all conditions are met for RESET state
• Current falls below IM
MELTING Conditions
The state of the PCM cell is set to 2, where it has the melting resistance RM, if following
condition is met:
• Current is above IM
16
Three-Dimensional Integrated Circuit (3DIC)
Modularization
This chapter describes the PrimeSim XA solution to modularize IC chips inside a 3DIC
design to be simulated as a single circuit.
For more details, see the Multi-Technology Simulation of 3D Integrated Circuit section in
PrimeSim Continuum Overview.
The current 3DIC solution also supports the Monte Carlo analysis flow.
This section contains the following topics:
• Instantiating Hierarchical Modules
• Full Circuit Example
…
*Camera control modules
.module cammod
.subckt camtop …
xcis ... cismod::cistop
…
.ends
.endmodule cammod
The example shows how you can use a single IC module netlist for a single IC set of
memory simulation properties from the file memory.lib.
.lib TT
.param … * parameters for the simulation corner TT.
…
.endl TT
.lib FF
.param … * parameters for the simulation corner FF
…
.endl FF
.lib SS
.param … * parameters for the simulation corner SS
…
.endl SS
.lib models
.models … * model cards for the memory IC.
.subckt nch_mac … * macro-models for the memory IC.
…
.ends nch_mac
.endl models
The netlist then draws on single IC memory circuit definitions from the file memory.sp:
* Top level circuit from single memory IC module
.subckt 1G_mem_top …
.temp 100
xbank1 … bank
…
.ends 1G_mem_top
* Other subcircuit definitions.
.subckt bank …
…
.ends bank
.include "memory.sp"
check_node_excess_rf
check_node_quick_rf
check_node_zstate
force_node_voltage
probe_waveform_current
probe_waveform_logic
probe_waveform_va
probe_waveform_voltage
release_node_voltage
report_operating_point
report_power
set_va_view
set_ccap_level
set_duplicate_rule
set_flash_option
set_model_level
set_model_option
set_oscillator
set_partition_option
set_sim_level
set_synchronization_level
set_synchronization_option
set_tolerance_level
set_tolerance_option
skip_circuit_block
These commands can be set for a subcircuit within a module using the -subckt argument
as follows:
command_name -subckt module_name:subckt_name
Examples
Following is an example of the top-level netlist, named top_3d.sp.
*** Top level netlist with inverter chains inside two 3DIC modules
.global vdd gnd
.module mod1
.inc './defcir.sp'
.endmodule
.module mod2
.inc './defcir.sp'
.endmodule
v1 vdd gnd 1.8
vg n0 gnd pulse 0 1.8 5n 1n 1n 20n 40n
xc1 n0 n1 mod1::chain
xc2 n0 n2 mod2::chain
.tran 1n 100n
.print v(*)
.lprint v(*)
.end
Following is an example of the netlist file that describes circuit definition of invert chain,
named defcir.sp.
*** Circuit definition of inverter chain
.subckt inv in out
mp out in vdd vdd pch l=1u w=3u
mn out in gnd gnd nch l=1u w=2u
.ends
.subckt chain in out
x1 in a inv
x2 a b inv
x3 b out inv
.ends
In this example, the top level netlist has two inverter chains inside a couple of 3DIC
modules. The commands in the configuration file set the model level to 3 for the first
module, and to 6 for the second module. So the inverter chain in the second module is
simulated with better accuracy.
silicon interposer that is extracted separately. The DSPF back-annotation steps in this flow
are:
• Extract each IC module with a separate DSPF file. Each DSPF file must contain the IC
module top subcircuit definition.
• Extract the silicon interposer layer as a flat DSPF file.
• Set the DSPF file reference for the corresponding module in the following syntax:
load_ba_file -file filename [-icmodule module_name]
Following is an example of the DSPF file for the module “IC_1”, named IC_1_flat.dspf.
.subckt top1
*Extracted RC nets
*|NET …
…
*INSTANCE
M1… w=0.3u l=0.2u …
…
.ends
DSPF file for module "IC_2" - IC_2_flat.dpsf:
.subckt top2
*Extracted RC nets
*|NET …
…
*INSTANCE
M1… w=0.3u l=0.2u …
…
.ends
DSPF Back-Annotation
The DSPF back-annotation supports the following different scenarios:
• DSPF File Has Matching Subcircuits
If the flat DSPF file has one or more subcircuits that match the IC module top-level
subcircuits, the DSPF file is back-annotated to those subcircuits.
• DSPF File Has No Subcircuit
If the flat DSPF file does not have a subcircuit definition, the PrimeSim XA tool
automatically detects it and back-annotates the DSPF file as follows:
◦ Get the module name from the load_ba_file command.
◦ Find the instances in the netlist with a matching module name.
◦ Back-annotate the DSPF file to the corresponding subcircuit of these instances.
This automatic detection works only if the module has only one subcircuit referenced at
the top level of the netlist. If more than one subcircuit of the module is referenced, the
PrimeSim XA tool does not back-annotate the DSPF file and issues a warning.
• DSPF File Without Matching Subcircuit
If the flat DSPF file has one or more subcircuits but none of them matches the IC
module top-level subcircuit, the PrimeSim XA tool does not back-annotate the DSPF
file and issues a warning on the unmatched subcircuit.
• Netlist Without Matching Module
If the module specified in the load_ba_file command has no matching module in
the netlist, the PrimeSim XA tool does not back-annotate the DSPF file and issues a
warning on the unmatched module.
*simulation setup
…
*silicon interposer netlist
X1 … IC_1::top
…
*IC modules
.module IC_1
.subckt top
…
.ends
.endmodule IC_1
…
DPF file - full_MTS_flat.dpsf:
*Extracted RC nets
*|NET …
…
*INSTANCE
MX1.M1… w=0.3u l=0.2u …
MX1.M2… w=0.3u l=0.2u …
…
.mts_seed tmod2::xins23=5
.module tmod1
.subckt top
…
.ends
.endmodule
.module tmod2
.subckt top
.option seed=2
…
.ends
.endmodule
PrimeSim XA generates the following four .mc0 files for the above 3DIC netlist:
• output.mc0: The .mc0 file for the top-level
• output.tmod1.mc0: The .mc0 file for the tmod1 module
• output.tmod2.mc0: The .mc0 file for the tmod2 module
• output.xins23.tmod2.mc0: The .mc0 file for the xins23 instance in the tmod2 module
when the instance seed (5) is specified.
For external sampling, list these 3DIC .mc0 files in the statement of option
Sampling_Method:
.option Sampling_Method=External External_File="output.mc0, \
output.tmod1.mc0, output.tmod2.mc0, output.xins23.tmod2.mc0"
For more information about the external sampling method, see the Sampling Options
section in PrimeSim HSPICE User Guide: Basic Simulation and Analysis.
17
PrimeSim MOSRA Support in PrimeSim XA
This chapter describes the PrimeSim MOSFET reliability (MOSRA) support in PrimeSim
XA.
where
• 0 (default): Enables the simmode=3 enhanced flow and skips the redundant simulation
steps
• 1: Enables the simmode=3 full flow and runs all aging simulations in each .alter
command
To control whether the gradual aging flow needs to detect early-exit in the aging model,
run the following command:
.MOSRA earlyExitEnabled = 0 (default) | 1
where
• 0: Do not detect early exit in the aging model
• 1: Detect early exit in the aging model
1. Before you run the post-stress simulation, include the .mosra simmode=1 and .option
radegfile netlist options. For example:
*Netlist content
.mosra reltotaltime =1e8
+ simmode=1
.option radegfile = 'res/out.m*.radeg'
.tran step stop sweep monte=10
circuit description
models with aging model card
For each Monte Carlo run with the same index, the random variable value used for
simmode=1 is the same as for simmode=0.
A
Spectre Netlist Compatibility
The PrimeSim XA tool is compatible with most of the documented Spectre syntaxes and
features. This chapter describes the supported features in Spectre netlist format.
See the Running the Simulator section for details about the command line options.
Table 54 lists the supported Spectre simulator BJT models in the PrimeSim XA tool.
Table 54 Supported Spectre Simulator BJT Device Models
Table 55 lists the supported Spectre simulator MOSFET models in the PrimeSim XA tool.
Table 56 lists the supported Spectre simulator JFET models in the PrimeSim XA tool.
r2 CMC R2 Model
r3 CMC R3 Model
ABS() ACOS()
ASIN() ATAN()
COS() COSH()
FLOOR() INT()
LOG() LOG10()
MAX() MIN()
POW() SIN()
SINH() SORT()
TAN() TANH()
The PrimeSim XA tool supports user-defined functions in Spectre netlist format. For details
about user-defined functions in Spectre format, see the related Spectre documents.
• rforce
• save
• scale
• scalm
• subcktprobelev
• temp
• title
• tnon
• useterms
This section includes information on the commands and features that are supported during
Monte Carlo simulation with Spectre netlists, as described in the following topics:
• Enabling Monte Carlo Simulation With Spectre Netlists
• Specifying Statistical Variation
• Specifying Distribution
• Using .ALTER Statements in Spectre Monte Carlo Simulation
You specify this analysis in the montecarlo line. Note that only transient analysis is
supported. For example:
mc1 montecarlo variations=process seed=1 numruns=5
{tran1 tran start=0 stop=100u
}
Note:
PrimeSim HSPICE datamining is not supported. The Monte Carlo output data
conform to the PrimeSim XA standards.
Supported Parameters
Table 59 lists the supported parameters of the Spectre montecarlo command in the
PrimeSim XA tool.
Parameter Description
donominal Whether to run nominal run. Can be yes or no. Default is yes.
The statistics block is supported in the PrimeSim XA tool, as well as both process and
mismatch.
Specifying Distribution
The distribution is specified inside the process{} and mismatch{} blocks using the vary
syntax:
vary param_name dist=<type> {std=value | N =value} {percent=yes|no}
The vary command and its parameters are supported in the PrimeSim XA tool. However
not all types of the parameters are supported. See Table 60.
Table 60 Supported Spectre Parameters
• Variation Block
Variation block that is defined outside the .ALTER block is supported. However, having
accumulative definition, redefinition or overriding a variation block through the .ALTER
block is not allowed. An error message will be issued if a variation block is defined
inside the .ALTER block.
• Distributed Processing (DP)
When running one or multiple specific .ALTER blocks, by default the simulator groups
the tasks by ALTER index. Monte Carlo analysis for each .ALTER block is independent
from each other.
If the machine count defined by the -dp option is less than the total task count, the
simulator distributes tasks which carry the same ALTER index as many as possible.
For example:
-dp 100
.alter count: 5
Monte sweep: 100 for each alter block
Monte Carlo analysis will be triggered independently after all simulation runs of a
particular ALTER index are completed.
Use the -dptask cfg_task option to customize the task list without modifying the
netlist. The task definition is line-based; each line will be resolved to single or multiple
tasks.
For example:
$feature_tasks // Setup DP task mode: feature_task/batch_tasks
AL= #1 MC=#6 // AL #1: Alter index 1; MC: Monte Carlo
index 6.
// Defined a task with alter index1 and mc
index 6.
AL=#(1, 3, 5) MC=#(10-49) // This line can be resolved to 120 tasks
(3*(49-10+1)).
// The comma sign as delimiter for discrete
task index
// definition. Dash sign can be used to
define continuous
// arrange tasks. In this example, A total
of 121 tasks
// will be simulated.
simulator lang=spectre
global 0
simulator lang=spice
.param bias=1m
.param globw=agauss(1u,0.1u,3)
i1 0 1 bias
i2 0 2 bias
i3 0 3 bias
i4 0 4 bias
r1 1 0 resistor w=globwidth l=10u
r2 2 0 resistor w='globwidth + locwidth' l=10u
r3 3 0 resistor w=locwidth l=10u
r4 4 0 resistor w=globwidth l=10u
.model resistor R w=3u l=3u rsh=100
.op
.tr 10n 300n sweep monte=8
.alter "2nd"
.param locwidth = agauss(2u,0.3u,4)
.alter "3nd"
.param locwidth = agauss(3u,0.5u,4)
.end
Following is an example of configuring settings for Monte Carlo simulation with the
set_monte_carlo_option command.
set_monte_carlo_option -enable 1 -sample_output all -parameter_file 1 \
-mc0_file 1 -mode_ffmc 1 -dump_waveform 1
• Instance and model parameters can be modified in the same way as other Spectre
instances.
• Spectre is case-sensitive. For example, “MyModule” is not equal to “mymodule” in
Spectre or in Verilog-A.
Following is a simple Verilog-A example for Spectre:
ahdl_include "res.va"
V0 (net1 0) vsource dc=1.0
R0 (net1 net2) resistor r=10
I1 (net2 net3) res R=20
R1 (net3 0) resistor r=10
The ahdl_include "res.va" statement references the following module definition, used
for the I1 instance:
module res (a, b);
electrical a, b;
parameter real R = 1.0;
analog begin
V(a,b) <+R * I(a,b);
end
endmodule
If both a Spectre subcircuit and a module definition exist with the same name, the
subcircuit definition will be used by default. Use set_va_view to switch between
definitions. See Module- and Instance-Based Partitioning: Switching Between Verilog-A
and SPICE Definitions for more details.
.trise and .tfall Control file By default, time unit is Time unit is required
automatically be scaled set to fs. before parsing.
by $timescale Example: Example:
.trise 100 becomes .trise 100fs
.trise 100fs after
parsing.
First VCD data point Data file The first VCD data N/A
point is converted to
time=0 data point,
irregardless of what is
in the VCD file
• In the SPECTRE language block, use the options statement to set a temperature
value. For example,
option_name options temp=60
To comply with the SPECTRE identifier naming convention, use escape characters with
any non-alpha-numeric characters in the naming.
For more information about PrimeSim HSPICE 3DIC syntaxes and features, see the
related topic in PrimeSim HSPICE User Guide: Basic Simulation and Analysis.
In the simulator lang=spice block of a SPECTRE netlist, use the following commands to
construct a 3DIC module:
• .module 3DIC_label
• .endmodule 3DIC_label
• .modulevar 3DIC_label
• .endmodulevar 3DIC_label
For a detailed description about PrimeSim HSPICE and SPECTRE netlist keywords,
see PrimeSim HSPICE User Guide: Basic Simulation and Analysis and Spectre Circuit
Simulator Reference.
Example 1
The following netlist uses both the SPECTRE and PrimeSim HSPICE 3DIC syntaxes to
defines a 3DIC module. Instance instantiation is compliant to the PrimeSim HSPICE-
equivalent syntax but requires to be fully compliant to the SPECTRE identifier naming
rules.
test.scs:
// 3DIC cell instantiation
top_inst … tmod\:\:topcell …
// 3DIC scope definition with unique labeling
simulator lang=spice
.module tmod
// Native SPECTRE netlist circuit definitions
simulator lang=spectre
include "./cell.scs" section=top
// 3DIC construct block end
simulator lang=spice
.endmodule tmod
cell.scs:
subckt topcell 1 2 3 4
model nm bsim1 vfb0=-0.5 …
m1 (1 2 3 4) nm l=5u w=10u …
res1 (1 3) resistor r=100
ends topcell
Example 2
The .temp statement the default nominal temperature parameter in both the PrimeSim
HSPICE and SPECTRE syntax format. The following example uses the .temp statement
to obtain the temperature of the current module.
The .option scale statement in PrimeSim HSPICE format scales only the devices
defined within the “tmod” 3DIC module.
The options statements in SPECTRE format are also applicable for module-based
options, such as temp, scale and tnom, and are placed inside the SPECTRE language
block. The values of temp and tnom are also accessible through parameters.
Netlist (test.scs):
// 3DIC cell instantiation
top_inst … tmod\:\:topcell …
• The DC solver can be skipped if the skipdc=yes parameter is specified in the tran
statement.
• The ic parameter in the tran statement controls the interaction of various methods of
setting the initial conditions. See Table 62.
Table 62 IC Parameter Settings
B
Eldo Netlist Compatibility
The PrimeSim XA tool is compatible with most of the documented Eldo netlist format
syntaxes and features. This chapter describes the supported features. Behavior variations
are also noted.
See the Running the Simulator section for details about the command line options.
.ALTER .INIT
.COMCHAR .MSELECT
.CONNECT .NODESET
.DATA .OP
.DEFMAC .OPTION
.DEFWAV .PARAM
.DSPF_INCLUDE .SETSOA
.END .SIGBUS
.HIER .TEMP
.IC .TITLE
.INC .TRAN
ABS() MAX()
ACOS() MIN()
ASIN() POW()
ATAN() PWR()
CEIL() ROUND()
COS() SGN()
COSH() SIN()
DB() SMABS()
EVECT() SORT()
EXP() SIGN()
FLOOR() SINH()
INT() TANH()
LOG() TAN()
LIMIT() WINTEG()
LOG10()
ASPEC DEFAD
DEFAS DEFL
DEFNRD DEFNRS
DEFPD DEFPS
DEFW SCALE
SCALM SEARCH
STVER TNOM
C Capacitor
D Diode
J JFET or MESFET
K Mutual Inductor
L Linear Inductor
M MOSFET
Q BJT
R Resistor
S Switch
T Transmission Line
X Subcircuit Instance
The PrimeSim XA tools supports the macro models from the Eldo simulator listed in
Table 68.
Table 68 Supported Eldo Macro Models
ADC or Y Analog to Digital Converter VSUP, VINF, VHI, VLO, TPD, VTH, TCOM
(ADC)
COMP or Y Single output comparator VHI, VLO, VOFF, VDEF, TCOM, TPD
The PrimeSim XA tool supports the voltage and current source functions listed in Table 69:
Table 69 Supported Voltage and Current Source Functions
Source Type
Level Description
1 Berkeley Level 1
3 Fowler-Nordheim Model
27 DIODE_CMC Model
Table 71 lists the Eldo simulator BJT models that are supported in the PrimeSim XA tool.
Table 71 Supported Eldo BJT Models
Level Description
8 VBIC Model
9 HICUM L2 Model
24 HICUM L0 Model
Table 72 lists the Eldo simulator MOSFET models that are supported in the PrimeSim XA
tool.
Level Description
60 BSIM4 Model
61 EKV3 Model
66 HiSIM2 Model
70 PSP102 Model
77 BSIM-CMG Model
80 UTSOI1 Model
81 BSIM-IMG Model
84 UTSOI2 Model
Table 73 lists the JFET models that are supported in Eldo format in the PrimeSim XA tool.
Level Description
Table 74 lists the resistor models that are supported in Eldo format in the PrimeSim XA
tool.
Table 74 Supported Resistor Models
Level Description
23 CMC R3 Model
25 CMC R2 Model
Use the .MC statement to define control parameters for Monte Carlo simulation. The
following sections list the supported parameters and commands in Eldo Monte Carlo
simulation in PrimeSim XA.
Supported .MC Parameters
Following are the .MC parameters that are supported in Eldo Monte Carlo simulation:
• NRUN_MAX
• IRUN
• NONOM
• SEED
• VARY
• SAMPLING=RAND. Only RAND is supported. Other sampling methods are not supported.
• ALL
Supported Eldo Variation Parameters
Following are the Eldo variation parameters supported in Eldo Monte Carlo:
• UNIF (NOM_VALUE, RANGE_VALUE, MULT)
• AUNIF (NOM_VALUE, RANGE_VALUE, MULT)
• GAUSS (NOM_VALUE, STD_VALUE, SIGMA_COEF, MULT)
• AGAUSS (NOM_VALUE, STD_VALUE, SIGMA_COEF, MULT)
• LIMIT (NOM_VALUE, STD_VALUE, SIGMA_COEF, MULT)
Supported Eldo Parameters for Variation Definition
Following are the supported Eldo parameters for variation definition in Monte Carlo:
• LOT/[UNIF/GAUSS]=MCVAL[%] for Global_Variation
• DEV/[UNIF/GAUSS]=MCVAL[%] for Local_Variation
• LOTGROUP
• DEVX
Supported Eldo Commands
Following are the supported Eldo commands in Monte Carlo simulation in the PrimeSim
XA tool:
• DEV[UNIF/GAUSS] and LOT[UNIF/GAUSS] in the .model card
• DEV={E(*, PAR)} in the .model card
• .MCMOD MODEL_NAME [(LIST_OF_INSTANCES)] PARAM1_NAME LOT|DEV=VALUE
[PARAM2_NAME LOT|DEV=VALUE ...}]
Sigma amplification is also supported in the PrimeSim advanced variability analysis (AVA)
flow. To run sigma amplification simulation in the Eldo AVA flow in PrimeSim XA, use the
following command:
%xa -eldo filename -adv file.json -o outdir/
For more information about how to run sigma amplification simulation in PrimeSim XA, see
Sigma Amplification.
For more details on the AVA flow, see the Sigma Amplification chapter in PrimeSim™ AVA
User Guide.
Improving Sensitivity Results
Running Eldo Monte Carlo requires the minimum number of samples to be equal to the
number of Independent Random Variables (IRVs). In come cases, the tool might write
inaccurate sensitivity information in the output .mpp0 file when running Eldo Monte Carlo
with smaller sample sizes (from hundreds to thousands). To improve the accuracy of the
sensitivity calculation result, specify the .option fast_sens_method=1 command in the
netlist.
The .verilog res.va and .model res macro lang=veriloga statements reference
the following Verilog-A definition, used for the yr3 instance.
module res (a, b);
electrical a, b;
parameter real R = 1.0;
analog begin
V(a,b) <+R * I(a,b);
end
endmodule
Eldo netlists are case-insensitive, but Verilog-A modules are case-sensitive. From within
Verilog-A modules, a mixed-case name matches a mixed-case name. If there are no exact
matches, Verilog-A matches the same name regardless of case. If two references exist
in the Verilog-A definitions that are case-sensitive (for example, mymodul1 inst1 and
mymodul1 Inst1) and they are referenced by case-insensitive statements in Eldo, the
PrimeSim XA tool displays a warning for any ambiguous references.
Note:
Instances that are instantiated in Eldo netlists as y elements cannot be
overridden; the Verilog-A definition is always used.
Then you can invoke the PrimeSim XA tool with your Eldo netlist and run the MOSRA
simulation.
Note:
The agelib option is ignored when mode=sim, whatever the agedsim value
is. That means the agelib file is not generated when mode=sim, even if
agedsim=0|no.
+ agedsim=yes
+ trelax=0
+ circuit_report = 1
+ area_scaling=100
Both fresh and post-stress MOSRA simulations are run (because mode=sim). A mapping
file is generated with the extension .mosra_map:
Known Limitations
• Only UTSOI models with level 80 and level 84 are supported.
• Linux64 is the only supported platform.
• .alter is not supported. Any data within the .alter blocks is ignored.
• Only the specified options of the .age command are supported. All other options are
not supported.
• When MOSRA is run with the set_sram_characterization command, aging is not
applied to MOSCAP devices. To apply aging to MOSCAP devices, you must use
set_model_option -moscap 0.
• In the SPECTRE language block, use the options statement to set a temperature
value. For example,
option_name options temp=60
To comply with the SPECTRE identifier naming convention, use escape characters with
any non-alpha-numeric characters in the naming.
For more information about PrimeSim HSPICE 3DIC syntaxes and features, see the
related topic in PrimeSim HSPICE User Guide: Basic Simulation and Analysis.
In the simulator lang=spice block of a SPECTRE netlist, use the following commands to
construct a 3DIC module:
• .module 3DIC_label
• .endmodule 3DIC_label
• .modulevar 3DIC_label
• .endmodulevar 3DIC_label
For a detailed description about PrimeSim HSPICE and SPECTRE netlist keywords,
see PrimeSim HSPICE User Guide: Basic Simulation and Analysis and Spectre Circuit
Simulator Reference.
Example 1
The following netlist uses both the SPECTRE and PrimeSim HSPICE 3DIC syntaxes to
defines a 3DIC module. Instance instantiation is compliant to the PrimeSim HSPICE-
equivalent syntax but requires to be fully compliant to the SPECTRE identifier naming
rules.
test.scs:
// 3DIC cell instantiation
top_inst … tmod\:\:topcell …
// 3DIC scope definition with unique labeling
simulator lang=spice
.module tmod
// Native SPECTRE netlist circuit definitions
simulator lang=spectre
include "./cell.scs" section=top
// 3DIC construct block end
simulator lang=spice
.endmodule tmod
cell.scs:
subckt topcell 1 2 3 4
model nm bsim1 vfb0=-0.5 …
m1 (1 2 3 4) nm l=5u w=10u …
res1 (1 3) resistor r=100
ends topcell
Example 2
The .temp statement the default nominal temperature parameter in both the PrimeSim
HSPICE and SPECTRE syntax format. The following example uses the .temp statement
to obtain the temperature of the current module.
The .option scale statement in PrimeSim HSPICE format scales only the devices
defined within the “tmod” 3DIC module.
The options statements in SPECTRE format are also applicable for module-based
options, such as temp, scale and tnom, and are placed inside the SPECTRE language
block. The values of temp and tnom are also accessible through parameters.
Netlist (test.scs):
// 3DIC cell instantiation
top_inst … tmod\:\:topcell …
simulator lang=spice
.module tmod
.temp 60
.option scale=0.9
Preprocessor Directives
The PrimeSim XA tool directly supports many of the Eldo simulator preprocessor
directives. The following directives are processed even without the -D and -U command
line options:
• #define
• #ifdef
• #ifndef
• #if
• #else
• #endif
• #com
• #endcom
If you use any other preprocessor directives, they must be invoked with the -D or -U
command line options. In addition, you can use undefined(VAR) in an #if clause.
Expression Syntax
Mathematical expressions in Eldo format netlists must be enclosed by curly braces {} to
ensure correct parsing.
Table 75 lists the function parameters that are supported in the PrimeSim XA tool.
Table 75 Supported Function Parameters for .EXTRACT TRAN Command
BEFORE VL
AFTER VTH
OCCUR VTHIN
LABEL VTHOUT
VH
Table 76 lists the functions that are supported in the PrimeSim XA tool.
Table 76 Supported Functions for .EXTRACT TRAN Command
Function
AVERAGE() BUS()
INTEG() MAX()
MIN() RMS()
TPDUU() TPDUD()
TPDDD() TPDDU()
TRISE() TFALL()
VALAT() WFREG()
Function
XDOWN() with 1st occurrence only (n=1) XUP() with first occurrence only (n=1)
XMAX() YVAL()
C
Debugging Tools
This chapter describes the debugging tools that are available in the PrimeSim XA tool.
PrimeSim XA provides several commands and scripts to identify any issue in installation
environment or differences between setups or releases, as listed in the following sections:
• The -diff_log Command Line Option
• Debugging Scripts
where
• The log_file1 and log_file2 files are the PrimeSim XA run log files to compare. If the
files are not present in the current folder, specify them with the relative or full path
along with the file names.
• The output.diff file is the output comparison result file. By default, the file is saved in the
current folder with the suffix .diff. To save the result file to a different folder, specify the
file name with the full path.
Examples
The following example compares two XA log files, f1.log and f2.log, and generates
comparison results xa.diff in the same folder.
xa -diff_log f1.log f2.log
The following example compares two XA log files, f1.log and f2.log, and generates
comparison results tmpa.diff in the same folder.
xa -diff_log f1.log f2.log -o tmpa
The following example compares two XA log files in different locations, u/abc/test/f1.log
and /testb/f2.log, and generates the comparison results in a different location /testc/
tmpb.diff.
xa -diff_log /u/abc/test/f1.log /testb/f2.log -o /testc/tmpb
Co-simulation run is 2-3X slower than the one with equivalent standalone setup. The
following example shows the temperature setting difference between these two runs.
Debugging Scripts
Table 77 lists the debugging scripts that are available in the PrimeSim XA binary.
Table 77 Debugging Scripts
bin/pstack_file.sh Creates periodic stack profile for Two files are generated:
taking runtime stack snapshots. • output_file_prefix.process-id
This script works for optimized Consists of encrypted stack function
binary runs. information that can be decrypted
The script writes by Synopsys to identify the function
the /proc/pid/limits.env stack where the application is slow,
information to check user or the location of segmentation faults.
environment for issues with batch • ourput_file_prefix.process-id.proc
environments. Consists of environment information
for debugging farm or job launch
environment setups.
D
PrimeSim XA Tutorials
The tutorial in this chapter contains examples to run the PrimeSim XA analyses.
This script file specifies the SPICE netlist, named setup.spi, and the command files to run
the different setup conditions.
From the UNIX command line, use cat to show the contents of the setup simulation
command files:
1. cat cmd_setup_basic
# In this setup check command, the reference signal is clk and
# the data signal is data. The edge to check for is the rising
# edge and the setup time to check for is 6ns. If the data
# moves in the 6ns window, a setup violation is reported.
2. cat cmd_setup_check_rise_fall_edge
# In this setup check command, the reference signal is clk and
# the data signal is data. The edge to check for is both the
# rising/falling edge, and the setup time to check for is
# 6ns. If the data moves in the 6ns window, a setup violation
# is reported.
3. cat cmd_setup_high_low_thresh
# In this setup check command, the reference signal is clk and
# the data signal is data. The edge to check for is the rising
# edge and the setup time to check for is 6ns. The high voltage
# threshold is 0.7v, and the low voltage threshold is 0.3v.
# If the data moves in the 6ns window, a setup violation
# is reported.
4. cat cmd_setup_error_file
# In this setup check command, the reference signal is clk and
# the data signal is data. The edge to check for is the rising
# edge and the setup time to check for is 6ns. The output error
# data is sent to a separate file called setup_error_file.
5. cat cmd_setup_negative
# In this setup check command, the reference signal is clk and
# the data signal is data. The edge to check for is the rising
# edge and the setup time to check for is -1n.If the data moves
# in the -1ns window, a setup violation is reported.
6. cat cmd_setup_subckt
# In this setup check command, the reference signal is clk and
# the data signal is data. The edge to check for is the rising
# edge and the setup time to check for is 6ns. The signal to
# check is inside the sub1 subcircuit. If the data moves in
# the 6ns window, a setup violation is reported.
7. cat cmd_setup_combine
# In this setup check command, the reference signal is clk and
# the data signal is data. The edge to check for is the rising
# edge and the setup time to check for is 6ns the high voltage
# threshold is 0.8v. The low voltage threshold is 0.2v and
The *.errt files are the timing violation output files. The number 0 at the end indicates
this is the first run. If there are multiple runs due to alter/data sweep statements, the
number increases based on the number of these statements.
This script specifies the SPICE netlist, named top.spi, and the command files to run the
back-annotation flow.
From the UNIX command line, use cat to show the contents of the power reporting
simulation command files.
1. cat cmd_ba
# Sets the simulation accuracy/performance control
set_sim_level 5
2. cat cmd_selective_extract
# Sets the simulation accuracy/performance control
set_sim_level 5
3. cat cmd_ba_active_net
# Sets the simulation accuracy/performance control.
set_sim_level 5
4. cat cmd_ba_conly
# Sets the simulation accuracy/performance control.
set_sim_level 5
5. cat cmd_ba_min_res
# Sets the simulation accuracy/performance control.
set_sim_level 5
# Specifies the back-annotation command.
# The -min_res/-min_cap instructs XA to short the # small resistors.
load_ba_file -file add4.spf -min_res 0.1
Running Back-Annotation
To run the back-annotation flow, do the following steps:
1. To run the simulation from the UNIX command line, use the source command to
source the relevant PrimeSim XA binary to run the PrimeSim XA tool.
2. Check the file permission to make sure that the run script is set to be executable.
3. Type run to run the simulation script.
4. When back-annotation finishes, it contains the following directories and files:
./RESULT (directory)
active_net.rcxt
XA_active_net_ba_flow.active_nets.rcxt
XA_active_net_ba_flow.fsdb
XA_active_net_ba_flow.log
XA_active_net_ba_flow.meas
XA_ba_conly.fsdb
XA_ba_conly.log
XA_ba_conly.meas
XA_ba_remove_min_res.fsdb
XA_ba_remove_min_res.log
XA_ba_remove_min_res.meas
XA_normal_ba_flow.fsdb
XA_normal_ba_flow.log
XA_normal_ba_flow.meas
XA_selective_extract_ba_flow.fsdb
XA_selective_extract_ba_flow.log
XA_selective_extract_ba_flow.meas
If there are multiple runs due to alter/data sweep statements, the number increases based
on the number of these statements.
◦ Nets not back-annotated is the number of SPF nets that the PrimeSim XA tool
cannot back-annotate. The PrimeSim XA tool issues a warning message in the log
file that explains why a specific SPF net cannot be back-annotated.
◦ Empty nets is the number of SPF nets with no RC information.
◦ Parasitic nodes is the number of nodes created due to the addition of parasitic
resistors.
◦ Resistors back-annotated is the number of resistors back-annotated from the SPF
file.
◦ Grounded capacitors back-annotated is the total number of grounded capacitors
back-annotated from the SPF file.
◦ Coupling capacitors back-annotated is the total number of coupling capacitors
back-annotated from the SPF file.
◦ Resistors skipped due to error is the number of resistors that could not be back-
annotated.
◦ Capacitors skipped due to error is the number of capacitors that could not be
back-annotated.
◦ Instance parameters updated (DPF) and Instances back-annotated list the
number of devices with device parameters updated.
2. Use a text editor to open the output .log file for the C-only back-annotation statistic and
report and search for the “Summary of parsing DSPF file” section. like:
Summary of parsing DSPF file "add4.spf"
------------------------------------------------------------
| module name | |
| # of instantiations | 1
| Lines parsed | 3877 |
| Nets parsed | 113 |
| Nets back-annotated without error | 113 (100%) |
| … Nets with lump C | 113 |
| … Nets with distributed RC | 0 |
| Nets not back-annotated | 0 ( 0%) |
| Empty nets | 0 ( 0%) |
| Parasitic nodes added | 0 |
| Resistors back-annotated | 0 |
| Grounded capacitors back-annotated | 113 (100%) |
| Coupling capacitors back-annotated | 0 ( 0%) |
| Resistors skipped due to errors | 0 |
| Capacitors skipped due to errors | 0 ( 0%) |
| Devices updated (DPF) without error | 208 (100%) |
| Devices not updated (DPF) due to error | 0 ( 0%) |
|-----------------------------------------------------------|
This statistics shows the RC back-annotation as well as device
parameter back-annotation has been successfully completed.
NETS: b1
NETS: b3
NETS: n6
…
This file shows the active net information generated by the PrimeSim XA tool, which
can be fed back to StarRC to generate the active net SPF or SPEF file.
The first rise edge of the clock signal occurred at 50 ns and the first falling edge occurred
at 100 ns. The slope of the rise/fall edge is 100 ps each.
The first rise edge of the data signal occurred at 49 ns and the first falling edge occurred
at 52 ns. The second rise edge of the data signal occurred at 95 ns and the second falling
edge occurred at 102 ns. The slope of the rise/fall edge is 100 ps each. For example:
Reviewing Violations
Review the set up violations of each command file and verify them against the waveform
file to confirm the validity of the timing violations.
1. cat ./setup_basic/xa.errt
** XA xx-bit LINUX D-2010.03-SP1 (built xx:xx:xx xxx xx xxxx)
2. cat ./setup_check_rise_fall_edge/xa.errt
** XA xx-bit LINUX D-2010.03-SP1 (built xx:xx:xx xxx xx xxxx)
* build id: xxxxxxx
*-----------------------------------------------------------* Timing
Setup check
* title =setup
* node =data
* data_edge_type =rf
* ref =clk
* ref_edge_type =rf
* setup_time =6e-09
* window =not specified
* subckt =not specified
* loth =default value
* hith =default value
* error_file =not specified
*-----------------------------------------------------------
Violation#1: setup: Ref=V(CLK) Sig=V(DATA) Tsig=4.507e-08
Tref=5.007e-08 Tsig-Tref=-5e-09
Violation#2: setup: Ref=V(CLK) Sig=V(DATA) Tsig=9.507e-08
Tref=1.0007e-07 Tsig-Tref=-5e-09
3. cat ./setup_high_low_thresh/xa.errt
*
* XA xx-bit LINUX D-2010.03-SP1 (built xx:xx:xx xxx xx xxxx)
* build id: xxxxxxx
*-----------------------------------------------------------
* Timing Setup check
* title =setup
* node =data
* data_edge_type =rise
* ref =clk
* ref_edge_type =rise
* setup_time =6e-09
* window =not specified
* subckt =not specified
* loth =0.3
* hith =0.7
* error_file =not specified
*-----------------------------------------------------------
Violation#1: setup: Ref=V(CLK) Sig=V(DATA) Tsig=4.507e-08
Tref=5.007e-08 Tsig-Tref=-5e-09
4. cat ./setup_error_file/setup_error_file.errt
** XA xx-bit LINUX D-2010.03-SP1 (built xx:xx:xx xxx xx xxxx)
* build id: xxxxxxx
*-----------------------------------------------------------
* Timing Setup check
* title =setup
* node =data
* data_edge_type =rise
* ref =clk
* ref_edge_type =rise
* setup_time =6e-09
* window =not specified
* subckt =not specified
* loth =default value
* hith =default value
* error_file =setup_error_file
*-----------------------------------------------------------
Violation#1: setup: Ref=V(CLK) Sig=V(DATA) Tsig=4.507e-08
Tref=5.007e-08 Tsig-Tref=-5e-09
5. cat ./setup_negative/xa.errt
** XA xx-bit LINUX D-2010.03-SP1 (built xx:xx:xx xxx xx xxxx)
* build id: xxxxxxx
*-----------------------------------------------------------
* Timing Setup check
* title =setup
* node =data
* data_edge_type =rise
* ref =clk
* ref_edge_type =rise
* setup_time =-1e-09
* window =3e-09
* subckt =not specified
* loth =default value
* hith =default value
* error_file =not specified
*-----------------------------------------------------------
6. cat ./setup_subckt/xa.errt
*
* XA xx-bit LINUX D-2010.03-SP1 (built xx:xx:xx xxx xx xxxx)
* build id: xxxxxxx
*-----------------------------------------------------------
* Timing Setup check
* title =setup
* node =data
* data_edge_type =rise
* ref =clk
* ref_edge_type =rise
* setup_time =6e-09
* window =not specified
* subckt =sub1
* loth =default value
* hith =default value
* error_file =not specified
*-----------------------------------------------------------
Violation#1: setup: Ref=V(CLK) Sig=V(DATA) Tsig=4.507e-08
Tref=5.007e-08 Tsig-Tref=-5e-09
7. cat ./setup_combine/setup_error_file.errt
*
* XA xx-bit LINUX D-2010.03-SP1 (built xx:xx:xx xxx xx xxxx)
* build id: xxxxxxx
*----------------------------------------------------------------
* Timing Setup check
* title =setup
* node =data
* data_edge_type =rise
* ref =clk
* ref_edge_type =rise
* setup_time =6e-09
* window =not specified
* subckt =sub1
* loth =0.8
* hith =0.2
* error_file =setup_error_file
*----------------------------------------------------------------
Violation#1: setup: Ref=V(CLK) Sig=V(DATA) Tsig=4.507e-08
Tref=5.007e-08 Tsig-Tref=-5e-09
This script file specifies the SPICE netlist, named top.spi, and the command files to
generate different types of power reports.
Figure 31 shows a high-level block diagram of the circuit.sp netlist.
From the UNIX command line, use cat to show the contents of the power reporting
simulation command files.
1. cat cmd_report_by_port_default
# Standard commands for setting simulation and waveform
# probing.
set_sim_level -level 5
probe_waveform_voltage * -port 1
2. cat cmd_report_by_port
# Standard commands for setting simulation and waveform
# probing.
set_sim_level -level 5
probe_waveform_voltage * -port 1
3. cat cmd_report_by_node_default
# Standard commands for setting simulation and waveform
# probing.
set_sim_level -level 5
probe_waveform_voltage * -port 1
4. cat cmd_report_by_node
# Standard commands for setting simulation and waveform
# probing.
set_sim_level -level 5
probe_waveform_voltage * -port 1
The *.power files are the timing violation output files. If there are multiple runs due to alter/
data sweep statements, the number increases based on the number of these statements.
◦ Following the port name is the subcircuit definition for the port. For each port name,
the default power reporting includes the max/min/average/Rms. The power report
also shows both current (A) and power (W).
In the previous power report, there are four sections:
◦ The first section is defined by the xinv1_power_thru_vdd label name. It prints the
power reporting through the v(vdd1) node.
◦ The second section is defined by the xinv2_power_thru_vdd label name. It prints
the power reporting through the v(vdd2) node.
◦ The third section is defined by the xbuf1_power_thru_vdd. It prints the power
reporting through the v(vdd3) node.
◦ The fourth section is defined by the xbuf2_power_thru_vdd label name. It prints
the power reporting through the v(vdd4) node.
Node=vdd1 (2)
Node capacitance=49.1543 fF
Node=vdd1 (2)
Channel-connected elements:
vd1 (0) Type=V N1=vdd1 (2) N2=0 (0)
xinv1.x2.mp (137) Type=PMOS D=xinv1.2 (62) G=xinv1.1 (61) S=vdd1 (2)
B=vdd1 (2)
xinv1.x3.mp (139) Type=PMOS D=xinv1.3 (63) G=xinv1.2 (62) S=vdd1 (2)
B=vdd1 (2)
xinv1.x4.mp (141) Type=PMOS D=xinv1.4 (64) G=xinv1.3 (63) S=vdd1 (2)
B=vdd1 (2)
xinv1.x5.mp (143) Type=PMOS D=xinv1.5 (65) G=xinv1.4 (64) S=vdd1 (2)
B=vdd1 (2)
xinv1.x6.mp (145) Type=PMOS D=xinv1.6 (66) G=xinv1.5 (65) S=vdd1 (2)
B=vdd1 (2)
xinv1.x7.mp (147) Type=PMOS D=xinv1.7 (67) G=xinv1.6 (66) S=vdd1 (2)
B=vdd1 (2)
xinv1.x8.mp (149) Type=PMOS D=xinv1.8 (68) G=xinv1.7 (67) S=vdd1 (2)
B=vdd1 (2)
xinv1.x9.mp (151) Type=PMOS D=xinv1.9 (69) G=xinv1.8 (68) S=vdd1 (2)
B=vdd1 (2)
xinv1.xa.mp (153) Type=PMOS D=xinv1.1 (61) G=a_inv1 (21) S=vdd1 (2)
B=vdd1 (2)
xinv1.xz.mp (155) Type=PMOS D=z_inv1 (10) G=xinv1.9 (69) S=vdd1 (2)
B=vdd1 (2)
Gate-connected elements:
10. To obtain the element information for the xinv1.x2.mp device connected to the vdd1
node, type:
XA> iprint_elem_info xinv1.x2.mp
2: break at time: 50 ns
13. To review all of the interactive mode commands used in this section, type:
XA> history
1 iopen_log interactive_file
2 iprint_help iopen_log
3 iset_break_point -at 10ns
4 iset_break_point -at 50ns
5 ilist_break_point
6 icontinue_sim
7 iprint_node_info vdd1
8 iprint_connectivity vdd1
9 iprint_elem_info xinv1.x2.mp
10 icontinue_sim
11 iclose_log
12 history
The run script specifies the SPICE netlist files, named top.spi and top_no_vec.spi, and the
command files for the different vector file conditions to run.
From the UNIX command line, use cat to show the contents of the vector file simulation
command files.
1. cat cmd
# Probes voltage signals
probe_waveform_voltage *
2. cat cmd_load_vec_file
# Probes voltage signals
probe_waveform_voltage *
3. cat cmd_load_vec_file_use_period
# Probes voltage signals
probe_waveform_voltage *
4. cat cmd_load_vec_file_stop_at_error
a_with_vector_file_in_netlist.err
xa_with_vector_file_in_netlist.fsdb
xa_with_vector_file_in_netlist.log
The .err file is the output checking result from the vector file.
4. Use the UNIX cat command to open the xa_with_vector_file_in_netlist.err file:
Expected Output Summary
--------------------------------------------------| Node | Pass/ |
Expected | Simulated | Time |
| name | Fail | state | state | (us)
||------+-------+----------+-----------+----------|
| cout | P | | | no error |
| s[0] | P | | | no error |
| s[1] | P | | | no error |
| s[2] | P | | | no error |
| s[3] | P | | | no error |
|------------------------------------------------|
3. Run the simulation with the second line from the run script:
xa top_no_vec.spi -c cmd_load_vec_file -o RESULT/
xa_with_load_vector_file
When the simulation is finished, list the directory contents. The following directories
and files are created:
./RESULT (directory)
xa_with_load_vector_file.err
xa_with_load_vector_file.fsdb
xa_with_load_vector_file.log
The .err file is the output checking result from the vector file.
4. Use the UNIX cat command to open the xa_with_load_vector_file.err file.
Expected Output Summary
--------------------------------------------------| Node | Pass/ |
Expected | Simulated | Time |
| name | Fail | state | state | (us) |
|------+-------+----------+-----------+----------|
| cout | P | | | no error |
| s[0] | P | | | no error |
| s[1] | P | | | no error |
| s[2] | P | | | no error |
| s[3] | P | | | no error |
|------------------------------------------------|
5. When the simulation is finished, list the directories and files that are created:
./RESULT (directory)
xa_with_load_vector_file_use_period.err
xa_with_load_vector_file_use_period.fsdb
xa_with_load_vector_file_use_period.log
5. When the simulation finishes, list the directories and files that are created:
./RESULT (directory)
xa_with_load_vector_file_stop_at_error.err
xa_with_load_vector_file_stop_at_error.fsdb
xa_with_load_vector_file_stop_at_error.log
The .err0 file is the output checking result from the vector file.
6. The stop_at_error syntax inside the adder_stop_at_error.vec file instructs
the PrimeSim XA tool to error out when an output violation occurs. The
xa_with_load_vector_file_stop_at_error.log contains the following information:
Warning: output comparison error on 's[0]' at 0.462 us, L expected
Autostop ends the simulation at: xxx
To use a VCD file with the PrimeSim XA tool, do the following steps:
1. From the UNIX command line, use cat to show the contents run script:
xa top.spi -c cmd -o RESULT/xa
This script file specifies the SPICE netlist, named top.spi, and the command files to use
a VCD file in the PrimeSim XA tool.
2. Use the UNIX cat command to display the content of the cmd command file:
# command to load in the VCD file
load_vector_file -file adder.vcd -format VCD -ctl adder.sig
3. To run the simulation from the UNIX command line, use the source command to
source the relevant PrimeSim XA binary to run the PrimeSim XA tool.
4. Check the file permission to make sure that the run script is set to be executable.
5. Type run to run the simulation script.
6. When the simulation finishes, it contains the following directories and files:
./RESULT (directory)
xa.err
xa.fsdb
xa.log
The .err file is the output checking result from the vector file.
7. Use the UNIX cat command to display the xa.err file.
Expected Output Summary
--------------------------------------------------
| Node | Pass/ | Expected | Simulated | Time |
| name | Fail | state | state | (us) |
| cout | P | | | no error |
| s[0] | P | | | no error |
| s[1] | P | | | no error |
| s[2] | P | | | no error |
| s[3] | P | | | no error |
|------------------------------------------------|
For more information about running the tutorials, see the README files in the Lab1 and
Lab2 directories.
To run the tutorial in Lab1, type:
run
In Lab2, to run a fresh simulation and generate the .radeg file, type
run_step1