VCS® PrimeSim AMS User Guide
VCS® PrimeSim AMS User Guide
www.synopsys.com
Contents
New in This Release . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19
Related Products, Publications, and Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Customer Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Statement on Inclusivity and Diversity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
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
use_verilog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
use_veriloga . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
use_vhdl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
12
Feedback
Contents
13
Feedback
Contents
01_test.init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
User-Defined Nettypes With Custom Interface Elements . . . . . . . . . . . . . . . . .372
Use Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
02_test.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
02_test.spi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
vt.va . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .378
Arrays of SystemVerilog Nettypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
Connecting Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .379
Rules and Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
14
Feedback
Contents
dump_port_prop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
dump_setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .406
map_subckt_name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
map_unfound_port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
set_args . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .407
set_intr_mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
set_port_prop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
verilog_file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
Automatic Voltage Level Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
Voltage Setting Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
Rule 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
Rule 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
Mixed-Signal Simulation Interactive Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
List Interface Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
csli . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .414
Print Global Interface History in Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
csh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Print Interface Node History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
csnh, csinh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
Set the Number of Entries Printed by csnh and csinh . . . . . . . . . . . . . . . . . . . 416
csnph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
Set Watchpoint to Interface Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
csnw, csinw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .417
Delete Watchpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .418
csdnw, csdinw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .418
Verilog System Tasks for Mixed-Signal Simulation . . . . . . . . . . . . . . . . . . . . . . . . . 418
Mixed-Signal Simulation Setup Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
Map Correct Port Voltages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
Define Clear Port Direction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .420
Set Input Ports As Voltage Sources If Possible . . . . . . . . . . . . . . . . . . . . . . . . 420
Define SPICE Netlist Bus Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .420
Handle Bidirectional Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Partitioning Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .421
Partition Boundary With Clear Digital Behavior . . . . . . . . . . . . . . . . . . . . . . . . 421
Avoid Partitioning at Timing Sensitive Signals . . . . . . . . . . . . . . . . . . . . . . . . . 421
Avoid Reach-in Signals in Analog Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . 422
Avoid Partitioning at Bidirectional Signals Involved Strength Fighting and Pass
Switches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
15
Feedback
Contents
16
Feedback
Contents
-genv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
finesim_bus_format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
finesim_port_map_by_name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
finesim_verilog_file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
finesim_verilog_instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
finesim_verilog_module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .451
finesim_verilog_module_file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
finesim_verilog_subckt_file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
Circuit Example: (test.sp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
Parallel Cosimulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .453
Common Cosimulation Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
Error while reading shared library symbols, cannot find new threads: generic
error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .454
ERROR: VPI NOFORCB: vpi_put_value() cannot force a bit of an unexpanded
vector net . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
17
Feedback
Contents
.INOUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
.OPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
.PRIMESIM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
primesim_a2d / primesim_d2a Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
Automatic Verilog Instance Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .476
-genv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
primesim_bus_format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
primesim_port_map_by_name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
primesim_verilog_file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .478
primesim_verilog_instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
primesim_verilog_module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
primesim_verilog_module_file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .479
primesim_verilog_subckt_file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
Circuit Example: (test.sp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
Parallel Cosimulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .480
Common Cosimulation Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
Error while reading shared library symbols, cannot find new threads: generic
error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .480
ERROR: VPI NOFORCB: vpi_put_value() cannot force a bit of an unexpanded
vector net . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
18
Feedback
• VCS®
• PrimeSim™ Custom Fault (formerly TestMAX™ CustomFault™)
• Custom Compiler™ and the Simulation and Analysis Environment (SAE)
• PrimeWave™ Design Environment
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
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
Getting Started With Mixed-Signal Simulation
Verilog-SPICE Flow
The Verilog-SPICE flow is required when the analog parts of the design are modeled in
one of the SPICE formats supported by the analog engine or behavioral analog (Verilog-
A), and the digital parts are modeled in Verilog.
This flow is supported using the VCS PrimeSim AMS tool with the following analog
simulation engines: PrimeSim XA, FineSim, and PrimeSim.
VHDL/Verilog-SPICE Flow
The VHDL/Verilog-SPICE flow is required when some or all of the digital portion of the
design is modeled in VHDL. In this flow, the VCS tool must be used as the digital engine,
because this tool supports VHDL as well as Verilog. This flow is almost identical to the
Verilog-SPICE flow, but includes support for VHDL blocks in the digital netlist.
This flow is supported using the VCS PrimeSim AMS tool with the following analog
simulation engines: PrimeSim XA, FineSim, and PrimeSim.
Verilog-AMS-SPICE Flow
The Verilog-AMS-SPICE flow is required when some or all of the design is modeled in the
Verilog-AMS language. This flow also supports blocks or subcircuits that are modeled in
SPICE or conventional digital Verilog.
This flow is supported using the VCS PrimeSim AMS tool with the following analog
simulation engines: PrimeSim XA, FineSim, and PrimeSim.
Note:
VHDL is not currently supported in this flow.
Running Cosimulation
This section explains how to execute cosimulations.
• Running Cosimulation From the Command Line
• Concurrent Simulations
Following is the example of the UCLI input file dump.do that contains following commands
to control the simulation:
dump -file OUTPUT/out.fsdb -type fsdb
dump -add / -depth 10 -fid fsdb0
run 10 us
exit
Concurrent Simulations
VCS PrimeSim AMS supports running multiple simulations concurrently, either within
the same directory or separate directories. To prevent overwriting results and simulation
failures when using the same directory, specify different output directory names for each
simulation.
Alternatively, copy the simv executable to different directories and execute concurrent
simulations independently in each location. For detailed instructions, refer to Running
Concurrent Mixed-Signal Simulations From the Same Compiled Code chapter.
The configuration files xa_at_10us.cfg and xa_at_20us.cfg files can contain different
XA options for analog blocks.
For more details on adding PrimeSim XA commands during runtime, refer to Adding
PrimeSim XA Commands at Runtime topic.
Interactive Simulation
1. Run the simulation through Verdi: Use the simv -verdi command to start the
simulation.
2. Control simulation from graphical user interface (GUI) or Unified Command-Line
Interface (UCLI): Use the Verdi GUI or UCLI mode to perform actions such as adding
waveforms, stop or continuing the simulation, and forcing signal values.
Note:
-kdb and -debug_access+all options are mandatory for interactive simulation.
• VCS elaboration
%vcs -kdb -debug_access+all ..
or
%simv -ucli -do vcs.do
Post Processing
1. Run simulation in batch mode: verdi -ssf dump.fsdb.
2. Dump FSDB with predefined set of signals.
Refer to Verdi documentation Verification Continuum™ Verdi® User Guide and Tutorial for
detailed information.
Netlist-Related Checks
This topic describes netlist-related issues that should be investigated before beginning a
mixed-signal simulation.
• Identical Module and Subcircuit Names
• Case-Sensitivity
• Connecting Power Supplies to SPICE Subcircuits With Verilog Top
• Netlist Statements
• Simulation Time
Case-Sensitivity
For a multi-view cell, the case used for the Verilog module name and the SPICE subcircuit
name must be identical. The cases used for port names must also be identical between
the SPICE and Verilog views. Also, be aware that every name in PrimeSim HSPICE
netlists is treated as lowercase (by default). Because Verilog is case-sensitive, and the
VCS tool processes everything as-is (by default), you must be aware of any possible case
discrepancies between the two views.
Example 3 SPICE Netlist With .global Statement for Power and Ground
* Power supply nets are propagated
* by using a .global statement
The following example shows the Verilog netlist that instantiates the SPICE inverter
subcircuit from Example 3. The VDD and VSS power supply nets are defined as global
nets in the SPICE netlist and are not included in the port list for the inverter.
For example:
// vcsAD.init
d2a -powernet -hiv 1.2 -lov 0 -node top.vdd;
d2a -powernet -hiv 1.2 -lov 0 -node top.vss;
The hierarchical paths to the power nets can be viewed in the simv.msv/
interface_element.rpt report file.
Note:
If the Verilog nets that drive the SPICE supplies are defined as Verilog
predefined supply0 or supply1 nets, the tool automatically treats those
nets as if the d2a -powernet command was applied to them. In this case,
no rmap resistor is placed at the d2a interface for those nets and they are
treated as ideal voltage sources on the analog side.
• Create a new two-port SPICE subcircuit
In this methodology, you create a new two-port SPICE subcircuit to provide power for
the SPICE instances. By instantiating this new subcircuit under Verilog, the two ports
are connected to the supply pins for other SPICE cells under Verilog.
Example 5 defines a two-port SPICE subcircuit named spice_pwr_supply. The
SPICE inverter connects to power and ground by creating vdd and vss ports in the
inverter subcircuit definition. Example 6 shows the corresponding Verilog netlist that
instantiates the power supply subcircuit from SPICE and shows an equivalent inverter
instance that contains vdd and vss ports.
Example 7 Verilog Netlist With SPICE Inverter Instance (No Power Pins)
inv1 i1 (.y(y_wire), .a(a_wire));
...
.ends
In this example, the power nets are not connected from the HDL to the SPICE subcircuit.
To connect the power, use the mixed-signal port_connect command to connect those
ports to any analog net that is connected to an ideal supply as shown in the following
example:
In the following example, the port_connect statement connects power to two ideal
supplies that are defined in subcircuit at the hierarchical path top.pwrblk:
Netlist Statements
Any statements, keywords, or elements that are not supported by the analog simulator in a
standalone analog simulation are also not supported in mixed-signal.
All other options and statements that are required for correct analog simulation setup,
such as .options scale=1e-6, must also be included in the netlist for mixed-signal
simulation. The following example shows a SPICE netlist file sample.
* test.spi
.lib 'models' TT
.inc 'cells.spi'
.options scale=1e-6
.temp 27
.global vdd gnd
.subckt test a b c d
x1 a b n1 vdd cell1
x2 c n1 d ref cell2
vref ref gnd 2.0
.ends
vvdd vdd 0 dc 3.3
vgnd gnd 0 dc 0
.end
Simulation Time
In mixed-signal simulation, the simulation time can be determined by either the analog
domain or the digital domain. In the analog domain, the time is usually defined by the
end time in the .tran statement. In the digital domain, time is usually determined by a
$finish or $stop system task in the Verilog code.
In the digital domain, if the simulation end time is specified by a $finish system task
in Verilog, the simulation exits when $finish is executed. If the simulation end time is
specified by a $stop system task in Verilog, then the simulation stops and enters the
Unified Command-Line Interface (UCLI) interactive mode.
In the analog domain, if the simulation end time is specified by the end time in the SPICE
.tran statement, by default, the simulation exits at the specified time. You can use the
transient_analysis command (currently only supported in the PrimeSim XA simulation
engine) to change the default behavior and specify that the simulation enter UCLI
interactive mode at the simulation end time as defined by the .tran statement.
In the case when different end times are specified in the analog and digital domains, the
smaller of the two times determines the simulation end time.
Note:
For the PrimeSim XA, FineSim, and PrimeSim simulation engines to report the
completed percentage of simulation time, there must be a .tran statement in
the SPICE code. The analog engine bases its percentage calculation on the
runtime given by the .tran statement.
Port-Related Checks
The section contains information about:
• Port Mapping
• Duplicate Ports
• Parameterized Bus Ports
Port Mapping
By default, mixed-signal simulation requires that a cell with both Verilog and SPICE views
has the same number of ports and matching port names in both views. If the number of
ports or the names of the ports differ between the two views, the compilation exits with an
error message. To resolve the port inconsistency problem between different views, you
must use the port_map option of the use_spice, use_verilog or use_vhdl commands.
To handle a discrepancy in the number of ports (for example if one view has extra ports),
you can use the port_connect command. If there is no port mismatch between different
views of a cell, ports from different views are mapped as described below.
For a SPICE parent instantiating a Verilog child, by default, ports are mapped by position.
You can enforce name-based port mapping by creating a SPICE view for the Verilog
cell. In name-based port mapping, the tool automatically maps ports by name for the
child Verilog cell by comparing the port order between the SPICE and Verilog views and
rearranging the Verilog port order to match the SPICE view.
For a Verilog parent instantiating a SPICE child, either name-based or position-based
port mapping can be used. When using port mapping by name, the Verilog module port
name begins with a period character ( . ), and must be identical to the SPICE port name.
The cases for port names at the instantiation must be identical to the case of ports in
the subcircuit definition. Figure 1 demonstrates the Verilog syntax for name-based port
mapping. Figure 2 is an example of port mapping by name.
Port mapping at the Verilog instantiation can also be implemented by port position. In
port-mapping
Figure 3, the port zn of the SPICE subcircuit nor1 is connected to the wire out1 at the
instantiation of that subcircuit in Verilog. And ports a and b of the SPICE subcircuit nor1
are connected to Verilog wires in1 and in2, respectively.
Port mapping between Verilog and SPICE can also be achieved for bus ports. By default,
mixed-signal simulation requires that the bus members defined in SPICE must be
contiguous in the subcircuit definition (that is, no other port defined between any two
members of the same bus port), and the ports must be sequentially numbered, either
ascending or descending. If these conditions are not met, the compilation exits with an
error message. In addition, the ascending or descending order of the bus members in
SPICE must be identical to the order defined by HDL, otherwise, the port connections are
incorrect. If the SPICE block has both an HDL view and a SPICE view, the tool uses the
HDL declaration to rearrange the bus orders in SPICE so that they match the HDL.
Figure 4 shows an example of a SPICE subcircuit (addr) with bus ports and the
instantiation of addr in a Verilog parent block. In the SPICE subcircuit, the port names
a[3], a[2], a[1], and a[0] are contiguous, and the sequencing of the bus members
meets the expectation of the parent Verilog (both are descending). As a result, compilation
should proceed without error due to bus order issues and port name resolution in SPICE.
In addition, the port connections for this bus are correct since both the bus port a in SPICE
and the wire ai in Verilog are in a descending order.
By default, the tool assumes that the SPICE port names that connect to a mixed-net
and contain closed bracket characters [ ] are members of a bus. If the bus notation
in the SPICE subcircuit is a string different from [ ], use the mixed-signal bus_format
command to override the default SPICE bus notation. For more information, see
bus_format.
Figure 4 Port Mapping for the Verilog Vector Port and SPICE Scalar Port
If the number of ports in the SPICE or HDL definition of the child block is more than the
number of ports referenced in the instantiation by the parent, the extra ports of the child
remain dangling. One usual example of this case is when the child block has power pins
but the instantiation in the parent does not refer to those pins. As a result, the tool does
not connect the pins to any net in the parent. You can use the port_connect command to
connect those unconnected ports to any net in the design.
If the number of ports in the child subcircuit or HDL definition is less than the number of
ports referenced in the instantiation, the compilation fails. This can happen when VDD
and VSS pins are referenced in the instantiation but are not found in the child port list. To
resolve this problem, use the -port_map option of the use_spice, use_verilog, or use_vhdl
commands to treat those extra ports in the instantiation as snps_open and ignore them.
Duplicate Ports
Duplicate port names in the SPICE subcircuit cannot be used, except for power supply
nodes.
Here the bus width for ports din and dout is determined by the BUS_WIDTH parameter
and is set to 8. If the bus widths for these ports in the SPICE definition of the cell are also
8, the compilation proceeds without error. However, if the bus width of the Verilog bus
(defined by the BUS_WIDTH parameter) is different from the SPICE bus width, an error
message is issued during compilation.
Note:
The Unix Platform supported must be compliant with a specific Synopsys
platform foundation (for example, QSC U-Foundation and T-Foundation).
You can find details on supported versions in the following link: https://
www.synopsys.com/support/licensing-installation-computeplatforms/compute-
platforms/release-specific-support.html
Note:
The compatibility Table 1 only lists major releases (example, 2020.12) and
Service Pack releases (example, 2020.12-SP1 and 2020.12-SP2). The table
does not list all the tool patches that stem from major or Service Pack releases.
Those patches follows the same tool compatibility as the root major release
or Service Pack that they branched from. For example the PrimeSim XA or
PrimeSim Pro patch 2020.12-SP1-1xxx follows the same tool compatibility as
their root release 2020.12-SP1.
Note:
PrimeSim XA: By default, the PrimeSim XA tool supports FSDB version 6.1, but
the versions 6.0 and 5.9 are also supported through the set_waveform_option
command. The merged FSDB version is set by Verdi. Refer to Verdi's
documentation for details.
Note:
PrimeSim™ Pro and SPICE: By default, the PrimeSim Pro and SPICE tool
supports FSDB version 6.1, but the versions 6.0 and 5.9 are also supported
through the primesim_fsdb_version command. The merged FSDB version is
set by Verdi. Refer to Verdi's documentation for details.
• For VCS:
setenv VCS_HOME VCS_installation_directory
set path = ($VCS_HOME/bin $path)
This directs the VCS tool to use 64-bit binaries and also instructs the analog engine (the
PrimeSim XA, FineSim, and PrimeSim simulation engines) to use 64-bit binaries as well
(assuming that the 64-bit binaries for the analog engines are installed and the environment
variables for the analog engines are set as described above).
The top-level instance name is a SPICE view with a user-defined name (that is, the
spice_top -name my_top; command is used in a mixed-signal control file to set the top-
level SPICE as my_top) with a block, i0, underneath it.
The full hierarchical path of the input port is: my_top.i0.in
Known Problems
The following problems currently exist:
• When a programming language interface (PLI) is used along with the g++ compiler on
the Linux platform, an error messages for multiple symbol definition... might be
generated. To suppress this error, set the NO_STDPP UNIX environment variable as
follows: setenv NO_STDPP 1
• The following cases have limited or no support and can lead to incorrect results:
◦ Registered nets that are connected to mixed-nets are not supported.
◦ Bidirectional resistive pass switches (rtran, rtranif1, and rtranif0) that are
connected to mixed-nets are not supported.
◦ Bidirectional pass switches (tran, tranif1, and tranif0) that are connected to
mixed-nets have limited support, and in certain cases the results might be incorrect.
If the pass switch is connected to analog on one side, and to digital on the other
side, and only one of the two sides drives while the other side is in HiZ state, the
results are correct.
But when both sides of the pass switch drive a net, the results might be incorrect.
Also, when both sides of the pass switch are connected to analog circuits, the
results are incorrect as the two SPICE nets are not shorted.
• Jumper ports that are connected to the mixed nets are not supported and produce
incorrect results.
The following example shows a sample jumper port.
module jumper (a, a);
inout a;
...
endmodule
• When you replace existing SPICE subcircuits with Verilog modules, the analog DC
initialization in mixed-signal simulation may not be identical to the standalone analog
simulation. For DC initialization condition-sensitive circuits, it may be necessary to
DC initialization
2
Mixed-Signal Simulation Feature Highlights
Note:
Verilog-SPICE allows SystemVerilog nets of type “real” to connect to SPICE
ports and SPICE nets to connect to SystemVerilog “real” ports. In these cases,
e2r (electrical to real) or r2e (real to electrical) interface elements are inserted
to convert analog voltages to digital real values or vice versa. To allow such
connectivity, use the -realport option with the VCS tool.
Interface elements are inserted automatically for mixed-nets based on the following
principles:
• Mixed nets can be unidirectional, in which case they are either a2d or d2a.
• Mixed nets can be bidirectional, or inout, which implies that at different simulation times
they can be either of an a2d or d2a nature.
• The direction of the mixed nets is determined from Verilog port directions:
◦ In a Verilog child under a SPICE parent configuration, the port direction of the
Verilog child determines the direction of the mixed nets.
◦ In a SPICE child under a Verilog parent configuration, and if the SPICE child has a
Verilog view as well, the port directions in that Verilog view determine the direction
of the mixed nets.
◦ If the SPICE child does not also have a Verilog view, the direction of all mixed nets
are inout.
• The default high and low voltage values in a d2a conversion are the local analog VDD
and 0V, respectively. You can use options with the d2a command to override these
default values.
• The default high and low voltage threshold for A/D conversion is 50% of the local
analog VDD. You can use options with the a2d command to override these default
values.
• In the d2a conversion, the digital driver is modeled as an ideal source in series with
a resistor on the analog side. The value of the resistor depends on the Verilog drive
strength and is determined by the resistance map file (see Creating a Resistance Map
File).
• The behavior of a2d conversion depends on the direction of the mixed-net interface:
◦ If the interface is a unidirectional a2d mixed-net, the analog driver is modeled as a
digital driver with the Verilog default drive strength of 6 or Strong.
◦ If the interface is a bidirectional mixed-net, the a2d events are modeled as a digital
driver whose drive strength is determined by the effective output resistance of
the analog driver. The analog engine calculates that output resistance and uses it
as an index resistance map file to get a corresponding drive strength for Verilog.
Smaller output resistances lead to stronger Verilog drive strengths and larger output
resistances lead to weaker Verilog drive strength (see Creating a Resistance Map
File).
Use the -hiz on and -hiz off options with the a2d mixed-signal command to change
these default behaviors.
• Note:
Calculating a2d drive strength and estimating the output resistance for the
a2d conversion is time consuming, which could noticeably slow down the
simulation if there are too many ports requiring it. Therefore, you should
limit the use of inout mixed-nets to interface nets that are functionally
bidirectional. For interface nets that have become bidirectional only
because they were ports of a single-view SPICE cell (with no Verilog view to
determine port directions), you should use the a2d command with the -hiz
off option to disable a2d drive strength calculation.
Cases Where A/D and D/A Interface Elements are Not Inserted
By default, the tool analyzes the design topology and inserts interface elements on analog
signals that connect to the digital domain and vice versa. In some cases, analog signals
may route through the digital domain, but not connect to a digital element. Likewise, digital
signals may route through the analog domain, but not connect to an analog element.
These nets are known as through-nets and interface elements inserted on through-nets
are removed during optimization.
There are two cases for mixed nets where a2d or d2a interface elements are not inserted
and are removed by through-net optimization:
Case #1
In case #1, a Verilog design contains instances represented by SPICE views. One or
more SPICE pins are connected to a wire or nettype in the parent Verilog cell, however,
there is no load or driver on that net in the digital domain. An example of this configuration
is shown in Figure 5, where blocks pll and adc are instantiated in a Verilog design, are
represented by SPICE views, and are connected by a net. The tool determines that
there is no connection from the analog domain to the digital domain for this net, performs
through-net optimization on this net, and avoids inserting an interface element on the net.
Figure 5 SPICE is the Source and Destination With No Connection to Digital Domain
Verilog
top.v
pll adc SPICE
In this example, the through-net that connects the pll and adc analog blocks is referred to
as an a2a through net. By default, a2a through nets are reported in the through_net.rpt
file.
Case #2
In case #2, a SPICE design contains instances represented by Verilog views. One or more
Verilog pins are connected to a wire or nettype in the parent SPICE block, however, there
is no load or driver on that net in the analog domain. An example of this configuration
is shown in Figure 6, where two register blocks are instantiated in a SPICE design, are
represented by Verilog views, and are connected by a net. The tool determines that
there is no connection from the digital domain to the analog domain for this net, performs
through-net optimization on this net, and does not insert an interface element on the net.
Figure 6 Verilog is the Source and Destination With No Connection to SPICE Domain
top.spi Verilog
In this example, the through-net that connects the two register blocks is referred to as a
d2d through-net.
In either case, if more than one port is connected through the top-level net, those ports
are connected through tunneling. The only exception to that rule is when a SPICE port
is connected to top-level SystemVerilog net of type "reg", "logic", or a VHDL net of type
"signal".
If the connection between the two SPICE ports was made with a nettype, the results are
the same as the results for wire. If the connection was made by using SystemVerilog
"logic", or "reg" or by using a VHDL "signal", then two interface elements are inserted,
one from each SPICE port to the digital net. In other words, through-net optimization does
not occur for SPICE port or ports connected to a SystemVerilog "reg", "logic", or VHDL
"signal".
If the ports of the two digital blocks blocka and blockb in Figure 6 were defined as
nettypes, the results are the same.
When you specify this option, an a2d, e2r, or e2n interface element is inserted and a
digital image of the signal is generated and output in the digital output file. The type of
interface element inserted by the tool depends on the type of the mixed-net. In addition,
the net is no longer reported in the through_net.rpt file
Note:
When you specify the -ad_runopt=noa2dopt option, no interface element
is inserted in the path between the two SPICE blocks. Instead, the new a2d
interface element is added from the analog net between pll and adc ports and
the digital domain.
The same principle applies to d2d through nets. By default, a d2d through-net is optimized
as a digital node and is written only to the digital output file. You can disable d2d through-
net optimization by using the -ad_runopt=nod2aopt option with the simv binary
simulation executable as follows:
% simv -ad_runopt=nod2aopt ...
When you specify this option, a d2a, or r2e, or n2e interface element is inserted and an
analog image of the signal is written to the analog output file. In addition, the net is no
longer reported in the through_net.rpt file.
Note:
When you specify the -ad_runopt=nod2aopt option, no interface element
is inserted between the two Verilog blocks. Instead, The new d2a interface
element is added from the digital net between the Verilog blocks and the analog
domain.
Caution:
These additional interface elements can create excess overhead for the mixed-
signal simulation and degrade performance. Use these interface elements with
caution.
To disable both a2a and d2d through-net optimization, you can combine runtime options
as shown in the following example:
% simv -ad_runopt=noa2dopt+nod2aopt
0 • 0V (gnd) or, in case dynamic supply is enabled for d2a, a percentage of the
voltage on the referenced VDD net.
• Can be modified with the d2a mixed-signal control command.
1 • Local supply voltage value or, in case dynamic supply is enabled for d2a, a
percentage of the voltage on the referenced VDD net.
• Can be modified by the d2a mixed-signal control command.
Z • The analog node is not be driven by Verilog. Treat Z" as an open circuit because
1'bz typically maps to a voltage source with half the supply voltage and a high
internal resistance (example, 1e8 ohms). This high internal resistance eliminates
current flow and is like an open circuit. The voltage of the node depends entirely
on the analog circuitry.
X • 0V
• Can be modified by the d2a mixed-signal command.
Signal value conversion in the a2d direction from the transistor level to Verilog is based on
the analog voltage crossing high and low thresholds. By default, 50% of the local voltage
supply is used for both high and low a2d thresholds. To change the threshold values
for digital event generation, the mixed-signal control command a2d must be used. If the
dynamic supply feature is enabled in the a2d command, the high and low thresholds can
be set as a percentage of the referenced supply net.
The analog-to-digital signal value conversion rules are displayed in Table 3.
Table 3 Signal Value Conversion Rules for Analog-To-Digital Conversion
• Less than (<) or equal to (=) the low threshold voltage (default = 50% of local 0
voltage supply)
• Can be modified by the a2d command
• Greater than (>) or equal to (=) the high threshold voltage (default = 50% of local 1
voltage supply)
• Can be modified by the a2d command
• In case of bidir interface nets or if the drive strength calculation is enabled for a2d Z
interface nets and the analog node is HiZ
Figure 8 demonstrates how, with the dynamic supply enabled, the a2d input threshold
voltage varies with changes to the analog supply voltage. In this example, both high and
low a2d threshold voltages are set to 50% of VDD.
Figure 9 demonstrates how the d2a conversion is affected by a varying analog supply
voltage if dynamic supply is enabled. Here, the Logic data is the input to the d2a interface
element and the Analog output is the output. The analog output tracks the changes in VDD
supply voltage. In this figure, the default high and low d2a levels are set to 100% and 0%
of VDD.
For more information, see the a2d and d2a command descriptions for details on about
how to enable the dynamic supply feature.
Drive strengths are used to resolve the logic value on a net when multiple drivers are
present. When a conflict occurs between multiple drivers on the same net, the driver with
strongest driving value takes precedence and determines the net value.
For the analog-to-digital conversion, if the mixed net has a direction of inout, the tool
calculates the effective analog output resistance of the mixed net to estimate an equivalent
drive strength on the digital side.
By default, all SPICE ports are assumed to be inout, unless the SPICE cell has a Verilog
view where the direction of ports are explicitly declared. If the direction of a SPICE port
connected to a mixed net is output, no drive strength mapping from analog to digital takes
place during analog-to-digital conversion and the mixed net always assumes the default
drive level of 6.
If the mixed net connects to a SPICE port of type inout (either because there is no Verilog
view for the SPICE cell or the direction of the port in the Verilog view is defined as inout)
then the tool calculates the effective output resistance for the analog output and maps it
to a corresponding drive strength in Verilog. This can be a time-consuming task during
simulation and it is recommended to avoid bidirectional mixed nets as much as possible.
For the digital-to-analog conversion, the Verilog drive strength is mapped to a resistance
value. The resistor is placed in series with the voltage supply that models the Verilog driver
in SPICE. The following sections describe the rules governing these conversions.
The equivalent resistance value is calculated by referring to the resistance map value for
strength 6 and taking the average value as follows:
The only exception is when Verilog drives with a highz0 or highz1 drive strength. In this
case, no driver (no ideal supply or series resistor) is applied on the analog side, the digital
driver acts as an open circuit, and the voltage of the analog node depends entirely on the
drivers in the analog circuit.
When a digital block drives an analog block by using the default drive strength (6), the
analog input might suffer a voltage drop if the analog block is drawing significant current.
This can occur if there are multiple drivers on the net. To increase the drive strength, use
the resistance_map command and specify a lower resistance value. For example, the
following resistance_map command specifies a resistance range from 1.2 to 10 ohms.
// rmapADcustom.init
...
resistance_map 1.2-10.0 6 ;
To use this custom resistance map file, specify the file name with the rmap_file
command in the vcsAD.init file as follows:
rmap_file ./rmapADcustom.init;
When the mixed-net is in the high state, the series resistor is added between the net and
VDD. When the mixed-net is in the low state, the series resistor is added between the net
and ground as shown in Figure 11.
VDD VDD
Ravg
0 1 1 0
Ravg
VDD VDD
Rpull_up
Rpull_down
Example 12, is available in the include directory of the simulator installation directory.
install_directory/include/rmapAD.init
You can create your own resistance map file with unique range values for both analog-to-
digital and digital-to-analog conversion. To load your custom resistance map file, use the
rmap_file command in the vcsAD.init mixed-signal simulation control file. If you do not
use the rmap_file command, the default rmapAD.init file is used.
Use the following syntax to specify a user-defined resistance value range for converting
signal values from digital to analog.
resistance_map -to analog resistance_value_range -from verilog strength;
The following example shows a complete resistance map file that contains resistance
map ranges for both analog-to-digital and digital-to-analog conversions for all eight Verilog
strength values.
Example 13 Resistance Map File With Distinct Ranges for A2D and D2A Conversion
resistance_map -from analog 90000.2-1e32 -to verilog 0;
resistance_map -from analog 70000.2-90000.1 -to verilog 1;
resistance_map -from analog 50000.2-70000.1 -to verilog 2;
resistance_map -from analog 5000.2-50000.1 -to verilog 3;
resistance_map -from analog 4000.2-5000.1 -to verilog 4;
resistance_map -from analog 3000.2-4000.1 -to verilog 5;
resistance_map -from analog 1.2-3000.1 -to verilog 6;
resistance_map -from analog 0-1.1 -to verilog 7;
Verilog-Top/SPICE-Top Flows
Mixed-signal simulation supports both Verilog-top/VHDL-top and SPICE-top
configurations. In a SPICE-top configuration, you must use the spice_top command
in the vcsAD.init mixed-signal simulation control file. For Verilog-top or VHDL-top
configuration, no specific command is required.
Donut Configurations
One of the factors that affects the setup of a mixed-signal simulation is the netlist formats
used in different layers of the design hierarchy. For example, if the top level of a design
is in SPICE format, the design is called SPICE-top. A design could also be Verilog-top,
VHDL-top or Verilog-AMS-top.
Also, a design in which Verilog is on top of SPICE in the hierarchy is called a Verilog-
SPICE donut configuration. There are many possible donut configurations for each of the
three flows. There are also restrictions on certain types of donut configurations that are
described in detail in following sections.
Figure 13 shows a simple design and its hierarchy. The block named top instantiates two
child blocks: blk1 and blk2. Child block blk2 contains blk3.
top
blk1 blk2
blk3
Cells blk1 and blk3 are referred to as leaf cells, because they are located at the bottom
of a hierarchy branch.
In a non mixed-signal design, the top block and all child blocks are either Verilog or SPICE
as shown in Figure 14.
A mixed-signal design supports different simulation domains for digital and analog blocks
within the same simulation. Figure 15 shows a Verilog-SPICE-Verilog donut configuration
that is simulated by using the following mixed-signal simulation control file:
top Verilog
SPICE
blk1 blk2
blk3
Figure 16 shows another possible donut configuration where the top-level design is
represented in SPICE (SPICE-top design) and has a SPICE-Verilog donut configuration.
The design is simulated with the following mixed-signal simulation control file:
top Verilog
SPICE
blk1 blk2
blk3
A block in the hierarchy might have both a Verilog description and a SPICE description
available for simulation. This type of cell is called a multi-view cell. By default, the tool
selects the view for a given cell based on the parent view. In the previous examples, the
specific view was selected by specifying the use_spice, use_verilog, and use_vhdl
commands in the vcsAD.init mixed-signal simulation control file.
In the preceding example, the Verilog views for blk1 and blk2 are used because of the
use_verilog commands, while the view selected for the multi-view cell blk3 is Verilog
because blk3 by default inherits the Verilog view of its parent blk2.
VHDL, Verilog or SPICE blocks can each instantiate blocks of the other two formats
without restriction. The only requirement is for SPICE instantiations under VHDL; those
SPICE cells must also have a Verilog view available in order for the instantiation under
VHDL to take place. The PrimeSim XA, FineSim, and PrimeSim simulation engines
support VHDL-top, Verilog-top, and SPICE-top design configurations.
A dynamic reference voltage requires only the node. If supply searching finds the
specified node, a dynamic supply reference to that node is established:
ie_reference_voltage -node node_name;
For Signal IE's that can trace to the reference node_name, this is equivalent to manually
setting a dynamic supply for each:
◦ D2A levels are calculated as hiv=100%, lov=0% referring to VDD=node_name
◦ A2D levels are calculated as hith=50%, loth=50% referring to VDD=node_name
A SPICE block often uses multiple supplies. You can use a separate ie_reference_voltage
command for each of the supplies. If you use multiple ie_reference_voltage commands on
the same net, the last one specified is used. Note that specifying multiple commands on
the same net might consume extra time to resolve them, so it is not recommended.
You use the ie_reference_voltage command to identify the output of the regulator and
either specify a value or declare it as a dynamic supply:
ie_reference_voltage -node A1 -voltage 1.5; //static
or
The Signal IEs that can trace supply to node A1 use the value specified by the
ie_reference_voltage command, or dynamically follow the voltage on A1 and use it as their
reference.
If you specify:
ie_reference_voltage -node A1;
The two signal IEs (which can trace supply to A1) become:
d2a -node top.i1.abc -hiv 100% -lov 0% -VDD A1;
a2d -node top.i1.def -hith 50% -loth 50% -VDD A1;
The previous reference is dynamic, so the signal IE levels follow the voltage on A1.
If you prefer to set a fixed value for the reference, you can specify the value:
ie_reference_voltage -node A1 -voltage 1.8;
Report Files
If you enable verbose mode for the interface_element.rpt, a note for each a2d/d2a/
inout indicates from where the value was derived. If the reference was derived from an
ie_reference_voltage command, it is noted if you used the following command:
report_option -interface_element verbose;
Note:
This feature is currently available only in the PrimeSim XA simulation engine
and is not supported in the FineSim or PrimeSim simulation engines.
options provide a mechanism to set global threshold options specific to each HDL
compiled library. These option apply to:
• Cells compiled into Verilog/SystemVerilog libraries with the applicable VCS vlogan
commands.
• Cells compiled into VHDL libraries with the applicable VCS vhdlan commands.
For more information about the vlogan and vhdlan commands, see the VCS® User
Guide.
You specify the HDL library names with the -library options for all the interface element
commands (a2d, d2a, and so on).
In the following example, when the d2a commands and options are applied, any interface
elements inserted at the interface to HDL cells in the cellLib1 library use the -hiv 1.2
and -lov 0.0 threshold options. Any interface elements inserted at the interface to HDL
cells in the cellLib2 library use the -hiv 1.8 and -lov 0.0 threshold options.
d2a -hiv 1.2 -lov 0.0 -library libCell1 -cell * -port *;
d2a -hiv 1.8 -lov 0.0 -library libCell2 -cell * -port *;
For more information about the interface element commands, see Mixed-Signal Control
Commands.
Figure 18 shows results that use manually-specified interface element command options
to give the correct results.
Figure 18 Waveforms
In this case, the interface elements inserted for this design without the application of the
new interface element library-based options in the interface_element.rpt file are:
Eight specific interface element commands with thresholds must be provided to produce
correct results for this design. With the new library-based interface element options, only
two commands in the vcsAD.init file for each library and options are needed to give
correct results:
To change the default time resolution for the FineSim tool (not recommended, as
explained above), set the finesim_tunit option:
.option finesim_tunit=0.1ps
• In the VCS PrimeSim AMS tool using the PrimeSim simulation engine, to match the
digital and analog resolutions, you can change either the PrimeSim or VCS time
resolution. Because the analog engine time resolution is usually determined by
the accuracy requirements of the analog circuit, you should set the PrimeSim time
resolution based on the accuracy requirements for the circuit and adjust the VCS time
resolution to match.
To override the VCS timescale, use the -override_timescale switch at compile
time. In the following example, the VCS timescale/time resolution is overridden with a
1ps/100fs:
% vcs -ad -override_timescale=1ps/0.1ps
To change the default time resolution for the PrimeSim tool (not recommended, as
explained above), set the primesim_tunit option:
.option primesim_tunit=0.1ps
• Parameter passing between SPICE and Verilog-A is always enabled in all solutions if
Verilog-A is read in via the SPICE .hdl command. For example:
.hdl "inv_verilog_a.va"
x1 in out inv_verilog_a vhigh=3.3 vlow=0 td=10
• In the Verilog-AMS-SPICE flow, parameter passing between Verilog and SPICE and
parameter passing between HVA blocks are enabled by default.
3
Using Advanced Features in Mixed-Signal
Simulation
current time point and restore it later, preventing simulation data loss. For more details,
refer to Saving and Restoring Simulation State chapter.
ace reread
This command allows a new configuration file or netlist to be read in the middle of a
simulation, with some limitations. The command saves the state of the analog simulator
to files with a .ic and .ic.sup extension. Later, the saved state is restored while the analog
engine reads in a new SPICE netlist file with a new set of options, temperature, or library
corners or, in the case of the PrimeSim XA simulation engine, a new PrimeSim XA
configuration file.
This operation allows you to make changes to the PrimeSim XA configuration or to the
SPICE netlist (and embedded options) and pass the updated information to the PrimeSim
XA, FineSim, or PrimeSim simulation engines. This command only applies to analog
netlists and the PrimeSim XA configuration file. This command cannot apply changes to
VCS command-line options or changes to the digital netlist.
You cannot make structural changes to the analog netlist, such as changing instances,
instance names, port names, and the number of cell ports. The command supports only
modifications that do not affect the structure of the analog netlist, such as changes to
temperature, SPICE options, accuracy settings, and component values such as resistor,
capacitor, or supply voltage and current values.
The syntax Is:
Options Description
-ad control_file Specifies a new mixed-signal simulation control file. Only the hiz
attributes of e2r and r2e interface elements can be overridden. All
other commands in the file are ignored.
-o output_file_name The restored waveform file and log file are prefixed with the specified
output file name.
-op_optimize The tool loads the operating point generated at the time point when
ace reread is executed.
• 0 (default): flattens the hierarchical netlist and loads the IC file
automatically generated by ace reread.
• 1: preserves netlist hierarchy while loading initial conditions (ICs) for
performance and capacity on designs with many levels of hierarchy.
By default, SDF delays on A2D mixed-signal nets are enabled on SPICE parent netlists.
Use either of the VCS elaboration options, +msvsdf or +msvsdfext, to disable this
annotation as follows:
vcs options -ad +msvsdf …
or:
vcs options -ad +msvsdfext …
In the following example, the $sdf_annotate system task is specified inside the initial
block in the top module. Note that the $sdf_annotate system task specifies only one
argument ("./dut.sdf"). In this case, the back-annotation data is applied to the current
module (top).
module top ( );
initial $sdf_annotate ("./dut.sdf");
endmodule
The VCS® User Guide contains more information on SDF annotation and the
$sdf_annotate system function.
* SPICE dut
.subckt dut out clk
xg1 net1 clk inv1
xg2 net2 net1 inv2
xg3 out net2 inv3
.ends
The conflict in instance names between the Verilog view and SPICE view creates
problems when switching between the two views in a mixed-level simulation. In the
following example, the testbench instantiates module dut and uses the $hdl_xmr system
task to access node top.g1.g2.Y.
As a result of the naming conflict, the mixed-signal simulation produces an error message
when trying to resolve the top.g1.g2.Y node:
Warning-[HXSSI] Hdl_xmr:Source signal invalid
verilog/testbench.v, 6
Instance path: top
Source signal 'top.g1.g2.Y' could not be found in the design.
One solution to this problem is to modify the $hdl_xmr system task to use the SPICE
instance name as follows:
$hdl_xmr("top.xg1.xg2.Y","xmr",1);
However, this requires keeping two or more copies of the testbench, one for digital
simulation and one for mixed-signal simulation. To automatically resolve this naming
conflict, use the resolve_x_inst_prefix enable mixed-signal command as described in
this section.
Prerequisites
Note the following when preparing the design views:
• The testbench should run without error for the digital-only design hierarchy.
• Design hierarchies instantiated in an HDL testbench can be of different formats, such
as mixed SPICE/HDL, but the hierarchies must be consistent using the same module/
entity or SPICE instances and cell names.
Using resolve_x_inst_prefix
To automatically resolve instance name conflicts due to the x prefix in SPICE, use the
resolve_x_prefix command in the vcsAD.init mixed-signal simulation control file as
follows:
resolve_x_inst_prefix enable;
When you add this command to the file, the same testbench can be used without
modification for digital-only and mixed-signal simulations. For the test case shown above,
the same testbench and $hdl_xmr can be used for the design configured with either the
Verilog or SPICE dut cell views.
initial begin $hdl_xmr("top.g1.g2.Y","xmr",1);
Note:
The resolve_x_prefix enable; command is not required for the 3rd-party
SPICE format because 3rd-party instances do not require an x prefix.
The following sections describe the settings required to run concurrent mixed-signal
simulations from the same directory and compiled code:
• Enabling Concurrent Mixed-Signal Simulations
• Creating Separate Output Files During Concurrent Mixed-Signal Simulation
• Changing the Configuration File or SPICE Netlist File for Concurrent Mixed-Signal
Simulation
The report_option command directs the tool to generate local copies of the simv.msv
directory. This prevents conflicts when multiple simulations point to the same compiled
executable, allowing the simulation output to the simv.msv directory to avoid writing to the
same file.
% ./simv \
+TEST2 \
-ucli \
-do Vcs2.ucli \
-l simv2.log \
-ad_runopt=analogconfig:anlg_run_2.do
In the following example, the minimum delta is set to 10mV. Signal changes less than
10mV do not generate an event in the digital simulator.
e2n -min_delta 10m -node top.n1;
It is also possible that the analog engine might need to generate more events for
the digital simulator to accurately record large changes in voltage. You can use the
-max_delta argument of the e2n command to set the maximum change in voltage that
triggers a simulation event. The analog simulator does not take an iteration during these
extra events, so the analog simulator still runs as efficiently as possible. It calculates the
additional events and sends the data to the digital simulator.
In the following example, the maximum delta is set to 20mV, meaning additional events
every 20mV are generated and sent to the digital engine.
e2n -max_delta 20m -node top.n2;
The digital simulator might take a lot of events, but when these events are sent to the
analog simulator, the value at the boundary is changing very little. For performance
reasons, you might want to filter these small value change events and have an event sent
to the digital simulator only after the analog values change by a large enough amount. You
can use the -min_delta argument of the n2e command to set this filter value.
In the following example, the minimum delta is set to 10mV and signal changes less than
10mV do not generate an event in the digital simulator.
n2e -min_delta 10m -node top.n1;
To run Monte Carlo analysis in a mixed-signal simulation, add the SWEEP MONTE keywords
to the .TRAN statement and run the simulation using the same command you use for a non
Monte Carlo analysis. The simv compiled simulation executable automatically launches a
simulation run for each Monte Carlo iteration.
rundir/results/
xa.pvadir/, xa.fsdb.grp, xa.log, xa.mc, xa.mc.csv,
xa.mc_params, xa.meas, xa.valog (XA files)
rundir/results/mc1/
xa.pvadir/, xa.m1.fsdb, xa.m1.meas, xa.ma, xa.valog
(Iteration-specific XA files)
rundir/results/mc2/
xa.pvadir/, xa.m2.fsdb, xa.m2.meas, xa.ma, xa.valog
(Iteration-specific XA files)
…
rundir/results/mcn/
All VCS tool-generated compile and runtime files are placed in the run directory and are
overwritten with each compile or run.
If waveforms are output from UCLI (FSDB or VPD), then VCS waveform files are added
with a suffix of m$i and are generated inside the iteration-specific directories.
After simulation, the file and directory structure is:
rundir/
simv, simv.daidir/, simv.msv/, csrc/, etc (VCS and MSV
compile and run time directories and files)
rundir/results/
xa.pvadir/, xa.fsdb.grp, xa.log, xa.mc, xa.mc.csv,
xa.mc_params, xa.meas, xa.valog (XA files)
rundir/results/mc1/
xa.pvadir/, vcs.m1.fsdb, xa.m1.fsdb, xa.m1.meas, xa.ma,
xa.valog (Iteration-specific XA files & VCS waveform
files)
rundir/results/mc2/
xa.pvadir/, vcs.m2.fsdb, xa.m2.fsdb, xa.m2.meas, xa.ma,
a.valog (Iteration-specific XA files & VCS waveform files)
…
rundir/results/mcn/
The following summary files are created by combining the results from all Monte Carlo
iterations:
• Append one-by-one
◦ xa.log
◦ xa.meas/mt (if it exists)
◦ xa.mc_param (if it exists)
• Statistical summary
◦ xa.mc (if it exists)
For example, assuming that the simulation starts in the rundir directory, do the following:
1. Specify the following mixed-signal simulation control file:
// vcsAD.init
choose finesim -o results/fs ...
rundir/results/
fs.pvadir/, fs.ic, fs.im, fs.log, fs.mt0, fs.valog,
fs_s1.fsdb , fs_s2.fsdb,…, fs_sn.fsdb, etc (FineSim files)
All VCS tool-generated compile and runtime files are placed in the run directory and are
overwritten with each compile or run.
If waveforms are dumped from UCLI (FSDB or VPD), then VCS waveform files are added
with a suffix of m$i to make the result unique.
After simulation, the file and directory structure is:
rundir/
simv, simv.daidir/, simv.msv/, csrc/, etc (VCS and MSV
compile and run time directories and files)
rundir/results/
fs.pvadir/, fs.ic, fs.im, fs.log, fs.mt0, fs.valog,
fs_s1.fsdb , vcs.m1.fsdb, fs_s2.fsdb, vcs.m2.fsdb, …,
fs_sn.fsdb, vcs.mn.fsdb, etc (FS files & VCS waveform
files)
The following summary files are created by combining the results from all Monte Carlo
iterations:
• Append one by one
◦ fs.log
◦ fs.mcpt0 (if it exists)
• Statistical summary
◦ fs.mt0 (if it exists)
For example, assuming that the simulation starts in the rundir directory, do the following:
1. Specify the following mixed-signal simulation control file:
// vcsAD.init
choose primesim -o results/ps ...
rundir/results/
ps.pvadir/, ps.ic, ps.im, ps.log, ps.mt0, ps.valog,
ps_s1.fsdb , ps_s2.fsdb,…, ps_sn.fsdb, etc (PrimeSim files)
All VCS tool-generated compile and runtime files are placed in the run directory and are
overwritten with each compile or run.
If waveforms are dumped from UCLI (FSDB or VPD), then VCS waveform files are added
with a suffix of m$i to make the result unique.
After simulation, the file and directory structure is:
rundir/
simv, simv.daidir/, simv.msv/, csrc/, etc (VCS and MSV
compile and run time directories and files)
rundir/results/
ps.pvadir/, ps.ic, ps.im, ps.log, ps.mt0, ps.valog,
ps_s1.fsdb , vcs.m1.fsdb, ps_s2.fsdb, vcs.m2.fsdb, …,
ps_sn.fsdb, vcs.mn.fsdb, etc (PS files & VCS waveform
files)
The following summary files are created by combining the results from all Monte Carlo
iterations:
• Append one by one
◦ ps.log
◦ ps.mcpt0 (if it exists)
• Statistical summary
◦ ps.mt0 (if it exists)
UCLI Support
UCLI scripts are supported in Monte Carlo analysis as:
% simv -ucli -do run.ucli
Note:
If the UCLI script does not exit the simulation, the simulation generates an error
message and stops.
If you use Ctrl+C to interrupt the simulation, the tool exits. Be aware that this is
different from the UCLI normal behavior.
The simv -ucli command (interactive mode) is available for debugging only:
• After running a suite of Monte Carlo simulations, you can identify an outlier by the seed
number.
• You can then duplicate that run using:
.tran ... SWEEP Monte=1 firstrun=seed
In the previous example, the simulator begins a single simulation replicating 27 and
stopping at time 0.
You can then use interactive commands to investigate the simulation.
Limitations
• The save/restore capability is not supported.
• The ucli2proc UCLI option is not supported.
• VCS PrimeSim AMS Monte Carlo analysis using the FineSim or PrimeSim simulation
engines does not generate any waveform group file (*.grp).
To distribute these simulations across a network, you must provide additional information
to the job distributor through the -ad_runopt option to simv. For example:
simv -ad_runopt=analogconfig:dp:worker#:[dp_cfg_file]:[dp_location]
Parameter Description
worker# Required parameter that specifies the number of worker CPUs available to
process Monte Carlo iterations. Must be a number greater than 0.
dp_cfg_file Optional user-defined file. If not specified, uses the local host.
CDPL distributed processing for the LSF and GRID compute farms is supported in the
VCS PrimeSim AMS tool. CDPL supports the following protocols for launching workers on
remote nodes/machines:
• RSH (Remote Shell)
• SSH (Secure Shell)
• SGE (Oracle Grid Engine, originally Sun Grid Engine)
• LSF (Load Sharing Facility, from Platform Computing)
Note:
The portion of the circuit that is simulated in VCS does not linearize, so the AC
analysis results of the digital portion are meaningless.
Running AC Analysis
The FineSim tool in SPICE mode (spicead, spicehd, spicemd, and spicexd), the
PrimeSim Pro tool in SPICE mode (spicehd, spicemd, and spicexd), and the PrimeSim
SPICE tool all support AC analysis. This analysis can also be used in mixed-signal
simulation. Add the SPICE command .OP 0 to create an operating point at time=0. There
is no need to run a transient analysis.
Note:
The portion of the circuit that is simulated in VCS does not linearize, so the AC
analysis results of the digital portion are meaningless.
netlist_commands_begin;
.temp 45
netlist_commands_end;
xa_commands_begin;
set_sim_level 5
xa_commands_end;
In the example shown in Figure 19, all of the analog simulation and interface events (d2a,
a2d, and so on) are skipped during the first window from t0 to t1. However, the last digital-
to-analog events (such as d2a) are recorded and applied right before t=t1 as a DCOP (DC
Operation) when the analog simulation starts. This ensures that the analog simulation gets
the updated state from the digital simulation.
If you provide initial conditions for these analog nodes, the states and d2a events should
be consistent. If there is any inconsistency, then the d2a events prevail because the d2a
events are treated as a DCOP at t=t1, which can trigger additional DC state updates from
the interface nets to the affected analog internal nodes, and which is automatically taken
care of by the simulator as a DCOP right before t=t1.
There should be no a2d events in the first window [t0, t1]. A warning message is issued if
there are such events and the events are ignored.
Note:
When the skip_analog command is issued at time 0, it automatically performs
a DCOP even without any run at time 0. If skip_analog is issued at a non-zero
time (for example, 10ns), it does not perform any DCOP at that time instant.
When the analog simulator wakes up after the skip_analog window, a DCOP
is performed automatically to initialize the analog nodes.
Specify the skip_analog command in UCLI mode to use this feature.
Syntax
ucli% ace skip_analog time_value
In this example, the first UCLI command sets the skip analog period as t=0 to t=200ns.
This sets the skip window only; it does not trigger the run.
The second command launches the run for 300ns, of which the first 200ns of analog
simulation is skipped (as set in the previous command), then the regular mixed-signal
simulation runs from t=200ns to t=300ns.
Example 2
The following example shows how analog simulation can be skipped for multiple time
windows.
% simv -ucli
ucli% ace skip_analog 200ns
ucli% run 300ns
ucli% ace skip_analog 100ns
ucli% run
In this example, the first UCLI command sets the skip analog period as t=0 to t=200ns.
This sets the skip window only; it does not trigger the run.
The second command launches the run for 300ns, of which the first 200ns of analog
simulation is skipped (as set in the previous command), then the regular mixed-signal
simulation runs from t=200ns to t=300ns.
The third UCLI command sets the skip analog period for the next 100ns, which sets the
skip window from t=300ns to t=400ns.
The last command runs the simulation from t=300ns to the end, of which the first 100ns
of analog simulation is skipped for the window from t=300ns to t=400ns (as set in the
previous command), and then regular mixed-signal simulation runs from 400ns to the end.
Example 3
The following example shows how analog simulation can be skipped during the
initialization phase of the simulation and how you can choose to provide an initial condition
after the skipped time.
% simv -ucli
ucli% ace skip_analog 200ns
ucli% run 200ns
ucli% ace reread -c rereadFile.cfg
ucli% run
In this example, the first UCLI command sets the skip analog period as t=0 to t=200ns.
This sets the skip window only; it does not trigger the run.
The second command launches the run for 200ns, in which the analog simulation is
skipped for t=0ns to t=200ns (as set in the previous command).
The third command reads in a new configuration file which has a PrimeSim XA, FineSim,
or PrimeSim simulation engine-specific command to load the initial conditions at t=200ns.
PrimeSim XA:
load_operating_point -file "xa_200ns.ic" -type ic
FineSim:
.load file="fs_200ns.ic"
PrimeSim:
.load file="ps_200ns.ic"
The xa_200ns.ic, fs_200ns.ic, and ps_200ns.ic files contain initial conditions for the
analog nodes at 200ns. Because there is no analog simulation during the initial phase, you
can also choose to skip the DCOP at t=0ns by using the following.
PrimeSim XA configuration command specified in the xa.cfg file:
set_dc_option -skip_dc 1
The last command runs the simulation as usual from t=200ns to the end.
4
Saving and Restoring Simulation State
In a VCS PrimeSim AMS mixed-signal simulation, you can save the state of the simulation
at any given time point and then restore it at a later time to continue the simulation. When
the simulation is restored, the simulation image is read from disk and copied into memory.
This feature can be used in different situations:
• A simulation is running for a long time and must be interrupted. Instead of losing the
simulation data, you can save the state of the simulation up to the current time point
and restore it later.
• A simulation has a long initialization sequence. Instead of running the initialization
sequence each time, you can complete the initialization sequence during the first
simulation, save the state, and use the saved state for subsequent simulations.
Another application of this feature is when multiple tests are run on the same design
(each with a different set of input stimulus for example) and all those tests share the same
power-on or initialization phase (for example, they all wait for PLLs to lock). You can use
save and restore to run one of the tests up to the point where the initialization phase is
complete and save the state. For each test, you can restore the simulation, set unique
parameters and input vectors, and continue the simulation. Note that the testbench must
be designed to allow the selection of different tests after restore, for example, by forcing
the content of an RTL variable that selects between tests to a different value after each
restore.
This chapter describes:
• Basic Save and Restore Usage
• Running Multiple Simulations With Save and Restore
You can use these commands to capture and save the state of the simulation at a given
timepoint and quit the simulation.
Note:
If you save a checkpoint with the save command and restore the checkpoint
with the restore command at a later time on a different machine, you
should try to match the CPU type and OS patch level between the machines.
Otherwise you might encounter compatibility issues.
The following example starts the compiled simulation in the UCLI interactive mode by
using the -ucli command-line option, runs the simulation for 100ns, saves an image of
the simulation to sim_state, and exits the simulation.
% simv -ucli
ucli% run 100ns
ucli% save sim_state_100ns
ucli% quit
You can restore the saved state of the simulation at a later time. The following example
starts the compiled simulator in interactive mode, loads the saved simulation state, and
continues the simulation:
% simv -ucli
ucli% restore sim_state_100ns
ucli% run
case (tst)
1: test1( ); // Run test No 1
2: test2( ); // Run test No 2
3: test3( ); // Run test No 3
4: test4( ); // Run test No 4
5: test5( ); // Run test No 5
default: tst0 ( );
endcase
...
end
The following example demonstrates this technique for running different tests based on a
variable setting. The simv -ucli command starts the simulation in UCLI interactive mode.
The simulation is run for 10ns and the simulation image is saved to sim_state. The saved
image is used in two subsequent simulations, where each simulation runs a different part
of the testbench. The second simulation restores the saved image and forces the tb.tst
variable to 2 in order to select test number 2. The third simulation forces the variable to 3
to select test number 3.
As a result, each simulation runs a different test as shown in Figure 20.
% simv -ucli
ucli% restore sim_state
ucli% force tb.tst 2
ucli% run
% simv -ucli
ucli% restore sim_state
ucli% force tb.tst 3
ucli% run
% simv -ucli
ucli% run 10ns
ucli% save sim_state
ucli% quit
5
Cross Module Reference
This chapter describes the different methods for reading and driving analog signals from
the digital domain. These methods work in the PrimeSim XA, FineSim, and PrimeSim
mixed-signal solutions.
• Accessing, Forcing, and Releasing Analog Signals From the Digital Domain
• Accessing SPICE Nodes Through the Verilog Language XMR
• Accessing SPICE Nodes Through hdl_xmr, hdl_xmr_force, and hdl_xmr_release
• Accessing SPICE Nodes Through Proprietary System Tasks and Functions
• Accessing SPICE Nodes Through UCLI XMRs
• Using Bus Notation With an XMR Task
• Using form_spice_bus for SPICE Ports Appearing in the Form of a Bus
The following example performs a Verilog language XMR read on a SPICE node with the
hierarchical path top.i1.i2.x1.strb into a Verilog register. It assigns the logic value
corresponding to the voltage of a SPICE node.
initial begin
...
verilog_reg = top.i1.i2.x1.strb;
...
end
The following example performs a Verilog language XMR write on a SPICE node. The d2a
interface element inserted by mixed-signal simulation translates the logic values to voltage
values and applies them to the SPICE node.
reg rst_reg;
assign top.i1.i2.x1.rst = rst_reg;
initial begin
...
rst_reg = 1'b0;
#5 rst_reg = 1'b1;
...
end
Because SPICE requires all buses to be split into individual signals, the bus signals in a
SPICE netlist must be surrounded in braces ({ }) if the target of a Verilog language XMR is
a SPICE bus. The following example shows a SPICE subcircuit with bus ports a_2, a_1,
and a_0 and how those SPICE bus members are accessed in a Verilog language XMR.
.subckt spice_blk a_2 a_1 a_0
The a_2, a_1, and a_0 SPICE bus ports are accessed in an assign statement that uses
Verilog language XMR as follows:
wire [2:0] verilog_wire;
assign verilog_wire = {top.x1.a_2, top.x1.a_1, top.x1.a_0};
In this example, verilog_wire is a Verilog bus. Note that braces ({ }) are used along with
the full hierarchical paths to the SPICE bus ports to assign a vector composed of SPICE
bus signals a_2, a_1, and a_0.
Arguments
Argument Description
verbose Specifies an optional integer value for setting the message level.
A value of 0 indicates no verbosity, and value 1 enables verbosity.
When the value is 1, a message is displayed every time a value of
the source object is copied onto the destination object.
Arguments
Argument Description
rel_time Specifies a time relative to the current simulation time. The VCS tool
forces the specified value on the specified destination_object at
the specified time, plus the current time. Specify the relative time in
the following format:
rel_time [fs | ps | ns | us | ms]
For example:
$hdl_xmr_force("top.dut.reset", "0",
"4 ns", "freeze", "5 ns");
If the specified time is less than simulation precision, then the force
happens at the end of the current time step.
Argument Description
force_type Specifies how the value is applied to the net. The force_type must
be one of the following:
• freeze (default): Forces the specified value on the specified
destination_object at the specified time. Any drivers later in
time have no impact on the destination_object.
• deposit : Forces the specified value on the specified
destination_object at the specified time. Any driver later in time
can override the forced value.
Note:
The deposit setting is not supported on SPICE nets.
cancel_time Specifies a time relative to the current simulation time. The VCS tool
cancels the forced value on the specified destination_object at
the specified time, plus the current time. Specify the relative time in
the following format:
cancel_time [fs | ps | ns | us | ms ]
For example:
$hdl_xmr_force("top.dut.reset", "0",
"4 ns","freeze", "5 ns");
If the specified time is less than simulation precision, the forced value
is canceled at the end of the current time step. The default behavior
is to never cancel the forced value, and is specified by leaving this
field blank.
Note:
cancel_time is not used when force_type is deposit. If
specified, cancel_time is ignored.
verbose Specifies the output message level to use. By default, the message
level is 0. A value of 0 indicates no verbosity, and a value of 1
enables verbosity.
Arguments
Argument Description
verbose Specifies the output message level to use. By default, the message
level is 0. A value of 0 indicates no verbosity, and a value of 1
enables verbosity.
Description
You can use the hdl_xmr_release() procedure or $hdl_xmr_release() system task
to release any objects forced with hdl_xmr_force(), $hdl_xmr_force(), or the force
commands in the design. hdl_xmr_release works the same as the Verilog release
command.
These signal release functions can be called concurrently or sequentially from a VHDL
architecture (for example, a testbench), a process, or from any Verilog scope where
a system call can be made. After the signal is released using hdl_xmr_release, the
expected behavior of the released node is:
• If the destination node is of type VHDL signal, and if there is no driver on the
destination node, then the node is forced to ‘U’.
• If the destination node is of type Verilog wire, and if there is no driver on the destination
node, then the node is forced to ‘Z’.
• If the destination node is of type Verilog reg, and if there is no driver on the destination
node, then the node retains the current value until future evaluations.
Runtime interface elements, rt_a2d, rt_d2a, rt_e2n, rt_e2r, rt_n2e and rt_r2e are inserted
automatically for conversion to and from SPICE with the hdl_xmr, hdl_xmr_force
procedures or $hdl_xmr, $hdl_xmr_force system tasks. Note that runtime interface
elements are not saved to the interface_element.rpt file, they are saved to the
runtime_interface_element.rpt file. You can view the console log to verify that
runtime elements were inserted during simulation.
The following example shows a $hdl_xmr_force of 0.33 on an analog target when the
analog target has an equivalent HDL view in which the target node is defined as nettype.
The vcsAD.init contains the following use_spice command:
use_spice -cell inv;
module top();
...
inv m1(y, in);
initial begin
#50 $hdl_xmr_force ("top.g1.y","0.33","50ns", , , 1);
#10 $hdl_xmr_release ("top.g1.y", 1 );
end
endmodule
In the previous example, the top.g1.y destination analog node is forced to a value of 0.33
at 50 ns by the $hdl_xmr_force system task. The tool inserts a rt_n2e element because
the node is defined as a nettype of voltage_r. The $hdl_xmr_release system task
releases the forced node after 10 time units.
The runtime_interface_element.rpt file reports the rt_n2e interface element as
follows:
rt_n2e -node top.g1.y // -nettype voltage_r
Table 6 Accessing SPICE Nodes With System Tasks or System Functions (Continued)
Caution:
These real XMR system tasks and functions are not yet supported in the VHDL/
Verilog-SPICE and Verilog-AMS-SPICE flows.
$snps_force_volt()
This system task allows Verilog to force a voltage on any SPICE node, even one
connected to an ideal voltage source. In such a case, this system task overrides the ideal
voltage source.
Syntax
$snps_force_volt(SPICE_node_name, verilog_real_value
| verilog_real_variable);
Argument Description
SPICE_node_name Specifies the full hierarchical node name for the internal SPICE node.
This can also be a mixed net (an A/D interface net).
verilog_real_value Specifies a real value or a Verilog real variable. The value is applied
verilog_real_variable to the SPICE node as an ideal voltage source.
Examples
$snps_force_volt (top.i1.spcell.n1, 3.3);
or
$snps_force_volt (top.i1.spcell.n1, real_var);
The voltage applied to the SPICE node stays at the specified value until the next
$snps_force_volt or $snps_release_volt system task call is applied.
$snps_inject_current()
Allows Verilog to inject additional current on a SPICE node.
Syntax
$snps_inject_current(SPICE_node_name, verilog_real_value
| verilog_real_variable);
Argument Description
SPICE_node_name Specifies the full hierarchical node name for the internal SPICE node.
This can also be a mixed net (an A/D interface net).
verilog_real_value Specifies an explicit real value or a Verilog real variable. The value is
verilog_real_variable applied to the SPICE node as an ideal voltage source.
Examples
$snps_inject_current (top.i1.spcell.n1, 20.0e-6);
An additional 20uA of current is added to the SPICE node. This additional current is
applied until the next $snps_inject_current system task call. To stop injecting current,
set the value to 0.0.
Note:
This feature is currently available only in the PrimeSim XA simulation engine
and is not supported in the FineSim or PrimeSim simulation engines.
$snps_release_volt()
This system task removes the voltage source applied by a previous $snps_force_volt
task, and from that point on, allows the SPICE node to assume voltages determined by
the SPICE circuit. If the node has not been forced with $snps_force_volt or is already
released, this system task has no effect.
Syntax
$snps_release_volt(SPICE_node_name);
Argument Description
SPICE_node_name Specifies the full hierarchical node name for the internal SPICE node.
This can also be a mixed net (an A/D interface net).
Examples
$snps_release_volt (top.i1.spcell.n1);
$snps_get_volt()
This is a Verilog function that allows sampling of voltage values for internal SPICE nodes.
This function can be used to assign a value to a Verilog real variable or it could be used as
a real value in an expression.
Syntax
$snps_get_volt(SPICE_node_name);
Argument Description
SPICE_node_name Specifies the full hierarchical node name for the internal SPICE node.
This can also be a mixed net (an A/D interface net).
Examples
always @(posedge clk) begin real_var =
$snps_get_volt(top.i1.spcell.n2);end
$snps_get_port_current()
This is a Verilog function that allows sampling of current through SPICE subcircuit ports or
SPICE primitive pins.
You can use this function to assign a value to a Verilog real variable or as a real value in
an expression.
Syntax
$snps_get_port_current(SPICE_port_name | spice_primitive_pin);
Argument Description
SPICE_port_name The Full Hierarchical Path to the SPICE subcircuit port or the pin of a
SPICE primitive such as a resistor, capacitor, inductor, or transistor.
spice_primitive_pin The names of SPICE primitives, which follow the PrimeSim HSPICE
convention. For example, "p" and "n" represent positive and negative
pins of two port primitives such as R's, C's, and L's, and "d", "g", and
"s" represent drain, gate, and source of MOS transistors.
Caution:
These system tasks and functions operate on an on-demand basis and are not
event-driven. This means that they sample and apply SPICE voltages only at
times when they are called in the Verilog code.
$snps_get_areal()
This is a Verilog function that allows sampling of a real variable defined in Verilog-A. The
function returns a real value to the digital domain. The function can be used to assign a
value to a Verilog real variable or used as a real value in an expression.
Syntax
$snps_get_areal(real_variable);
Argument Description
// Verilog-A module
real v_sup;
analog begin
v_sup = V(sup);
end
$snps_get_aint()
This is a Verilog function that allows sampling of an integer variable defined in Verilog-A. It
returns an integer value to the digital domain. This function can be used to assign a value
to a Verilog int variable or used as an integer value in an expression.
Syntax
$snps_get_aint(int_variable);
Argument Description
// Verilog-A module
int v_sup;
analog begin
if (V(sup) > 0.7) v_sup=1;
end
$snps_get_dreal()
This is a Verilog-A function that allows sampling of a real variable defined in
SystemVerilog. It returns a real value to the analog domain. This function is limited to
accessing the SystemVerilog parent of a Verilog-A module.
Syntax
$snps_get_dreal(real_variable);
Argument Description
// Verilog-A module
real v_v1;
analog begin
v_v1 = $snps_get_dreal(r_v1);
V(out) <+ transition(v_v1,0,1n,1n);
end
$snps_get_dint()
This is a Verilog-A function that allows sampling of an integer variable defined in
SystemVerilog. It returns an integer value to the analog domain. It is limited to accessing
the SystemVerilog parent of a Verilog-A module.
Syntax
$snps_get_dint(int_variable);
Argument Description
// Verilog-A module
real r_v1;
analog begin
r_v1 = $snps_get_dint(i_v1);
V(out) <+ transition(r_v1,0,1n,1n);
end
snps_above()
Generates a digital event that allows Verilog to sense when a given SPICE voltage has
gone above or below a certain threshold. This event can be used in the sensitivity list of
a Verilog always block, which would then allow a piece of Verilog code to be executed
depending on the voltage transitions on the given SPICE node.
Syntax
snps_above(expression);
snps_absdelta()
Generates a digital event when the expression changes by more than the specified delta
value. This event can be used in the sensitivity list of a Verilog always block to allow
execution of Verilog code based on a changing SPICE node. This function is useful when
real valued variables are used in Verilog modules and the analog signals must be sampled
continuously.
Syntax
Argument Description
delta Sets the delta value that causes the function to create an event. Must
be a non-negative number. If delta is set to 0, all analog changes
trigger events.
Argument Description
time_tol Sets the value of the time tolerance. Must be a nonnegative number.
snps_cross()
Generates a digital event that allows Verilog to sense when a given SPICE voltage has
passed a certain threshold voltage. This event can be used in the sensitivity list of a
Verilog always block to allow execution of Verilog code based on a voltage transition at
the given SPICE node.
Syntax
snps_cross(expression, dir);
Argument Description
Argument Description
Where node is the hierarchical path name of the node to be forced. The effect of this
command can be canceled with the following commands:
• A release command
• Another force command
• A force command with the -cancel option
Use the release command to release the value forced to a signal, variable, net, or reg
previously forced by the force command. After this command is executed, the drivers of
signal, variable, net or reg have their original drivers.
Note:
If the nettype is reg, then it retains its value until the original driver forces a new
value.
The release syntax is:
release node
where node is the nested hierarchical identifier of the signal, variable, net or reg or SPICE
node.
The following example applies a UCLI force command on an analog target:
ucli% run 20ns
ucli% force top.g1.g2.y 1
The following example applies a UCLI force command on an analog target when the
analog target has an equivalent HDL view in which the target node is defined as nettype.
Usage Example
The following example supports usage of force and release assignments on wreal nets:
top.v
module top;
mid m();
endmodule
module mid;
wreal wr[1:2];
bot b();
always @(wr[1]) $display ("wr[1]=%g at %0t", wr[1], $time);
endmodule
module bot;
real r;
assign top.m.wr[1] = r;
initial begin
r = 0.1;
repeat (5) #10 r = r * 2.0;
$finish;
end
endmodule
Command line:
% vcs top.v -sverilog -wreal res_sum -debug_access+all
% ./simv -ucli
Tool session:
ucli% catch {force {top.m.wr[1]} 1.0 -deposit} err
1
ucli% puts $err
Error-[UCLI-FORCE-ERR-WREAL] NYI force on WREAL
Force command failed on object 'top.m.wr[1]' with type
'vpiRealWire'.
Command force deposit on wreal net is not yet supported.
Please refer to UCLI user guide for more documentation on force
commands.
ucli% force {top.m.wr[1]} 8.0
ucli% run 1
ucli% get {top.m.wr[1]}
8.000000
ucli% release {top.m.wr[1]}
ucli% run 3
ucli% get {top.m.wr[1]}
0.100000
ucli% quit
Limitations
This feature has the following limitations:
• The $deposit system task on the wreal net is not supported.
• The force and release on wreal arrays that are present in modules instantiated in VHDL
is not supported.
• The force and release on wreal arrays are not supported when wreal scalarization is
disabled using the -wreal noscalarize option.
Escaped identifiers begin with the backslash ( \ ) character. The entire identifier is escaped
by the backslash. Escaped identifier is terminated by white space. For example:
real_var1 = $snps_get_volt(snps_sptop.\x1_[2] .in);
^ ^
6
Sweep/Alter in Mixed-Signal Simulation
Sweeps and Alters are commonly used in SPICE and Fast SPICE to perform multiple
simulations. This feature enables sweep methods commonly used in SPICE to be used in
mixed-signal simulation.
Sweeps and Alters are described in the following sections:
• Types of Sweeps
• Combining Sweeps
• Running Distributed Sweeps and Alters
• Output Files and Directories
• Placing Waveform Files in One Directory
• Merged FSDB Files
• Group Files
• UCLI Support
• Sweep and Alter With Save/Restore or ACE-Reread
• Known Limitations
Types of Sweeps
The following types of sweeps and alters are supported in mixed-signal simulation:
• Parameter Sweeps
• Data Sweeps
• Temperature Sweeps
• Alter Blocks
• DC Sweeps
The sweep mechanism is specified in the SPICE netlist the same way as a SPICE-only
simulation. You can use the SWEEP keyword with the .TRAN statement to enable sweep
analysis. Refer to the respective user guides for the PrimeSim XA, FineSim, or PrimeSim
simulation engines for more information regarding the .TRAN command.
Parameter Sweeps
You can specify parameter sweeps as:
or
Argument Description
np Specifies the number of points for lin or poi or the number of points per
decade or octave for dec and oc sweeps, respectively.
For example, each of the following.tran statements sweeps the simulation using six
points:
.tran 1ns 100ns sweep p1 10 110 20
.tran 1ns 100ns sweep p2 lin 6 10 110
.tran 1ns 100ns sweep temp poi 6 10 30 50 70 90 110
Data Sweeps
You can define sweep parameters in a .DATA block:
.TRAN tstep tstop [UIC] [SWEEP DATA=dataname]
.DATA datanm pnam1 [pnam2 pnam3 ... pnamx]
+ pval1 [pval2 pval3 ... pvalx]
+ pval1' [pval2' pval3' ... pvalx']
.ENDDATA
For example:
.TRAN 1ns 100ns sweep DATA=data1
.DATA data1 param1 param2
10 20
30 40
.ENDDATA data1
Temperature Sweeps
There are four ways to sweep temperature:
• The .TEMP command.
• The TEMP parameter in the .TRAN statement.
• The TEMP/TEMPER parameter in the first column of the .DATA statement.
• As a parameter in a .ALTER block.
Note:
The TEMP parameter in a .TRAN statement or in .DATA statement is treated as
a parameter sweep. Samples have an extension of .s# in file names. TEMP
as a parameter in a .ALTER block is treated as an alter. Samples have a .a#
extension to their file names.
For example:
.TEMP 10 20 30
.TRAN 10ns 1us UIC SWEEP TEMP -55 75 10
.TRAN 1ns 100ns sweep DATA=data1
.DATA data1 temp p2
0 20
25 30
125 40
.ENDDATA data1
Alter Blocks
The .ALTER statement resimulates a netlist using different parameter values, model
libraries, components, temperatures, and so on for each run.
The following example changes a parameter:
.param rvalue = 10
Vsource source 0 PULSE(0 5 1n 1n 1n 20n 40n)
Rsource source 0 'rvalue'
.alter rvalue=10
.alter rvalue=100
.end
.lib 'mymodel.l' TT
.alter
.del lib 'mymodel.l' TT
.lib 'mymodel.l' SS
.alter
.del lib 'mymodel.l' SS
.lib 'mymodel.l' FF
.END
The following example sets the temperature and changes a resistor value:
DC Sweeps
The FineSim tool in SPICE mode (spicead, spicehd, spicemd, and spicexd), the
PrimeSim Pro tool in SPICE mode (spicehd, spicemd, and spicexd), and the PrimeSim
SPICE tool all support DC sweep analysis in mixed-signal simulation. Add the SPICE
command .DC to enable DC Sweep.
The following example runs a DC sweep of a mixed-signal circuit. The parameter vd1 is
linearly swept from 1.0 to 1.4 in five steps.
.dc vd1 lin 5 1.0 1.4
Combining Sweeps
The sweeps and alters may be combined and nested. The following example combines
temperature, parameter, and alter sweeps for a total of 30 simulations:
simv -ad_runopt=analogconfig:dp:worker#:[dp_cfg_file]:[dp_location]
Argument Description
dp_cfg_file Optional user-defined file. If not specified, uses the local host.
For more information about distributed processing, see Running Distributed Monte Carlo
Analysis.
Sweep
-o output/xa -> output/s#/xa.s#.*
Temperature:
-o output/xa -> output/t#/xa.t#.*
Alter:
-o output/xa -> output/a#/xa.a#.*
FineSim-Generated Files
Output file names and locations follow the FineSim tool convention. You specify the
directory and file name with the -o option on the FineSim command line as:
-o results/fs
The FineSim tool does not create sample-specific directories. Instead, it makes the file
names (.fsdb, .vpd) unique by adding s (sweep), t (temperature) or a (alter) with the
sample number and places them inside the output results directory. For example:
results/
fs_s0.fsdb, fs_s1.fsdb … (Sweep)
fs_t0.fsdb, fs_t1.fsdb … (Temperature)
fs_a0.fsdb, fs_a1.fsdb … (Alter)
PrimeSim-Generated Files
Output file names and locations follow the PrimeSim tool convention. You specify the
directory and file name with the -o option on the PrimeSim command line as:
-o results/ps
The PrimeSim tool does not create sample-specific directories. Instead, it makes the file
names (.fsdb, .vpd) unique by adding s (sweep), t (temperature) or a (alter) with the
sample number and places them inside the output results directory. For example:
results/
ps_s0.fsdb, ps_s1.fsdb … (Sweep)
ps_t0.fsdb, ps_t1.fsdb … (Temperature)
ps_a0.fsdb, ps_a1.fsdb … (Alter)
rslt_dir/s1
f_name.s1.0.ic
f_name.s1.fsdb
f_name.s1.meas
vcs_rslt.s1.fsdb
simv.daidir/
simv.msv/
FineSim Tool
fs … -o rslt_dir/f_name
PrimeSim Tool
ps … -o rslt_dir/f_name
f_name.s0.meas
vcs_rslt.s0.fsdb
f_name.s1.0.ic
f_name.s1.fsdb
f_name.s1.meas
vcs_rslt.s1.fsdb
s0/
simv.daidir/
simv.msv/
s1/
simv.daidir/
simv.msv/
...
Group Files
A WaveView group (.grp) file is generated to make it easy to load all the resulting
waveform files into WaveView at one time and overlay the results.
For example, suppose you ran a series of 12 sweeps and used the following command:
xa -o rslt_dir/f_name
In WaveView, choose File > Open Waveform and open the following .grp file to load all
of the waveforms at one time:
[email protected]@sw.grp
UCLI Support
The following UCLI capabilities are supported:
• simv -ucli -do run.ucli
• Note that if the UCLI script does not contain a means to exit, the simulation
automatically adds one.
• A digital or analog force can be applied at any time from the UCLI command file.
• You can use ace commands in the ucli.cmd file.
• The UCLI ace reread command is supported.
• You can apply breakpoints.
The following features are not supported:
• Interactive mode is not supported. Ctrl+C causes the simulation to exit.
• The UCLI save/restore commands are not supported. These commands are ignored
and a warning is given.
• -ucli2proc
Known Limitations
• Only transient analysis is supported.
• If swept analog parameters are passed to digital, only the initial value is passed. This
is because the parameter passing between analog and digital is determined at compile
time.
• Alter blocks cannot change the interface element. You cannot change views using an
alter block.
• You cannot combine data sweep and parameter driven sweeps. This is consistent
with the PrimeSim XA standalone tool. If you specify both, data sweep is used and
parameter sweep is ignored.
• Sweep statements cannot be inside .alter statements:
.param rvalue=1
.tran 1ns 100ns
.lib 'Cmos90nm.lib' tt
.alter 1
.tran 1ns 100ns sweep rvalue 1 2 1 $ This line will be ignored
.lib 'Cmos90nm.lib' ss
• You cannot mix sweeps or alters with Monte Carlo analysis. If encountered, the tool
produces an error message and exits.
• UCLI interactive mode is not supported. Ctrl+C causes the simulation to exit.
7
Mixed-Signal Simulation in the Verilog-SPICE
Flow
This chapter provides information about the Verilog-SPICE mixed-signal simulation flow.
To comment out lines one-by-one, use double slashes (//) as shown in the following
example:
// TEST A
// use_spice -cell blocka;
// a2d -loth 1.65v -hith 1.65v -node top.s[0];
You can also use Verilog-style block comments (/* */) to comment out multiple lines as
shown in the following example:
//TEST A
/*
use_spice -cell blocka ;
a2d -loth 1.65v -hith 1.65v -node top.s[0] ;
a2d -loth 1.65v -hith 1.65v -node top.s[1] ;
*/
You can include the content of other files with the `include command. In the following
example, the contents of File1 and File2 are inserted into the vcsAD.init file:
`include "/path/mydir/File1" ;
`include "/path/mydir/File2" ;
// `include "/path/mydir/File3"
The `include command calculates relative paths to the included files based on the
simulation directory (the directory where the simv simulation executable is created and
executed). For example, suppose the simulation directory is /user/unit/case/test and
the vcsAD.init file contains the following `include commands:
`include /a/b/c/d/sub1.init
`include dir1/dir2/sub2.init
You can reference the $MYFILE1 and $MYFILE2 environment variables in your vcsAD.init
file as follows:
choose xa -hspice addr4.spi -c cfg ;
`include "$MYFILE1" ;
`include "$MYFILE2" ;
In the previous example, note that the threshold values for top.s[0] set by the
snps_vcsAD.ini file are overridden by the vcsAD.init file.
The path for each control file is recorded to the compile log in the order in which it was
read.
% vcs testbench.v -debug_access+all -ad=vcsAD.init -l ./vcs.log
...
[MSV-MC-FRO] - Notice: Mixed-signal commands were read in this order from
the following files:
snps_vcsAD.ini
vcsAD.init
For a complete list of the mixed-signal control commands, see Mixed-Signal Control
Commands.
Before using the Verilog-SPICE flow, the following files must also be in place:
• Verilog netlist files (for example, testbench.v)
• Verilog-A module files, if used
• SPICE netlist files (including device model libraries)
• Mixed-signal simulation control file (for example, vcsAD.init)
• Command file, depending on which analog engine is being used (for example, cfg)
Use the VCS option -full64 to run in 64-bit mode. The following example uses VCS to
elaborate the design named top with the -ad compile-time option. The command reads
the default vcsAD.init file as the mixed-signal simulation control file and creates the simv
simulation executable.
% vcs top -ad -full64
The following example elaborates the design named my_top and loads my_setup.init as
specified by the -ad compile time option. The command creates the my_simv simulation
executable.
% vcs -full64 my_top -ad=my_setup.init -o my_simv
Note:
The -y command-line switch in VCS is not recommended in the mixed-signal
flow and may interfere with or prevent the instantiation of SPICE blocks in the
design.
When you modify any design files (Verilog, Verilog-A, or SPICE) or the mixed-signal
simulation control file:
• Remove all the intermediate files/directories generated by the previous mixed-signal
simulation by removing the simv.daidir and csrc directories.
• Restart the compilation.
Also, if you use the analog configuration commands to change the case sensitivity in
SPICE netlists, then you must recompile the design before those changes can take effect.
the SPICE netlist that do not have a corresponding Verilog module. A Verilog dummy
module, also called a dummy wrapper or shadow file, is defined as a spicemodule instead
of module, and contains the port name, port direction, net name, and instance module
definitions (if available). These dummy Verilog modules are generated at compile time and
are kept in the simv.daidir directory.
You can use the -R option to vcs to compile and run the design at the same time as shown
in the following example:
% vcs -full64 -R -ad=vcsAD.init testbench.v adder.v -l comp.log \
-debug_pp -o simv -l sim.log
The following example specifies the simv.log file as the output log file for the simulation.
% simv -l simv.log
Caution:
All time step values for the VCS tool must be set to a value that is an even
power of 10; for example 1ns, 10ps, 100ps.
8
Mixed-Signal Simulation in the
VHDL/Verilog-SPICE Flow
This chapter describes how to prepare the input data to run a mixed-signal simulation with
the VCS PrimeSim AMS tool.
When using the FineSim or PrimeSim simulation engines, replace choose xa with
choose finesim or choose primesim.
sets the VHDL simulation time base and time resolution, and assigns values to some
simulation control variables.
One of the most frequent uses of the VHDL setup file is to map logical VHDL libraries to
physical host directories.
In VHDL, design blocks can be analyzed and stored in one or more logical libraries.
This capability offers great flexibility in maintaining multiple versions of a VHDL block by
analyzing each version in a different library.
The VHDL setup file supports the mapping of multiple logical library names to their
physical location.
By default, all VHDL blocks are analyzed and stored in the WORK logical library. The default
physical directory for this library is ./WORK.
For more information on the VCS setup file, refer to the VCS User Guide.
The following example shows a sample synopsys_sim.setup file. Here, rtl_lib and
gate_lib (two logical libraries) and their physical locations are defined. Also, the WORK
default logical library is mapped to the rtl_lib library.
WORK > rtl_lib
rtl_lib: ./rtl_library
gate_lib: ./gate_library
TIMEBASE=ns
TIME_RESOLUTION=10ps
If real ports are used in the VHDL description, ensure that a wreal declaration is made
for the same ports in the Verilog wrapper module (also include the -realport switch
when calling vlogan and vcs, which is discussed later in this document). When using a
wreal declaration, only input and output ports are allowed. Note that inout ports are
not supported.
The following example shows a wreal declaration file sample.
Note:
Using real ports can result in a simulation performance penalty. Specifically, real
values passed from the analog engine to VHDL when combined with smaller
time resolution values can result in decreased simulation performance.
The following example shows a SPICE subcircuit, its instance in the VHDL description,
and the required corresponding Verilog wrapper. Note that only the subcircuit ports are
required.
.subckt chargepump_com
+ com_inv<3> com_inv<2> com_inv<1> com_inv<0>
The following example instantiates the chargepump_com SPICE block from the previous
example into a VHDL description. The sig_inv, sig_rsh and sig_clk signals are defined
in the VHDL block and connect to the chargepump ports.
I3 : chargepump_com
port map (
com_inv => sig_inv(3 downto 0),
com_rsh => sig_rsh(3 downto 0),
clk => sig_clk
);
The following example shows a Verilog wrapper that must be generated to allow the
instantiation of the SPICE cell under VHDL.
'timescale 1ns/10ps
module chargepump_com(com_inv, com_rsh, clk);
input [3:0] com_inv, com_rsh;
input clk;
// The body of the Verilog wrapper can be empty.
// Any content here will be ignored.
endmodule
...
endmodule
Transistor-Level Descriptions
For SPICE netlists, note the following:
• PrimeSim HSPICE and VHDL netlist formats are case-insensitive, but Verilog is case-
sensitive.
So the best practice is to create all subcircuit, port, and signal names consistently, in
either lowercase or uppercase, across all SPICE, Verilog and VHDL files.
• Unused ports must be removed from the subcircuits that are going to be instantiated
under VHDL, and a Verilog wrapper is generated for them.
utility.
After creating the wrapper file, you must edit the wrapper.v file and change the port
directions to match the design intent for the circuit. By default, the port direction in a
SPICE subcircuit is inout and the autowrapper utility writes out all ports with an inout
direction. Using the default inout port direction setting could slow the runtime because
inout mixed-nets can lead to many successive back-and-forth D/A and A/D conversions.
The wrapper.v file contains all Verilog wrapper modules that correspond to subcircuits
defined in the SPICE file. For instance, if there are four subcircuits specified in the SPICE
file, the utility creates four Verilog wrapper modules in the wrapper.v file. The syntax for the
autowrapper utility is:
autowrapper -n[fmt] netlist_files
[-bus_fm bus_format] [-cell subckt_name(s)]
[-xcell subckt_name(s)] [-file netlist_file_name]
[-o output_file_name][-case s|S|l|L|u|U]
Note that all ports are defined as inout in module inv. For the best simulation
performance, you must change port directions as shown in the following example:
// modified verilog wrapper example
module inv (a, zn);
input a;
output zn;
endmodule
-bus_fm bus_format Specifies the format of bus signals in the input netlist file. The default
bus format is [%d]. See Table 8 for examples of different bus formats.
-cell subckt_name(s) Specifies the subcircuits, in the netlist file, that must be converted
into Verilog wrapper modules. All other subcircuits are ignored. The
module name uses the same case-sensitivity as the subckt_name.
-xcellsubckt_name(s) Specifies the subcircuits that must not be converted into Verilog
wrapper modules. All other subcircuits are converted into Verilog
wrapper modules. This option excludes specified subcircuits, and is
case-insensitive.
-file netlist_file Specifies a file that contains a list of subcircuits, one subcircuit name
per line, to convert to Verilog wrapper modules. Use the semicolon (;)
character as a comment character as shown in the following example:
File:name.txt
;inv
;xor
;f_add
adder
-o output_file_name Specifies the output file name where the Verilog wrappers are
written and sets the .log file prefix. If the same file exists in the output
directory, it is overwritten without a WARNING message.
-case s|S|l|L|u|U -case s or -case S maintains case-sensitivity for the port names
-case l or -case L generates lowercase port names (default)
-case u or -case U generates uppercase port names
A[0] [%d]
B_1 _%d
C<2> <%d>
D_3_ _%d_
E{4} {%d}
F5 %d
G6_ %d_
For example, the _%d bus format directs the autowrapper utility to recognize bus signals
defined as A_1, A_2 ..., A_n.
• The autowrapper utility generates one Verilog wrapper module per subcircuit.
Therefore, it can generate unnecessary Verilog wrappers. Some of these modules
might be using the same module name as other Verilog modules in the original Verilog
code. If this occurs, the VCS tool generates an error message and stops compilation.
Therefore, before compiling, check the module names in the Verilog wrapper file.
If the name is used elsewhere in the Verilog description, and the generated Verilog
wrapper is not needed, remove the module from the Verilog wrapper file. The following
example displays the SPICE definition for subcircuits adder4 and inv, and how a
Verilog wrapper can be generated.
.subckt adder4 a[3] a[2] a[1] a[0] b[3] b[2] b[1] b[0]
+ clk cin cout
xinv1 clk clkn inv
…
.ends
.subckt inv a zn
m1 zn a vdd vdd p 1 0.35
m2 zn a gnd gnd n 2 0.35
.ends
The tool generates the net.v file as shown in the following example:
module adder4 (a, b, clk, cin, cout);
inout [3:0] a;
inout [3:0] b;
inout clk;
inout cin;
inout cout;
endmodule
The inv module is unnecessary here and can create confusion if another inv module
exists in the original Verilog code. You must remove the inv module description from
the net.v file.
• Verilog is case-sensitive. SPICE is not case-sensitive. The autowrapper utility
maintains case-sensitivity for module names; but, you must use the -case option if you
want to maintain case-sensitivity for port names.
• The autowrapper utility does not generate timescale information. Therefore, the
wrapper file must be placed at the end of the Verilog file’s compilation input:
vcs -ad a.v c.v d.v wrapper.v
Verilog wrapper file (original SPICE subcircuit), as shown in the following example.
wrapper file, bus/array-type signals
The autowrapper utility automatically forms bus- or array-type signals in the Verilog
bus-type signals, Verilog wrapper bus-type signal, Verilog wrapper array-type signal,
signals,Verilog
Verilogwrapper
wrapper Verilog wrapper file, bus/array-type signals
• If special characters and Verilog-specific keywords are used for the signal or subcircuit
name, the name is assigned a backslash ( \ ) leading character.
In addition, a space is inserted at the end of the name in the Verilog wrapper file, as
shown in the following example.
module \inverter.test ( \if , \1 , \2 );
inout \if ;
inout \1 ;
inout \2 ;
endmodule
module vsources (\0 , \B#1 , B, \CE# , CLK,
DECOUT, \Q^ , XDPD, \b#2 );
inout \0 ;
inout \B#1 ;
inout [5:5] B;
inout \CE# ;
inout CLK;
inout [7:7] DECOUT;
inout \Q^ ;
inout [7:7] XDPD;
inout \b#2 ;
endmodule
• If subcircuit ports in a bus are randomly ordered in the transistor netlist, the
autowrapper utility cannot function properly. See the following example for a sample
(unsupported) file.
.subckt p7ibptacddecwr clk wlw0[0] wlw0[10] wlw0[11] wlw0[12]
+wlw0[13] wlw0[14] wlw0[15] wlw0[1] wlw0[2]
+wlw0[3] wlw0[4] wlw0[5] wlw0[6] wlw0[7]
+wlw0[8] wlw0[9] wlw1[0] wlw1[10] wlw1[11]
+wlw1[12] wlw1[13] wlw1[14] wlw1[15] wlw1[1]
+wlw1[2] wlw1[3] wlw1[4] wlw1[5] wlw1[6]
+wlw1[7] wlw1[8] wlw1[9] writeadd[0] writeadd[1]
• Nested subcircuits in the SPICE netlist are supported. A module is generated for the
nested subcircuit; the module name is made of the nested subcircuit name preceded
by the parent subcircuit name, itself preceded by a backslash character (\).
A nested subcircuit sample is shown in the following example.
.subckt s in out
.subckt inv13 in out
.ends inv13
.ends s
The Verilog wrapper generated by the autowrapper utility is shown in the following
example.
module s (in, out)
inout out;
inout in;
endmodule
Argument Description
-include [VCS command Specifies a file that contains VCS commands to be run during
file_name] run-time.
-ucli Starts the simulation in the UCLI interactive mode. The UCLI
feature must have been enabled at compile time by passing the
-ucli option to VCS.
In the following example, the -ucli option starts the simulation in the UCLI interactive
mode. Note that you must also specify the -debug or -debug_all option VCS compilation.
% simv -ucli
Known Limitations
The known VHDL/Verilog-SPICE limitations are:
• Verilog wrappers are required for instantiations of SPICE under VHDL.
However, donut configurations of Verilog and SPICE blocks, or SPICE instantiating
VHDL, do not require a Verilog wrapper.
• Through-net optimization is not supported for SPICE ports connecting through a top-
level Verilog/VHDL net. But Verilog/VHDL ports connecting through a top-level SPICE
net are subject to through-net optimization.
Note:
As an alternative, real type connections in VHDL can be used to generate
unidirectional connections of SPICE ports via VHDL.
9
Mixed-Signal Simulation in the
Verilog-AMS-SPICE Flow
The Verilog-AMS-SPICE flow is supported by the VCS PrimeSim AMS tool. This flow
supports Verilog-AMS, as described in the Verilog-AMS LRM (with some exceptions and
limitations described in this section).
The Verilog-AMS-SPICE flow supports many of the same features as those in Verilog-
SPICE, described in Mixed-Signal Simulation in the Verilog-SPICE Flow.
Some of the concepts in the Verilog-AMS language that must be considered when using
the Verilog-AMS-SPICE flow are:
• Analog and digital blocks in Verilog-AMS
• Connect rules and connect modules
• Continuous and discrete domains
• Nets and disciplines
This chapter describes:
• Required Input Files for the Verilog-AMS-SPICE Flow
• Nets and Disciplines
• Converting Signals With Interface A/D and D/A Connect Modules
• Compiling the Design for a Verilog-AMS-SPICE Simulation
• Running a Verilog-AMS-SPICE Simulation
• Resolving Keyword Conflicts between SystemVerilog and Verilog-AMS
• Support for Wreal Nets in Verilog-AMS Flow
• Unsupported Features in Verilog-AMS-SPICE
• Support for SystemC Designs in Verilog-AMS
3. Include the following two lines at the top of the first Verilog file passed to the simulator:
`include "constants.vams"
`include "disciplines.vams"
In this case, the call to the PrimeSim XA tool in the mixed-signal simulation control file
requires the following command:
choose xa -c xa.cfg;
// cell-based use_verilog
use_verilog -module mux;
// cell-based use_spice
use_spice -cell inverter;
// instance-based use_verilog
use_verilog -module mux -inst top.i1.i2;
// instance-based use_spice
use_spice -cell inverter -inst top.i1.i3;
Note:
In the Verilog-AMS-SPICE flow, all Verilog files are passed to VCS at compile
time. In the Verilog-SPICE flow, Verilog-A files are passed to FastSPICE, using
the `hdl command. Although this feature is also supported in the Verilog-AMS-
SPICE flow, it is recommended that, in the Verilog-AMS-SPICE flow, all Verilog
files, including legacy Verilog-A, be passed to VCS at compile time.
In this example, it is assumed that the files are in the local directory. If not, a full path to the
location of these files is required (just as in any other Verilog file).
// Digital block
reg clk;
initial begin
clk = 0;
forever #5 clk = ~clk;
end
// Analog block
analog begin
if (in == clk)
A Verilog-AMS module can contain many digital blocks, but it can only contain one analog
block as defined in the Verilog-AMS Language Reference Manual.
An analog block is identified by the analog keyword. All other blocks inside a module
definition, such as initial and always blocks, are considered to be digital blocks (for
example, initial and always blocks).
Because Verilog-AMS is a superset of the Verilog-A and digital Verilog-HDL languages,
a module that only contains digital blocks (conventional digital Verilog HDL) or a module
that only contains an analog block (conventional Verilog-A) is also viewed and treated as
Verilog-AMS code by the simulator.
module test;
endmodule
In the digital Verilog-HDL language, no explicit discipline declaration is made for wire,
reg, or port, so the compilation of the Verilog-HDL files can fail when they are used
in the Verilog-AMS-SPICE flow. To resolve this problem, declare a default discipline
by placing the `default_discipline directive inside the Verilog code or by using the
-ams_discipline VCS compile switch.
`default_discipline logic
module mydesign ( a , b);
input a;
output b;
...
endmodule
In the following example, the -ams_discipline VCS switch defines a default discipline.
vcs testbench.v -R -ad -ams_discipline logic
Unlike nets, disciplines are not explicitly declared for variables. The domain of a variable
is determined by the context in which the assignment is made. If the variable is assigned a
value in an analog context (that is, in an analog block), the variable is considered analog.
However, if the assignment is made in a digital context (that is, in a digital block), the
variable is considered to be digital. A variable can only be assigned a value in one domain,
but it can be accessed for reading from any domain.
The following example shows a digital domain variable. The real variable v is assigned
a value in the digital domain (inside the initial block), and as a result is considered a
digital variable.
`include "constants.vams"
`include "disciplines.vams"
module mydesign;
real v;
initial begin
v=1.5;
end
...
endmodule
The following example shows a variable definition in Verilog-AMS code. The variable is
assigned a value in the analog domain, and is treated as an analog variable.
`include "constants.vams"
`include "disciplines.vams"
module mydesign;
real v;
analog begin
...
v = 1.5;
...
end
...
endmodule
endmodule
A connect rule may contain many more associations; for example, to define interfaces
between other types of digital and analog disciplines, or to define bidi connect modules.
Note:
Connect rules and connect modules are only deployed by the simulator if there
is a connection between a digital and an analog net. If no direct connection
exists throughout the netlist, connect rules and connect modules are not used.
analog begin
// Digital signal accessed in analog domain
if (dig_in == 1b'1)
V(an_out) <+ 1.8;
end
...
endmodule
Figure 21 shows an example of a simple inverter chain circuit where connect modules are
used to model the direct connection of analog and digital nets.
Note:
Connect rules and connect modules are not used if this no direct connection
between analog and digital nets. This occurs if the interactions between analog
and digital nets are implemented by analog/digital cross-boundary sampling
within a Verilog-AMS module, not through port connections.
However, if there are direct connections between analog and digital nets (for example,
nets of electrical and logic disciplines), the definitions for connect rules and connect
modules must be passed to the simulator at compile time.
Specific xx strings signify specific connect rule definitions for specific analog supply
voltages. For example, the default connect rule file for a 1.8V supply is:
snps_crules_1_18.vams
If the design has specific characteristics (for example, an analog supply voltage of
1.6V) that do not match any of the default connect rule files, define a connect rule file
by copying one of the default files to a new file and change the parameters for the
connect module referenced inside of it.
-ams
Enables the Verilog-AMS-SPICE feature. Specify this option on the VCS command line as
follows:
% vcs -ad -ams ...
-ams_discipline logic
Treats all nets without an explicit discipline definition as discipline type logic. This
compile option is used when importing legacy Verilog-D code in which no disciplines are
defined for module ports. By using this option, discipline logic is assigned to all such
ports.
While logic is the digital discipline commonly used, any other discipline name can be
used in Verilog-AMS as the default discrete discipline. Especially if Verilog-AMS is used
along with SystemVerilog, a name different from logic must be used for default discrete
discipline because logic is a reserved SystemVerilog type. The following example specifies
a discrete discipline called logical as the default discipline.
% vcs -ams_discipline logical ...
-ams_dresolution
Enables detail discipline resolution. The Verilog-AMS LRM describes basic and detail
discipline resolution. By default, basic discipline resolution is used, but this compile time
option switches to detail discipline resolution. Typically, detail discipline resolution causes
more connect modules to be inserted.
% vcs -ams_dresolution ...
-ams_iereport
Records a list of all instances of connects modules in the design. The list is displayed at
the console and saved in the log file with the following information:
• Instance name under which the connect module was inserted
• Instance name of the connect module
• Module name of the connect module
• Discipline resolution mode used (that is, merged or split)
• Net and port that connect to each end of the connect module
A full report, which also lists the final parameter values for each connect module instance,
is output to simv.msv/connectmodule.rpt.
Note:
simv is the default name for the binary simulation executable generated after
compilation. You can change this name by using the -o exec_file_name
compile time switch.
If you use this naming convention, you can use the +verilogamsext and
+systemverilogext switches to identify the file extensions used for SystemVerilog and
Verilog-AMS as shown in the following example:
% vcs -ams -ad +verilogamsext+vams +systemverilogext+sv+v+svh ...
This technique separates the language context for SystemVerilog and Verilog-AMS at
compilation time and avoids the potential conflict between keywords and function names.
Usage Example
The following example defines connect modules that matches the discipline of the wreal
net or port along with the wreal type:
module bot(output wreal p1);
myLogical p1;
assign p1 = 1.0;
anaMod ANAMOD (p1);
endmodule
// Analog module
module anaMod (e1);
output e1;
electrical e1;
endmodule
anaMod
wreal electrical
bot
connect module
// The following connect module has output port with myLogical discipline
// with wire type.
connectmodule elect_to_logic (ain, dout);
input ain;
electrical ain;
output dout;
myLogical dout;
...
endmodule
connectrules mixedsignal;
connect elect_to_logic input electrical, output myLogical;
connect elect_to_wreal input electrical, output myLogical;
...
endconnectrules
In the preceding example, a connect module is required inside the bot module because
p1 wreal signal is connected to the e1 electrical port of the anaMod module. To select the
connect module, there are two connect rules that refer to two different connect modules,
that is, elect_to_logic and elect_to_wreal respectively.
The elect_to_wreal connect module has digital output port of type wreal with myLogical
discipline. Therefore, the elect_to_wreal connect module is selected as per the connect
module selection algorithm.
Use Model
This section provides the use model to support Verilog-AMS and SPICE with SystemC
designs.
The other options of VCS elaboration for mixed-signal simulations remain the same.
If the -sysc=ams option is not used for Verilog-AMS elaboration, then an error message is
generated that mentions Verilog-AMS is not supported.
Usage Example
The following example illustrates the usage of a SystemC design in a simulation with
Verilog-AMS and SPICE:
Example 36 test_sc.v
// test_sc.v
`include "connectmodules.vams"
`include "bottom2.vams"
`timescale 1ns/1ps
interface myport (
output wire iw1,
output wire iw2,
output wire iw3,
output bit ib1,
output bit ib2,
output bit ib3,
output logic il1,
output logic il2,
output logic il3);
endinterface
initial begin
$fsdbDumpfile("vcs.fsdb");
$fsdbDumpvars("+all");
end
endmodule
module myspice (output wire w1, w2, w3, w4, w5, w6, w7, w8, w9);
wire z1, z2, z3, z4, z5, z6, z7, z8, z9;
// VERILOG
bottom1 VLOG_BOTTOM_1 (z1, z2, z3, z4, z5, z6, z7, z8, z9);
Example 37 test_sc.spi
.inc "spiceinv.spi"
subckt myspice w1 w2 w3 w4 w5 w6 w7 w8 w9
// VERILOG
VLOG_BOTTOM_1 z1 z2 z3 z4 z5 z6 z7 z8 z9 bottom1
// SPICE
SP1 w1 z1 spiceInv
SP2 w2 z2 spiceInv
SP3 w3 z3 spiceInv
SP4 w4 z4 spiceInv
SP5 w5 z5 spiceInv
SP6 w6 z6 spiceInv
SP7 w7 z7 spiceInv
SP8 w8 z8 spiceInv
SP9 w9 z9 spiceInv
ends myspice
Example 38 spiceinv.spi
simulator lang=spice
.inc 'models.spi'
*epic tech="voltage 3.3"
Example 39 disciplines.vams
// disciplines.vams
`ifdef DISCIPLINES_VAMS
`else
`define DISCIPLINES_VAMS 1
//
// Natures and Disciplines
//
discipline logical
domain discrete;
enddiscipline
// Electrical
// Current in amperes
nature Current
units = "A";
access = I;
idt_nature = Charge;
`ifdef CURRENT_ABSTOL
abstol = `CURRENT_ABSTOL;
`else
abstol = 1e-12;
`endif
endnature
// Charge in coulombs
nature Charge
units = "coul";
access = Q;
ddt_nature = Current;
`ifdef CHARGE_ABSTOL
abstol = `CHARGE_ABSTOL;
`else
abstol = 1e-14;
`endif
endnature
// Potential in volts
nature Voltage
units = "V";
access = V;
idt_nature = Flux;
`ifdef VOLTAGE_ABSTOL
abstol = `VOLTAGE_ABSTOL;
`else
abstol = 1e-6;
`endif
endnature
// Flux in Webers
nature Flux
units = "Wb";
access = Phi;
ddt_nature = Voltage;
`ifdef FLUX_ABSTOL
abstol = `FLUX_ABSTOL;
`else
abstol = 1e-9;
`endif
endnature
// Conservative discipline
discipline electrical
potential Voltage;
flow Current;
enddiscipline
// Signal flow disciplines
discipline voltage
potential Voltage;
enddiscipline
discipline current
potential Current;
enddiscipline
`endif
Example 40 connect_modules.vams
// connect_modules.vams
`include "disciplines.vams"
`timescale 1ns/1ps
connectmodule logic_to_elect(l2e_cm,l2e_el);
input l2e_cm; logical l2e_cm;
output l2e_el; electrical l2e_el;
connectrules mixedsignal;
connect elect_to_logic input electrical, output logical;
connect logic_to_elect input logical, output electrical;
endconnectrules
Example 41 sc_bottom1.cpp
#include "sc_bottom1.h"
Example 42 sc_bottom1.h
#ifndef sc_bottom1_h
#define sc_bottom1_h
#include "systemc.h"
#include "bottom2.h"
SC_MODULE(sc_bottom1)
{
sc_out<bool> w1;
sc_out<bool> w2;
sc_out<bool> w3;
sc_out<bool> w4;
sc_out<bool> w5;
sc_out<bool> w6;
sc_out<bool> w7;
sc_out<bool> w8;
sc_out<bool> w9;
bottom2 VLOG_BOTTOM_2;
SC_CTOR(sc_bottom1):
w1("w1")
,w2("w2")
,w3("w3")
,w4("w4")
,w5("w5")
,w6("w6")
,w7("w7")
,w8("w8")
,w9("w9")
,VLOG_BOTTOM_2("VLOG_BOTTOM_2")
{
VLOG_BOTTOM_2.l1(w1);
VLOG_BOTTOM_2.l2(w2);
VLOG_BOTTOM_2.l3(w3);
VLOG_BOTTOM_2.l4(w4);
VLOG_BOTTOM_2.l5(w5);
VLOG_BOTTOM_2.l6(w6);
VLOG_BOTTOM_2.l7(w7);
VLOG_BOTTOM_2.l8(w8);
VLOG_BOTTOM_2.l9(w9);
}
};
#endif
Example 43 vcsAD.init
choose xa -nspice test_sc.spi -c xa.cfg;
use_spice -cell spiceInv;
use_spice -cell myspice;
10
Output Files
This chapter describes how to generate digital and analog waveform output files and a
unified dump output file.
The following configuration commands must be used to set the output format for analog
signals:
• For the PrimeSim XA tool:
Use the set_waveform_option -format fsdb|wdf|out|vpd command inside the
PrimeSim XA command file. See the PrimeSim XA User Guide for more details.
• For the FineSim tool:
Use the SPICE option:
.option finesim_output=fsdb|wdf|psf|tr0|psfascii|none|out
For more information about this command, see the FineSim User Guide: Pro and
SPICE Reference.
• For the PrimeSim tool:
Use the SPICE option:
.option primesim_output=fsdb|wdf|psf|tr0|psfascii|none|out
For more information about this command, see the PrimeSim User Guide: Pro and
SPICE.
By default, the hierarchical nets that appear in multiple levels of the SPICE hierarchy with
different names (aliases) appear only once under their top-level alias. This causes the
size of the analog output file to be more compact but could make tracing signals through
the hierarchy difficult. The following configuration commands enable printing of all analog
hierarchical aliases:
• For the PrimeSim XA tool, use the -port 1 option of the probe_waveform_voltage
and probe_waveform_current commands. For example:
probe_waveform_voltage * -port 1
2. Make sure that the Verdi tool is installed and is included in the path.
3. Use the simv runtime options -ucli -i ucli_command_file to pass UCLI commands
to output an FSDB file. The command file must contain a dump command to create an
FSDB file. The command file can also specify the name of the output FSDB file. The
following example shows how the UCLI command file is read at runtime:
% simv -ucli -i ucli_command_file
These commands specify the type of the output file (FSDB), the name of the output
file, and the signals and levels of hierarchy to write to the FSDB output. For a complete
list of all options for the UCLI dump command, refer to the VCS Unified Command-Line
Interface User Guide.
When you run parallel simulations (Monte Carlo Analysis, .alter and .sweep), you
must output the waveforms by using UCLI commands and specify the -fid option. Other
waveform output commands, such as system tasks or command-line options, are not
supported.
The following example generates an FSDB format file:
ucli% dump -file vcs.fsdb -type fsdb
ucli% dump -add / -depth 10 -fid FSDB0
This limitation also applies when merged analog and digital waveforms are used, or when
unified dump is used.
5. Run the VCS tool with the -debug_access+all command line switch:
% vcs -ad -debug_access+all
6. Run the simulation executable and specify the UCLI command file. Make sure the
name of the fsdb file (OUTPUT/out.fsdb in this example) matches the fsdb file name
specified in the UCLI command file in the previous step.
% simv -ucli -i ucli.cmd +fsdbfile+OUTPUT/out.fsdb
For more information on FSDB file generation in the VCS tool, see the VCS/VCSi User
Guide.
For more information about the -debug_access option, see the VCS® User Guide and
Unified Command-Line Interface User Guide.
2. Create a unified dump output data file with the existing VCS UCLI dump command. For
example:
ucli% dump -file vcsAms.fsdb -type fsdb
3. By default, the dump -add command outputs voltages. You need to specify additional
dump -add commands with options to output mixed-signal terminal voltages and
currents. By default, the dump -add command outputs voltages.
For example:
ucli% dump -add top -depth 0 -v -vN -vall -i -iN -iall -isub
ucli% dump -add top.dut -iall -fid FSDB0
You can add these UCLI commands to a text file and use the -ucli -i filename
option to the simv simulation executable to run the commands as shown in the
following example:
# Create the command file
% cat ucli.cmd
dump -file vcsAms.fsdb -type fsdb
dump -add top.dut -iall -fid FSDB0
run 1000
For more information about the dump command, see the VCS® User Guide.
or
$fsdbDumpvars("+IE_Only");
The following example writes out the listed signals in the FSDB waveform file for the
design shown in Figure 24:
11
Report Files
This chapter provides a detailed description of the report files generated in the Verilog-
SPICE, VHDL/Verilog-SPICE, and Verilog-AMS-SPICE mixed-signal simulation flows.
In all flows of a mixed-signal simulation, the tool creates a simv.msv directory to store
mixed-signal report files. The name is based on the simulation executable, which is named
“simv” by default. You can change the name by using the -o option with the vcs command.
The following sections describe the report files that are stored in the simv.msv directory
and explains their contents.
• connectmodule.rpt
• hierarchy.rpt
• interface_activity.rpt
• interface_connectivity.rpt
• interface_element.rpt
• interface_element_temporal.rpt
• interface_tracing.rpt
• mview.rpt
• port.rpt
• runtime_interface_element.rpt
• through_net.rpt
• use_cell_view.rpt
Note:
There are two ways to generate the names_map.rpt file, depending on the
version of the tool you are using:
• For older releases (O-2018.09 and earlier): By default, the names_map.rpt
file is not automatically generated in the mixed-signal simulation flow. To
force its generation, set the environment variable COSIM_USE_MSV_COMMON
to 0 as follows.
% setenv COSIM_USE_MSV_COMMON 0
• For latest releases: You can enable generation of the names_map.rpt file by
adding the following option in your vcsAD.init file.
report_option -names_map enable;
connectmodule.rpt
This file lists the connect module instances in the design at compile time by using the VCS
switch -ams_iereport.
If you use this switch, the tool displays an abbreviated report at the console and in the
vcs.log file, as shown in the following example:
# =====================LIST OF CONNECT MODULE INSTANCES=======================
# Instance: snps_sptop
# (1) \net1[0]__snps_cm_a2d_1__ddiscrete (ConnectModule: snps_cm_a2d_1)
# Mode: merged
# Net: snps_sptop.net1[0] (electrical)
# Ports: snps_sptop.xg1.clk[0] (ddiscrete)
# (2) \net1[1]__snps_cm_a2d_1__ddiscrete (ConnectModule: snps_cm_a2d_1)
# Mode: merged
# Net: snps_sptop.net1[1] (electrical)
# Ports: snps_sptop.xg1.clk[1] (ddiscrete)
The full report, which also lists the final parameter values for each connect module
instance, is output to simv.msv/connectionmodule.rpt, as shown in the following
example:
# =====================LIST OF CONNECT MODULE INSTANCES=======================
# Instance: snps_sptop
# (1) \net1[0]__snps_cm_a2d_1__ddiscrete (ConnectModule: snps_cm_a2d_1)
# Mode: merged
# Net: snps_sptop.net1[0] (electrical)
# Ports: snps_sptop.xg1.clk[0] (ddiscrete)
# Parameters:
# vsup = 1.7999999523162842
# hir = 0.59999999999999998
# lor = 0.40000000000000002
# tdx = 4.0000000000000001e-08
# rin = 100000000000.00000
# cin = 0.0000000000000000
# vxh = 1.0799999713897706
# vxl = 0.71999998092651374
# hysteresis = 4.0000000000000000
# hyst_int = 0.089999997615814203
# vxh1 = 0.98999997377395632
# vxl1 = 0.80999997854232797
# (2) \net1[1]__snps_cm_a2d_1__ddiscrete (ConnectModule: snps_cm_a2d_1)
# Mode: merged
# Net: snps_sptop.net1[1] (electrical)
# Ports: snps_sptop.xg1.clk[1] (ddiscrete)
# Parameters:
# vsup = 1.7999999523162842
# hir = 0.59999999999999998
# lor = 0.40000000000000002
# tdx = 4.0000000000000001e-08
# rin = 100000000000.00000
# cin = 0.0000000000000000
# vxh = 1.0799999713897706
# vxl = 0.71999998092651374
# hysteresis = 4.0000000000000000
# hyst_int = 0.089999997615814203
# vxh1 = 0.98999997377395632
# vxl1 = 0.80999997854232797
hierarchy.rpt
This file lists the hierarchical paths to all cells in the design, along with their cell names.
Each hierarchical instance name is followed by the cell name of the instance wrapped in:
• Parentheses, "( )", if the cell is in Verilog/VHDL
• Angle brackets, "< >", if it is in SPICE or Verilog-A (which is read in through SPICE
`hdl)
interface_activity.rpt
This file contains either the interface element (IE) activity statistics for the Verilog-SPICE
and VHDL/Verilog-SPICE flows or the connect module (CM) activity statistics for the
Verilog-AMS flow. It reports the number of data transfers between digital and analog
domains during the simulation.
Note:
This file is generated only if the interface activity report is enabled with the
ie_activity_rpt command.
The following example report shows the number of events on each interface element:
// interface_activity.rpt
top.dut.net2 // voltage_r nettype
n2e 162
top.dut.net1 // voltage_r nettype
e2n 161
top.clk
d2a 11
top.voltage_r_vdd
r2e 1
top.dut.net2 // voltage_r nettype
rt_e2n 352
Summary:
Number of d2a events (including HighZ) : 11
Number of HighZ d2a events : 0
Number of n2e events (including HighZ) : 162
Number of HighZ n2e events : 0
Number of e2n events (including HighZ) : 161
Number of HighZ e2n events : 0
Number of r2e events (including HighZ) : 1
Number of HighZ r2e events : 0
Number of rt_e2n events (including HighZ): 352
Number of HighZ rt_e2n events : 0
Total number of events : 687 for 5 interface signals
interface_connectivity.rpt
This file lists additional connectivity information for the interface elements in the simulation,
including the digital drivers and the connected SPICE nets and ports for each interface
element. To generate this report, specify ie_connect_rpt enable in the vcsAD.init
mixed-signal simulation control file.
In the following example, the top-level net rst connects digital module tb to SPICE blocks
ia1, ia2, and digital module ia3.
SPICE
in out
ia1
Verilog
rst
in out in out
ia2
in out
tb ia3
top
The interface_connectivity.rpt file contains the following information for the d2a
interface element on net rst, including the Verilog statements that drive the net.
# Interface element:
top.ia1.in //d2a
# Digital driver(s):
top.tb.rst top.tb top.v 17 : always #25 rst =~ rst;
top.tb.rst top.tb top.v 20 : rst = 1'b1;
# Analog port(s):
top.ia1.xu0.in
top.ia1.in
top.ia2.in
interface_element.rpt
This file lists the interface elements inserted by the tool and specified in the vcsAD.init
mixed-signal simulation control file. This file is only generated in Verilog-SPICE and VHDL/
Verilog-SPICE flows. The report contains all information related to interface nets in the
design in the following format:
• A header explaining the meanings of interface elements used in the file (a2d, e2r, and
so on)
• Total number of all resistors added to the netlist because of interface elements
The header is followed by a section that indicates the total number of resistors and
capacitors added by interface elements.
Total number of resistors added by interface elements = 9
Total number of capacitors added by interface elements = 9
The next section in the report file is a list of resistance map files used in the design. If no
explicit resistance map file is used, the default resistance map is listed as follows:
rmap_file 1 tool_install_dir/resistance.map
If resistance map files were specified in the vcsAD.init file, they are listed in the report
file as follows:
rmap_file 1 ./global_res.map
rmap_file 2 ./cust_res_a.map
rmap_file 3 ./cust_res_b.map
rmap_file 4 ./cust_res_lv.map
rmap_file 5 ./cust_res_hv.map
The bottom of the report file contains the list of interface elements as shown in the
following example:
a2d -loth 0.6v -hith 1.2v -node top.id<0>;
d2a -hiv 1.8v -lov 0v -rf_time 3e-10 -x2v 3 -node top.mux_en;
e2n -node top.vref; // -nettype voltage_r
n2e -node top.i1.BUS[0]; // -nettype current_r
e2r -node vcc_i1;
r2e -node top.vin;
inout -loth 0.6v -hith 1.2v -hiv 1.8v -lov 0v -rf_time 3e-10 -x2v 3 -node
io;
Note:
Recent versions of the interface_element.rpt file use the inout term
instead of bidir.
The loth and hith values for a2d and inout nodes are reported as absolute values,
not as ratios (percentages). Note that, for the a2d and d2a interface elements, the
reports are generated with the correct command syntax. You can copy lines from the
interface_element.rpt file, paste them into your vcsAD.init mixed-signal simulation
control file, edit the loth and other settings as needed, and rerun the compilation and
simulation.
The node argument specifies the location of the interface element. If you specify multiple
interface elements for the same net, a net alias condition exists and the tool:
• Combines the parameters specified for the interface elements on the same net
• Uses the last parameter specified in the vcsAD.init file if conflicts exist
In the following example, the rst net connects the output of module tb to the inputs of
SPICE blocks ia1 and ia2.
SPICE
in out
ia1
Verilog
rst
in out in out
ia2
in out
tb ia3
top
The following interface elements are specified in the following vcsAD.init mixed-signal
simulation control file; note that the node references all refer to the same net:
// vcsAD.init
d2a -hiv 3.1v -node top.ia1.in;
d2a -lov 0.1v -node top.rst;
d2a -rf_time 1.5n -node top.ia2.in;
The tool consolidates the multiple d2a interface elements to a single interface element
by combining the parameters. The interface_element.rpt file reports the interface
element and aliases as follows:
// interface_element.rpt
d2a -hiv 3.1v -lov 0.1v -rf_time 1.5e-09 -node top.ia1.in;
Verbose Mode
To produce additional debugging information, specify the report_option
-interface_element command with the verbose option in the vcsAD.init mixed-signal
simulation control file as follows:
report_option -interface_element verbose;
When the verbose mode is enabled, the tool adds additional information to the
interface_element.rpt file. For d2a and a2d interface elements, the tool reports the
top net (the highest hierarchical alias of a mixed-net name with the smallest number of
hierarchical separators ".") and all the hierarchical boundary nets in the SPICE domain that
touch a digital net or port.
In the previous example shown in Figure 26, the top-level signal rst connects digital
module tb with SPICE blocks ia1, ia2, and digital block ia3. For this design, the following
listing shows the default report for a d2a interface element on the left. The verbose
report, generated when you specify the report_option -interface_element verbose
command, is shown on the right.
The -ad_iereport option writes out the interface element report in the Verilog SPICE flow
to the console and the PrimeSim XA log file.
The equivalent report in the Verilog-AMS-SPICE flow is the Connect Module report (see
connectmodule.rpt), which can be generated with the -ams_iereport option on the VCS
command line.
interface_element_temporal.rpt
This file records changes to interface elements by using the UCLI ace command when
running the simulation. This file is only generated in the Verilog-SPICE and VHDL/Verilog-
SPICE flows and contains the details of the interface element options and values that were
changed during the simulation.
In the following example based on Figure 25, the simulation is run with the -ucli option
and UCLI ace commands are used to modify the parameters of the same d2a interface
element by using different node aliases for the same net.
% simv -ucli
ucli% ace d2a -hiv 3.3v -lov 0.0v -node top.ia1.in;
ucli% run 10
100 ps
ucli% ace d2a -hiv 2.5v -lov 0.0v -node top.ia2.in
ucli% run 10
200 ps
ucli% ace d2a -hiv 3.3v -lov 0.0v -node top.rst
ucli% run 10
300 ps
ucli% ace d2a -hiv 2.5v -lov 0.0v -node top.ia3.in
ucli% run 10
400 ps
interface_tracing.rpt
This file helps you check whether your user-defined Vdd nodes are correct. If a user-
defined Vdd differs from the supply reached by the tracing algorithm, the report includes a
warning message.
Note:
This file is generated only if the interface activity report is enabled with the
ie_tracing_rpt command.
mview.rpt
This file lists all cells in the design that have more than one view (for example, SPICE,
Verilog, Verilog-A).
Here is an example of the file content:
; Has unresolved modules?
0
; For Spice: case l by default
; Lists of modules: Verilog Spice Verilog-A Adfmi
addr4 addr4 * *
; Verilog Top Module(s)
1 top
;done
port.rpt
This file contains information about how ports are mapped when one SPICE or HDL view
is replaced by the other. If multiple views are present, the port order, names, or direction
are often not consistent between them. The tool tries to reconcile the differences according
to the rules and commands described in this manual.
The results in the port.rpt file contain syntactically correct commands that can be cut,
edited, and pasted back into the mixed-signal simulation control file.
Note:
The port.rpt file does not display connectivity from the high to low (from
parent to child). It displays the mapping between child views
The port.rpt file is useful when ports were mapped by the tool successfully and you
want to compare the results to the intended mapping, or when some ports were not
mapped successfully and you want to find out why.
The report contains:
• A header that provides a reminder of the syntax used within the report
• Reports on cells with multiple views, organized by cell name
• Reports on cells with single view; contains port direction only
Entries are grouped by cell name.
The following example shows cell names, modules and subcircuit references for cells with
multiple views, including:
• Each cell name
• Where to find the cell definitions within the overall design
• Port list for the Verilog and SPICE views
• Total port count for both views
For example:
-----------------------Cell: addr4 ---------------------------
*** Port Warnings Encountered For this Cell ***
Each port_map entry contains the following set of resolved and unresolved ports for each
multi-view cell:
• Ports specifically mapped by the port_map command
• Unresolved ports
• Ports mapped by default as snps_by_name
Buses are reported, where possible, in the busname[m:n] format. They are resolved and
printed, as much as possible, as a unit. A mismatch in one bus should not generally affect
the reporting of another.
Unresolved ports are reported with double question marks (??). They are collapsed where
possible, but if you define the port map, it is expressly shown. For example:
use_spice -cell addr4 port_map(
a[3:0]=>a[4:0]??, //bus width mismatch
*=>snps_by_name);
When extra SPICE ports are detected, they are shown mapped to ??. For example:
use_spice -cell addr4d port_map(
<??=>vdd1, <??=>vss1,
*=>snps_by_name);
After the port mapping information, the resolved port directions of cells with a SPICE view
are reported in the format of the port_dir command. For example:
port_dir -cell addr4b(
input a, b, cin;
output s, cout
) //derived from verilog
runtime_interface_element.rpt
This file lists the runtime interface elements (rt_a2d, rt_d2a, rt_e2r, rt_r2e) inserted by the
tool. In an HDL testbench and UCLI run scripts, the hdl_xmrs, hdl_xmr_force and UCLI
force commands are used to force a value on a node. When a cell view is switched from
a digital HDL view to an analog view, the same hdl_xmr, hdl_xmr_force or UCLI force
commands must be applicable for the analog target.
When a node is forced to 0, 1, X, or Z by using the hdl_xmr, hdl_xmr_force or UCLI
force commands, the tool must correctly apply the correct value even after the digital
target has changed to an analog target. The tool uses an automatic VDD detection
mechanism, similar to that used for traditional interface element thresholds and voltage
swings, to select voltage levels and thresholds for digital-to-analog and analog-to-digital
conversions.
You can manually change the voltage thresholds and swings with the following interface
elements:
• rt_a2d
• rt_d2a
• rt_e2r
• rt_r2e
The runtime_interface_element.rpt file is generated and updated each time an
hdl_xmr, hdl_xmr_force, or hdl_xmr_release system task is executed, or a force or
release command is entered through the UCLI. The tool automatically generates voltage
level and threshold settings for the runtime interface element based on the design context
and includes the settings in the report file.
You can cut and paste the runtime interface element commands from the
runtime_interface_element.rpt file and use them in the vcsAD.init mixed-signal
simulation control file. When you use an hdl_xmr, hdl_xmr_force, or hdl_xmr_release
system task, or a force or release UCLI command on an analog target, the tool issues
a message to the console with information about the options that have been used for
any analog-to-digital or digital-to-analog conversion, electrical-to-real, or real-to-electrical
conversion.
An example runtime_interface_element.rpt file is shown as follows:
rt_d2a -hiv 3.3v -lov 0v -node top.u1.u2_1.a;
rt_a2d -hith 1.65v -loth 1.65v -node top.u1.u2_1.a;
rt_d2a -hiv 3.3v -lov 0v -node top.u1.u2_1.b;
rt_a2d -hith 1.65v -loth 1.65v -node top.u1.u2_1.b;
rt_a2d -hith 1.65v -loth 1.65v -node top.u1.u2_2.a;
rt_a2d -hith 1.65v -loth 1.65v -node top.u1.u2_2.b;
through_net.rpt
This file contains a list of nets that connect two digital ports within a SPICE subcircuit, or
two SPICE ports within a digital block. This file is only generated in Verilog-SPICE and
VHDL/Verilog-SPICE flows and is generated only if there is at least one a2a or d2d net in
the design. If both a2a and d2d through-nets exist in the design, the a2a nets are listed
first, followed by d2d nets. Any n2n through-nets are listed with a comment that indicates
the specific type. The through-nets that share the same connectivity appear together while
the ones that do not share the same connectivity are reported after a blank line as shown
in the following example:
// This report contains a list of a2a, d2d and n2n through-nets in the design.
//
// VCS runtime options can be used to disable, globally, through-net optimization.
//
// Use the VCS runtime option -ad_runopt=noa2aopt to disable a2a through net
xtop.xia1.temp1 A2A
xtop.xia1.temp2 A2A
xtop.xia1.temp4 D2D
xtop.xia1.n1 D2D
xtop.xia1.n2 D2D
xtop.xia1.n3 D2D
xtop.xia1.temp5 D2D
xtop.xia1.temp3 D2D
xtop.xia7.t1 D2D
use_cell_view.rpt
This file lists all the cell names and instance names that match each of the use_spice,
use_verilog and use_vhdl commands in the vcsAD.init file. The list is partitioned into
sections, and each section corresponds to each use statement. Each section contains a
Full Hierarchical Path to the matching element.
In the following example, the SPICE view is used for the buffer cell and the Verilog view
is used for the inv cell.
#===============================================================
# Command used on line 5 of mixed-signal control file vcsAD.init
# followed by instances partitioned by that command
#===============================================================
use_spice -cell buffer;
#top.spi.sm.G10.G20.buffer
#top.spi.sm.G10.G21.buffer
#top.spi.sm.G11.G20.buffer
#top.spi.sm.G11.G21.buffer
#===============================================================
# Command used on line 7 of mixed-signal control file vcsAD.init
# followed by instances partitioned by that command
#===============================================================
use_verilog -module inv;
#top.spi.sm.G10.G20.buffer.inv1
#top.spi.sm.G10.G21.buffer.inv1
#top.spi.sm.G11.G20.buffer.inv1
#top.spi.sm.G11.G21.buffer.inv1
#top.inv
12
Interactive Debug
Interactive debug is a useful feature that is widely used to debug the issues in design and
verification stages. This feature allows you to interrupt the simulation anytime, interact with
the tool and circuit to access or change the settings during the runtime.
• Invoking the Interactive Mode With the UCLI Debugging Feature With Verilog-SPICE or
VHDL/Verilog-SPICE
• UCLI Ace Analog Interactive Commands
• Pausing and Resuming Simulations
• Debugging Current Consumption
• Viewing and Modifying Interface Element Options at Runtime
For example:
vcs -debug_access+all -ad=vcsAD.init ….
For more information see the VCS User Guide and Unified Command-Line Interface User
Guide..
Next, invoke the simv binary file by passing the -ucli option to it:
% simv -ucli
This switch stops the mixed-signal simulation at simulation time 0, and generates the UCLI
prompt:
ucli%
Alternatively, you can stop the simulation any time during the simulation by pressing Ctrl
+C, provided that the UCLI was enabled through -debug or -debug_all at compile time
and simv was run with the -ucli switch.
All UCLI commands can be used at this prompt, such as
ucli% run 10
For a complete list of the UCLI commands, see the VCS Unified Command-Line Interface
User Guide.
Note:
The analog simulation time cannot be advanced using the UCLI command.
The analog simulation time can only be advanced by advancing the digital
simulation time in UCLI. See the VCS User Guide for more information.
To use the FineSim interactive command exi to report devices with excessive current:
ucli% ace exi
To use the PrimeSim interactive command exi to report devices with excessive current:
ucli% ace exi
You can interrupt the simulation anytime pressing Ctrl+C and execute any different set of
commands other than ucli.cmd.
Note:
Use -keep option with run command to prevent commands in ucli.do from
being overwritten by commands entered after interrupting with Ctrl+C.
Example 2
simv <simv_options> -i ucli.cmd
In this example, ucli.cmd commands will still be executed even if there is an interrupt
using Ctrl+C and different sets of commands are supplied.
ace show_ie
In interactive simulation mode, this ace UCLI command displays the interface elements on
the screen or in a specified file. You can use this command to output all the actual option
values used by the tool for each interface element, including default option values and
those you set.
Syntax
ace show_ie node=[hierarchical_node_name]
type=[a2d|d2a|n2e|e2n|r2e|e2r]
input=[0|1|X|Z] .
output_range={min_value,max_value}
output=[0|1|X|Z]
input_range={min_value,max_value}
cond=["expr"]
mode=[concise|verbose]
property_rpt=[report_list|all]
csv=filename;
Arguments
node=hierarchical_node_name
Specifies the hierarchical path to the interface element and can be any SPICE
net name (which includes primary-net name (PNN) reported by the tool in the
interface_element.rpt file, or any hierarchical alias in the SPICE hierarchy)
and only the digital net name that is used in the vcsAD.init mixed-signal
simulation control file.
You can specify wildcard characters (*) in the path, but it is limited only to
point to a PNN, that is, a hierarchical name for an interface element reported
in the interface_element.rpt file. The wildcard cannot be used to target a
hierarchical alias.
type=a2d|d2a|n2e|e2n|r2e|e2r|u2e|e2u
Shows only the type specified.
input=0|1|X|Z
Shows only the d2a interface elements where the digital signal is the specified
value.
output_range={min_value,max_value}
Shows only the non-a2d interface elements where the analog voltage is the
between the min_value and the max_value.
output=0|1|X|Z
Shows only the a2d interface elements where the digital signal is the specified
value.
input_range={min_value,max_value}
Shows only the non-d2a interface elements where the analog voltage is the
between the min_value and the max_value.
cond="expr"
A Boolean expression in which input, output, input_range, and
output_range can be used. When cond is specified, input, output,
input_range, and output_range cannot be used as separate arguments.
Expressions can include && and || for logical AND and OR functions,
respectively.
mode=[concise|verbose]
Generates a concise or verbose output:
• In concise mode, you see the most commonly displayed options (like the
options that you see in interface_element.rpt) for the interface elements.
The options reported in concise mode are sticky in nature, which means that
if you use any specific option (such as the x2v option for the d2a command
in the mixed-signal simulation control file (vcsAD.init)), it is reported. In
typical cases, interface_element.rpt does not show the x2v option
unless it is explicitly specified in vcsAD.init.
• The verbose mode displays all the editable options and values applicable
for the interface elements. Options can be of two types: editable and non-
editable. Editable options are the ones whose values can be modified during
simulation using ace runtime interface element commands, whereas non-
editable ones are just the opposite. See Modifying Interface Element Options
at Runtime for more details.
property_rpt={report_list|all}
When all is specified, all the relevant properties are listed. When a space-
separated list is specified, those properties are listed.
csv=filename
Creates command separated .csv files of the form, filename_ietype.csv.
Examples
The following examples show the command input and tool output for various ace show_ie
commands:
• Show interface element details for a specific node:
ucli% ace show_ie node=top.dut.cin
d2a -hiv 3.3v -lov 0v -node top.dut.cin
If the node does not exist, the tool issues an error message as follows:
ucli% ace show_ie node=top.dut.not_a_node
Warning: [MSV-CMD-008] Can't find interface net
top.dut.not_a_node in command "ace show_ie".
The command is ignored.
By default, the command reports by using concise mode. You can explicitly specify
concise mode by including the mode=concise option.
Note that some options that are set to their default settings are not reported, such as
-minv and -minv_analog in this example.
• Show all interface elements that match a wildcard expression by using the wildcard
character (*):
ucli% ace show_ie node=*
d2a -hiv 3.3v -lov 0v -node top.dut.cin
d2a -hiv 3.3v -lov 0v -node top.dut.a_3
d2a -hiv 3.3v -lov 0v -node top.dut.a_2
...
• Show all interface elements of type a2d (note that you must also specify the node=*
option):
ucli% ace show_ie type=a2d node=*
a2d -loth 1.65v -hith 1.65v -node top.dut.s_3
a2d -loth 1.65v -hith 1.65v -node top.dut.s_2
...
• Show how to display only d2a interface elements whose output range is between 0.8V
and 1.2V:
ucli% ace show_ie node=* type=d2a output_range={0.8,1.2}
• Show how the cond argument is used to build a more complex filter (in this case, only
d2a interface elements are displayed whose input is either 1 or 0 and output voltage is
between 0.8V and 1.2V):
ucli% ace show_ie node=* type=d2a cond="(input=1 || input=0) &&
output_range={0.8,1.2}"
• Show how the .csv files are generated (in this case, a file called design_ie_d2a.csv
with a list of all the d2a interface elements and a file called design_ie_a2d.csv with a
list of all the a2d interface elements are created; similar files for r2e, e2r, n2e, and e2n
are created, as necessary):
ucli% ace show_ie node=* csv=design_ie
• Show how the property_rpt argument is used to display the specified arguments (in
this case, all d2a interface elements and their corresponding hiv and lov values are
displayed):
ucli% ace show_ie node=* type=d2a property_rpt={hiv lov}
• e2n: -type
• e2r: -res, -type i
• n2e: -res, -type i
• r2e: -type i
The following example displays all interface elements in the design, modifies an interface
element by setting new parameters, and displays the updated interface element.
% simv -ucli
ucli% ace show_ie node=*
d2a -hiv 3.3v -lov 0v -node top.dut.a_3
d2a -hiv 3.3v -lov 0v -node top.dut.a_2
d2a -hiv 3.3v -lov 0v -node top.dut.a_1
d2a -hiv 3.3v -lov 0v -node top.dut.a_0
...
ucli% ace d2a -hiv 3.7 -lov 0.22 -rise_time 3e-09 -fall_time 4e-09
-delay 1e-09 -node top.dut.a_3
All UCLI commands are written to the VCS ucli.key file, which you can replay for
subsequent VCS PrimeSim AMS simulations. The runtime interface element modifications
are also recorded in the interface_element_temporal.rpt file; use this file to track any
changes to interface elements that occur during runtime.
Note:
The same set of rules that is applicable to the node=node_name for the ace
show_ie command is also applicable for these ace runtime interface element
commands.
A
Mixed-Signal Control Commands
This appendix lists the syntax descriptions for the mixed-signal control commands.
The vcsAD.init mixed-signal simulation control file contains commands to specify the
views to use for different cells and instances, interface element types and locations,
reporting modes, and so on. You can specify a different file name with the -ad
<control_file_name> compile-time option.
• choose
• d2a
• disable_ie
• downgrade_to_warn
• duplicate_net_inst_name
• dynamic_supply_filter
• e2n for current_r Nettype
• e2n for i_wire Nettype
• e2n for th_wire Nettype
• e2n for voltage_r Nettype
• e2n for v_wire_avg, v_wire_sum, and v_wire_one Nettypes
• e2r
• e2u
• form_spice_bus
• gen_spice_wrapper
• ie_activity_rpt
• ie_connect_rpt
• ie_reference_voltage
• ie_tracing_rpt
• insert_cell
• map_by_node
• n2e for current_r Nettype
• n2e for i_wire Nettype
• n2e for th_wire Nettype
• n2e for voltage_r Nettype
• n2e for v_wire_avg, v_wire_sum, and v_wire_one Nettypes
• netlist_commands_begin
• netlist_commands_end
• optimize_shadowfile
• param_pass
• port_connect
• port_dir
• print_ie_res
• r2e
• remove_d2a
• report_option
• resolve_x_inst_prefix
• rmap_file
• rt_a2d
• rt_d2a
• rt_e2n
• rt_e2r
• rt_n2e
• rt_r2e
• shadow_file
• shadow_file_dir
• skip_xmr_name_check
• spice_top
• transient_analysis
• u2e
• udn_bidir
• udn_e2n
• udn_n2e
• upf_port_connect
• upgrade_to_error
• use_spice
• use_verilog
• use_veriloga
• use_vhdl
a2d
Controls all aspects of the analog-to-digital (a2d) interfaces in the VCS PrimeSim AMS
tool. If you do not specify this command, all a2d events are triggered at 50% of the local
VDD by default.
Syntax
a2d
[-loth lo_thrsh [V | %]]
[-hith hi_thrsh [V | %]]
[-xband xband]
[-hiz on | off]
[-library library_name]
[-cell cell_name -port port_name]|
[-inst inst_name -port port_name]|[-node hier_name]
[-vdd hier_name]
[-vss hier_name]
[-vdd_port port_name]
[-vss_port port_name]
[-minv min_vdd_voltage]
[-minv_logic 0 | 1 | X | Z]
[-ceff value]
[-midv_time value]
[-midv_logic 0 | 1| X | Z]
[-except_port port_name]
[-strength supply | strong | pull | large | weak |
medium | small | hiz | rmap]
Arguments
-loth lo_thrsh [V | %], -hith hi_thrsh [V | %]
Specifies the low and high a2d threshold values. Threshold values are specified
as absolute values (1.1V, 2.2) or as a percentage of the supply (10%, 90%).
Voltages can be specified with or without the v character.
For a dynamic supply specification using the -vdd option, values can only be
specified as a percentage of the supply voltage. This forces the a2d thresholds
to change as the supply voltage changes.
-xband xband
Sets a hysteresis level for X-state detection. Parameters -hith and -loth set
the thresholds for high, low, and X-state generation, as follows:
• When the voltage is above -hith, a 1 is generated.
• When the voltage is below -loth, a 0 is generated.
• When the voltage is between -hith and -loth for a time greater than
-midv_time, an X-state is generated.
• When a falling voltage is between hith_hys and -loth for a time greater
than -midv_time, an X-state is generated.
• When a rising voltage is between loth_hys and -hith for a time greater
than -midv_time, an X-state is generated.
There is no default value for -xband. If not set, the value of loth_hys is the
same as -loth and the value of hith_hys is the same as -hith.
-hiz off
Turns off the a2d drive strength calculation. All a2d events are passed to
digital with the Verilog default drive strength of 6 (strong). Use this option when
specifying an a2d interface element for inout (bidirectional) nets. When this
option is enabled, the a2d interface element always outputs digital signals with
a strong drive strength (strong0 or strong1) and does not output values with a
highz0 or highz1 strength. For a list of Verilog drive strengths, see Converting
Signal Strength.
You can use this option to remove (mask) the HiZ glitches on bidirectional
interface nets. The HiZ glitches are caused during the periods when neither
the analog nor the digital circuits are driving the interface net. With this option
enabled, the interface element always drives the digital side with a strength
of strong0 or strong1 based on the voltage on the analog side and the a2d
thresholds.
Note:
HiZ glitches usually reflect the correct behavior of the circuit.
Removing them by using the -hiz off option can potentially mask a
real phenomenon or problem in the circuit and is discouraged.
-hiz on
Turns on the a2d drive strength calculation. For each a2d event, the analog
engine calculates the analog output resistance and uses that value as an index
to the resistance map file to get the corresponding Verilog output drive strength.
With this option enabled, HiZ states are passed to digital if the analog engine
identifies them. This feature is enabled by default for bidirectional interface nets.
-library library_name
Specifies a library_name to apply global a2d threshold options. Use this option
to specify unique threshold options for all cells in the specified library. For more
information, see Using Library-Based Interface Element Options.
-cell cell_name -port port_name
Specifies cell and port names for the interface element. The cell_name must
be the same as the name used in the use_spice, use_verilog, or use_vhdl
commands. You can specify the asterisk (*) wildcard character in a cell name.
-inst inst_name -port port_name
Specifies the hierarchical instance path to the port for the interface element. You
can specify the asterisk (*) wildcard character in an instance name.
-node hier_name
Specifies the hierarchical node name for the interface element. You can specify
the asterisk (*) wildcard character in a node name. You must also specify the
-debug_access option with the vcs command when you specify the wildcard
character.
-vdd hier_name, -vss hier_name
Specifies the reference supply to use when calculating high and low thresholds.
If you use this option, the high and low thresholds change as the combination
of VDD and VSS supply voltages identified by the hier_name changes during
the simulation. By default, without this option the reference supply is VDD, if
defined, or the interface element behaves as if the reference supply voltage
was constant. With this option enabled, only the % format can be used to specify
loth and hith arguments. The supply net identified by the hier_name can be
either an internal analog node, a top-level analog net, a regular interface net
(d2a, inout). or a real interface net.
-vdd_port port_name, -vss_port port_name
Specifies the vdd or vss port to use as the reference supply. Use the -vdd_port
and -vss_port arguments to assign the supply sensitivity to the a2d interface
element when you only know the vdd and vss ports of the block. The -vdd_port
and -vss_port arguments allow the tool to trace the hierarchy to identify the
actual vdd and gnd parent nets. The -vdd_port and -vss_port arguments
must be used together with the -port argument. The port_name can also refer
to a node one level higher in the hierarchy, such as -vdd_port ../VDD1.
Note that the interface_element.rpt contains the vdd and vss that were
used, not the -vdd_port and -vss_port statements from the vcsAD.init file.
-minv min_vdd_voltage
Specifies the minimum voltage for VDD (or VDD-VSS) that turns off the a2d
conversion. Use this option to disable a2d conversions when the analog supply
(or the difference of supplies) is very low. In this case, it does not make sense
to continue converting analog signals to logic values and generate simulation
events.
When specified, if the VDD supply (or VDD-VSS supplies) associated with the
interface element goes below this value, the a2d conversion is turned off and a
fixed logic value is output on the digital side as specified by the -minv_logic
argument. By default, minv is 100mV.
Note:
The -minv argument is required when both -vdd and -vss of the
dynamic supply pair are used.
-minv_logic 0 | 1 | X | Z
Specifies the output logic value when the a2d conversion is disabled with the
-minv trigger. By default, a Z value is output.
-ceff value
Specifies a capacitance value to model the loading effect of the digital blocks
driven by the analog interface net. By default, no extra capacitance is inserted at
the a2d interface net. Use this option to specify a loading capacitance to insert
at the a2d interface net or nets. The unit of the value is Farad.
-midv_time value, -midv_logic 0 | 1 | X | Z
The -midv_time option sets the time (seconds) when the a2d command
generates an X or Z-state. These options work with the -hith and -loth
options. There is no default value.
The -midv_logic option specifies the output logic value. The default value is X.
-except_port port_name
Prevents dynamic supply sensitivity on the specified ports when you used
wildcards in a previous a2d command with -port. You can specify the asterisk
(*) wildcard character partially in a port name to filter out certain ports. For
example,
use_verilog -cell F32;
a2d -loth 0.4 -hith 0.8 -cell F32 -port VDDV12DIG;
a2d -loth 20% -hith 80% -cell F32 -port * -minv 0.6 \
-minv_logic 0 -vdd tb.VDD -except_port VDDV12DIG;
a2d -loth 20% -hith 80% -cell F32 -port * -minv 0.6 \
-minv_logic 0 -vdd tb.VDD -except_port VDD*;
hith
Analog Inputs
(fast and slow) loth
Examples
The following examples illustrate the use of different options with the a2d interface
element:
• Set the a2d low and high thresholds for node top.i1.ctl to 0.2V and 1.7V
respectively. Use either command to perform this task. Note that the units character, V,
is optional.
a2d -loth 0.2V -hith 1.7V -node top.i1.ctl;
a2d -loth 0.2 -hith 1.7 -node top.i1.ctl;
• Set the a2d low and high thresholds for node top.i1.ctl to 20% and 80% of the local
supply voltage.
a2d -loth 20% -hith 80% -node top.i1.ctl;
• Enable the dynamic supply feature and set the a2d thresholds for node top.i1.ctl to
50% of the referenced VDD node. As the voltage of the VDD node changes, so do the
a2d thresholds.
a2d -loth 50% -hith 50% -node top.i1.ctl -vdd top.vdd;
• Enable the dynamic supply feature and set the a2d thresholds for node top.i1.ctl
to 40% and 60% of the referenced VDD node. The -minv value is set to 500mV. As a
result, if the VDD voltage drops below that value, the a2d conversion is shut off and
HiZ is output on the digital side instead.
a2d -loth 40% -hith 60% -node top.i1.ctl -vdd top.vdd -minv 500mV;
• Enable the dynamic supply feature and set the a2d thresholds for node top.i1.ctl to
40% and 60% of the referenced VDD node. Set the -minv value to 500mV and specify
that logic value X is output on the digital side if the VDD voltage drops below the -minv
value.
a2d -loth 40% -hith 60% -node top.i1.ctl -vdd top.vdd -minv 500mV
-minv_logic x;
Note:
If multiple a2d commands in the mixed-signal simulation control file target
the same node, the last command overrides all the others.
• Specify top.n1 to be an a2d interface net and add 1pF capacitance at the top.n1
node.
a2d -node top.n1 -ceff 1p;
• Specify the ports in1 of cell blk1 to be a2d interface nets and add 2pF capacitance at
this port.
a2d -cell blk1 -port in1 -ceff 2p;
• Output a Z-state on the digital output when the analog voltage is between 0.7V and
0.2V for more than 10ns.
a2d -hith 0.7 -loth 0.2 -midv_time 10n -midv_logic Z -node top.w1;
• The following example uses the -vdd_port and -vss_port arguments to correctly
specify vdd and vss for the circuit. The circuit contains three inverter blocks: inva,
invb, and invc. inva contains an additional vdd supply; invb and invc contain one
vdd connection and one vss connection. The vcsAD.init mixed-signal simulation
control file contains two a2d commands to correctly specify the vdd and vss
connections for the simulation.
cells.v
module inva(a1);
module invb(b1);
module invc(c1);
* SPICE subcircuits
.subckt inva a1 vdda vssa vddh
.subckt invb b1 vddb vssb
.subckt invc c1 vddc vssc
...
X1 n1 vdd1 vss1 vddh1 inva
The vcsAD.init file contains the following a2d specification. Note that the second a2d
command overrides the first a2d command for the inva cell.
// vcsAD.init
a2d -cell * -port * -vdd_port vdd* -vss_port vss*
a2d -cell inva -port * -vdd_port vdda -vss_port vssa
ams_cdef_inst
Description
Overrides connectivity to power and ground nets given from ams_cdef_net commands.
This command is used when specific instances in the designs have different power and
ground connections.
Note:
This command is used with the ams_supply and ams_cdef_net commands to
allow power-aware connect modules in the design.
Syntax
ams_cdef_inst -cell cell_name [-lib library_name]
-inst {inst_name [, inst_name] …}
-supply {attribute_name => net_name, [attribute_name => net_name};
Arguments
-cell cell_name
Specifies the cell name.
-lib library_name
Specifies the library name. This is the VCS compiled library.
-inst {inst_name [, inst_name] …}
Specifies a list of instances that are overridden.
-supply {attribute_name => net_name, [attribute_name => net_name}
Specifies the name of the net associated with the list in the -net argument of
the ams_cdef_net command.
Examples
The following example shows one use of the ams_cdef_net and ams_cdef_inst
commands:
• This example electrically connects the net vdd2 in the cell blk02 to the net top.vdd
for all instances of blk02 in the design with the exception of instance top.i1. For this
instance, net vdd2 is connected to top.vdd1.
ams_cdef_net -cell blk02 -net {vdd2} -default_supply {vdd2_tag =>
top.vdd};
ams_cdef_inst -cell blk02 -inst {top.i1} -supply {vdd2_tag =>
top.vdd1};
ams_cdef_net
Description
Connects an electrical net to an analog power or ground electrical net. When the netlist
for the design does not contain the connectivity for the power and ground network, this
command is used to create that connection.
Note:
This command is used with the ams_supply and ams_cdef_inst commands to
allow power-aware connect modules in the design.
Syntax
ams_cdef_net -cell cell_name [-lib library_name]
-net {net_name [, net_name] …}
-default_supply {attribute_name => net_name};
Arguments
-cell cell_name
Specifies the cell name.
-lib library_name
Specifies the library name. This is the VCS compiled library.
-net {net_name [, net_name] …}
Specifies a list of net names that are connected to the net specified by the
-default_supply argument. These nets are declared inside the specified cell.
-default_supply {attribute_name => net_name}
Specifies the name of the net associated with the list in the -net argument.
Examples
The following example shows one use of the ams_cdef_net command:
• This example electrically connects the net vdd2 in the cell blk02 to the net top.vdd.
ams_cdef_net -cell blk02 -net {vdd2} -default_supply {vdd2_tag =>
top.vdd};
ams_cm
Description
Enables the override of connect rules and connect module parameters in the Verilog-AMS-
SPICE flow. For more information, see Converting Signals With Interface A/D and D/A
Connect Modules.
Using this command, you can override the following:
• General parameters of one or more connect module instances
• Connect module insertion mode (split | merge)
• Connect rule for connect module insertion
Note:
This command does not change any disciplines in the design (for this, use
ams_set_discipline).
This command is functional only when the Verilog-AMS-SPICE flow is enabled
using the VCS -ams option. If the Verilog-AMS-SPICE flow is not enabled, this
command is ignored and a warning message is output.
Syntax
ams_cm -connect_rule_module_parameter_name parameter_value
[-mode split | merge]
[-crules connect_module_library_name.connect_rule_name]
[-library library_name]
[-cell cell_name [-node node_name]]
[-inst inst_name [-node node_name]]
[-node hier_name]
[-vddnet global_supply_name | hierarchical_path_to_supply_node]
[-vssnet global_supply_name | hierarchical_path_to_supply_node]
Arguments
-connect_rule_module_parameter_name parameter_value
Specifies the connect rule or connect module parameter and the value to which
it is set. The parameter_value can be either real or a string parameter. If you
-vssnet global_supply_name|hierarchical_path_to_supply_node
Specifies the -vssnet parameter.
Note:
This parameter is not applicable with the default connect rule, so a
different connect rule must be given if this argument is used. The
connect rule containing the -vssnet argument references connect
modules containing the Verilog-AMS $node_alias function and is
used for dynamic supply sensitivity in the connect modules.
Examples
The following examples show different uses of the ams_cm command:
• This example globally overrides the vsup parameter value (3.3) for all connect
modules connected or inserted throughout the design.
ams_cm -vsup 3.3;
• This example overrides the vsup parameter value (3.2) for any connect modules
connected or inserted on node ClockTop.I3.y.
ams_cm -vsup 3.2 -node ClockTop.I3.y;
Note:
There could be multiple connect modules inserted on the node
ClockTop.I3.y depending on whether the connect module insertion mode
is set to split or merge.
• This example overrides the vsup parameter value (3.222) for all connect modules
connected or inserted for any cell named dflop in the design.
ams_cm -vsup 3.222 -cell dflop;
• This example overrides the vsup parameter value (3.333) for all connect modules
connected or inserted for the instance ClockTop2.I3 in the design.
ams_cm -vsup 3.333 -inst ClockTop2.I3;
• This example:
1. Globally overrides the vsup parameter value (3.3) for all connect modules
connected or inserted throughout the design,
2. Then overrides the vsup parameter value (3.222) for all connect modules
connected or inserted for the instance ClockTop2.I3.I5 in the design,
3. Then overrides the vsup parameter value (3.444) for any connect modules
connected or inserted on node ClockTop2.I3.net18.
• This example:
1. Globally overrides the vsup parameter value (3.3) for all connect modules
connected or inserted throughout the design,
2. Then overrides the vsup parameter value (3.222) for all connect modules
connected or inserted for the instance ClockTop2.I3 with node CLK in the design.
ams_cm -vsup 3.3;
ams_cm -vsup 3.222 -inst ClockTop2.I3 -node CLK;
• This example:
1. Globally overrides the vsup parameter value (3.3) for all connect modules
connected or inserted throughout the design,
2. Then overrides the -vddnet parameter for dynamic supply on
instance ClockTop.I3 in the design using the connect rules in
snpsConnectLib.snps_ana_crules.
ams_cm -vsup 3.3;
ams_cm -crules snpsConnectLib.snps_ana_crules -vddnet top.vdd1 -inst
ClockTop.I3;
ams_set_discipline
Description
Enables the override of net disciplines (or setting the discipline of a net that does not have
any declared discipline) in the Verilog-AMS-SPICE flow. For more information, see Nets
and Disciplines.
Arguments
-discipline discipline_name
Specifies the name of the discipline to declare.
-library library_name
Specifies the name of the logical library for which the discipline is declared.
-cell cell_name [-node node_name]
Specifies the cell or cell/node names for which the discipline is declared. The
node name is optional; if it is not specified, this argument is treated as -cell
cell_name -node *.
-inst inst_name [-node node_name]
Specifies the hierarchical instance path or instance/node names for which
the discipline is declared. The node name is optional; if it is not specified, this
argument is treated as -inst inst_name -node *.
-node hier_name
Specifies the hierarchical node name for which the discipline is declared.
ams_supply
Description
Associates the analog supply information with digital signal ports in the Verilog-AMS-
SPICE flow. This command is used for Verilog-AMS modules that have digital signal ports
and analog supply ports.
Note:
• This command works with connect modules that use the port_power and
port_ground attributes as internal electrical supplies.
Arguments
-cell cell_name
Specifies the cell name.
-lib library_name
Specifies the library name. This is the VCS compiled library.
-digital_port {digital_port_name, digital_port_name, …}
Specifies a list of port names that are associated with the supply set.
-supply {port_power => power_port_name,
port_ground => ground_port_name}
Specifies the names of the power and ground associated with the list of port
names in the -digital_port argument.
Examples
The following examples show different uses of the ams_supply command:
• This example associates the logic ports y and a to the power port vdd and ground port
gnd for cell inv01.
ams_supply -cell inv01 -digital_port {y, a} -supply {port_power => vdd,
port_ground => gnd};
This Verilog-AMS module has four ports: two are declared as ddiscrete (y and a) and
two are declared as electrical (vdd and gnd).
• This example associates the logic port y to the power port vdd1, and ground port gnd
and the logic port a to the power port vdd2 and ground port gnd for cell inv01.
ams_supply -cell inv01 -digital_port {y} -supply {port_power => vdd1,
port_ground => gnd};
ams_supply -cell inv01 -digital_port {a} -supply {port_power => vdd2,
port_ground => gnd};
This Verilog-AMS module has five ports: two are declared as ddiscrete (y and a) and
three are declared as electrical (vdd1, vdd2, and gnd).
bus_format
Identifies the bus notation used in the SPICE netlist.
Syntax
bus_format -format [open_char] %d [close_char] [[open_char] %d
[close_char]...];
Description
This command causes the tool to treat multiple SPICE ports as members of a bus and
group them together when making connections between SPICE and Verilog/VHDL buses
at the analog/digital boundary. It allows more than one bus format to be identified as the
SPICE bus notation. The [%d] notation is the default bus format for SPICE. The ports in a
SPICE subcircuit that follow the [%d] notation, such as a[2] a[1] a[0], are considered
members of a bus when connecting to Verilog by default.
Examples
The following examples illustrate the use of different options with the bus_format
command:
• Specify that angle brackets (< >) are used as the bus notation used in the SPICE
netlist:
bus_format -format <%d>;
*SPICE subckt
.subckt addr4 a<3> a<2> a<1> a<0>
+b<3> b<2> b<1> b<0> cin
+s<3> s<2> s<1> s<0> cout
.ends
• Define multiple bus formats for SPICE. Both ports inp and out are considered as
buses when connecting to Verilog.
bus_format -format <%d> _%d ;
*SPICE subckt
.subckt addr4 a_3 a_2 a_1 a_0
+b_3 b_2 b_1 b_0 cin
+s_3 s_2 s_1 s_0 cout
.ends
Note:
Mixed-signal simulation only supports the following bus format characters for
SPICE: < > [ ] _
choose
Description
Use the choose command to select the analog simulator (the PrimeSim XA, FineSim, and
PrimeSim simulation engines) and command options for mixed-signal simulation.
Mixed-signal simulation supports all the PrimeSim XA command-line options.
Syntax
choose xa xa_command_line_options;
choose finesim finesim_command_line_options;
choose primesim primesim_command_line_options;
Examples
The following examples illustrate different usages of the choose command:
• Specify that the PrimeSim XA tool is used during mixed-signal simulation and the
PrimeSim XA tool reads a netlist named net.spi. The -c option passes PrimeSim XA
analog configuration commands stored in the xa.cmd file. Comments are specified with
double slashes (//).
//This is a comment
choose xa -hspice net.spi -c xa.cmd;
• Specify that the FineSim Pro tool is used during mixed-signal simulation. The FineSim
Pro tool reads a netlist named net.spi. The -o option specifies the prefix for output
files created by FineSim.
//This is a comment
choose finesim net.spi -o out;
• Specify that the PrimeSim tool is used during mixed-signal simulation. The PrimeSim
tool reads a netlist named net.spi. The -o option specifies the prefix for output files
created by PrimeSim.
//This is a comment
choose primesim net.spi -o out;
• Specify that the PrimeSim tool in SPICE-mode is used during mixed-signal simulation.
The PrimeSim tool reads a netlist named net.spi. The -o option specifies the prefix
for output files created by PrimeSim.
// This is comment
choose primesim -spice net.spi -o out;
d2a
Description
Controls all aspects of the digital-to-analog (d2a) interfaces in the VCS PrimeSim AMS
tool.
Syntax
d2a [-powernet 0 | 1] [-rf_time slope_time] | [-rise_time rise_time]
[-fall_time fall_time]
[-delay delay_time] | [-rise_delay rise_delay]
[-fall_delay fall_delay]
[-x2v 0 | 1 | 2 | 3 |4]
[-hiv high_voltage | %]
[-lov low_voltage | %]
[-library library_name]
[-cell cell_name -port port_name]|
[-inst inst_name -port port_name]| [-node hier_name]
[-vdd vdd_hier_name]
[-vss vss_hier_name]
[-vdd_port port_name]
[-vss_port port_name]
[-minv value]
[-minv_analog value]
[-vdd_filter filter_thresh]
Arguments
-powernet 0 | 1
Identifies a d2a node as an ideal voltage source on the analog side without the
resistance map resistor. You must use this option when Verilog drives analog
power nets in order to remove the series resistance map resistors and to allow
efficient partitioning of the analog circuit.
• 0: to not treat as an ideal voltage source (default).
• 1: to treat as an ideal voltage source.
Note that If the Verilog wires driving the SPICE supply are defined as supply1
or supply0 types in the Verilog code, the tool treats the d2a interfaces
connected to those wire types as if the d2a command with the -powernet option
was used. This means that no resistance map resistors are inserted at the d2a
interface and the supply nets are treated as ideal sources in analog.
-rf_time slope_time
Specifies the analog rise and fall times. The default time unit is in seconds,
so specify the subunit with the value, for example, -rf_time 1.5n. With this
option, both rise and fall times are set to the same value.
-rise_time rise_time
Specifies the analog rise time. The default time unit is in seconds, so specify the
subunit with the value, for example, -rise_time 1n.
-fall_time fall_time
Specifies the analog fall time. The default time unit is in seconds, so specify the
subunit with the value, for example, -fall_time 2n.
-delay delay_time
Specifies the inertial delay before the analog transition starts. The default time
unit is in seconds, so specify the subunit with the value, for example, -delay
1.5n. With this option, the inertial delays for both rising and falling signals are
set to the same value.
-rise_delay rise_delay
Specifies the inertial delay before the analog transition starts for rising digital
signals. The default time unit is in seconds, so specify the subunit with the value,
for example, -rise_delay 1n.
-fall_delay fall_delay
Specifies the inertial delay before the analog transition starts for falling digital
signals. The default time unit is in seconds, so specify the subunit with the value,
for example, -fall_delay 2n.
-x2v 0 | 1 | 2 | 3 | 4
Sets the rule for how a logic X must be translated to a voltage level on the
analog side: Use this option to manage the translation of the X to a voltage level.
• 0: always set to the logic 0 voltage (default)
• 1: always set to the logic 1 voltage
• 2: set to the (logic 0 voltage + logic 1 voltage)/2
• 3: set to previous voltage
• 4: Set the output based on the following conditions
◦ If the input is logic 0, set to the logic 1 voltage
◦ If the input is logic 1, set to the logic 0 voltage
◦ Otherwise, set to the previous voltage
-hiv high_voltage
Specifies the default voltage for logic 1 as an absolute voltage value (for
example, 1.2V or 1.2) or as a percentage of the supply voltage (for example,
90%). By default, the logic 1 voltage value is the voltage of the local supply. If
the tool cannot trace the d2a net to an ideal supply, it assumes 3.3V.
If the dynamic supply feature is enabled by using the -vdd option, the values for
-hiv can only be specified as a percentage of the VDD net. You must use this
option together with the -lov option.
-lov low_voltage
Specifies the default voltage for logic 0 as an absolute voltage value (for
example, 0.1V or 0.1) or as a percentage of the supply voltage (for example,
10%). By default, the logic 0 voltage value is assumed to be 0V.
If the dynamic supply feature is enabled by using the -vdd option, values for lov
can only be specified as a percentage of the VDD net. You must use this option
together with the -hiv option.
-library library_name
Specifies a library name to apply global d2a threshold options. You can apply
threshold options on a library-by-library basis as described in Using Library-
Based Interface Element Options.
-cell cell_name -port port_name
Specifies the cell and port names for the interface element. The name must be
the same as the cell_name used in the use_spice, use_verilog, or use_vhdl
commands. You can specify the asterisk (*) wildcard character in a cell name.
-inst inst_name -port port_name
Specifies the hierarchical path to the instance port for the interface element. You
can specify the asterisk (*) wildcard character in an instance name.
-node hier_name
Specifies the hierarchical node name for the interface element. You can specify
the asterisk (*) wildcard character in a node name. You must also specify the
-debug_access option with the vcs command when you use the wildcard
character.
-vdd vdd_hier_name, -vss vss_hier_name
Specifies the nodes for high and low reference supplies. Distinguishes the
reference supply associated logic high and low values. If you use this option, the
d2a logic high and low values change as the combination of vdd and vss supply
voltages identified by the hier_name changes during the simulation. By default,
the d2a command either refers to vdd, if defined, or behaves as if the reference
supply voltage was constant. With this option enabled, values to the -lov and
-hiv arguments must be specified as percentages using the % format. The
supply net identified by the hier_name can be either an internal analog node, a
top-level analog net, a regular interface net (d2a, inout). or a real interface net.
-vdd_port port_name, -vss_port port_name
Specifies the vdd or vss port to use as the reference supply. Use the -vdd_port
and -vss_port arguments to assign the supply sensitivity to the a2d interface
element when you only know the vdd and vss ports of the block. The -vdd_port
and -vss_port arguments allow the tool to trace the hierarchy to identify the
actual vdd and gnd parent nets. The -vdd_port and -vss_port arguments
must be used together with the -port argument. The port_name can also refer
to a node one level higher in the hierarchy, such as -vdd_port ../VDD1.
Note that the interface_element.rpt contains the vdd and vss that were
used, not the -vdd_port and -vss_port statements from the vcsAD.init file.
-minv value
Specifies the minimum voltage for VDD (or VDD-VSS) that turns off the d2a
conversion. The purpose of the option is to disable d2a conversions when
the analog supply (or the difference of supplies) is very low and it does not
make sense to continue converting analog signals to logic values, giving the
impression to the digital domain that the analog circuit is still functioning.
When specified, if the VDD supply (or VDD-VSS supplies) associated with the
interface element goes below this value, the d2a conversion is turned off and
the d2a output is floating, keeping the current value (or DC value at time=0). If
-minv_analog is specified, the d2a output is equal to the -minv_analog value
instead. By default, -minv is set to 100mV.
Note:
The -minv argument is required when both -vdd and -vss of the
dynamic supply pair are used.
-minv_analog value
Specifies the analog value passed to the analog engine when the d2a
conversion is disabled because vdd- vss is less than -minv. It is undefined by
default, so the d2a output is left floating.
-vdd_filter filter_thresh
Triggers the evaluation of the d2a interface. The interface element is evaluated
only if the variation of the power supply defined with vdd_hier_name is greater
than filter_thresh.
This argument is only valid if the power supply is a dynamic supply. If
you specify both the global command dynamic_supply_filter and d2a
-vdd_filter, then the dynamic_supply_filter value should be smaller
than the d2a -vdd_filter threshold value, and the -vdd_filter value
overrides the global dynamic_supply_filter value. For more information, see the
dynamic_supply_filter command.
Examples
The following examples illustrate different usages of the d2a command:
• Set the high and low d2a voltages to 1.8V and 0.1V.
d2a -hiv 1.8 -lov 0.1 -node top.i1.ctl;
• Set the high and low d2a voltages to 1.2V and 0V.
d2a -hiv 1.2V -lov 0V -node top.i1.ctl;
• Define interface nets top.vdd and top.vss as ideal supplies while setting their high
and low voltage values to 1.2V and 0V respectively.
d2a -powernet 1 -hiv 1.2 -lov 0 -node top.vdd;
d2a -powernet 1 -hiv 1.2 -lov 0 -node top.vss;
• Enable dynamic supply and define the interface net top.i1.rst as a d2a interface for
which high and low voltages track the changes on node top.i2.vdd. The high and low
voltages are set to 90% and 10% of the voltage on the node top.i2.vdd.
d2a -hiv 90% -lov 10% -node top.i1.rst -vdd top.i2.vdd;
• Enable dynamic supply for all d2a interface elements below the hierarchical level
top.i1. All those d2a interfaces track the changes on supply net top.i1.vdd
dynamically. The -hiv and -lov values are set to 100% and 0% of the voltage on node
top.i1.vdd.
d2a -hiv 100% -lov 0% -node top.i1.* -vdd top.i1.vdd;
• Enable multiple dynamic supplies with respect to vdd1 and vss1 as the power of
reference to define the logic high and low to all ports of the instance top.x2. If the
difference between the vdd1 and vss1 supplies is less than the -minv value of 0.1v, the
d2a is in a high impedance state and the analog output is equal to the -minv_analog
value of 0V.
d2a -hiv 100% -lov 0% -inst top.x2 -port * -vdd vdd1 -vss vss1
-minv_analog 0 -minv 0.1;
Note:
If multiple d2a commands in the mixed-signal simulation control file target
the same node, the last command overrides all the others.
disable_ie
Description
Disables an interface element from the digital-analog boundary. The -node argument is
the path to a mixed-signal net. The -node argument cannot take the asterisk wildcard
character (*), such as -node *. However, a partial node search using the asterisk
character is legal; for example, -node top.din* matches all signals with names starting
with the top.din string.
This command disables any type of interface element, including:
• Logic/electrical (a2d and d2a)
• Real/electrical (r2e and e2r)
Arguments
node -node_name
Specifies the node from which to disable the interface element. This argument
cannot take the asterisk wildcard character (*), for example, -node *. However,
a partially-specified node search using the asterisk character is accepted, such
as -node N*.
Examples
• Disable the interface element from node top.i1.outa.
disable_ie -node top.i1.outa;
downgrade_to_warn
Downgrades or lowers the priority of an error message to a warning message.
Syntax
downgrade_to_warn -id message_ID [message_ID ...];
Description
Use the downgrade_to_warn command to downgrade the [MSV-IE-OPT-TNF] and [MSV-
RTIE-OPT-TNF] error messages. The [MSV-IE-OPT-TNF] message identifier applies to
error and warning messages for interface element commands. The [MSV-RTIE-OPT-TNF]
message identifier applies to error and warning messages for runtime interface element
commands.
You can downgrade this type of error message to a warning message with the following
command:
downgrade_to_warn -id MSV-IE-OPT-TNF
duplicate_net_inst_name
Allows the same name to be used for both an instance and a net in SPICE.
Syntax
duplicate_net_inst_name -enable | -disable;
Description
The duplicate_net_inst_name -enable command internally renames the net
names that are used for both an instance and a net in SPICE. Nets are renamed to
net_name_DUPLICATE_INST_n in Verilog (not in SPICE, original duplicate names are
preserved in SPICE) where n is a numerical index starting from 0 and going up if the
duplicate name is used for more than one net.
Using the same name for a node and an instance is allowed in SPICE but it is illegal in
Verilog and causes a compilation error. Because mixed-signal simulation builds a Verilog
shadow module for each instance of SPICE subcircuit by default, if the same name is used
both as an instance and a net name anywhere in the SPICE netlist, the Verilog shadow
modules inherits the same net and instance names which violate the Verilog rule and lead
to a mixed-signal compilation error.
One of the options (-enable or -disable) must be used with the command. The -enable
option allows identical names to be used for both SPICE nets and instance in mixed-signal
by renaming the net name to net_name_DUPLICATE_INST_n in the Verilog shadow module
created for the SPICE instance, where n is a numerical index.
By default, this option is disabled and duplicate names used for nets and an
instance in SPICE cause a compilation error. You can specify this behavior with the
duplicate_net_inst_name -disable command.:
Examples
In this example, the subcircuit and2x2 is instantiated with instance name x_and1 while
at the same time one of the nodes connected to its ports is also called x_and1. This
is allowed in SPICE, but invalid in Verilog, and causes an error during mixed-signal
compilation.
x_and1 a x_and1 y and2x2
To resolve it, use the following command inside the mixed-signal simulation control file:
duplicate_net_inst_name -enable;
dynamic_supply_filter
Triggers an evaluation at the digital/analog interface, based on a change in supply voltage,
only if the variation of the power supply is greater than the specified voltage change. This
feature can be used only when you specify an interface element with a dynamic power
supply by using the vdd or vss argument.
Syntax
dynamic_supply_filter -deltav value;
Description
Use this command to adjust the number of simulation events produced when there is
a continuous variation of the power supply over the simulation time, such as a power
up mode. Do not overestimate the dynamic_supply_filter value. It is a tradeoff for
performance and accuracy. If you specify too large a value, it can lead to unpredictable
results.
The default value of -deltav is 10% of the largest vdd value in the design. You must
set an absolute voltage value to see the option become effective. It represents the
absolute voltage change threshold, forcing the engine to reevaluate the interface element.
To assess the benefits of this option, it is recommended to apply it in an additional
ie_activity_rpt in the vcsAD.init mixed-signal simulation control file to better
estimate the outcome by looking at the total reported number of events.
Examples
In the following example there are two inverters, with one in a Verilog description and the
other in SPICE.
a z1
//vcsAD.init
use_spice -cell inv ;
The next two examples show that you can observe the different number of time points with
and without the dynamic_supply_filter command.
In Figure 29, the power supply is stable and very few events are generated when the input
is at a steady state.
In Figure 30, the power supply is continuously varying and many events are generated.
The simv.msv/interface_activity.rpt file reports the event count for nodes that are
connected to interface elements in the mixed-signal simulation. The following abbreviated
example is a comparison of two interface activity reports. The report on the left shows
the interface element activity with no supply filtering; the report on the right is generated
with dynamic_supply_filter -deltav 0.1 and shows fewer simulation events and
potentially better simulation performance.
a2d events (incl HighZ) : 351 | a2d events (incl HighZ) : 343
HighZ a2d events : 0 | HighZ a2d events : 0
Total events : 265226 | Total events : 6934
for 5 interface signals | for 5 interface signals
Arguments
-node hierarchical_node_name
Specifies the hierarchical path to the e2n interface. You can specify wildcard
characters (*) in the path.
-min_delta value
Specifies the absolute current threshold value for e2n events. The value
field is specified by using engineering notation, such as 1e-09 and must be
nonnegative. When the value is set to 0, nothing is filtered at the boundary.
The default value is 1% of the maximum value. For more information about
this argument, see Controlling the Number of Time Points at the Analog-Digital
Boundary.
-max_delta value
Sets the current difference between two e2n events to be less than or equal
to the specified value, which must be greater than 0. This option disables the
min_delta option. Note that if you specify a very small max_delta value, it
can slow down a simulation. For more information about this argument, see
Controlling the Number of Time Points at the Analog-Digital Boundary.
-gain value
Multiplies the analog value by the specified value. The value can be a negative
number. The default value is 1.
-res value
Specifies resistance. The default is 1000 Ohms.
-res_node node_name
Specify a path to a SPICE node name to connect the resistor. This argument
is typically used to mimic a pull-up resistor. By default, the resistor is internally
connected to ground.
-library library_name
Specifies a library_name to apply global e2n threshold options. Use this option
to specify unique threshold options for all cells in the specified library. For more
information, see Using Library-Based Interface Element Options.
-cell cell_name -port port_name
Specifies the cell and port names for connecting the e2n interface element. The
cell_name must be the same as the name used in the use_spice, use_verilog,
or use_vhdl commands. You can specify the asterisk (*) wildcard character in a
cell name.
-inst inst_name -port port_name
Specifies the hierarchical path to the instance port for connecting the e2n
interface element. You can specify the asterisk (*) wildcard character in an
instance name.
-node hier_name
Specifies the hierarchical node name for connecting the e2n interface element.
You can specify the asterisk (*) wildcard character in a node name.
-ceff value
Specifies a capacitance value to model the loading effect of the digital blocks
driven by the analog interface net. By default, there is no extra capacitance
inserted at the e2n interface net. The unit of the value is Farad.
-type nettype_name
Applies e2n (or n2e) command arguments to a specified nettype. For example:
n2e -min_delta 1e-09 -type voltage_r -node *;
e2n -min_delta 1e-09 -type voltage_r -node *;
n2e -min_delta 1e-10 -node top.g1.g4.a;
e2n -gain 100 -node top.g1.g5.y;
These commands set the -min_delta argument for n2e and e2n interface
elements to 1e-09V for all nettypes of voltage_r. On line 3, the n2e
-min_delta command specifies a value of 1e-10V for the top.g1.g4.a node
and overrides the previous -min_delta value of 1e-09V.
Note:
The -type nettype_name argument limits the scope of the e2n
(or n2e) command only; it does not change how the e2n (or n2e)
interface element is modeled.
Arguments
-node hierarchical_node_name
Specifies the hierarchical path to the e2n interface. You can specify wildcard
characters (*) in the path.
-min_delta value
Specifies the absolute voltage threshold value for e2n events. The value
field is specified by using engineering notation, such as 1e-09 and must be
nonnegative. When the value is set to 0, nothing is filtered at the boundary. The
default is 1% of the maximum value. For more information about this option, see
Controlling the Number of Time Points at the Analog-Digital Boundary.
-max_delta value
Sets the voltage difference between two e2n events to be less than or equal
to the specified value, which must be greater than 0. This option disables the
-min_delta option. Note that if you specify a very small max_delta value it
can slow down a simulation. For more information about this argument, see
Controlling the Number of Time Points at the Analog-Digital Boundary.
-gain value
Multiplies the analog value by the specified value. The value can be a negative
number. The default value is 1.
-res value
Specifies resistance. The default is 1000 Ohms.
-res_node node_name
Specify a path to a SPICE node name to connect the resistor. This argument
is typically used to mimic a pull-up resistor. By default, the resistor is internally
connected to ground.
-library library_name
Specifies a library_name to apply global e2n threshold options. Use this option
to specify unique threshold options for all cells in the specified library. For more
information, see Using Library-Based Interface Element Options.
-cell cell_name -port port_name
Specifies the cell and port names for connecting the e2n interface element. The
cell_name must be the same as the name used in the use_spice, use_verilog,
or use_vhdl commands. You can specify the asterisk (*) wildcard character in a
cell name.
-inst inst_name -port port_name
Specifies the hierarchical path to the instance port for connecting the e2n
interface element. You can specify the asterisk (*) wildcard character in an
instance name.
-node hier_name
Specifies the hierarchical node name for connecting the e2n interface element.
You can specify the asterisk (*) wildcard character in a node name.
-ceff value
Specifies a capacitance value to model the loading effect of the digital blocks
driven by the analog interface net. By default, there is no extra capacitance
inserted at the e2n interface net. You can use this option to specify a loading
capacitance to be inserted at the e2n interface net or nets. The unit of the value
is Farad.
-type nettype_name
Applies e2n (or n2e) command arguments to a specified nettype. For example:
n2e -min_delta 1e-09 -type voltage_r -node *;
e2n -min_delta 1e-09 -type voltage_r -node *;
n2e -min_delta 1e-10 -node top.g1.g4.a;
e2n -gain 100 -node top.g1.g5.y;
These commands set the -min_delta argument for n2e and e2n interface
elements to 1e-09V for all n2e and e2n nettypes of voltage_r. On line 3, the
n2e -min_delta command specifies a value of 1e-10V for the top.g1.g4.a
node and overrides the previous -min_delta value of 1e-09V.
Note:
The -type nettype_name argument limits the scope of the e2n
(or n2e) command only; it does not change how the e2n (or n2e)
interface element is modeled.
Arguments
-node hierarchical_node_name
Specifies the hierarchical path to the e2n interface. You can specify wildcard
characters (*) in the path.
-min_delta value
Specifies the absolute voltage threshold value for e2n events. The value field
is specified in engineering notation, such as 1e-09 and must be nonnegative.
When the value is set to 0, nothing is filtered at the boundary. The default is 1%
of the maximum value. For more information about this option, see Controlling
the Number of Time Points at the Analog-Digital Boundary.
-max_delta value
Sets the voltage difference between two e2n events to be less than or equal
to the specified value, which must be greater than 0. This option disables the
-min_delta option. Note that if you specify a very small -max_delta value,
it can slow down a simulation. For more information about this argument, see
Controlling the Number of Time Points at the Analog-Digital Boundary.
-library library_name
Specifies a library_name to apply global e2n threshold options. Use this option
to specify unique threshold options for all cells in the specified library. For more
information see Using Library-Based Interface Element Options.
-cell cell_name -port port_name
Specifies the cell and port names for connecting the e2n interface element. The
cell_name must be the same as the name used in the use_spice, use_verilog,
or use_vhdl commands. You can specify the asterisk (*) wildcard character in a
cell name.
-inst inst_name -port port_name
Specifies the hierarchical path to the instance port for connecting the e2n
interface element. You can specify the asterisk (*) wildcard character in an
instance name.
-node hier_name
Specifies the hierarchical node name for connecting the e2n interface element.
You can specify the asterisk (*) wildcard character in a node name.
-ceff value
Specifies a capacitance value to model the loading effect of the digital blocks
driven by the analog interface net. By default, there is no extra capacitance
inserted at the e2n interface net. You can use this option to specify a loading
capacitance to be inserted at the e2n interface net or nets. The unit of the value
is Farad.
-type nettype_name
Applies e2n (or n2e) command arguments to a specified nettype. For example:
n2e -min_delta 1e-09 -type voltage_r -node *;
e2n -min_delta 1e-09 -type voltage_r -node *;
n2e -min_delta 1e-10 -node top.g1.g4.a;
e2n -gain 100 -node top.g1.g5.y;
These commands set the -min_delta argument for n2e and e2n interface
elements to 1e-09V for all nettypes of voltage_r. On line 3, the n2e
-min_delta command specifies a value of 1e-10V for the top.g1.g4.a node
and overrides the previous -min_delta value of 1e-09V.
Note:
The -type nettype_name argument limits the scope of the e2n
(or n2e) command only; it does not change how the e2n (or n2e)
interface element is modeled.
Arguments
-node hierarchical_node_name
Specifies the hierarchical path to the e2n interface. You can specify wildcard
characters (*) in the path.
-min_delta value
Specifies the absolute voltage threshold value for e2n events. The value
field is specified by using engineering notation, such as 1e-09 and must be
nonnegative. When the value is set to 0, nothing is filtered at the boundary. The
default is 1% of the maximum value. For more information about this argument,
see Controlling the Number of Time Points at the Analog-Digital Boundary.
-max_delta value
Sets the voltage difference between two e2n events to be less than or equal
to the specified value, which must be greater than 0. This option disables the
-min_delta option. Note that if you specify a very small -max_delta value it
can slow down a simulation. For more information about this argument, see
Controlling the Number of Time Points at the Analog-Digital Boundary.
-drive_strength 0 | 1
Enables the e2n drive strength calculation. For each e2n event, the analog
engine calculates the analog output resistance. When the calculated resistance
is above the value of the -r_off_th argument, the net is considered to be
in a highZ state and the interface element passes highZ to the VCS tool. For
bidirectional nets, the default is 1, which means the calculation is on. For
unidirectional nets, the default is 0 and the calculation is off.
-library library_name
Specifies a library_name to apply global e2n threshold options. Use this option
to specify unique threshold options for all cells in the specified library. For more
information see Using Library-Based Interface Element Options.
-cell cell_name -port port_name
Specifies the cell and port names for connecting the e2n interface element. The
cell_name must be the same as the name used in the use_spice, use_verilog,
or use_vhdl commands. You can specify the asterisk (*) wildcard character in a
cell name.
-inst inst_name -port port_name
Specifies the hierarchical path to the instance port for connecting the e2n
interface element. You can specify the asterisk (*) wildcard character in an
instance name.
-node hier_name
Specifies the hierarchical node name for connecting the e2n interface element.
You can specify the asterisk (*) wildcard character in a node name.
-ceff value
Specifies a capacitance value to model the loading effect of the digital blocks
driven by the analog interface net. By default, there is no extra capacitance
inserted at the e2n interface net. You can use this option to specify a loading
capacitance to be inserted at the e2n interface net or nets. The unit of the value
is Farad.
-type nettype_name
Applies e2n (or n2e) command arguments to a specified nettype. For example:
n2e -min_delta 1e-09 -type voltage_r -node *;
e2n -min_delta 1e-09 -type voltage_r -node *;
n2e -min_delta 1e-10 -node top.g1.g4.a;
e2n -gain 100 -node top.g1.g5.y;
These commands apply the n2e and e2n -min_delta argument value of 1e-09
for all n2e and e2n nettypes of voltage_r. Note that a specific n2e -min_delta
value of 1e-10 applies to the top.g1.g4.a node and overrides the previous
-min_delta value of 1e-09 value for a single n2e command.
Note:
The -type nettype_name argument limits the scope of the e2n
(or n2e) command only; it does not change how the e2n (or n2e)
interface element is modeled.
-r_off_th value
Sets the threshold value for the impedance calculation. When the impedance of
the analog net is above this value and drive strength calculation is enabled, the
interface element passes hiZ to the VCS tool. The default is 100KOhms.
Arguments
-node hierarchical_node_name
Specifies the hierarchical path to the e2n interface. You can specify wildcard
characters (*) in the path.
-min_delta value
Specifies the absolute voltage threshold value for e2n events. The value
field is specified by using engineering notation, such as 1e-09 and must be
nonnegative. When the value is set to 0, nothing is filtered at the boundary. The
default is 1% of the maximum value. For more information about this argument,
see Controlling the Number of Time Points at the Analog-Digital Boundary.
-max_delta value
Sets the voltage difference between two e2n events to be less than or equal
to the specified value, which must be greater than 0. This option disables the
min_delta option. Note that if you specify a very small max_delta value it
can slow down a simulation. For more information about this argument, see
Controlling the Number of Time Points at the Analog-Digital Boundary.
-drive_strength 0 | 1
Enables the e2n drive strength calculation. For each e2n event, the analog
engine calculates the analog output resistance. When the calculated resistance
is above the value of the -r_off_th argument, then net is considered in a highZ
state and the interface element passes highZ to the VCS tool. For bidirectional
nets, the default is 1 and the calculation is on. For unidirectional nets, the default
is 0 and the calculation is off.
-library library_name
Specifies a library_name to apply global e2n threshold options. Use this option
to specify unique threshold options for all cells in the specified library. For more
information see Using Library-Based Interface Element Options.
-cell cell_name -port port_name
Specifies the cell and port names for connecting the e2n interface element. The
cell_name must be the same as the name used in the use_spice, use_verilog,
or use_vhdl commands. You can specify the asterisk (*) wildcard character in a
cell name.
-inst inst_name -port port_name
Specifies the hierarchical path to the instance port for connecting the e2n
interface element. You can specify the asterisk (*) wildcard character in an
instance name.
-node hier_name
Specifies the hierarchical node name for connecting the e2n interface element.
You can specify the asterisk (*) wildcard character in a node name.
-type nettype_name
Applies e2n (or n2e) command arguments to a specified nettype. For example:
n2e -min_delta 1e-09 -type voltage_r -node *;
e2n -min_delta 1e-09 -type voltage_r -node *;
n2e -min_delta 1e-10 -node top.g1.g4.a;
e2n -gain 100 -node top.g1.g5.y;
These commands set the n2e and e2n -min_delta argument value of 1e-09
for all n2e and e2n nettypes of voltage_r. Note that a specific n2e -min_delta
value of 1e-10 applies to the top.g1.g4.a node and overrides the previous
min_delta value of 1e-09 value for a single n2e command.
Note:
The -type nettype_name argument limits the scope of the e2n
(or n2e) command only; it does not change how the e2n (or n2e)
interface element is modeled.
-r_off_th value
Sets the threshold value for the impedance calculation. When the impedance of
the analog net is above this value and drive strength calculation is enabled, the
interface element passes hiZ to the VCS tool. The default is 100KOhms.
e2r
Description
Use the e2r command to control the behavior of an e2r interface element. This command
sets the threshold at which e2r events occur and allows e2r to convert analog voltage
values (default) or current values to digital.
Syntax
e2r [-type i]
[-min_delta value]
[-max_delta value]
[-gain value]
[-res value]
[-res_node node_name]
[-library library_name]
[-cell cell_name -port port_name]|
[-inst inst_name -port port_name]|[-node hier_name]
Arguments
-type i
Specifies whether the e2r interface element is converting voltage values to
digital (default) or the current through a resistor (with -type i).When you
specify -type i, the current direction follows the PrimeSim HSPICE rule, which
is a positive value means the current is flowing into the subcircuit and a negative
value means that the current is flowing out of the subcircuit. You can change the
sign of the gain argument to change the current direction.
-min_delta value
Specifies the absolute current threshold value for e2r events. The value
field is specified by using engineering notation, such as 1e-09 and must be
nonnegative. When the value is set to 0, nothing is filtered at the boundary. The
default is 1% of possible maximum value of e2r, that stabilizes after several
e2r conversions. For more information about this argument, see Controlling the
Number of Time Points at the Analog-Digital Boundary.
-max_delta value
Sets the voltage difference between two e2r events to be less than or equal
to the specified value, which must be greater than 0. The -max_delta option
does not disable the -min_delta option. Therefore it is recommended to use
both the arguments together for precise control over e2r filtering. For example,
if you specify only -max_delta, the default -min_delta (1% of possible
maximum value of e2r) is still applied. And if -max_delta is less than the default
-min_delta, then the -min_delta takes precedence, and -max_delta is
ignored. Note that if you specify a very small -max_delta value it can slow down
a simulation. For more information about this argument, see Controlling the
Number of Time Points at the Analog-Digital Boundary.
-gain value
Determines if the analog voltage/current needs to be multiplied by a multiplier
when converted to digital. The multiplier could be a negative number as well.
The default value is 1.
-res value
Specifies the value of the resistor that is placed between the interface net and
ground to measure the current through it. This option is only applicable with
-type i.
-res_node node_name
Specify a path to a SPICE node name to connect the resistor. This option
provides a path to a SPICE node name, typically used to mimic a pull-up
resistor. By default, the series resistor is internally connected to ground.
-node hierarchical_node_name
Specifies the hierarchical path to the e2r interface. You can specify wildcard
characters (*) in the path.
-library library_name
You can specify a library_name to apply global e2r threshold options that
interface to HDL cells that have been compiled into separate libraries and are
used in the mixed-signal design configuration. For more information see Using
Library-Based Interface Element Options.
-cell cell_name -port port_name
Specifies the cell and port names for connecting the e2n interface element. The
cell_name must be the same as the name used in the use_spice, use_verilog,
or use_vhdl commands. You can specify the asterisk (*) wildcard character in a
cell name.
-inst inst_name -port port_name
Specifies the hierarchical path to the instance port for connecting the interface
element. You can specify the asterisk (*) wildcard character in an instance
name.
-node hier_name
Specifies the hierarchical node name for connecting the interface element. You
can specify the asterisk (*) wildcard character in a node name.
Examples
The following examples show different usages of the e2r interface element.
• The following example sets the e2r interface element to a current type at hierarchical
path top.i1.ictrl. The current through the 10 Ohm resistor, specified by the -res
10 option, is converted to digital real values.
e2r -type i -node top.i1.ictrl -res 10;
• The following example sets the -min_delta for the e2r interface located at
test.pblk.clk to 1mV.
e2r -min_delta 1e-3 -node top.pblk.clk;
e2u
Specifies the behavior of an e2u interface element. This interface element is used to
connect a net from SPICE to a UPF supply net.
Syntax
e2u [-node hierarchical_node_name | -cell cell_name -port port_name]
[-type power | pwr | ground | gnd]
[-rth res_value]
[-res_tth time_value]
[-vth voltage_value1]
[-vth_low voltage_value2]
[-glitch_time time_value]
[-min_delta value]
[-max_delta value]
Arguments
-node hierarchical_node_name
Specifies the hierarchical node name. You can specify the asterisk (*) wildcard
character in a node name.
-cell cell_name -port port_name
Specifies the cell and port names for the interface element. The cell_name
must be the same as the name used in the use_spice, use_verilog, or use_vhdl
commands. You can specify the asterisk (*) wildcard character in a cell name.
-type power | pwr | ground | gnd
Specifies whether the e2u interface element is driving a power supply net
(-type power | pwr) or a ground net (-type ground | gnd). The default is
power.
-rth res_value
Specifies the output resistance of the SPICE supply driver connected to the e2u
input. If this resistance is greater than res_value, the interface element outputs
an OFF value. Otherwise, FULL_ON is output.
-res_tth time_value]
Specifies how much time must pass after the output impedance crosses the
output resistance threshold, rth, before switching the interface element output
from FULL_ON to OFF or from OFF to FULL_ON. The default is 0.
-vth voltage_value1
If -type power | pwr, specifies the threshold voltage. If the input voltage to
the e2u interface element is less than voltage_value1, the interface element
outputs an OFF value. Otherwise, FULL_ON is output.
If -type ground | gnd, specifies the upper boundary of a range with -vth_low
voltage_value2. When the input voltage is within the specified range, the
interface element outputs FULL_ON. Otherwise, it outputs an OFF value.
-vth_low voltage_value2
If -type power | pwr, this argument is ignored.
If -type ground | gnd, specifies the lower boundary of a range with -vth
voltage_value1. When the input voltage is within the specified range, the
interface element outputs FULL_ON. Otherwise, it outputs an OFF value. The
default is -∞.
-glitch_time time_value
Specifies how much time must pass after the input voltage crosses the threshold
voltage (-vth, if -type power | pwr) or crosses a boundary of the voltage
range (-vth and -vth_low, if -type ground | gnd) before switching the
interface element output from FULL_ON to OFF or from OFF to FULL_ON. The
default is 0.
-min_delta value
Specifies the absolute voltage threshold value for e2u events. The value
field is specified by using engineering notation, such as 1e-09 and must be
nonnegative. When the value is set to 0, nothing is filtered at the boundary. The
default is 1% of the maximum value. For more information about this argument,
see Controlling the Number of Time Points at the Analog-Digital Boundary.
-max_delta value
Sets the voltage difference between two e2u events to be less than or equal
to the specified value, which must be greater than 0. This option disables the
-min_delta option. Note that if you specify a very small -max_delta value,
it can slow down a simulation. For more information about this argument, see
Controlling the Number of Time Points at the Analog-Digital Boundary.
Description
The e2u interface element is used to convert a SPICE power output signal to a UPF
supply net value. Use the e2u command to configure and change the default behavior
for an e2u interface element placed at the SPICE-to-UPF interface. Use options to the
command to define the threshold voltage or output resistance to determine whether a
FULL_ON or OFF state is passed to UPF.
In the following figure, an e2u interface element is used to convert the VDD SPICE power
output signal to a UPF supply net value for the digital block.
UPF driver
Examples
The following examples use the -rth and -vth options to control the behavior of the e2u
interface element:
• Specify a threshold voltage of 0.9V:
e2u -node Top.I0.I0.vdd_high -vth 0.9
In this example, if the voltage of node Top.I0.I0.vdd_high is less than 0.9, the
interface element outputs an OFF value. Otherwise, FULL_ON is output.
• Specify a threshold voltage of 0.9V and an output resistance of 10:
e2u -node Top.I0.I0.vdd_high -rth 1k;
form_spice_bus
Description
Enables or disables the use of Verilog language XMR or UCLI force statements to be
developed by using a vector format. This command is used for designs that contain Verilog
language XMR, $hdl_xmr, $hdl_xmr_force, or UCLI force commands on SPICE ports
that appear as a bus in the digital view of the target cell. By default, form_spice_bus is
-enable.
If there are errors for designs that are not using XMR or UCLI force statements, you can
disable this command. If disabled, XMR or UCLI force statements cannot be used in a
vector format.
Syntax
form_spice_bus -enable | -disable;
Arguments
-enable
Enables (default) the form_spice_bus command.
-disable
Disables the form_spice_bus command.
Examples
The following examples show the usage of the form_spice_bus command:
• The following digital testbench uses the Verilog language XMR feature on a SPICE port
that appears as a bus. The form_spice_bus command allows the SPICE vector out
to be treated as a Verilog vector, which allows the parts of the Verilog code that make
vector-to-vector assignments to remain unchanged in mixed-signal simulation.
dut.spi
.subckt my_design in<2> in<1> in<0> out<2> out<1> out<0>
...
.ends
testbench.v
module top;
wire [-2:0] read1, read2, read3;
...
my_design dut (.in(x[-2:0]), .out(z[-2:0]));
assign read1 = top.dut.out;
assign read2[-1:0] = top.dut.out[-1:0];
assign read3 = {top.dut.out[-2], top.dut.out[-1],
top.dut.out[-0]};
endmodule
• In the following example, the digital testbench uses $hdl_xmr_force on SPICE ports
(top.dut.out<2>, top.dut.out<1>, top.dut.out<0>), which appears as a bus.
testbench.v
module top;
...
my_design dut (.in(x[-2:0]), .out(z[-2:0]));
initial begin
#20 $hdl_xmr_force ("top.dut.out", "101", "0ns", , , 0);
#20 $hdl_xmr_release ("top.dut.out", 0);
end
endmodule
module my_design (in, out);
input [-2:0] in;
output [-2:0] out;
...
endmodule
dut.spi
.subckt my_design in<2> in<1> in<0> out<2> out<1> out<0>
...
.ends
In this case, you must use form_spice_bus -enable; in the mixed-signal simulation
control file to enable the force on the SPICE bus. The command is disabled by default.
gen_spice_wrapper
Helps the tool to read in the list of ports in the Verilog or VHDL descriptions and generate
the wrapper with the port definitions.
Syntax
gen_spice_wrapper -cell cell_list -add_port port_list;
Arguments
-cell cell_list
Specifies a list of the Verilog or VHDL cells that are instantiated in a structural
Verilog netlist and require a wrapper. The cell names are separated by a
space. These cells must also appear either in the use_verilog or use_vhdl
commands.
-add_port port_list
Specifies a list of the extra ports you want to add in the SPICE wrapper.
Description
When a design uses structural Verilog for its SPICE blocks, structural Verilog is read in
using the load_verilog_file PrimeSim XA command and is assumed to be a SPICE
view in a VCS PrimeSim AMS simulation. However, when you have VHDL or Verilog
cells inside the structural Verilog, the VCS PrimeSim AMS tool is not able to find the ports
defined in the VHDL or Verilog descriptions.
You only need to use this command if your design meets all the following conditions:
• You are using a structural Verilog netlist as a SPICE view (using load_verilog_file
in the PrimeSim XA configuration file).
• You are using a VHDL or Verilog view for one of the instances in the structural Verilog.
• Your design references ports by name, not by position, in the structural Verilog for the
blocks specified with the use_vhdl or use_verilog commands.
Port reference by name is:
INV U0 ( .A(A[0]) , .Z(Z[0]) );
• There is no SPICE .subckt description for the Verilog or the VHDL blocks instantiated
in the structural Verilog.
In order for the gen_spice_wrapper command to execute, there must be a VHDL or
Verilog description for the blocks specified in the use_verilog or use_vhdl command.
The gen_spice_wrapper command reads in the VHDL or the Verilog description of the
block and generates a wrapper that gives the analog simulator the information it needs
about the ports.
When there are buses, the buses are separated in single bit signals by using the Verilog or
VHDL bus notation for each bit. When there is a mismatch between the port names used
in the Verilog module (or VHDL model) and the structural Verilog instance port names, an
error message is issued.
Examples
The following examples show different use cases for the gen_spice_wrapper command:
• Generate a SPICE wrapper for the Verilog INV cell and the VHDL ND2 cell. The tool
reads the inv.v file to build the wrapper for INV and reads the nd2.vhd file to build the
wrapper for ND2.
vcsAD.init
use_verilog INV;
use_vhdl ND2;
gen_spice_wrapper -cell INV ND2;
top.v
module top();
...
INV U0 ( .A(A[0]) , .Z(Z[0]) );
• Generate a SPICE wrapper for the Verilog INV cell and the VHDL BUF cell. The tool
reads the inv.v file to build the wrapper for INV and reads the buf.vhd file to build the
wrapper for ND2.
vcsAD.init
use_verilog INV;
use_vhdl BUF;
gen_spice_wrapper -cell INV;
gen_spice_wrapper -cell BUF;
top.v
module top()
...
INV U0 ( .A(A[0]) , .Z(Z[0]) , .VSS (VSS), .VDD(VDD));
BUF U1 ( .A(A[1]) , .Z(Z[1]) );
endmodule
• Generate a SPICE wrapper for the Verilog MUX cell. Note that the MUX cell instance
contains VDD and VSS ports; these are generated in the SPICE wrapper by specifying
-add_port VDD VSS.
vcsAD.init
use_verilog MUX;
gen_spice_wrapper -cell MUX -add_port VDD VSS;
top.v
module top ();
...
MUX U0 ( .A(IN) , .Z(OUT), .VDD(inh_sup), .VSS(inl_sup) );
...
endmodule
ie_activity_rpt
Enables outputting either the interface element (IE) activity statistics for the Verilog-SPICE
and VHDL/Verilog-SPICE flows or the connect module (CM) activity statistics for the
Verilog-AMS flow into the report file, simv.msv/interface_activity.rpt.
Syntax
ie_activity_rpt -enable | -disable
[-flush flush_percentage | flush_time];
Arguments
-enable | -disable
Enables or disables outputting of the interface_activity.rpt file to the
simv.msv directory.
-flush flush_percentage
Specifies the simulation time interval at which the report file gets updated.
The interval is given as a percentage of the end time specified in the .tran
statement. By default, the interval is 10% of the .tran end time. If there is no
.tran statement in SPICE, this option is ignored.
-flush flush_time
Specifies the absolute simulation time intervals at which the report file gets
updated.
Description
By default, the tool updates the interface_activity.rpt file at time intervals equal to
10% of the simulation time specified by the .tran statement.
This file is generated only if the interface activity report is enabled with the
ie_activity_rpt command. The report file has an entry for each interface element (a2d,
d2a, e2r, or r2e) and displays how many events have occurred for each interface.
Examples
• The following example writes out the interface activity report to the simv.msv/
interface_activity.rpt file.
ie_activity_rpt -enable;
• The following example writes out the interface activity report and sets the update
interval for the file to 2ns.
ie_activity_rpt -enable -flush 2ns;
• The following example writes out the interface activity report and sets the update
interval for the file to 5% of the .tran end time.
ie_activity_rpt -enable -flush 5%;
ie_connect_rpt
Description
Enables outputting the interface element connectivity information into the report file,
simv.msv/interface_connectivity.rpt. This command is disabled by default.
Syntax
ie_connect_rpt -enable | -disable -msg_count value;
Arguments
-enable | -disable
Enables or disables output of the interface_connectivity.rpt file to the
simv.msv directory. Because the ie_connect_rpt command can potentially
impact performance and memory usage, -disable is the default.
-msg_count value
Controls the count of messages dumped in both digital drivers and analog port
connections. By default, both analog connections and digital drivers are dumped
into the report. Default is 20.
Examples
ie_connect_rpt -enable -msg_count 99
This command enables the count of messages, for both analog connections and digital
drivers, dumped with a maximum message count of 99.
ie_connect_rpt -enable -msg_count 99 -type digital
With the -type digital the report only has digital drivers checked and dumped with a
maximum message count of 99.
ie_reference_voltage
Description
Defines a reference node that can assist automatic supply tracing to set the appropriate
thresholds or levels of a2d or d2a interface elements. See Specifying a Voltage Reference
for Interface Elements for more information.
Syntax
ie_reference_voltage -node node_name [-voltage value];
or
ie_reference_voltage -skip_node skip_node_name;
Arguments
-node node_name
Specifies the reference to a hierarchical node name inside SPICE.
-voltage value
Specifies a voltage value used to calculate the thresholds and levels of interface
elements whose SPICE side can trace supply to the specified reference node. If
this argument is not set, the reference is dynamic.
-skip_node skip_node_name
Specifies the node that is skipped from supply tracing.
Note:
This argument cannot be used with the other arguments of this
command.
Examples
Automatic supply tracing may not work correctly if the circuit has a floating ground node,
that is, a node that is not directly connected to true ground. In the example shown in
Figure 32, the floating ground node vss may create a false path for tracing vdd_33 to the
interface element (IE). To eliminate such a path, you can skip vss from supply tracing by
setting the following:
ie_reference_voltage -skip_node vss;
This results in vdd_18 being the only path for supply tracing to the interface element.
ie_tracing_rpt
Description
Enables outputting the report file, simv.msv/interface_tracing.rpt. This file helps you
check whether your user-defined Vdd nodes are correct. If a user-defined Vdd differs from
the supply reached by the tracing algorithm, the report includes a warning message.
Syntax
ie_tracing_rpt -enable | -disable -refLov val;
Arguments
-enable | -disable
Enables or disables output of the interface_tracing.rpt file to the simv.msv
directory.
-refLov val
Used for estimating -hiv when you set constant -hith and -loth (Estimated
hiv=hith+loth-refLov). The default for -refLov is 0.0.
Examples
The following examples demonstrate the use of the ie_tracing_rpt command:
Example 1
In this example, the user-defined Vdd (vdd20) matches the traced Vdd (vdd20).
Set the following commands in the vcsAD.init file:
ie_tracing_rpt -enable
d2a -node net1 -vdd vdd20 -vss vss00 -hiv 90% -lov 10%
Example 2
In this example, the user-defined -vdd (vdd18) does not match the traced -vdd (vdd20).
Set the following commands in the vcsAD.init file:
ie_tracing_rpt -enable
d2a -node net1 -vdd vdd18 -vss vss00 -hiv 90% -lov 10%
Example 3
If you set a static interface element (constant -hiv and -hith), the tool checks only
the results of the tracing algorithm against -hith because the simulator does not run
the tracing for those interface nodes that have constant -hiv (in fact, the user-defined
constant -hiv has higher priority than the supply tracing).
In this example, the estimated -hiv (1.5) does not match the traced -hiv (2.0).
Set the following commands in the vcsAD.init file:
ie_tracing_rpt -enable -refLov 0.0
a2d -node net1 -hith 1.0 -loth 0.5
Example 4
In this example, the estimated p-hiv (2.0) matches the traced -hiv (2.0).
Set the following commands in the vcsAD.init file:
ie_tracing_rpt -enable -refLov 0.0
a2d -node net1 -hith 1.5 -loth 0.5
insert_cell
Description
Inserts a 2-port SPICE netlist on the analog side of an interface net. This can be used to
convert a voltage into a current.
Syntax
insert_cell
[-param parameter_list]
[-subckt subcircuit_name -apin port_name -dpin port_name]
[-cell cell_name -port port_name | -node hier_name]
subckt subcircuit_name -apin port_name -dpin port_name
Arguments
-subckt subcircuit_name -apin port_name -dpin port_name
Identifies a two-port subcircuit to be inserted on the analog side of the interface
and determines which port faces the analog side and which the digital side. The
-apin and -dpin options are only needed if the two ports of the inserted cell are
not called the default names -apin and -dpin.
-cell cell_name, -port port_name, -node hier_name
The command can be applied to cells and ports, or nodes.
• For cells, specify the cell name and port name.
• For nodes, specify the hierarchical path to the instance port.
• Cell and port names can contain the asterisk (*) wildcard character, for
example,
-node top.i1.ad*,
-cell *foo, -port *.
Examples
• Insert a 2-port SPICE subcircuit named multiplier with pins in and out at the
interface net top.rst:
// vcsAD.init
insert_cell -subckt multiplier -apin in -dpin out -node top.rst;
* multiplier subcircuit
.subckt multiplier in out ...
.ends
• Insert a 2-port SPICE subcircuit named term at the interface net test.i1.d_in. Note
that the default pin names, -apin and p-dpin, are used and the -dpin and -apin
arguments are not required:
// vcsAD.init
insert_cell -subckt term -node top.i1.d_in;
* term subcircuit
.subckt term apin dpin
...
.ends
map_by_node
Description
Specifies a resistance value for d2a conversion at an interface node, instead of the value
calculated from the resistance map file. This command is only applied in the digital-to-
analog direction.
Syntax
map_by_node -r resistance_value -node node_names;
Examples
In the following example, the 5 ohm resistance value is applied to the interface resistor
connected to the top.n1 node.
map_by_node -r 5 -node top.n1;
When multiple map_by_node commands are used for the same mixed-nets in the mixed-
signal simulation control file, the last command takes precedence.
Arguments
-node hierarchical_node_name
Specifies the hierarchical path to the n2e interface. You can specify wildcard
characters (*) in the path.
-min_delta value
Specifies the absolute current threshold value for n2e events. The value
field is specified by using engineering notation, such as 1e-09 and must be
nonnegative. When the value is set to 0, nothing is filtered at the boundary. The
default is 1% of the maximum value. For more information about this argument,
see Controlling the Number of Time Points at the Analog-Digital Boundary.
-gain value
Multiplies the output value by the specified value. The multiplier can be a
negative number. The default value is 1.
-rf_rate value
Specifies how fast the voltage changes from the current value to the target
value. Units are specified as second/ampere, with the default set to 10ps/A. You
should avoid rapid changes in voltage values that might create unwanted current
peaks.
-res value
Specifies parallel resistance. The default is 1100G Ohms.
-x2i value
Specifies the current source value when the interface element real value is set
to realX.
-library library_name
Specifies a library_name to apply global n2e threshold options. Use this option
to specify unique threshold options for all cells in the specified library. For more
information see Using Library-Based Interface Element Options.
-cell cell_name -port port_name
Specifies the cell and port names for the interface element. The cell_name
must be the same as the name used in the use_spice, use_verilog, or use_vhdl
commands. You can specify the asterisk (*) wildcard character in a cell name.
-inst inst_name -port port_name
Specifies the hierarchical path to the instance port. You can specify the asterisk
(*) wildcard character in an instance name.
-node hier_name
Specifies the hierarchical node name for the interface element. You can specify
the asterisk (*) wildcard character in a node name.
-type nettype_name
Applies n2e (or e2n) command arguments to a specified nettype. For example:
n2e -min_delta 1e-09 -type voltage_r -node *;
e2n -min_delta 1e-09 -type voltage_r -node *;
n2e -min_delta 1e-10 -node top.g1.g4.a;
e2n -gain 100 -node top.g1.g5.y;
These commands apply the n2e and e2n -min_delta argument value of 1e-09
for all n2e and e2n nettypes of voltage_r. Note that a specific n2e -min_delta
value of 1e-10 applies to the top.g1.g4.a node and overrides the previous
-min_delta value of 1e-09 value for a single n2e command.
Note:
The -type nettype_name argument limits the scope of the n2e
(or e2n) command only; it does not change how the n2e (or e2n)
interface element is modeled.
Arguments
-node hierarchical_node_name
Specifies the hierarchical path to the n2e interface. You can specify wildcard
characters (*) in the path.
-min_delta value
Specifies the absolute voltage threshold value for n2e events. The value
field is specified by using engineering notation, such as 1e-09 and must be
nonnegative. When the value is set to 0, nothing is filtered at the boundary. The
default is 1% of the maximum value. For more information about this argument,
see Controlling the Number of Time Points at the Analog-Digital Boundary.
-gain value
Multiplies the analog value by the specified value. The value can be a negative
number. The default value is 1.
-rf_rate value
Specifies how fast the voltage changes from the current value to the target
value. Units are specified as second/volt, with the default set to 10ps/V. You
should avoid rapid changes in voltage values that might create unwanted current
peaks.
-res value
Specifies parallel resistance. The default is 1100G Ohms.
-x2i value
Specifies the current source value when the interface element real value is set
to realX.
-library library_name
Specifies a library_name to apply global n2e threshold options. Use this option
to specify unique threshold options for all cells in the specified library. For more
information, see Using Library-Based Interface Element Options.
-cell cell_name -port port_name
Specifies the cell and port names for connecting the interface element. The
cell_name must be the same as the name used in the use_spice, use_verilog,
or use_vhdl commands. You can specify the asterisk (*) wildcard character in a
cell name.
-inst inst_name -port port_name
Specifies the hierarchical path to the instance port to apply the voltage value
to the ports referring to the target instance. You can specify the asterisk (*)
wildcard character in an instance name.
-node hier_name
Specifies the hierarchical node name. You can specify the asterisk (*) wildcard
character in a node name.
-type nettype_name
Applies n2e (or e2n) command arguments to a specified nettype. For example:
n2e -min_delta 1e-09 -type voltage_r -node *;
e2n -min_delta 1e-09 -type voltage_r -node *;
n2e -min_delta 1e-10 -node top.g1.g4.a;
e2n -gain 100 -node top.g1.g5.y;
These commands apply the n2e and e2n -min_delta argument value of 1e-09
for all n2e and e2n nettypes of voltage_r. Note that a specific n2e -min_delta
value of 1e-10 applies to the top.g1.g4.a node and overrides the previous
-min_delta value of 1e-09 value for a single n2e command.
Note:
The -type nettype_name argument limits the scope of the n2e
(or e2n) command only; it does not change how the n2e (or e2n)
interface element is modeled.
Arguments
-node hierarchical_node_name
Specifies the hierarchical path to the n2e interface. You can specify wildcard
characters (*) in the path.
-min_delta value
Specifies the absolute voltage threshold value for n2e events. The value
field is specified by using engineering notation, such as 1e-09 and must be
nonnegative. When the value is set to 0, nothing is filtered at the boundary. The
default is 1% of the maximum value. For more information about this argument,
see Controlling the Number of Time Points at the Analog-Digital Boundary.
-rf_rate value
Specifies how fast the interface element internal voltage changes from the
present value to the target value. Units are specified as second/volt, with the
default set to 10ps/V. You should avoid rapid changes in voltage values that
might create unwanted current peaks
-library library_name
Specifies a library_name to apply global n2e threshold options. For more
information see Using Library-Based Interface Element Options.
-cell cell_name -port port_name
Specifies the cell and port names for connecting the n2e interface element. The
cell_name must be the same as the name used in the use_spice, use_verilog,
or use_vhdl commands. You can specify the asterisk (*) wildcard character in a
cell name.
These commands apply the n2e and e2n -min_delta argument value of 1e-09
for all n2e and e2n nettypes of voltage_r. Note that a specific n2e -min_delta
value of 1e-10 applies to the top.g1.g4.a node and overrides the previous
-min_delta value of 1e-09 value for a single n2e command.
Note:
The -type nettype_name argument limits the scope of the n2e
(or e2n) command only; it does not change how the n2e (or e2n)
interface element is modeled.
Arguments
-node hierarchical_node_name
Specifies the hierarchical path to the n2e interface. You can specify wildcard
characters (*) in the path.
-min_delta value
Specifies the absolute voltage threshold value for n2e events. The value field
is specified in engineering notation, such as 1e-09 and must be nonnegative.
When the value is set to 0, nothing is filtered at the boundary. The default is
1% of the maximum value. For more information about this argument, see
Controlling the Number of Time Points at the Analog-Digital Boundary.
-gain value
Multiplies the analog value by the specified value. The multiplier can be a
negative number. The default value is 1.
-rf_rate value
Specifies how fast the voltage changes from the present value to the target
value. Units are specified as second/volt, with the default set to 10ps/V. You
should avoid rapid changes in voltage values that might create unwanted current
peaks.
-res value
Specifies series resistance. The default is 50.0Ohms.
-r_off value
Specifies the series resistance value when the interface element real value is
set to -hiz. This should be a fairly high value to mimic a high impedance analog
node. The default is 10G Ohm.
-x2v value
Specifies the voltage source value when the interface element real value is set
to realX.
• If not specified, during DC, the interface element is 0.0V for a realX and
during transient, the interface element holds its last value.
• If specified, during DC or transient, then interface element is forced to the
specified value for a realX.
-powernet 0 | 1
Identifies an n2e node as an ideal voltage source on the analog side without the
resistance value. You must use this option when Verilog drives analog power
nets in order to remove the series resistance map resistors and to allow efficient
partitioning of the analog circuit.
• 0 to not treat as an ideal voltage source (default).
• 1 to treat as an ideal voltage source.
-library library_name
Specifies a library_name to apply global n2e threshold options. Use this option
to specify unique threshold options for all cells in the specified library. For more
information see Using Library-Based Interface Element Options.
-cell cell_name -port port_name
Specifies the cell and port names. The cell_name must be the same as the
name used in the use_spice, use_verilog, or use_vhdl commands. You can
specify the asterisk (*) wildcard character in a cell name.
-inst inst_name -port port_name
Specifies the hierarchical path to the instance port to apply the voltage value
to the ports referring to the target instance. You can specify the asterisk (*)
wildcard character in an instance name.
-node hier_name
Specifies the hierarchical node name. You can specify the asterisk (*) wildcard
character in a node name.
-type nettype_name
Applies n2e (or e2n) command arguments to a specified nettype. For example:
n2e -min_delta 1e-09 -type voltage_r -node *;
e2n -min_delta 1e-09 -type voltage_r -node *;
n2e -min_delta 1e-10 -node top.g1.g4.a;
e2n -gain 100 -node top.g1.g5.y;
These commands apply the n2e and e2n -min_delta argument value of 1e-09
for all n2e and e2n nettypes of voltage_r. Note that a specific n2e -min_delta
value of 1e-10 applies to the top.g1.g4.a node and overrides the previous
-min_delta value of 1e-09 value for a single n2e command.
Note:
The type -nettype_name argument limits the scope of the n2e
(or e2n) command only; it does not change how the n2e (or e2n)
interface element is modeled.
Arguments
-node hierarchical_node_name
Specifies the hierarchical path to the n2e interface. You can specify wildcard
characters (*) in the path.
-min_delta value
Specifies the absolute voltage threshold value for n2e events. The value
field is specified by using engineering notation, such as 1e-09 and must be
nonnegative. When the value is set to 0, nothing is filtered at the boundary. The
default is 1% of the maximum value. For more information about this argument,
see Controlling the Number of Time Points at the Analog-Digital Boundary.
-gain value
Multiples the analog value by the specified value. The value can be a negative
number. The default value is 1.
-rf_rate value
Specifies how fast the voltage changes from the present value to the target
value. Units are specified as second/volt, with the default set to 10ps/V. You
should avoid rapid fast changes in voltage values that might create unwanted
current peaks.
-res value
Specifies series resistance. The default is 50.0 Ohms.
-r_off value
Specifies the series resistance value when the interface element real value is
set to -hiz. This should be a fairly high value to mimic a high impedance analog
node. The default is 10G Ohm.
-x2v value
Specifies the voltage source value when the interface element real value is set
to realX.
• If not specified, during DC, the interface element is 0.0V for a realX and
during transient, the interface element holds its last value.
• If specified, during DC or transient, then interface element is forced to the
specified value for a realX.
-powernet 0 | 1
Identifies an n2e node as an ideal voltage source on the analog side without the
resistance value. You must use this option when Verilog drives analog power
nets in order to remove the series resistance map resistors and to allow efficient
partitioning of the analog circuit.
• 0 to not treat as an ideal voltage source (default).
• 1 to treat as an ideal voltage source.
-library library_name
Specifies a library_name to apply global n2e threshold options. Use this option
to specify unique threshold options for all cells in the specified library. For more
information see Using Library-Based Interface Element Options.
-cell cell_name -port port_name
Specify the cell and port names for connecting the n2e interface element. The
cell_name must be the same as the name used in the use_spice, use_verilog,
or use_vhdl commands. You can specify the asterisk (*) wildcard character in a
cell name.
-inst inst_name -port port_name
Specifies the hierarchical path to the instance port to apply the voltage value
to the ports referring to the target instance. You can specify the asterisk (*)
wildcard character in an instance name.
-node hier_name
Specifies the hierarchical node name. You can specify the asterisk (*) wildcard
character in a node name.
-type nettype_name
Applies n2e (or e2n) command arguments to a specified nettype. For example:
n2e -min_delta 1e-09 -type voltage_r -node *;
e2n -min_delta 1e-09 -type voltage_r -node *;
n2e -min_delta 1e-10 -node top.g1.g4.a;
e2n -gain 100 -node top.g1.g5.y;
These commands apply the n2e and e2n -min_delta argument value of 1e-09
for all n2e and e2n nettypes of voltage_r. Note that a specific n2e -min_delta
value of 1e-10 applies to the top.g1.g4.a node and overrides the previous
-min_delta value of 1e-09 value for a single n2e command.
Note:
The -type nettype_name argument limits the scope of the n2e
(or e2n) command only; it does not change how the n2e (or e2n)
interface element is modeled.
netlist_commands_begin
Description
Use this command in the vcsAD.init mixed-signal simulation control file, along with the
netlist_commands_end command, to pass simulator-specific commands to the PrimeSim
XA, FineSim, or PrimeSim simulation engines.
Note:
For the PrimeSim XA simulation engine, you can also use the
xa_commands_begin and xa_commands_end commands.
Syntax
netlist_commands_begin;
simulator_specific_commands
…
netlist_commands_end;
Examples
See Adding Netlist Commands to the Control File for examples for the PrimeSim XA,
FineSim, and PrimeSim simulation engines.
netlist_commands_end
Description
Use this command in the vcsAD.init mixed-signal simulation control file, along with the
netlist_commands_begin command, to pass simulator-specific commands to the PrimeSim
XA, FineSim, or PrimeSim simulation engines.
Note:
For the PrimeSim XA simulation engine, you can also use the
xa_commands_begin and xa_commands_end commands.
Syntax
netlist_commands_begin;
simulator_specific_commands
…
netlist_commands_end;
Examples
See Adding Netlist Commands to the Control File for examples for the PrimeSim XA,
FineSim, and PrimeSim simulation engines.
optimize_shadowfile
Use the optimize_shadowfile command to optimize the shadow Verilog hierarchy
optimize_shadowfile command
generated for SPICE blocks. You can use the -disable and -enable options of the
optimize_shadowfile command to change the default behavior.
Syntax
optimize_shadowfile -enable | -disable;
Description
To save compile time, this command directs the analog engine to avoid generating
unnecessary Verilog dummy modules for blocks with the SPICE view. If references to
nets in the transistor-level netlist (from the Verilog netlist) are made when this command
is used, compilation errors related to the cross-module references (XMR) may occur. Be
cautious when using this option with XMR.
Examples
In the following example, the PrimeSim XA, FineSim, and PrimeSim simulation engines
are directed to avoid generating some of the Verilog dummy modules so the Verilog
hierarchy under the SPICE view can be optimized.
Note:
This command prevents VCS from probing inside the SPICE hierarchy; this can
prevent optimization of D2D through-nets and might increase the number of
interface elements.
param_pass
Enables parameter passing between Verilog/VHDL and SPICE.
Syntax
param_pass -enable | -disable;
Description
This command uses the -disable and -enable options of the param_pass command to
change the default behavior. Table 11 shows the default behavior for parameter passing
in different flows. To change the default behavior, use the param_pass command with the
proper switch: -enable or -disable.
Table 11 Parameter Passing for Different Mixed-Signal Flows
port_connect
Use this command when a SPICE cell is instantiated under a Verilog or VHDL parent and
contains extra ports (usually VDD and VSS) that are not connected in the instantiation.
Syntax
port_connect -cell cell_name ([-inst inst_name] [real]
spice_port_name => hierarchical_net, ... |
spice_port_name => snps_open);
Arguments
-cell cell_name
Specifies the cell name.
-inst inst_name
If this option is used, only the specified instance is instantiated in SPICE. The
Full Hierarchical Path to the instance is required.
real
Specifies that hierarchical_net is a real net in the digital domain.
hierarchical_net
Specifies the hierarchical path to the net; this net is used to connect the extra
port.
Description
This command allows extra ports to connect to a hierarchical net in either the digital or the
analog domain.
Note:
If a hierarchical net is at the top level, you must define it as a global net. For
example, if you specify:
port_connect -cell inv ( inv_vdd => vdd , inv_vss => vss );
And vdd and vss are not declared as global (there is no such line: .global
vdd vss), then the connection is not made.
Examples
• Connect the dangling SPICE ports vdd and vss to the ideal supply nets. Here the
SPICE cell inv1 is instantiated under a Verilog-top testbench:
inv1 i1 ( .y(y_wire), .a(a_wire) );
The SPICE cell has two extra ports called vdd and vss that are not present in the
Verilog view of the cell and as a result are not connected in the instantiation above.
.subckt inv1 y a vdd vss
...
module inv1 (y, a);
...
Assuming that in the body of SPICE there are two ideal supplies defined as follows:
v3 vdd! 0 DC=3.0
v2 vss! 0 DC=0
The following mixed-signal command connects the dangling SPICE ports vdd and vss
to the nets connected to the ideal supplies:
port_connect -cell inv1 ( vdd => vdd! , vss => vss! );
• Connect the dangling SPICE ports vdd and vss to the ideal supply nets driven by
top.i_power_blk. In the following example, the SPICE cell inv1 is instantiated under
a Verilog-top testbench:
inv1 i1 (.y(y_wire), .a(a_wire) );
The cell has two extra ports, vdd and vss, that are not present in the Verilog view of the
cell:
.subckt inv1 y a vdd vss
...
module inv1 (y, a);
...
Assuming that two ideal supplies are defined in subcircuit at the hierarchical path
top.i_power_blk as:
v1 vdd 0 DC=1.2
v2 vss 0 DC=0
The following mixed-signal command connects the dangling SPICE ports vdd and vss
to the nets connected to the ideal supplies:
port_connect -cell inv1 ( vdd => top.i_power_blk.vdd , vss =>
top.i_power_blk.vss );
• Connect the SPICE ports vdd and vss to the Verilog real nets top.my_vdd and
top.my_vss, respectively.
port_connect -cell test ( real vdd => top.my_vdd , real vss =>
top.my_vss );
port_dir
Description
Declares port directions for SPICE subcircuit ports that cannot be derived from an
equivalent multiple Verilog or VHDL view port direction.
Syntax
port_dir -cell cell_name [input|output|inout]
[spice_port_name], [spice_port_name], …;
[input|output|inout] [spice_port_name], …);
Arguments
-cell cell_name
Specifies the cell name. You can specify the asterisk (*) wildcard character in a
cell name.
input|output|inout
Specifies the port direction.
spice_port_name
Specifies the SPICE port name. You can specify the asterisk (*) wildcard
character in a SPICE port name.
Examples
port_dir -cell invs1 (input a; output y);
port_dir -cell invs1 (input a, b; output y);
print_ie_res
Prints out analog output resistance values for mixed-signal interface elements for which
the driver strength calculation is enabled.
Syntax
print_ie_res [-limit value]
-node hier_node_name | -cell cell_name -port port_name;
Arguments
-limit value
Specifies the upper limit for the resistance to be graphed in the output waveform
file. The value can be expressed as an integer (such as 1000), metric (such as
1k or 1M or 250m), or scientific notation (such as 1e3). The default upper limit is
1MOhms.
-node hier_node_name
Specifies the hierarchical path to the interface element. The hierarchical path
is taken from the simv.msv/interface_element.rpt file. You can specify a
wildcard character (*) in the node name.
-cell cell_name -port port_name
Specifies the cell name and port name. You must specify both names, in which
you can use wildcard characters (*).
Description
Bidirectional interface elements are common in mixed-signal designs. These interface
elements usually model I/O elements that can assume one of the following two states
during the circuit operation:
• Transmitter (driver)
• Receiver (high impedance (HiZ) input)
Two or more of such I/O elements are connected together to allow data exchange
between multiple transmitters and receivers. Usually at each given time only one of the I/O
elements is in transmission mode and the rest of the I/Os are in HiZ receiver mode. For
this data exchange to occur, it is important that all the receivers stay in HiZ mode and do
not drive the interface. Otherwise, they would interfere with the transmitter (active driver).
Note:
If you use a2d -hiz_off, the print_ie_res command is ignored for
that interface element. If you use a2d without -hiz_on and the net is not
bidirectional, the print_ie_res command is ignored for that interface element.
In a mixed-signal simulation, it is possible that one of the I/O elements is modeled in
SPICE and another in RTL. In that case, it is important that when in the receiver mode,
the SPICE I/O (blue device in Figure 33) must be in an HiZ state and does not drive,
and potentially corrupt, the value driven by the digital driver (red device in Figure 33).
Usually for that to happen, the resistance map for the bidirectional interface element (see
Figure 33) for the SPICE I/O must be adjusted such that when the SPICE I/O is in the
receiver mode, its output resistance satisfies the minimum resistance requirement for HiZ.
Use the rmap_file command to specify the resistance map file.
For example, if the output resistance of the SPICE I/O is 1.2 kOhms when in receiver
mode, the resistance map for this interface element must be modified such that the HiZ
threshold is brought down from the default 90 kOhms to, for example, 1kOhms. That way
when the SPICE I/O is in the receiver mode it exhibits an output resistance larger than the
HiZ resistance threshold and the interface element goes into HiZ (not driving the interface
net).
In this process, knowing the value of the output resistance exhibited by the SPICE I/O
element, especially during the receiver mode, is crucial to proper adjustment of the
resistance map for the interface element, as shown in Figure 34.
The capability to view the output resistance of the analog drivers at the analog/digital
boundary in the analog waveform file and decide how or whether to adjust the resistance
map for that interface element is only applicable to interface elements for which analog
drive strength calculations take place, which are:
• inout interface elements
• a2d interface elements for which drive strength calculation is enabled with the -hiz_on
option of the a2d command
Figure 34 Output Resistance of the Analog Driver is used for Drive Strength Calculation of
the Interface Element
Examples
The following command enables dumping the output resistance for interface net
top.i1.ckgen.rst:
print_ie_res -node top.i1.ckgen.rst;
The output resistances bigger than 1MOhms is capped and displayed as 1MOhms:
The following command enables dumping the output resistance for interface net at port
vbc of cell bandgap and limits the display of output resistances bigger than 10kOhms:
print_ie_res -limit 10k -cell bandgap -port vbc;
The output resistances bigger than 10kOhms is capped and displayed as 10kOhms:
r2e
Description
Controls the behavior of an r2e interface element. This command sets the threshold at
which r2e events occur and also allows defining r2e as a voltage source (default) or a
current source on the analog side of the interface.
Syntax
r2e [-type i]
[-min_delta value]
[-gain value] -node hierarchical_node_name [-rf_rate value]
[-library library_name]
[-cell cell_name -port port_name]|
[-inst inst_name -port port_name]|[-node hier_name]
Arguments
-type i
Specifies whether the r2e is modeled as a voltage source (default) or as a
current source (with -type i).When you specify -type i, the current direction
follows the PrimeSim HSPICE rule: a positive value specifies that the current
is flowing into the subcircuit and a negative value specifies that the current is
flowing out of the subcircuit. You can change the sign of the -gain argument to
change the current direction.
-min_delta value
Specifies the absolute voltage threshold value for r2e events. The value
field is specified by using engineering notation, such as 1e-09 and must be
nonnegative. When the value is set to 0, nothing is filtered at the boundary. The
default is 1% of the maximum value. For more information about this argument,
see Controlling the Number of Time Points at the Analog-Digital Boundary.
-gain value
Multiplies the analog value by the specified value. The value can be a negative
number. The default value is 1.
-node hierarchical_node_name
Specifies the hierarchical path to the r2e interface. You can specify wildcard
characters (*) in the path.
-rf_rate value
Specifies how fast the voltage changes from the present value to the target
value. The -rf_rate has a unit of second/volt, with the default set to 10ps/V.
You should avoid rapid changes in voltage values that might create unwanted
current peaks.
-library library_name
Specifies a library_name to apply global r2e threshold options. Use this option
to specify unique threshold options for all cells in the specified library. For more
information see Using Library-Based Interface Element Options.
-cell cell_name -port port_name
Specifies the cell and port names for the interface element. The cell_name
must be the same as the name used in the use_spice, use_verilog, or use_vhdl
commands. You can specify the asterisk (*) wildcard character in a cell name.
-inst inst_name -port port_name
Specifies the hierarchical path to the instance port to apply the voltage value
to the ports referring to the target instance. You can specify the asterisk (*)
wildcard character in an instance name.
-node hier_name
Specifies the hierarchical node name for the interface element. You can specify
the asterisk (*) wildcard character in a node name.
Examples
• The following example sets the r2e interface element at hierarchical path
top.i1.ictrl to be a current type:
r2e -type i -node top.i1.ictrl;
• The following example sets the -min_delta to 1mV for the r2e interface at
test.pblk.clk.
r2e -min_delta 1e-3 -node top.pblk.clk;
remove_d2a
Description
Removes a d2a (digital-to-analog) mixed-net from the digital-analog boundary and
applies a constant DC voltage on the analog side source with a value defined by the -dc
argument. The -node argument takes a mixed-net. The -node argument cannot take the
asterisk wildcard character (*), such as -node *. However, a partial node search using the
asterisk character is legal; for example, -node top.din* matches all signals with names
starting with the top.din string.
Syntax
remove_d2a [-dc dc_voltage_source_value] -node node_name;
Arguments
-dc dc_voltage_source_value
Specified the constant DC voltage to apply on the analog side.
-node hier_name
Specifies the node from which to remove the d2a element. This argument
cannot take the asterisk wildcard character (*), for example, -node *. However,
a partially-specified node search using the asterisk character is accepted, such
as -node N*.
Examples
• Remove the d2a interface element from node top.VVDH and replace it with a constant
voltage of 1.8V.
remove_d2a -dc 1.8 -node top.VVDH;
• Remove all d2a interface elements from nodes in the top module that begin with V and
replaces the interface elements with a constant voltage of 2.5V.
remove_d2a -dc 2.5 -node top.V* ;
Note:
When multiple remove_d2a commands are used for the same mixed-nets,
the last remove_d2a command takes precedence.
report_option
Description
Use the report_option command to perform the following actions:
• Change the location of the runtime msv directory
• Generate concise or detailed information about interface elements in the
interface_element.rpt file
• Control the output of hierarchy information of cells and instances in the hierarchy.bin
and hierarchy.rpt files
• Output additional information to the interface_element.rpt file for interface
elements connected to tranif-type gates
Syntax
report_option [-msv_dir vcs | spice]
[-interface_element concise | verbose]
[-through_net concise | verbose]
[-hierarchy ascii | binary | concise | suppress]
[-tranif enable | disable];
Arguments
-msv_dir vcs | spice
Specifies the destination directory type, vcs or spice. The default is vcs (see
Example 46).
If you specify spice, the runtime results are redirected to a directory as
specified by xa -o name or finesim -o name, different from the compilation
results directory (see Example 47).
By default, or if you specify -msv_dir vcs, the tool updates runtime results in
the same compilation directory as specified by vcs -o name.
-interface_element concise | verbose
Specifies whether to generate the interface_element.rpt file as a concise
report or as a report with additional information.
• The concise option has only one line for each interface element, which
might not provide enough detail (see Example 48).
• The verbose option provides additional information about the interface
elements in the inout section of the interface_element.rpt file. It also
shows which supply element it found for the values of the interface element,
such as hiv. It shows you the types of interface elements so you can copy
and paste them in your vcsAD.init file (see Example 49).
-through_net concise | verbose
Specifies whether to generate the through_net.rpt file for all the through-
nets that share the same connectivity or a maximum of ten through-nets sharing
the same connectivity. This -through_net argument controls the through-net
reporting only when the entries share the same connectivity; that is, it still shows
all the remaining unique through-nets.
requires the least disk space. Note the following conditions when using the
-hierarchy suppress option:
Note:
You must specify the -debug_access+drivers option with the vcs
command when using this argument.
hierDump Utility
You can use binary mode to improve performance by reducing compilation time and
output file size. You can still generate the hierarchy.rpt text-format file from the binary
hierarchy.bin file by using the hierDump utility included with each simulation engine:
You can use the hierDump utility to generate the hierarchy.rpt in either ascii mode
(see Example 55) or concise mode (see Example 56).
Examples
This section provides examples for the different arguments of the report_option
command and the hierDump utility.
Note:
In a mixed-signal simulation, the simv.msv directory contains the mixed-signal
report files. Some of the report files are generated during compilation and some
are generated during runtime. In cases when the runtime directory (where simv
is executed) is different from the compilation directory (where simv is located),
this command determines where the runtime files are written.
For more information about using this command, see Running Concurrent
Mixed-Signal Simulations From the Same Compiled Code.
// Top-Net
// top.s[-0]
// All Boundary Nets
// top.dut.s_0
a2d -loth 1.65v -hith 1.65v -node top.dut.s_1;
// loth and hith from node vdd value=3.3
// Top-Net
// top.s[-1]
// All Boundary Nets
// top.dut.s_1
xtop.xia1.temp4 D2D
# Only the first 10 ports forming the through-nets were reported below to
limit the file size.
# To get the full list of all connectivity, use mixed-signal command
report_option -through_net verbose;
xtop.xia1.n1 D2D
xtop.xia1.n2 D2D
xtop.xia1.n3 D2D
xtop.xia1.n4 D2D
xtop.xia1.n5 D2D
xtop.xia1.n6 D2D
xtop.xia1.n7 D2D
xtop.xia1.n8 D2D
xtop.xia1.n9 D2D
xtop.xia1.n10 D2D
xtop.xia1.temp2 D2D
xtop.xia1.temp3 D2D
xtop.xia7.t1 D2D
xtop.xia1.temp4 D2D
xtop.xia1.n1 D2D
xtop.xia1.n2 D2D
xtop.xia1.n3 D2D
xtop.xia1.n4 D2D
xtop.xia1.n5 D2D
xtop.xia1.n6 D2D
xtop.xia1.n7 D2D
xtop.xia1.n8 D2D
xtop.xia1.n9 D2D
xtop.xia1.n10 D2D
xtop.xia1.n11 D2D
xtop.xia1.n12 D2D
xtop.xia1.n13 D2D
xtop.xia1.n14 D2D
xtop.xia1.temp2 D2D
xtop.xia1.temp3 D2D
xtop.xia7.t1 D2D
where the binary file is specified with the -db option and the direct output file is specified
with the -o option.
Example 56 Concise Hierarchy Report From Binary File (hierDump -mode concise)
The following example uses the hierDump utility to generate the hierarchy.rpt file in
concise mode from the binary file:
hierDump -db simv.msv/hierarchy.bin -mode concise -o simv.msv/hierarchy.rpt
resolve_x_inst_prefix
Description
Removes the SPICE x prefixes so that HDL testbenches do not have to be changed when
multiple cell views are changed.
Syntax
resolve_x_inst_prefix -enable | -disable;
rmap_file
Specifies the resistance map file or path to the resistance map file. If this command is not
specified, the tool reads the default rmapAD.init resistance map file from the PrimeSim
XA, FineSim, and PrimeSim installation directory.
Syntax
[-file] resistance_map_file_name
[-node node_name(s)] [-nodefile node_filename]
[-inst instance_names(s)] [-inst instance_name -port port_name(s)]
[-instfile instance_filename]
[-subckt subckt_name(s)] [-subckt subckt_name -port port_name(s)]
[-subcktfile subckt_filename];
Description
The -node, -instance, and -subcircuit options are mutually exclusive, and cannot
be used with each other in the same command. However, these options can be used in
separate rmap_file commands.
When more than one rmap_file command is used, the last command overrides the
settings of the previous commands.
See Table 12 for the four rmap_file command option categories.
Table 12 rmap_file Command Option Categories
Examples
The following examples show different uses of the rmap_file command.
• Use the resis_comp.map file in the current directory as the resistance map file.
rmap_file resis_comp.map;
• Use the resis_comp.map file in the /u/tools/xa directory as the resistance map file.
rmap_file /u/tools/xa/resis.map;
• Apply the r2.map resistance map file to nodes top.i1.wen and top.i2.ren. The
default resistance map file is applied to the remaining mixed nets.
rmap_file r2.map -node top.i1.wen top.i2.ren;
• Apply the r3.map resistance map file to all mixed nets connected to the top.i1.abc
and top.i2.xyz instances. The default resistance map file is applied to the remaining
mixed nets.
rmap_file r3.map -inst top.i1.abc top.i2.xyz;
• Apply the r3.map resistance map file to mixed nets connected to port Z on the
top.i1.abc instance. The default resistance map file is applied to the remaining mixed
nets.
rmap_file r3.map -inst top.i1.abc -port Z;
• Apply the r4.map resistance map file to all mixed nets connected to the pad subcircuit.
The default resistance map file is applied to the remaining mixed nets.
rmap_file r4.map -subckt pad;
• Apply the r4.map resistance map file to the mixed net connected to the IN port on the
pad subcircuit. The default resistance map file is applied to the remaining mixed nets.
rmap_file r4.map -subckt pad -port IN;
• Apply the r6.map file to the nets connected to the top.i1,top.i2, top.i3.abc and
top.i4.xyz instances. The nets are listed in the inst1.txt file. The default resistance
map file is applied to the remaining mixed nets.
rmap_file r6.map -instfile inst1.txt;
• Apply the r7.map resistance map file to the pad, abc, and xyz subcircuits. The
subcircuits are listed in the s1.txt file. The default resistance map file is applied to the
remaining mixed nets.
rmap_file r7.map -subcktfile s1.txt;
• Apply the r8.map resistance map file to all mixed nets matched by *addr*. The default
resistance map file is applied to the remaining mixed nets.
rmap_file r8.map -node *addr*;
• The following example ignores the r1.map resistance map file because the second
rmap_file command includes the signal specified by the first command. When two
or more rmap_file commands include the same nodes, the last command is used. In
this example, the r2.map resistance map file is applied to the top.i1.addr.n1 node
and the default resistance map file is applied to the remaining mixed nets that are not
covered by these commands.
rmap_file r1.map -node top.i1.addr.n1;
rmap_file r2.map -node top.*addr*;
• The following example is invalid because the -node and -inst options cannot be used
together in the same command. You must use two or more rmap_file commands to
specify resistance mapping files for both nodes and instances.
// INVALID SPECIFICATION
rmap_file r1.map -node top.i1.addr -inst top.i1.abc;
• Apply the r2.map resistance map file to the mixed nets connected to the top.i1.abc
instance. The r1.map resistance map file is applied to the top.i1.addr.n1 node. The
default resistance map file is applied to the remaining mixed nets.
rmap_file r1.map -node top.i1.addr.n1;
rmap_file r2.map -inst top.i1.abc;
If multiple rmap_file commands target the same mixed nets and each one of the
commands uses one of the -node, -instance, or -subcircuit options, use the options
with the rmap_file command in the following order:
1. Subcircuit-based
2. Instance-based
3. Node-based
The wildcard (*) character can be used in the port, node, instance, or subcircuit name.
The period (.) character is the required hierarchical separator. The string length must not
exceed 4,096 characters.
Note:
When multiple rmap_file commands are used for the same mixed nets in the
mixed-signal simulation control file, the last command takes precedence.
rt_a2d
Description
Controls all aspects of any runtime a2d interfaces created in the VCS PrimeSim AMS tool.
If this command is not specified, all a2d events are triggered at 50% of the local VDD by
default.
Syntax
rt_a2d [- loth lo_thrsh[V | %]]
[-hith hi_thrsh[V | %]]
-node hier_name;
Arguments
-loth lo_thrsh [V | %], -hith hi_thrsh[V | %]
Specifies the low and high a2d threshold values. They can be expressed either
as absolute values (1.1V, 2.2) or as a percentage of the supply (10%, 90%).
-node hier_name
Because rt_a2d is instance based, you must specify the hierarchical path to the
instance port. For example, -node top.i1.y;.
rt_d2a
Description
Controls all aspects of any runtime d2a interfaces created in the VCS PrimeSim AMS tool.
The drive strength for rt_d2a defaults to the supply strength.
Syntax
rt_d2a [-rf_time slope_time] | [-rise_time rise_time]
[-fall_time fall_time]
[-x2v 0|1|2|3|4]
-hiv high_voltage [ V | % ]
-lov low_voltage [V | % ]
-node hier_name;
Arguments
-rf_time slope_time
Specifies the analog rise and fall times. The default time unit is in seconds, so
specify the subunit with a value such as -rf_time 1.5n, for example. With this
option, both rise and fall times are set to the same value.
-rise_time rise_time
Specifies the analog rise time. The default time unit is in seconds, so specify the
subunit with a value such as -fall_time 1n -rise_time 2n, for example.
-fall_time fall_time
Specifies the analog fall time. The default time unit is in seconds, so specify the
subunit with a value such as -fall_time 1n -rise_time 2n, for example.
-x2v 0|1|2|3|4
Sets the rule on how a logic X must be translated to a voltage level on the
analog side. Use this option to manage the translation of the X to a voltage level
with one of the following values:
• 0 to always set to the logic 0 voltage (default)
• 1 to always set to the logic 1 voltage
• 2 to set to (the logic 1 voltage + the logic 0 voltage)/2
• 3 to set to previous voltage
• 4 to set to the logic 1 voltage else; if logic = 1 set to the logic 0 voltage else
get previous voltage
-hiv high_voltage [ V | % ]
Specifies the voltage that corresponds to the logic 1 state. Use this option to
override the default value by either expressing an absolute voltage value (for
example, 1.2V or 1.2) or as a percentage of the supply voltage (for example,
90%). You must use this option combination with the -lov option. By default, the
logic 1 voltage value is the voltage of the local supply. If the tool cannot trace the
rt_d2a net to an ideal supply, it assumes the same default value as the rmap
d2a.
-lov low_voltage [V | % ]
Specifies the voltage that corresponds to the logic 0 state. Use this option to
override the default value by either expressing an absolute voltage value (for
example, 0.2V or 0.2) or as a percentage of the supply voltage (for example,
10%). You must use this option combination with the -hiv option. By default, the
logic 0 voltage value is 0V.
-node hier_name
Because rt_d2a is instance based, you must specify the hierarchical path to the
instance port. For example: -node top.i1.y;
rt_e2n
Description
Controls the behavior of a runtime e2n interface element. This command sets the
threshold at which e2n events occur and also allows e2n to convert analog voltage values
(default) or current values to digital.
Syntax
rt_e2n [-min_delta value]
[-set_type i]
-node hierarchical_node_name;
Arguments
min_delta value
Specifies the absolute voltage/current threshold value for e2n events. The value
field is specified by using engineering notation, such as 1e-09 and must be
nonnegative. When the value is set to 0, nothing is filtered at the boundary. The
default is 1% of the maximum voltage or current value. For more information
about this argument, see Controlling the Number of Time Points at the Analog-
Digital Boundary.
-set_type i
Enables the interface element to convert current to real. When the $hdl_xmr
task has a SPICE block port as the source and a nettype variable as the
destination, the tool places a rt_e2n to assign the port voltage value to the
nettype variable. This interface element can be configured through the rt_e2n
command. If you use the -set_type i option, the rt_e2n interface element no
longer converts the voltage but instead converts the current pulled by the SPICE
block port.
-node hierarchical_node_name
Specifies the hierarchical path to the e2n interface. You can specify wildcard
characters (*) in the path.
rt_e2r
Description
Controls the behavior of a runtime e2r interface element. This command sets the threshold
at which e2r events occur and also allows e2r to convert analog voltage values (default) or
current values to digital.
Syntax
rt_e2r [-min_delta value]
[-type i]
-node hierarchical_node_name;
Arguments
-min_delta value
Specifies the absolute voltage/current threshold value for e2r events. The value
field is specified by using engineering notation, such as 1e-09 and must be
nonnegative. When the value is set to 0, nothing is filtered at the boundary. The
default is 1% of the maximum voltage or current value. For more information
about this argument, see Controlling the Number of Time Points at the Analog-
Digital Boundary.
-type i
Enables the interface element to convert current to real. When the $hdl_xmr
task has a SPICE block port as the source and a real variable as the destination,
the tool places a rt_e2r to assign the port voltage value to the real variable.
This interface element can be configured through the rt_e2r command. If you
use the type i option, the rt_e2r interface element no longer converts the
voltage but instead converts the current pulled by the SPICE block port.
-node hierarchical_node_name
Specifies the hierarchical path to the e2r interface. You can specify wildcard
characters (*) in the path.
rt_n2e
Description
Controls the behavior of a runtime n2e interface element. This command sets the
threshold at which n2e events occur and allows n2e to act as a voltage source (default) or
a current source on the analog side of the interface.
Syntax
rt_n2e [-min_delta value]
[-gain value]
-node hierarchical_node_name
[-x2v value];
Arguments
-min_delta value
Specifies the absolute voltage/current threshold value for n2e events. The
value field is specified in the engineering notation, such as 1e-09 and must be
nonnegative. When the value is set to 0, nothing is filtered at the boundary. The
default is 1% of the maximum voltage or current value. For more information
about this argument, see Controlling the Number of Time Points at the Analog-
Digital Boundary.
-gain value
Multiplies the analog voltage or current by the specified value. The value can
be a negative number. The default value is 1.
-node hierarchical_node_name
Specifies the hierarchical path to the n2e interface. You can specify wildcard
characters (*) in the path.
-x2v value
Specifies the voltage source value when the interface element real value is set
to realX.
• If not specified, during DC, the interface element is 0.0V for a realX and
during transient, the interface element holds its last value.
• If specified, during DC or transient, then interface element is forced to the
specified value for a realX.
rt_r2e
Description
Controls the behavior of a runtime r2e interface element. This command sets the threshold
at which r2e events occur and also allows defining r2e as a voltage source (default) or a
current source on the analog side of the interface.
Syntax
rt_r2e [-gain value]
-node hierarchical_node_name;
Arguments
-gain value
Multiplies the analog voltage or current by the specified value. The multiplier
can be a negative number. The default value is 1.
-node hierarchical_node_name
Specifies the hierarchical path to the r2e interface. You can specify wildcard
characters (*) in the path.
shadow_file
Improves compile-time performance by hiding internal analog-side connections to the
digital side controlled by the VCS tool.
Syntax
shadow_file -type compact|concise;
Description
Improves compile-time performance for designs with large analog cones and many analog
ports.
Arguments
-type compact
Enables the analog simulator to hide the internal analog-side connections to
the digital side controlled by VCS. This limits the associated computations and
reduces runtime. VCS only sees the connection information at the interface
(d2a / a2d and so on) boundary. However, this leads to the loss of digital-to-
digital through-net tunneling through analog domain
-type concise
Enables the analog simulator to hide the internal analog-side connections if
there are no digital instances underneath. However, if it detects digital instances
under SPICE cones, it maintains all the connections between analog and
digital instances. By using this option, the digital-to-digital through-net tunneling
through the analog domain is kept.
shadow_file_dir
Sets the simv.daidir directory which contains user-modified Verilog dummy module files.
Syntax
shadow_file_dir [-path] directory_path;
Description
In Verilog-SPICE and VHDL/Verilog-SPICE flows, mixed-signal simulation automatically
generates Verilog dummy module files (called shadow modules) for all SPICE subcircuits
shadow_file_dir command
in the design. These files are placed in the simv.daidir directory or, if the VCS switch -o
unique_name is used, in the unique_name.daidir directory.
VCS then reads these files to construct the design hierarchy. If there are any problems in
the Verilog dummy modules (usually caused by differences in the number of ports or their
names between Verilog and SPICE views) VCS fails in the compilation phase.
This command allows you to work around such netlist disparity problems by following
these steps:
1. Copy the simv.daidir directory (or unique_name.daidir if VCS option -o
unique_name is used) to a new location.
2. Edit the shadow module files to resolve the Verilog/SPICE netlist disparity issues.
3. Run the compile again with the shadow_file_dir command in the mixed-signal
simulation control file pointing to the new location.
Examples
The following example shows how to have the shadow_file_dir command point to
the /u/user1/work/wrapper_dir directory, which contains the modified versions of
simv.daidir files.
shadow_file_dir /u/user1/work/wrapper_dir;
skip_xmr_name_check
Description
When enabled, the compilation skips cross-module reference (XMR) checks. The default
is -disable.
Syntax
skip_xmr_name_check -enable | -disable;
Examples
For example, a SPICE back-annotated netlist includes the net:
x1/x0/n36:1
allows the compilation to skip this error and continue to compile and simulate.
spice_top
Description
Specifies that the top-level of the design is described in SPICE. This command is required
for simulating a SPICE-top design.
Syntax
spice_top [-name top_name];
Arguments
-name top_name
Specifies the name (of your choice) to the top-level dummy module instance—
see the following example. Specifying a top_name option is useful when you
want the name of the top-level block in the design be something other than
the default SPICE-top name: snps_sptop. This top-level name appears in the
hierarchical signal names in the VCS-generated output file.
Examples
The following example specifies a SPICE-top design and names the top-level dummy
module as my_top.
spice_top -name my_top;
transient_analysis
Specifies that the tool enters interactive mode when the transient analysis simulation is
complete.
Syntax
transient_analysis -mode finish | stop;
Arguments
-mode finish
Runs transient simulation until it finishes (default)
-mode stop
Enters interactive mode and returns to the UCLI prompt at the end of transient
simulation.
Description
By default, the mixed-signal simulation finishes at the end of the transient analysis, but if
you specify stop, the simulation stops and returns to the interactive mode (UCLI prompt)
after it reaches the end of the.tran time. You need to use the UCLI quit command to
finish the simulation.
Examples
.tran is not used transient_analysis run 10ns Not used Runs for 10ns and
-mode finish; finishes.
.tran is not used transient_analysis run 10ns Not used Runs for 10ns and
-mode stop; finishes. The use of
transient_analysis
-mode stop has no
effect if .tran is not
used in SPICE netlist.
.tran is not used transient_analysis run #10 finish; Runs for 10ns and
-mode finish; finishes.
.tran is not used transient_analysis run #10 finish; Runs for 10ns and
-mode stop; finishes. The use of
transient_analysis
-mode stop has no
effect if .tran is not
used in SPICE netlist.
.tran 1ns 30ns transient_analysis run Not used Runs for 30ns and then
-mode finish; completes simulation.
.tran 1ns 30ns transient_analysis run Not used Runs for 30ns and
-mode stop; then stops at UCLI
prompt due to the
transient_analysis
-mode stop command.
.tran 1ns 25ns transient_analysis run 30ns Not used Runs for 25ns and then
-mode finish; completes simulation.
.tran 1ns 25ns transient_analysis run 30ns Not used Runs for 25ns and
-mode stop; then stops at UCLI
prompt due to the
transient_analysis
-mode stop command.
.tran 1ns 30ns transient_analysis run 25ns; Not used Runs for 25ns and then
-mode finish; run stops at UCLI prompt
due to the use of run
25ns UCLI command.
If run is issued, it
runs and finishes the
simulation.
.tran 1ns 30ns transient_analysis run 25ns Not used Runs for 25ns and then
-mode stop; stops at UCLI prompt
due to the use of run
25ns UCLI command.
If run is issued, it runs
and then returns to
UCLI prompt due to the
transient_analysis
-mode stop command.
.tran 1ns 20ns transient_analysis run #50 -mode Runs for 20ns and then
-mode finish; finish; completes simulation.
.tran 1ns 20ns transient_analysis run #50 -mode Runs for 20ns and
-mode stop; finish; then stops at UCLI
prompt due to the
transient_analysis
-mode stop command.
.tran 1ns 80ns transient_analysis run #50 -mode Runs for 50ns and then
-mode finish; finish; completes simulation.
.tran 1ns 80ns transient_analysis run #50 -mode Runs for 50ns and then
-mode stop; finish; completes simulation.
u2e
Specifies the behavior of a u2e interface element. This interface element is used to drive a
SPICE power net from a UPF supply net. Command options provide control over rise time
rate, fall time rate, and scaling factor for output voltage.
Syntax
u2e [-node hierarchical_node_name | -cell cell_name -port port_name]
[-rise_time_rate rise_time_rate]
[-fall_time_rate fall_time_rate]
[-gain value]
[-min_delta value]
Arguments
-node hierarchical_node_name
Specifies the hierarchical node name. You can specify the asterisk (*) wildcard
character in a node name.
-cell cell_name -port port_name
Specifies the cell and port names for the interface element. The cell_name
must be the same as the name used in the use_spice, use_verilog, or use_vhdl
commands. You can specify the asterisk (*) wildcard character in a cell name.
-rise_time_rate rise_time_rate
Specifies how fast the voltage changes from the present value to the higher
target value. This argument has a unit of seconds/volt, with the default set to
10ps/V. You should avoid rapid changes in voltage values that might create
unwanted current peaks.
-fall_time_rate fall_time_rate
Specifies how fast the voltage changes from the present value to the lower
target value. This argument has a unit of seconds/volt, with the default set to
10ps/V. You should avoid rapid changes in voltage values that might create
unwanted current peaks.
-gain value
Multiplies the analog value by the specified value. The value can be a negative
number. The default value is 1.
-min_delta value
Specifies the absolute voltage threshold value for u2e events. The value
field is specified by using engineering notation, such as 1e-09 and must be
nonnegative. When the value is set to 0, nothing is filtered at the boundary. The
default is 1% of the maximum value. For more information about this argument,
see Controlling the Number of Time Points at the Analog-Digital Boundary.
Description
The u2e interface element is used to convert a UPF supply net value to a SPICE power
output signal. Use the u2e command to configure and change the default behavior for the
u2e interface element placed at the UPF-to-SPICE interface. Use options to the command
to add rise and fall times to the supply voltage transitions from UPF.
In the following figure, a u2e interface element converts the UPF supply net value for VDD
to a SPICE power input signal.
UPF driver
Examples
The following examples use command options to control the behavior of the u2e interface
element:
• Specify a 1us rise time rate and 1us fall time rate. By default, the rise and fall transition
times for the analog supply voltage would equal the time resolution for the analog
engine:
u2e -node top.i1.vdd -rise_time_rate 1u -fall_time_rate 1u;
• Specify a gain of 2:
u2e -node top.i1.vdd -gain 2
In this example, the nets Top.I1.I3.vdd and Top.I1.I5.vdd are driven by the UPF
supply net VDDH, so you set the following commands:
u2e -node Top.I1.I3.vdd -rise_time_rate 1.0u -fall_time_rate 1.0u
u2e -node Top.I1.I5.vdd -rise_time_rate 1.5u -fall_time_rate 1.5u
The output of the u2e interface elements placed by the tool results in the following:
udn_bidir
Description
Controls the behavior of an udn_bidir interface element. This command sets a Verilog-A
module for a specified user-defined nettype on a specific node.
Syntax
udn_bidir
[-type value]
[-min_delta value]
[-max_delta value]
[-module value]
[-library library_name]
[-cell cell_name -port port_name]|
[-inst inst_name -port port_name]|[-node hierarchical_node_name]
Arguments
-type value
Specifies the user-defined nettype for the interface element.
-min_delta value
Specifies the absolute current threshold value for bidir events. The value
field is specified by using engineering notation, such as 1e-09 and must be
nonnegative. When the value is set to 0, nothing is filtered at the boundary. The
default is 1% of possible maximum value of bidir, that stabilizes after several
bidir conversions. For more information about this argument, see Controlling the
Number of Time Points at the Analog-Digital Boundary.
-max_delta value
Sets the voltage difference between two bidir events to be less than or equal
to the specified value, which must be greater than 0. The -max_delta option
does not disable the -min_delta option. Therefore it is recommended to use
both the arguments together for precise control over bidir filtering. For example,
if you specify only -max_delta, the default -min_delta (1% of possible
maximum value of bidir) is still applied. And if -max_delta is less than the
default -min_delta, then the -min_delta takes precedence, and -max_delta
is ignored. Note that if you specify a very small -max_delta value it can slow
down a simulation. For more information about this argument, see Controlling
the Number of Time Points at the Analog-Digital Boundary.
-module value
Specifies the module name of the Verilog-A model.
-library library_name
Specifies a library_name to apply global udn_bidir threshold options. Use
this option to specify unique threshold options for all cells in the library. For more
information, see Using Library-Based Interface Element Options.
udn_e2n
Description
Controls the behavior of a udn_e2n interface element. This command sets a Verilog-A
module for a specified user-defined nettype on a specific node.
Syntax
udn_e2n
[-type value]
[-min_delta value]
[-max_delta value]
[-module value]
[-library library_name]
[-cell cell_name -port port_name]|
[-inst inst_name -port port_name]|[-node hierarchical_node_name]
Arguments
-type value
Specifies the user-defined nettype for the interface element.
-min_delta value
Specifies the absolute current threshold value for e2n events. The value
field is specified by using engineering notation, such as 1e-09 and must be
nonnegative. When the value is set to 0, nothing is filtered at the boundary. The
default is 1% of possible maximum value of e2n, that stabilizes after several
e2n conversions. For more information about this argument, see Controlling the
Number of Time Points at the Analog-Digital Boundary.
-max_delta value
Sets the voltage difference between two e2n events to be less than or equal
to the specified value, which must be greater than 0. The -max_delta option
does not disable the -min_delta option. Therefore it is recommended to use
both the arguments together for precise control over e2n filtering. For example,
if you specify only -max_delta, the default -min_delta (1% of possible
maximum value of e2n) is still applied. And if -max_delta is less than the
default -min_delta, then the -min_delta takes precedence, and -max_delta
is ignored. Note that if you specify a very small -max_delta value it can slow
down a simulation. For more information about this argument, see Controlling
the Number of Time Points at the Analog-Digital Boundary.
-module value
Specifies the module name of the Verilog-A model.
-library library_name
Specifies a library_name to apply global udn_e2n threshold options. Use this
option to specify unique threshold options for all cells in the specified library. For
more information, see Using Library-Based Interface Element Options.
-cell cell_name -port port_name
Specifies the cell and port names for the interface element. The cell_name
must be the same as the name used in the use_spice, use_verilog, or use_vhdl
commands. You can specify the asterisk (*) wildcard character in a cell name.
-inst inst_name -port port_name
Specifies the hierarchical path to the instance port to apply the voltage value
to the ports referring to the target instance. You can specify the asterisk (*)
wildcard character in an instance name.
-node hierarchical_node_name
Specifies the hierarchical node name. You can specify the asterisk (*) wildcard
character in a node name.
udn_n2e
Description
Controls the behavior of an udn_n2e interface element. This command sets a Verilog-A
module for a specified user-defined nettype on a specific node.
Syntax
udn_n2e
[-type value]
[-min_delta value]
[-module value]
[-library library_name]
[-cell cell_name -port port_name]|
[-inst inst_name -port port_name]|[-node hierarchical_node_name]
Arguments
-type value
Specifies the user-defined nettype for the interface element.
-min_delta value
Specifies the absolute current threshold value for n2e events. The value
field is specified by using engineering notation, such as 1e-09 and must be
nonnegative. When the value is set to 0, nothing is filtered at the boundary. The
default is 1% of possible maximum value of n2e, that stabilizes after several
n2e conversions. For more information about this argument, see Controlling the
Number of Time Points at the Analog-Digital Boundary.
-module value
Specifies the module name of the Verilog-A model.
-library library_name
Specifies a library_name to apply global udn_n2e threshold options. Use this
option to specify unique threshold options for all cells in the library. For more
information, see Using Library-Based Interface Element Options.
-cell cell_name -port port_name
Specify the cell and port names for the interface element. The cell_name must
be the same as the name used in the use_spice, use_verilog, or use_vhdl
commands. You can specify the asterisk (*) wildcard character in a cell name.
-inst inst_name -port port_name
Specifies the hierarchical path to the instance port to apply the voltage value
to the ports referring to the target instance. You can specify the asterisk (*)
wildcard character in an instance name.
-node hierarchical_node_name
Specifies the hierarchical node name for the interface element. You can specify
the asterisk (*) wildcard character in a node name.
upf_port_connect
Description
When used in an analog-top configuration where a digital block with power and ground
network defined by UPF must be connected to an external SPICE block (the SPICE
supplies, either local or global nets, must be connected to the power and ground network
defined in the UPF file), the upf_port_connect command:
• Connects the supplies generated from SPICE to the UPF-created supply ports by
placing e2u interface elements.
• Connects the supplies generated from UPF to an external SPICE block by placing u2e
interface elements.
Syntax
upf_port_connect -cell cell_name
([-inst inst_name] upf_port_name => hier_node_name, … )
Arguments
-cell cell_name
Specifies the digital cell name which must be the same as the name used in the
use_verilog or use_vhdl commands.
-inst inst_name
Specifies the full hierarchical instance path. If this option is used, only the
specified instance is used for the port connection. The full hierarchical path to
the instance is required.
upf_port_name
Specifies the UPF-created supply port.
hier_node_name, …
Specifies the name of SPICE net that is connected to the UPF-created supply
port.
Examples
Consider the scenario represented in Figure 37 where:
• vdd1 and vdd2 are SPICE nets
• VDDL and VDDH are UPF supply ports
The following command specifies the connections of vdd1 to VDDL and vdd2 to VDDH:
upf_port_connect -cell TopDig (VDDL => vdd1, VDDH => vdd2)
Assuming that vdd1 and vdd2 are driving VDDL and VDDH, the tool places two e2u
interface elements as shown in Figure 38. Moreover, if this command is used in
combination with the VCS option -power ams_tunnel_thru_upf, the supplies of SPICE
blocks X1.I1.I3 and X1.I1.I5 are directly connected to vdd1 through tunneling as shown in
Figure 38.
upgrade_to_error
Changes a warning message to an error message.
Syntax
upgrade_to_error -id message_ID [message_ID];
Description
You can upgrade warning messages to error messages for the [MSV-IE-OPTTNF], [MSV-
RTIE-OPT-TNF] and [MSV-MV-PND-POD] message identifiers.
Examples
The following example has this entry in the vcsAD.init file.
d2a -hiv 1.8 -lov 0.0 -node top.fail;
You can upgrade this type of warning message to an error message with:
upgrade_to_error -id MSV-IE-OPT-TNF
use_spice
Uses the SPICE view of a multi-view cell for a child cell under a Verilog or VHDL parent.
Syntax
use_spice -cell subcircuit_name
[-icmodule SPICE_module_label]
[-inst instance_name ]
[port_map (port_map_list)]
[port_index_order (port_name_list)];
Arguments
-cell subcircuit_name
Specifies the cell to replace with a SPICE view. The substitution is done on a
cell basis for all instances of the cell. The asterisk (*) wildcard character can be
used as part of the subcircuit name.
-icmodule SPICE_module_label
Specifies the name of the SPICE .module to replace with a SPICE view. The
SPICE_module_label corresponds to the label in the .module line.
-inst instance_name
Specifies the instance to replace with the SPICE view. The Full Hierarchical
Path to the instance is required. If you use the VCS -adopt wildcard wildcard
command-line switch, the instance name can also contain a wildcard (*)
character. Note that using the VCS -adopt wildcard switch and specifying a
wildcard (*) character in the instance name increases the compilation time by
• Forcing the tool to elaborate the design one time so all the hierarchical
instance names in the design are known, then
• Applying the use_spice command with the wildcard (*) character in the
instance name and elaborating the design for a second time
port_map (port_map_list)
Specifies the mapping between Verilog port names and SPICE port names as
follows:
• Map the Verilog/VHDL port name to SPICE. Use this option when the ports
in the SPICE view of a multi-view cell have a different name compared to
their Verilog or VHDL view. The port_map_list can have one or more of the
following mappings, each separated by a comma (,):
verilog/vhdl_port_name => spice_port_name
• Map the Verilog/VHDL port name to SPICE using this alternate syntax for
single dimensional buses. The port name could also be a bus identifier.
verilog/vhdl_port_name => spice_port_name[range]
If you do not specify a range, the members with the same index number are
mapped together:
verilog/vhdl_port_name[0] => spice_port_name[0]
verilog/vhdl_port_name[1] => spice_port_name[1]
...
But if you specify the SPICE bus range, the leftmost member of the Verilog/
VHDL bus is mapped to the leftmost member of the SPICE port, and so on.
You can specify the range for SPICE bus to, for example, flip the bus order in
SPICE so that SPICE MSB maps to Verilog/VHDL LSB and vice versa.
• Create an open connection for a Verilog/VHDL port without a corresponding
SPICE port. The top-level Verilog/VHDL net connected to that port remain
open/dangling.
verilog/vhdl_port_name => snps_open
• Map all Verilog/VHDL ports (or all remaining Verilog/VHDL ports that have
not been mapped yet) to SPICE ports by position. The first port declared in
Verilog/VHDL is mapped to the first port declared in the SPICE subcircuit,
and so on.
* => snps_by_position
• Map all Verilog/VHDL ports (or all remaining Verilog/VHDL ports that have
not been mapped yet) to SPICE ports by name. Ports that have the same
name in SPICE and Verilog/VHDL are mapped together.
*=> snps_by_name
• Create an open connection for all Verilog/VHDL ports (or all remaining
unmapped Verilog/VHDL ports). The top-level Verilog/VHDL nets connecting
to those Verilog ports stay open/dangling when the Verilog/VHDL view of the
cell is substituted with the SPICE view.
* => snps_open
port_index_order (port_name_list)
Set the order of the port indexes to make them continuous. When the indexes of
the SPICE ports of a single-view cell are not continuous (they are intermingled)
you can use this argument to change the ordering.
Note:
This argument only works with a single SPICE view of a cell.
Description
By default, mixed-signal simulation chooses the view for the child cell that is the same as
the parent cell view. For example, if the parent of a multi-view cell uses a Verilog view, the
same Verilog view is picked for the child cell by default. Use this command to override the
default view selection and explicitly select the SPICE view for a given cell or instance of a
cell.
Note:
If the use_spice command targets a cell under a VHDL parent, the Verilog view
of the SPICE must also be available, otherwise, the use_spice command does
not take effect. The Verilog view of the SPICE can be an empty module (no
content) as long as it contains port definitions. Such a Verilog view for SPICE
can be generated by the spicean utility.
Also, note that an instance-based use_spice command does work for an
instance inside a generate/endgenerate block and instance array. For
example:
genvar i;
generate
for(i=0; i<=3; i=i+1) begin : genb
inv1 nd (sb[i], s[i]);
end
endgenerate
The following command targets only one instance to SPICE, the third one with
the 2 field.
use_spice -cell inv1 -inst top.genb[2].nd;
Examples
The following examples illustrate different uses of the use_spice command:
• Use the SPICE view for all instances of the memory cell. This command can be used
when both the memory Verilog module and the memory SPICE subcircuit are available.
use_spice -cell memory;
• Use the SPICE view for all instances of core which are contained in the .module cpu
declaration.
use_spice -cell core -icmodule cpu;
• Use the SPICE view for the inv2 cell only for instances top.i1.u1 and
top.i2.u5.inv5.
use_spice -cell inv2 -inst top.i1.u1 top.i2.u5.inv5 ;
• Replace the Verilog view of a multi-view cell with its SPICE counterpart and map the
Verilog ports to SPICE ports when they have different names.
module inv1 (y, a);
...
.subckt inv1 i o
...
use_spice -cell inv1 port_map ( y => o, a => i );
• Map Verilog ports to SPICE ports when a few of the ports have different names in
Verilog and SPICE but the rest have identical names in both views and can be mapped
by name.
module inv1 (z, n, a, b, c);
...
.subckt inv1 y m a b c
...
use_spice -cell inv1 port_map ( z => y, n =>m, * => snps_by_name);
• Map Verilog ports to SPICE ports when some Verilog ports have no corresponding port
in SPICE, some ports have different names in Verilog and SPICE, and the remaining
ports have identical names.
module inv1 (z, n, a, b, c);
...
.subckt inv1 y a b c
...
• Map a Verilog bus to its SPICE counterpart when there is a mismatch between the
Verilog and SPICE bus port names:
module data_path (data, ...);
input [2:0] data;
...
Another way to map the bus ports is to use the bus identifiers to map the ports:
use_spice -cell data_path port_map (data => d, *=> snps_by_name);
The leftmost member of data is mapped to the leftmost member of d and so on:
data[2] => d[2]
data[1] => d[1]
data[0] => d[0]
The wildcard (*) character in the instance name is only supported if the -adopt
wildcard switch is added to the VCS command line as follows:
vcs -ad -adopt wildcard ...
Note that all ports must be mapped. That is why the wildcard (*) character in the *=>
snps_by_name port map command is required to map any port that is not explicitly
mapped.
Note that the instance name (under the SPICE view) begins with the letter X. To ensure
that you are using the correct hierarchical path to the instance, use the hierarchical
names listed in the interface_element.rpt file under the simv.msv directory as a
guide.
• Replace a Verilog module with a SPICE subcircuit of a different name:
use_spice -cell Verilog_module_name:SPICE_subcircuit_name [-inst
instance_name ] [port_map (port_map_list) ] ;
You can apply the use_spice command in the same way as when the names of the
two views are the same.
• Replace the Verilog module CPU with a SPICE subcircuit SPICE_CPU.
use_spice -cell CPU:SPICE_CPU;
• Replace the module CPU with a SPICE subcircuit SPICE_CPU in instance blk1, but
replaces module CPU with SPICE subcircuit SPICE_CPU2 in instance blk2.
use_spice -cell CPU:SPICE_CPU -inst top.dut.blk1;
use_spice -cell CPU:SPICE_CPU2 -inst top.dut.blk2;
• Use the port_index_order argument to fix the order of the indexes of the SPICE
ports for a single-view cell.
.subckt addr4 s_3 a_2 a_1 a_0
+b_3 b_2 b_1 b_0 cin
+a_3 s_2 s_1 s_0 cout
...
These ports are discontinuous; the ports s and a are intermingled such that s_3
appears in place of a_3.
use_spice -cell addr4 port_index_order (*=>same, a=>dec, s=>inc);
In this example, the port_index_order argument specifies the order of the indexes
of the ports of addr4 as follows: from left to right, port a has the indexes arranged in
decreasing order (a_3 a_2 a_1 a_0). Port s appears in the increasing order (s_0 s_1
s_2 s_3) while the remaining ports follow the original order.
use_verilog
Use the use_verilog command to use the Verilog view of a cell with multiple views for a
use_verilog command
Syntax
use_verilog| use_vcs
-cell module_name:logical_library.module_name |
-module module_name:logical_library.module_name
[-icmodule SPICE_module_label]
[-inst instance_name]
[-exclude instance_name]
[port_map (port_map_list)];
Arguments
-cell module_name:logical_library.module_name
Replaces a SPICE subcircuit with a Verilog module. The module name cannot
contain an asterisk wildcard (*) character. You can also select a module of a
specific library. The -cell and -module options perform the same function.
-module module_name:logical_library.module_name
Replaces a SPICE subcircuit with a Verilog module. The module name cannot
contain an asterisk wildcard (*) character. You can also select a module of a
specific library. The -cell and -module options perform the same function.
-icmodule SPICE_module_label
Specifies the name of the SPICE .module to replace with a SPICE view. The
SPICE_module_label corresponds to the label in the .module line.
-inst instance_name
Instantiates only the specified Verilog instances under SPICE. You must specify
the Full Hierarchical Path to the instance. If the instance name contains special
characters, you must escape the characters by inserting a backslash character
(\) and terminating the escaped string with a space as follows:
// WRONG!
use_verilog -cell monitor -inst i1<1>.i2;
// Correct
use_verilog -cell monitor -inst \i1<1> .i2;
-exclude instance_name
Excludes from partition the specified Verilog instances under SPICE. You must
specify the Full Hierarchical Path to the instance. If the instance name contains
special characters, you must escape the characters by inserting a backslash
character (\) and terminating the escaped string with a space as shown in the
-inst argument.
port_map (port_map_list)
Specifies the mapping between port names in SPICE and Verilog as follows:
• Map the SPICE name to the Verilog name. Use this option when the ports
in the Verilog view of a multi-view cell have a different name compared to
their SPICE view. The port_map_list can have one or more of the following
mappings, each separated by a comma (,):
spice_port_name => verilog_port_name
• Map all SPICE ports (or all remaining SPICE ports that have not been
mapped yet) to Verilog ports by position. The first port declared in the subckt
definition is mapped to the first port declared in Verilog module definition, and
so on.
* => snps_by_position
• Map all SPICE ports (or all remaining SPICE ports that have not been
mapped yet) to Verilog ports by name. Ports that have the same name in
SPICE and Verilog are mapped together.
*=> snps_by_name
• Disconnect all SPICE ports (or all remaining SPICE ports that have not been
mapped yet). All top-level SPICE nets that connect to those SPICE ports
stay open and dangling when the SPICE view of the cell is replaced with the
Verilog view.
* => snps_open
Description
This command explicitly selects the Verilog view for the specified cell or instance of a cell.
By default, mixed-signal simulation chooses the view for the child cell that is the same as
the parent cell view. For example, if the parent of a multi-view cell uses a SPICE view, the
same SPICE view is picked for the child cell by default.
Support for Wildcard Character and the -exclude Option
The -inst option in the use_verilog command specifies the instances to use the Verilog
view. The wildcard (*) character is supported only in the use_spice command and not in
the use_verilog command.
The -exclude option is supported in the use_verilog command, which can be used
to provide the instances that must not be partitioned. Also, the wildcard (*) character is
supported in the hierarchical path of the -inst and -exclude options in the use_verilog
mixed-signal control command. This feature is useful when there are large number of
instances in the design.
The syntax of the -exclude option with the wildcard character is as follows:
use_verilog -module inverter -inst top.*.* -exclude top.a0.*;
Note:
The wildcard (*) character in the instance name is only supported if the -adopt
wildcard option is added to the VCS command line as follows:
% vcs -adopt wildcard ...
For example:
% vcs -sverilog example.v -ad example.init -adopt wildcard -full64
Note:
Using the -adopt wildcard option and the wildcard (*) character in the
use_verilog command increases (sometimes almost doubles) the compilation
time.
Examples
The following example illustrates usage of -exclude option in the use_verilog
command.
* example.spi
subckt inv i zn
xi0 i zn inverter
.ends
.subckt inverter in out
mn1 out in gnd gnd n w=1u l=1u
mp1 out in vdd vdd p w=4u l=1u
,ends
// vcsAD.init
use_veriloga
Use the use_veriloga command to explicitly instruct the tool to use the Verilog-A view of
use_verilog command
Arguments
-cell module_name
Specifies the cell to replace with a Verilog-A view. The substitution is done on a
cell basis for all instances of the cell.
-module module_name
Specifies the cell to replace with a Verilog-A view. The substitution is done on a
cell basis for all instances of the cell.
-inst instance_name
If you use this argument, only the specified Verilog-A instances are instantiated
under SPICE. You must specify the Full Hierarchical Path to the instance.
port_map (port_map_list)
Specifies the mapping between Verilog port names and Verilog-A port names as
follows:
• Map the Verilog/VHDL port name to Verilog-A. Use this option when the ports
in the Verilog-A view of a multi-view cell have a different name compared to
their Verilog or VHDL view. The port_map_list can have one or more of the
following mappings, each separated by a comma (,):
verilog/vhdl_port_name => veriloga_port_name
• Map the Verilog/VHDL port name to Verilog-A using this alternate syntax for
single dimensional buses. The port name could also be a bus identifier.
If you do not specify a range, the members with the same index number are
mapped together:
verilog/vhdl_port_name[0] => veriloga_port_name[0]
verilog/vhdl_port_name[1] => veriloga_port_name[1]
...
But if you specify the Verilog-A bus range, the leftmost member of the
Verilog/VHDL bus is mapped to the leftmost member of the Verilog-A port,
and so on. You can specify the range for Verilog-A bus to, for example, flip
the bus order in Verilog-A so that Verilog-A MSB maps to Verilog/VHDL LSB
and vice versa.
• Create an open connection for a Verilog/VHDL port without a corresponding
Verilog-A port. The top-level Verilog/VHDL net connected to that port remain
open/dangling.
verilog/vhdl_port_name => snps_open
• Map all Verilog/VHDL ports (or all remaining Verilog/VHDL ports that have
not been mapped yet) to Verilog-A ports by position. The first port declared in
Verilog/VHDL is mapped to the first port declared in the Verilog-A subcircuit,
and so on.
* => snps_by_position
• Map all Verilog/VHDL ports (or all remaining Verilog/VHDL ports that have
not been mapped yet) to Verilog-A ports by name. Ports that have the same
name in Verilog-A and Verilog/VHDL are mapped together.
*=> snps_by_name
• Create an open connection for all Verilog/VHDL ports (or all remaining
unmapped Verilog/VHDL ports). The top-level Verilog/VHDL nets connecting
to those Verilog ports stay open/dangling when the Verilog/VHDL view of the
cell is substituted with the Verilog-A view.
* => snps_open
Description
By default, mixed-signal simulation chooses the view for the child cell that is the same as
the parent cell view. For example, if the parent of a multi-view cell uses a Verilog view, the
same Verilog view is picked for the child cell by default. Use this command to override the
default behavior and explicitly select the Verilog-A view for the given cell or instance of a
cell.
Note:
Also, note that an instance-based use_veriloga command does work for
an instance inside a generate/endgenerate block and instance array. For
example:
genvar j;
generate
for(j=0; j<=3; j=j+1) begin : genva
invva nc (sc[j], sb[j]);
end
endgenerate
The following command targets only one instance to Verilog-A, the third one
with the 2 field.
use_veriloga -cell invva -inst top.genva[2].nc;
Examples
The following examples illustrate different uses of the use_veriloga command:
• Use the Verilog-A view for all instances of the memory cell. This command can be
used when both the memory Verilog module and the memory Verilog-A subcircuit are
available.
use_veriloga -cell memory;
• Use the Verilog-A view for the inv2 cell only for instances top.i1.u1 and
top.i2.u5.inv5.
use_veriloga -cell inv2 -inst top.i1.u1 top.i2.u5.inv5 ;
• Replace the Verilog view of a multi-view cell with its Verilog-A counterpart and map the
Verilog ports to Verilog-A ports when they have different names.
module inv1 (y, a);
...
.subckt inv1 i o
...
use_veriloga -cell inv1 port_map ( y => o, a => i );
• Map Verilog ports to Verilog-A ports when a few of the ports have different names
in Verilog and Verilog-A but the rest have identical names in both views and can be
mapped by name.
module inv1 (z, n, a, b, c);
...
.subckt inv1 y m a b c
...
use_veriloga -cell inv1 port_map ( z => y, n =>m, * => snps_by_name);
• Map Verilog ports to Verilog-A ports when some Verilog ports have no corresponding
port in Verilog-A, some ports have different names in Verilog and Verilog-A, and the
remaining ports have identical names.
module inv1 (z, n, a, b, c);
...
.subckt inv1 y a b c
...
use_veriloga -cell inv1 port_map ( z => y, n =>snps_open, * =>
snps_by_name);
• Map a Verilog bus to its Verilog-A counterpart when there is a mismatch between the
Verilog and Verilog-A bus port names:
module data_path (data, ...);
input [2:0] data;
...
Another way to map the bus ports is to use the bus identifiers to map the ports:
use_veriloga -cell data_path port_map (data => d, *=> snps_by_name);
The leftmost member of data is mapped to the leftmost member of d and so on:
data[2] => d[2]
data[1] => d[1]
data[0] => d[0]
You can apply the use_veriloga command in the same way as when the names of the
two views are the same.
• Replace the Verilog module CPU with a Verilog-A subcircuit VA_CPU.
use_veriloga -cell CPU:VA_CPU;
• Replace the module CPU with a Verilog-A subcircuit VA_CPU in instance blk1, but
replaces module CPU with Verilog-A subcircuit VA_CPU2 in instance blk2.
use_veriloga -cell CPU:VA_CPU -inst top.dut.blk1;
use_veriloga -cell CPU:VA_CPU2 -inst top.dut.blk2;
use_vhdl
Description
The use_vhdl command selects the VHDL view of a multi-view cell instantiated in a
partitioning
set rmap commands
SPICE block.
Note:
This command applies only to VHDL/Verilog-SPICE flow.
Syntax
use_vhdl -cell cell_name
[-inst instance_name]
[port_map (port_map_list)];
Where cell_name::=
entity_name |
entity_name:library_name.entity_name |
entity_name:entity_name(architecture_name) |
entity_name:library_name.entity_name(architecture_name)|
entity_name:configuration_name |
entity_name:library_name.configuration_name
Arguments
-cell cell_name
Replaces a SPICE subcircuit with a VHDL cell. The entity name cannot contain
a wildcard (*) character. You can also select a cell of a:
• Specific library
• Specific architecture
• VHDL architecture from a specific library
• VHDL configuration name
• VHDL configuration from a specific library
-inst instance_name
If this option is used, only the specified instances are instantiated in VHDL. The
Full Hierarchical Path to the instance is required.
If the instance name contains special characters, you must escape the
characters by inserting a backslash character (\) and terminating the escaped
string with a space as follows:
// WRONG!
use_vhdl -module monitor -inst i1<1>.i2;
// Correct
use_vhdl -module monitor -inst \i1<1> .i2;
port_map (port_map_list)
Specifies the mapping between port names in SPICE and VHDL as follows:
• Map the SPICE port name to the VHDL port name. Use this option when the
ports in the VHDL view of a multi-view cell have a different name compared
to their SPICE view. The port_map_list can have one or more of the following
mappings, each separated by a comma (,):
spice_port_name => vhdl_port_name
• Map all SPICE ports (or all remaining SPICE ports that have not been
mapped yet) to VHDL ports by position. The first port declared in the subckt
definition is mapped to the first port declared in VHDL module definition, and
so on.
* => snps_by_position
• Map all SPICE ports (or all remaining SPICE ports that have not been
mapped yet) to VHDL ports by name. Ports that have the same name in
SPICE and VHDL are mapped together.
*=> snps_by_name
• Disconnects all SPICE ports (or all remaining SPICE ports that have not
been mapped yet). All top-level SPICE nets that connect to those SPICE
ports stay open and dangling when the SPICE view of the cell is replaced
with the VHDL view.
* => snps_open
Examples
• Use the VHDL view for inv cell instances inv2, xi1.xu1, and xi2.xu5.xinv5.
use_vhdl -cell inv2 -inst xi1.xu1 xi2.xu5.xinv5;
• Map SPICE ports to VHDL ports when a few of the ports have different names in VHDL
and SPICE but the rest have identical names in both views and can be mapped by
name. Note that all ports must be mapped, which is why the wildcard (*) character in
*=> snps_by_name is required to map any port that is not explicitly mapped.
.subckt inv1 y m a b c
...
• Map SPICE ports to VHDL ports when some SPICE ports have no corresponding port
in VHDL, a few of the ports have different names in VHDL and SPICE, and the rest
have identical names:
.subckt inv1 y n a b c
...
• Select the library to use when multiples libraries exist. For example, if you have
compiled two different VHDL descriptions for the same invvhd cell in two different
libraries vhdl_lib and vhdl_lib2:
vhdlan -work vhdl_lib -nc vhdl/inv.vhd -full64
vhdlan -work vhdl_lib2 -nc vhdl/inv2.vhd -full64
• Select the configuration to simulate if you have multiple configurations in your VHDL
description. The following example selects the cg1 configuration of the entity cell1:
configuration cfg1 of cell1 is
for structural
end for;
end configuration cfg1;
• Select a configuration if you have both multiple libraries and multiple configurations:
use_vhdl -cell invvhd:vhdl_lib2.cfg2;
B
Using Hierarchical Aliases for Interface Elements
in Mixed-Signal Commands
This appendix explains how to use hierarchical aliases for interface elements.
After the tool compiles a mixed-signal design, the tool lists all the interface elements with
their hierarchical locations to the simv.msv/interface_element.rpt report file. By
default, the hierarchical names listed in the interface_element.rpt file are the names
that must be used in any mixed-signal command. Starting with the N-2017.12 release,
in PrimeSim XA and FineSim mixed-signal simulations, you can specify the hierarchical
name specified in the interface_element.rpt file or any other hierarchical alias of that
net in a mixed-signal command.
For example, the mixed-signal design shown in Figure 39 contains the following d2a
interface element listed in the interface_element.rpt file.
d2a -hiv 1.2 -lov 0 -node top.ia1.ib1.ic1.id1.in;
Figure 39 Interface Element at the Instantiation of an Analog Block Under a Digital Parent
Starting with the N-2017.12 release of the PrimeSim XA and FineSim tools, you can
specify nodes by using any hierarchical alias for the net. For example, any of the following
d2a specifications refer to the same net and result in the same d2a interface element:
d2a -hiv 1.0 -lov 0.2 -node top.rst;
d2a -hiv 1.0 -lov 0.2 -node top.ia1.in;
d2a -hiv 1.0 -lov 0.2 -node top.ia1.ib1.in;
d2a -hiv 1.0 -lov 0.2 -node top.ia1.ib1.ic1.in;
d2a -hiv 1.0 -lov 0.2 -node top.ia1.ib1.ic1.id1.in;
d2a -hiv 1.0 -lov 0.2 -node top.ia3.ib3.in;
d2a -hiv 1.0 -lov 0.2 -node top.ia5.ib5.in;
Limitation
You can use the hierarchical alias of an interface element as long as that net name is
directly connected to the interface element through SPICE nets or Verilog wires, and no
net splitting is done by the simulator. Nets are split when the connectivity is made through
SystemVerilog logic, reg, VHDL signal, or due to UPF level shifters/isolation cells, or
SDF back-annotation of a digital net, and so on.
Note:
The same concept and support for all aliases of the interface element in
mixed-signal commands apply if the white blocks in Figure 39 represent
analog and the yellow block represents digital. Since the tool always puts the
interface element in the analog domain, the location of the interface element is
top.ia1.ib1.ic1.in.
Another example for mixed-signal design hierarchy is shown in Figure 40, which is similar
to Figure 39 but uses three analog cell views used instead of one. The in ports of the
three analog blocks are connected to each other within the parent digital block. As a result,
all three analog ports are shorted together by the tool and connect to the same interface
element. In this case, the selects picks the port location with the shortest hierarchical path,
top.ia5.ib5.in, when assigning the node for the interface element. As in Figure 39, you
can use top.ia5.ib5.in, top.rst, top.ia1.in, or any other hierarchical alias for the
net when creating the interface element by using the vcsAD.init mixed-signal simulation
control file.
Figure 40 Interface Element at the Instantiation of Three Analog Blocks, all Connected to the
Same Net in the Digital Parent
In both Figure 39 and Figure 40, any hierarchical alias can be used instead of
top.ia5.ib5.in to place the interface element, assuming that the connectivity between
those aliases and the interface net top.ia5.ib5.in is through Verilog wires or SPICE
nets, and those connections are not split because of SDF back-annotation, low power
isolation/level shifter cells, or the use of SystemVerilog logic, reg, or VHDL signal nets
that automatically split a net.
Note:
This feature is currently available only in the PrimeSim XA simulation engine
and is not supported in the FineSim or PrimeSim simulation engines.
C
Mixed-Signal Simulation for Three-Dimensional
Integrated Circuits (3DIC)
This appendix describes how the 3DIC methodology allows the integration of different
chips in a mixed-signal flow with different technologies, in the same netlist, without
modifying the netlist, models, or parameters of the individual chips.
top
x2 x4
mem1::dram mult
x1 x3
cpu::core mem2::dram
You can select a SPICE subcircuit with a 3DIC scope using the use_spice command.
To use this command to instantiate a 3DIC SPICE cell, you must specify the cell and
icmodule. For example:
use_spice -cell core -icmodule cpu -inst top.x1;
You can replace any cell with a SPICE view with a 3DIC scope:
use_spice -cell and_gt -icmodule cpu -inst top.x4.x5.x1;
use_spice -cell dram -icmodule mem1 -inst top.x2;
use_spice -cell dram -icmodule mem2 -inst top.x3;
top
x2 x4
x4
addr
cpu2 mult
x1 x3
cpu1 mem::dram
You can select a Verilog or VHDL module with a 3DIC scope using the use_verilog or
use_vhdl command. To use this command to instantiate a 3DIC SPICE cell, you must
specify the cell and icmodule. For example:
use_vhdl -cell mult;
use_verilog -cell cpu1;
use_verilog -cell addr:VLOG.addr -icmodule cpu2;
//use_vhdl -cell addr:VHDL.addr -icmodule cpu2;
In order to define the direction of the ports of a SPICE subcircuit instantiated in Verilog, a
Verilog module view of that cell needs to be provided.
Wildcard Support
Instance-based wildcards that refer to blocks inside a 3DIC module are allowed. For
example: top.x1.ou*.
Node-based connections from Verilog are supported, allowing for separate supplies:
d2a -powernet 1 … -node top.vdd1 -vih 1.0
d2a -powernet 1 … -node top.vdd2 -vih 1.2
If a cell- or port-based reference is made, it is applied to all cells of that name, regardless
of 3DIC scope. For example:
d2a -powernet 1 -cell cellname -port n1
D
Unified Power Format (UPF) in Mixed-Signal
Simulation
This appendix discusses how mixed-signal simulation with UPF allows designs that
contain HDL descriptions, SystemVerilog or VHDL, SPICE, and UPF to be simulated
together. Information from UPF is automatically passed to SPICE for the supplies and
signals.
The SPICE representation must also have the power ports. Use the UPF command
connect_supply_net to connect the UPF net to the SPICE port, as shown below:
connect_supply_net VDD -ports {I1/vdd}
Running a mixed-signal simulation with UPF is described further in the following sections:
• SPICE/HDL Boundary
• SPICE/HDL Boundary for Signals
• SPICE/HDL Boundary for Supplies
• Tunneling SPICE Supply Ports Through the UPF Supply Network
• UPF Power-Aware Interface Elements
• Examples
• Limitations
SPICE/HDL Boundary
The boundary between SPICE and HDL has two types of interfaces: a2d and d2a interface
elements for signals and r2e interface elements for supplies. The tool automatically
detects whether the boundary net is a signal or supply and automatically inserts the
correct interface element.
For signals coming from SPICE to HDL, the a2d tracks the supply for the proper threshold
voltages.
Example Design
The following example shows a SystemVerilog file that describes an inverter targeted to
SPICE.
`timescale 1ns/1ns
module tb ();
import UPF::*;
logic clk;
wire clkb;
inv_spi I1 (clk, clkb, ,);
always #6 clk = ~clk;
initial begin
supply_on("VDD", 3.3);
supply_on("VSS", 0.0);
clk = 1'b0;
#40 supply_on("VDD", 3.0);
#40 supply_on("VDD", 3.3);
#40 $finish();
end
endmodule
module inv_spi (input logic in, output logic out,
input logic vdd, input logic gnd);
endmodule
This file creates a power domain, D1, and power nets VDD and VSS. These nets are
connected with connect_supply_net to the SPICE inverter power ports.
The SPICE netlist defines the transistors for the inverter:
* SUBCKT inverter
.model n nmos level=54
.model p pmos level=54
.subckt inv_spi in out vdd gnd
mn1 out in gnd gnd n w=1.00u l=0.35u
mp1 out in vdd vdd p w=2.00u l=0.35u
.ends
.end
The SPICE subcircuit for the inverter has the same four ports as the SystemVerilog
module. The SPICE netlist does not contain .global or voltage sources for power and
ground. This information comes from the SystemVerilog testbench via the UPF file.
The VCS run script enables mixed-signal with UPF:
vcs -lca -ad=vcsAD.init -upf <options>
The -lca option is needed as this is a "Limited Customer Availability" feature. The VCS
tool compiles and runs and generates analog waveforms as shown in Figure 50.
This feature improves the SPICE simulation accuracy and performance by creating
a single E2U or U2E interface element (if needed) to communicate the supply value
between the VCS tool and the VCS PrimeSim AMS analog simulation engine.
Multiple SPICE Supply Ports Driving the Same UPF Supply Net
If multiple SPICE supply ports drive the same UPF supply net, then all those SPICE ports
are tunneled and a single E2U interface element is created (instead of creating separate
E2U elements for each of these SPICE output ports) as shown in Figure 53.
Figure 53 Multiple SPICE Supply Ports Driving the Same Supply Net
Tunneling Limitations
The limitations are as follows:
• If a UPF supply net is connected to a SPICE inout port, then the inout port is treated
either as an input port or as an output port.
During simulation, VCS Native Low Power (NLP) monitors each UPF supply. AMS uses
the UPF supply registered for an a2d signal to get the logic from voltage value and a
d2a signal to get the voltage value of logic. Use this feature to simulate the interface
elements inserted by the simulation tool at the analog-digital boundaries in the mixed-
signal simulation environment.
UPF power-aware interface elements are described further in the following sections:
• Boundary SPICE Port With set_port_attributes Specified in the UPF
• Boundary SPICE Port With set_related_supply_net Specified in the UPF
Examples
Running a mixed-signal simulation with UPF is demonstrated in the following examples:
• Example 1
• Example 2
Example 1
The following example uses the set_related_supply_net command for a SPICE input
port. Therefore, the supply associated with the pin is an SRSN power supply.
UPF
create_supply_set SS_srsn -function {power VDD_srsn} \
-function {ground VSS_srsn}
set_related_supply_net -object_list { m/m/sp1/in1} \
-power VDD_srsn -ground VSS_srsn
vcsAD.init
use_spice -cell sp1;
test.spi
* Simple inverter
.subckt sp1 in1 out1 vdd vss
mn1 out1 in1 vss vss n w=20.00u l=0.35u
mp1 out1 in1 vdd vdd p w=40.00u l=0.35u
.ends
Testbench
supply_on("VDD_srsn",5.0);
#60 ; supply_on("VDD_srsn",8.0);
In the preceding figure, the VDD_srsn and the SPICE input have the same voltage values.
When VDD_srsn changes, the SPICE input value also changes.
In the preceding figure, SPICE values are not supply-aware. When the
set_related_supply_net supply value changes, the SPICE voltage value does not
change and holds a constant 3.3 volts; this is the default d2a voltage.
Reporting
If you run without the -power=supply_aware_ie option, the tool generates the following
interface element as reported in the interface_element.rpt file:
# without -power=supply_aware_ie
d2a hiv=3.3v lov=0v node=tb.top_unit.m.m.sp1.in1;
If you run with the -power=supply_aware_ie option, VCS NLP determines the actual
driver of the signal, identifies the supply, and generates the following d2a interface
element:
# with -power=supply_aware_ie
d2a -hiv 100% -lov 0% -node tb.top_unit.m.m.sp1.in1
-vss tb/top_unit/VSS_srsn
-vdd tb/top_unit/VDD_srsn;
Example 2
UPF
create_supply_set SS_srsn -function {power VDD_srsn} \
-function {ground VSS_srsn}
set_related_supply_net -object_list {m/m/sp1/out1} \
-power VDD_srsn -ground VSS_srsn
Note that the set_related_supply_net command is defined for the SPICE output port.
Therefore, the supply associated with the pin is the set_related_supply_net power
supply.
vcsAD.init
use_spice -cell sp1;
test.spi
* Simple voltage divider out1=3.6V
.subckt sp1 in1 out1 vdd vss
R1 temp1 temp 2k
R2 temp 0 3k
R3 temp out1 3k
V1 temp1 0 6V
.ends
Testbench
supply_on("VDD_srsn",5.0);
#60 ; supply_on("VDD_srsn",8.0);
In the preceding figure, when VDD_srsn changes to 8.0, out1 changes to 0. In AMS, the
higher and lower threshold values for the a2d interface element are 50% of the a2d supply
voltage. When VDD_srsn is 8.0, the higher threshold value is 4.0, which is greater than the
SPICE output voltage. Therefore, the corresponding digital value is 0.
In the preceding figure, when the set_related_supply_net supply value changes, the
digital value does not change and holds at 1.
Reporting
If you run with the -power=supply_aware_ie option, the tool generates the following a2d
interface element as reported in the interface_element.rpt file:
a2d -loth 50% -hith 50% -node tb.top_unit.m.m.sp1.out1
-minv 0.1 -minv_logic x
-vss tb/top_unit/VSS_srsn
-vdd tb/top_unit/VDD_srsn;
Limitations
• Verilog-AMS is not supported.
• The voltage aware flow is not supported. No 30-70 (VIH-VIL) related corruptions
are done in MVSIM native mode at the MVSIM Native and PrimeSim XA, FineSim,
or PrimeSim boundaries. Signals going in or coming out of the SPICE instance are
assumed to be correctly level-shifted.
• SystemVerilog nettype is not supported.
• Merged VPD mode is not supported.
• MVSIM native mode does not support the following hierarchy for mixed-signal
verification: Verilog -> SPICE -> Verilog -> SPICE. The SPICE subcircuit cannot have
VHDL as either parent or child.
• You cannot specify UPF for the nested Verilog instance inside the SPICE instance.
• UPF must not refer to any object in the nested Verilog instance under the SPICE
instance.
• connect_supply_net is not allowed in UPF either from SPICE to SPICE or SPICE to
UPF.
• SPICE port of inout direction is not supported.
• Supply net connection through XMRs, aliases, and jumper ports in the RTL is not
supported.
E
Support for Nettypes in Mixed-Signal Simulation
Predefined Nettypes
Predefined nettypes let you exchange electrical voltage, current, or Thevenin information
among multiple analog and digital blocks.
The following predefined nettypes are available in the $VCS_HOME/etc/snps_msv/
snps_msv_nettype_pkg.svp package:
nettype i_wiret i_wire with i_wire_rf;
nettype r_wiret r_wire;
nettype real current_r with rf_sum_of_drivers;
nettype real voltage_r with rf_1_driver;
nettype real wreal1driver with wreal_rf_def;
nettype real wreal4state with wreal_rf_4state;
nettype real wrealavg with wreal_rf_avg;
nettype real wrealmax with wreal_rf_max;
nettype real wrealmin with wreal_rf_min;
nettype real wrealsum with wreal_rf_sum;
nettype th_wiret th_wire with th_wire_rf;
nettype v_wiret v_wire_4state with v_wire_rf_4state;
nettype v_wiret v_wire_avg with v_wire_rf_avg;
nettype v_wiret v_wire_max with v_wire_rf_max;
nettype v_wiret v_wire_min with v_wire_rf_min;
nettype v_wiret v_wire_one with v_wire_rf_one;
nettype v_wiret v_wire_sum with v_wire_rf_sum;
• v_wire_one Nettype
• v_wire_sum Nettype
current_r Nettype
The current_r nettype resolves multiple driver current values. The resolved current value
on this nettype is the sum of the active drivers. This nettype has one member, a real type
and is defined as:
nettype real current_r with rf_sum_of_drivers;
i_wire Nettype
The i_wire nettype can resolve multiple driver current values. The resolved current value
on this nettype is the sum of the active drivers. This nettype has two members, one real
type (i) and one logic type (active).
typedef struct {
real i;
logic active;
} i_wiret;
In this structure, i holds the driver value, and active determines if the driver is active or
not. The driver current is counted when this field is set to 1. Otherwise, the value of i is
ignored.
This nettype is defined as:
nettype i_wiret i_wire with i_wire_rf;
Changes to analog current cause the e2n interface element to generate an event and pass
the analog current to the digital side as a real value. The value of the resistance can be
changed by setting the res option with the e2n command. For example:
e2n -res 2k -node top.iw4;
To model a pull-up resistor, use the res_node argument. The value of the argument is an
analog power source, such as vdd.
In the following example the resistor of the interface element is connected between nodes
top.net1 and vdd.
e2n -res 100k -res_node vdd -node top.net1;
The convention for the current direction is as follows: when current flows into the interface
element, a negative value is sent to the VCS tool, and when current flows out of the
interface element, a positive value is sent to the VCS tool.
The resolved value in the VCS simulator is the value of the current source. A parallel
resistor ensures convergence of the analog simulator. You can change arguments for the
interface element with the n2e command. For example:
n2e -rf_rate 25p -node top.rw3;
The current direction follows the SPICE convention. For example, a positive value from the
VCS tool is converted into a current going into the interface element and a negative value
from the VCS tool is converted into a current coming out of the interface.
voltage_r Nettype
The voltage_r nettype can resolve multiple drivers if only one driver value is active and
the remaining drivers are realZ. If there is more than one active driver, the resolved value
is realX and all driver values.
This nettype has one member, a real type, and is defined as:
nettype real voltage_r with rf_1_driver;
The resolved value in the VCS simulator is the value of the voltage source, and a
nominal series resistance ensures convergence of the analog simulator. The value of the
resistance can be changed with the n2e command. For example:
n2e -res 125.0 -node top.rw1;
th_wire Nettype
The th_wire nettype models Thevenin resistance and voltage and can resolve multiple
drivers.
typedef struct {
real vth;
real rth;
logic active;
} th_wiret;
Arguments to the interface element can be changed with the n2e command. For example:
n2e -rf_rate 25p -node top.rth3;
v_wire_avg Nettype
The v_wire_avg nettype can resolve multiple driver values. In the case of multiple drivers,
the resolved voltage value on this nettype is the average of the voltages of the active
drivers.
typedef struct {
real v;
logic active;
} v_wiret;
This nettype has two members, one real type named as v, and one logic type named
active:
v_wire_one Nettype
The v_wire_one nettype can resolve multiple drivers. In the case of multiple drivers, only
one driver active value should be 1. If there is more than one active driver, the active field
of the resolved value is X (meaning that all driver values have been ignored).
typedef struct {
real v;
logic active;
} v_wiret;
This nettype has two members, one real type named v, and one logic type named active:
• v holds the driver value.
• active determines whether the driver is active. The driver voltage is counted when this
field is set to 1. Otherwise, the value of the v field is ignored.
This nettype is defined as:
nettype v_wiret v_wire_one with v_wire_rf_one;
The resolved value in the VCS simulator is the value of the voltage source, and a
nominal series resistance ensures convergence of the analog simulator. The value of the
resistance can be changed with the n2e command. For example:
n2e -res 125.0 -node top.rw1;
v_wire_sum Nettype
The v_wire_sum nettype can resolve multiple drivers. In the case of multiple drivers, the
resolved voltage value on this nettype is the sum of the voltages of the active drivers.
typedef struct {
real v;
logic active;
} v_wiret;
The nettype has two members, one real type named v, and one logic type named active:
• v holds the driver value.
• active determines whether the driver is active. The driver voltage is counted when this
field is set to 1. Otherwise, the value of the v field is ignored.
This nettype is defined as:
nettype v_wiret v_wire_sum with v_wire_rf_sum;
The following example illustrates the use of predefined nettypes at the SystemVerilog-
SPICE boundary.
module sv_top;
v_wiret nt_wire;
v_wire_sum in, out;
initial begin
#1; nt_wire.v = 0.0; nt_wire.active = 1;
#10; nt_wire.v = 3.3; nt_wire.active = 1;
#10; nt_wire.v = 0.0; nt_wire.active = 1;
#10; nt_wire.v = 3.3; nt_wire.active = 1;
#10; nt_wire.v = 0.0; nt_wire.active = 0;
#10; nt_wire.v = 3.3; nt_wire.active = 0;
#10; nt_wire.v = 0.0; nt_wire.active = 0;
#10; nt_wire.v = 3.3; nt_wire.active = 1;
#10; nt_wire.v = 0.0; nt_wire.active = 1;
#10; nt_wire.v = 3.3; nt_wire.active = 1;
#10; nt_wire.v = 1.3; nt_wire.active = 1;
#100 $finish;
end
assign in = nt_wire;
.subckt sp1 a y
m1 y a gnd gnd nch L=0.4u W=8u
m2 y a vdd vdd pch L=0.4u W=8u
.ends
.subckt sp2 a y
m1 y a gnd gnd nch L=0.4u W=8u
m2 y a vdd vdd pch L=0.4u W=8u
.ends
v1 vdd 0 3.3
v2 gnd 0 0.0
.end
vlogan \
-full64 \
-work work \
-sverilog \
test.v \
-l vlogan.log
vcs \
-full64 \
sv_top \
-lca \
-debug_access+all \
-xlrm coerce_nettype \
-ad=vcsAD.init \
-ad_iereport \
-l vcs.log
simv \
-ucli \
-do xaVcs.ucli \
-l simv.log
User-Defined Nettypes
User-defined nettypes are nettypes other than the predefined nettypes that are defined in
the Synopsys package.
There are two methods to have user-defined nettypes connect to SPICE: with Synopsys-
defined interface elements and with user-defined interface elements written in Verilog-A:
• User-Define Nettypes With Predefined Interface Elements
• User-Defined Nettypes With Custom Interface Elements
All these user-defined nettypes are in a SystemVerilog package. The user-defined nettype
should be mapped to a predefined nettype so that it can connect to SPICE. The mapping
to the nettype ID is made as follows:
vcsAD.init file:
nettype_map <library>.<package>.
<nettype information> => <nettype alias name>;
If you map a nettype as shown in the following example, then mixed-signal simulation
knows that usage of current_u is same as i_wire:
nettype_map msv_lib.msv_types.current_u => msv_ie_i_wire_r;
You can use the following interface element names for all predefined types:
msv_ie_v_wire_av_r v_wire_avg
msv_ie_v_wire_sum_r v_wire_sum
msv_ie_v_wire_one_r v_wire_one
msv_ie_i_wire_r i_wire
msv_ie_th_wire_r th_wire
msv_ie_voltage_r voltage_r
msv_ie_current_r current_r
The following example illustrates how the nettype_map command is added in the
vcsAD.init mixed-signal simulation control file:
01_test.v
`timescale 1ns/10ps
package MP;
typedef struct {
real v;
logic active;
} nt_v;
endpackage : MP;
import snps_msv_nettype_pkg::*;
import MP::*;
module sv_top;
nt_v nt_wire;
nt_v_s sp_in1;
initial begin
#1;
nt_wire.v = 0.0; // #1
nt_wire.active = 1;
#10;
nt_wire.v = 2.0; // #11
nt_wire.active = 1;
#10;
nt_wire.v = 1.0; // #21
nt_wire.active = 1;
endmodule
01_test.spi
* SUBCKT inverter
.inc '01_test.mod'
.subckt sp1 sp_in sp_out
mn1 sp_out sp_in gnd gnd n w=1.00u l=0.35u
mp1 sp_out sp_in vdd vdd p w=2.00u l=0.35u
.ends
01_test.init
choose xa -hspice 01_test.spi;
use_spice -cell sp1;
use_spice -cell sp2;
nettype_map work.MP.nt_v_s => msv_ie_v_wire_sum_r;
Command Line
% vlogan 01_test.v -sverilog -full64
% vcs sv_top -ad=01_test.init -full64
Use Model
This section provides examples to explain the use model for setting up the custom UDN at
the mixed-signal boundaries as follows:
Placement of the Verilog-A Interface Elements
A Verilog-A model is placed on the mixed-signal net, closest to the SPICE net. This model
serves as the interface between the nettype and the SPICE electrical net. As it is written in
Verilog-A, each field of the nettype becomes a separate port. Therefore, a uni-directional
Verilog-A model contains N+1 total ports, while a bidirectional model contains 2N+1 total
ports, where N is the number of fields in the nettype. Separate Verilog-A models are
written for n2e, e2n, and bidirectional scenarios. These models are called with the .hdl
lines in the SPICE netlist.
The nettype connects to the Verilog-A model by position, not name.
• For udn_n2e, the ports are connected by field1, field2, field3, and so on, electrical.
• For udn_e2n, the ports are connected by electrical, field1, field2, field3, and so on.
• For udn_bidir, the ports are connected by field1_in, field2_in, field3_in, electrical,
field1_out, field2_out, field3_out, and so on.
Resolution Function
Mixed-signal nets with UDN still employ the SystemVerilog (SV) resolution function to
resolve all the drivers into a single resolved value. This value is transmitted from VCS
to the analog solver. The Verilog-A module then converts these individual fields into the
correct analog values.
For bidirectional nets, SV drives are resolved, sent to SPICE for solving, and the solved
values are returned to SV receivers.
Waveform Names
The simulated SPICE netlist contains the instantiated Verilog-A model, named identically
to the boundary net with an appended underscore. For example, if the boundary net is ni,
the Verilog-A instance is named ni_.
The SPICE nets for each of the nettype uni-directional interface elements is named by
appending an underscore and the field name to the nettype. For instance, if the boundary
net is ni and the udn has field r1, the SPICE net is named as ni_r1.
The first design has nettype na connected between Drv1, Drv2, and Rcv as shown in
Figure 64.
Cell Rcv is targeted to SPICE, so net ni is a mixed-signal net and an interface element is
placed on this SPICE net. The SystemVerilog resolution function resolves the two drivers
and transmits these fields to the analog solver. The Verilog-A module for the interface
element has three ports, inputs r1 and r2 and output nett1elec. The effective simulated
design is shown in Figure 65.
The second design has nettype na connected between Drv1, Drv2, Rcv3, and Rcv4, as
shown in Figure 66.
Cell Rcv4 is targeted to SPICE, so net ni is a mixed-signal net and an interface element is
placed on this SPICE net. The SystemVerilog resolution function resolves the two drivers
and transmits these fields to the analog solver. The Verilog-A module for the interface
element has five ports, inputs r1_in and r2_in, inout nett1elec, outputs r1_out, and
r2_out. The effective simulated design is shown in Figure 67.
For example:
udn_n2e -type mynettype -module my_n2e_va;
udn_e2n -type mynettype -module my_e2n_va;
udn_bidir -type mynettype -module my_bidir_va;
Where mynettype is the name of the user-defined nettype that appears at mixed-signal
boundary. The Verilog-A module my_n2e_va is used to send the nettype value to SPICE.
The last port of this module connects to SPICE and the previous ports connect to the
respective fields of the user-defined nettype mynettype. The Verilog-A module my_e2n_va
is used for the reverse communication, that is, to send SPICE value to user-defined
nettype mynettype. The first port of this Verilog-A module connects to SPICE and the
following remaining ports connect to the respective fields of this user-defined nettype.
Parameter values can also be passed to a Verilog-A interface element module using
<field>=<value> syntax, as follows:
udn_e2n -type mynettype -module va_e2n -param1 1.1 -param2 2.2;
Here param1=1.1 and param2=2.2 are used to set the values of the parameters param1
and param2 of the Verilog-A module va_e2n to 1.1 and 2.2, respectively.
These Verilog-A interface element modules are included in the interface_element.rpt
file.
Example
The following example shows how to use custom interface elements at the mixed-signal
boundary.
02_test.v
02_test.spi
vt.va
02_test.v
package my_nettype;
typedef struct {
logic l;
real volt;
real tt;
} udn_vt;
endpackage : my_nettype;
`timescale 1ps/1ps
import my_nettype::*;
module testbench (output logic clk_out, output udn_vt_1 vt_out);
`timescale 1ps/1ps
import my_nettype::*;
module top;
endmodule
02_test.spi
*** top
** Read in Verilog-A module for UDN2E
.hdl "vt.va"
.subckt inv_sp y a
mn1 y a gnd gnd n w=5.00u l=0.35u
mp1 y a vdd vdd p w=10.00u l=0.35u
.ends inv_sp
.end
vt.va
`include "disciplines.vams"
module vt1 (l, volt, tt, out);
input l, volt, tt;
output out;
electrical volt, tt, out;
logic l;
real r_l;
analog begin
r_volt = V(volt);
r_tt = V(tt);
if (l == 1'b1) r_l = 1.0; else r_l = 0.0;
V(out) <+ r_volt * transition(r_l,0.0,r_tt);
end
endmodule
Command Line
% vlogan 02_test.v -sverilog -full64
% vcs top -ad -full64
Limitations
This feature has the following limitations.
• The cosimulation flows of the FineSim and PrimeSim simulation engines do not support
parameter passing to a Verilog-A interface element module.
• Fields in the user-defined nettype are always scalar such as real, logic, bit, and so
on. A user-defined nettype with a field of type vector, struct, union, and array is not
supported.
Driver Receiver
module buf_s1 (a, net_1); input a; module buf_s2 (net_1, out); input
output voltage_r net_1[0:1]; real voltage_r net_1[0:1]; output voltage_r
oval[0:1]; assign net_1=oval; always out[0:1]; real midval[0:1]; assign
@(a) begin if (a) oval= {1.0,2.0}; else midval[0:1] = net_1[0:1]; assign out[0:1]
oval= {0.0,0.0}; endendmodule = midval[0:1];endmodule
Connection
The following SPICE netlists could be substituted for the driver or receiver:
.subckt buf_s1 a net_d_0 net_d_1
X0 a net_d_0 buf_1
X1 a net_d_1 buf_1
.ends.subckt buf_s2 net_r_0 net_r_1 out_0 out_1
X0 net_r_0 out_0 buf_2
X1 net_r_1 out_1 buf_2
.ends
For this example, a bus_format command must be issued in the mixed-signal simulation
control file. The command for this example is:
bus_format %_d;
Connecting Bits
Each of the bits of a nettype array may drive loads located in different blocks. Each of the
load blocks may be either SPICE or Verilog. The driving blocks could also be SPICE or
Verilog.
These connections are generalized in Figure 68. This example shows an 8-bit array of
nettype whose elements may connect to SPICE or Verilog.
In this case several drivers and receivers can each be SPICE or Verilog. When an element
of the array is connected between two SPICE blocks an electrical connection is made
between them, and no interface element is placed between them. Similarly, if an element
of the array is connected between two Verilog blocks, there is also no interface element
inserted.
For any array element connecting SPICE to Verilog or Verilog to SPICE, the appropriate
interface element (e2n/n2e) is inserted.
...
.ends
The index for each dimension should start from the left bound of the dimension to the right
bound in ascending or descending order.
F
Verilog/VHDL/PrimeSim XA VPI Mixed-Signal
Simulation
• Configuration commands
PrimeSim
Verilog/VHDL/
configuration
mixed-signal
XA commands
simulation
digital and analog blocks and simulated as one. The digital partition is in Verilog/VHDL and
blocks analog blocks
digital partitioning flows to fit into different design and verification methodologies:
• Verilog/VHDL netlist on top with leaf instances assigned to SPICE
• SPICE netlist on top with leaf instances assigned to Verilog or VHDL
• Integration with Virtuoso® Analog Design Environment with analog and digital netlists
Virtuoso Analog Design Environment
Cadence
Cadence Verilog-XL[2] also works with mixed-signal simulation, but it is not fully tested.
Verilog-XL
Other PLI 2.0 compliant Verilog/VHDL simulators may also work with PrimeSim XA mixed-
signal simulation but have not been fully tested.
Mixed-signal simulation uses Verilog Procedural Interface (VPI) or Programming
Verilog Procedural Interface VPI (Verilog Procedural Interface) programming language interface (PLI)
Language Interface (PLI) 2.0, to interact with ncsim, NC-Verilog/VHDL simulator. The
mixed-signal simulation executable is a shared library including VPI code and the
VPI code
PrimeSim XA engine. Mixed-signal simulation starts with ncsim as the master simulator
which dynamically links with the mixed-signal simulation library and invokes the PrimeSim
XA engine. The single process combines the ncsim, mixed-signal simulation interface,
and PrimeSim XA engine. The interactions between ncsim and PrimeSim XA go through
VPI
VPI function calls. This approach does not need any communication backplane and
function call inter-process
To perform high-level mixed-signal simulation without using the cell view approach, do the
following:
1. For those Verilog modules to be simulated by PrimeSim XA, replace their module body
with only one line as shown in the following syntax example:
initial $snps_module();
2. Provide a SPICE netlist for Verilog modules that have the same module or subcircuit
and port names.
3. Recompile the Verilog source code using ncvlog. Proper hdl.var and cds.lib are
required for ncvlog.
4. Insert ncelab with an additional command-line option where libxa_vpi.so is the
VPI share library shipped to Synopsys customers as shown in the following syntax
example:
-loadvpi libxa_vpi.so:snps_vpi_startup
5. Specify PrimeSim XA parameters such as the netlist file name in the cosim.cfg file.
6. Run ncsim with additional command-line option as shown in the following syntax
example:
-loadvpi libxa_vpi.so:snps_vpi_startup +snps+./cosim.cfg
Use a new file name extension, such as .cs, to compile the new files into a new view
such as cosim view.
2. Modify hdl.var to define a new view as shown in the following syntax example:
DEFINE VIEW_MAP (.cs => cosim)
3. The selected view described in the previous syntax is cell-based. For an instance-
based view selection, insert the following compilation directive before the instance in
the original Verilog source code as shown in the following syntax:
`uselib lib=cosim_lib view=cosim
4. Create a SPICE netlist for the Verilog modules. Make sure to have the same subcircuit
name as the Verilog module name and port names as well.
Note:
If a subcircuit name is different from the module name, use
map_subckt_name to associate them.
5. Compile the new Verilog files into a new view as specified in hdl.var.
6. Prepare the mixed-signal simulation configuration file, for example, cosim.cfg, with
PrimeSim XA parameters and mixed-signal simulation parameters.
7. Run the NC-Verilog command with additional -loadvpi command option. NC-Verilog
Cadence NC-Verilog
where libxa_vpi.so is the VPI share library are shipped with the product.
Note:
The ncsim command-line option +snps+ is used to pass the cosim.cfg
configuration file name to mixed-signal simulation. If the +snps+ option is
not specified, the default configuration file is cosim.cfg.
The following example illustrates a simple inverter chain with five inverters of which
two are in analog and three in digital. The inv module is shown in both the top.v and
gate.cs files. Because hdl.var defines the .cs file as the cosim view with a higher
precedence over the default module view, the inv module is simulated in PrimeSim XA. Its
equivalent subcircuit is defined in the inv.spi file.
Example 57 top.v
// Top cell with 5 chain inverters, but pushing through
// one more level of hierarchy by my_buf
`timescale 1ns / 10ps
module top;
wire z1, z2, z3;
testbench tb(z1, z2, z3, a);
chain main(a, z1, z2, z3);
endmodule
#200;
$finish;
end
endmodule
Example 58 gate.cs
module inv (a, z);
input a;
output z;
initial $snps_module();
endmodule
Example 59 inv.spi
.subckt inv a z
m1 z a vdd vdd p l=0.5u w=5u as=1.0e-10 ad=1.0e-10
+ ps=0 pd=0
m2 z a 0 0 n l=0.5u w=3u as=1.0e-10 ad=1.0e-10
+ ps=0 pd=0
.ends
Example 60 test.spi
.param VDDVAL=3v
* global nodes
in accordance with the IEEE standard, IEEE 1364-2001. A library map file contains
IEEE Standard, IEEE 1364-2001
the binding rules. This feature is invoked using ncvlog and ncelab with the -libmap
command-line option to specify the library map file.
Multiple implementations of the same module can be compiled into different design
libraries. Using Verilog configurations, ncelab searches design libraries to bind instances
as shown in the following example.
====== File: top.v ======
module top();
chain a1(...);
chain a2(...);
endmodule
module chain(...);
inv i1(...);
inv i2(...);
endmodule
initial $snps_module();
endmodule
config cfg;
design rtlLib.top;
default liblist rtlLib cosimLib;
instance top.a2.i1 liblist cosimLib;
endconfig
To compile the design units, invoke ncvlog using the following syntax:
% ncvlog -libmap lib.map top.v inv.cs
This compiles the design units into the appropriate libraries as follows:
top rtlLib
chain rtlLib
In the lib.map (library map) file, the Verilog configuration cfg specifies an instance-
based instantiation for instance top.a2.i1. To elaborate the top design, use the following
command:
% ncelab -libmap lib.map cfg -loadvpi \
libxa_vpi.so:snps_vpi_startup -access +rwc
The instance top.a2.i1 is bound to the design unit inv in cosimLib while the remaining
three inv instances are bound to the design unit inv in rtlLib. During mixed-signal
simulation, the instance top.a2.i1 is partitioned to the analog simulator and the others
are simulated by Verilog simulator. With the Verilog configuration, analog and digital
partitioning for mixed-signal simulation can be accomplished in an instance-based fashion.
Refer to the NC-Verilog User Manual and IEEE 1364-2001 Standard for further details on
instance-based instantiation.
designs. This Synopsys mixed-signal simulation uses VPI to interact with ncsim. However,
VPI can only access Verilog objects. In order to simulate with VHDL, PrimeSim XA needs
Verilog as the media to interact with VHDL indirectly. Therefore, a Verilog wrapper is
required.
Use the following steps to run mixed-signal simulation with VHDL designs.
1. Create a Verilog module with the same port definition as the VHDL entity to be
Verilog module
partitioned to SPICE. This Verilog module contains only one statement as the module
body and functions as a wrapper around the SPICE block as shown below:
initial $snps_module();
2. Modify the original VHDL code to instantiate the new Verilog module.
3. Compile the VHDL code with ncvhdl as shown in the following syntax:
% ncvhdl top.vhd
4. Compile the Verilog code with ncvlog as shown in the following syntax:
% ncvlog gate.cs
Note:
Bidirectional port in VHDL/PrimeSim XA mixed-signal simulation is not
bidirectional port
supported.
The following example shows a VHDL on top design of an inverter chain with two leaf
VHDL on top mixed-signal simulation
inverters assigned to SPICE. The VHDL entity inv is replaced by a SPICE subcircuit inv
for mixed-signal simulation. A Verilog module inv is created as the wrapper of the SPICE
subcircuit.
use ieee.std_logic_1164.all;
entity testbench is
port (z1, z2, z3: in std_logic;
a: out std_logic);
end testbench;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_textio.all;
library std;
use std.textio.all;
architecture behav of testbench is
signal tick: std_logic;
begin
process
variable i: std_logic := '0';
variable initial: integer := 0;
begin
a <= i;
tick <= i after 3 ns;
if (now >= 250 ns) then
wait;
end if;
wait for 25 ns;
i := NOT i;
end process;
process(tick)
variable error: STRING (1 to 7) := "ERROR: ";
VARIABLE I: LINE;
begin
if (now > 0 ns) then
if (tick /= z1) or
(tick = z2 ) or
(tick = z3 ) then
write( I, error, left, 7);
write( I, now, left, 15);
write( I, tick, right, 3);
write( I, z1, right, 3);
write( I, z2, right, 3);
write( I, z3, right, 3);
writeline(output, I);
end if;
end if;
end process;
end behav;
library ieee;
use ieee.std_logic_1164.all;
entity cut is
port (a: in std_logic;
z1, z2, z3: out std_logic);
end cut;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_textio.all;
library std;
use std.textio.all;
architecture gate of cut is component
my_buf port (a: in std_logic;
z: out std_logic);
end component;
component
my_inv port(a: in std_logic;
z: out std_logic);
end component;
signal m1, m2, m3: std_logic;
begin
x1: my_buf PORT MAP (a, m1);
x2: my_inv PORT MAP (m1, m2);
x3: my_buf PORT MAP (m2, m3);
z1 <= m1;
z2 <= m2;
z3 <= m3;
-- process (a, m1, m2, m3)
-- VARIABLE I: LINE;
-- begin
-- write( I, now, left, 15);
-- write( I, a , right, 3);
-- write( I, m1, right, 3 );
-- write( I, m2 , right, 3);
-- write( I, m3 , right, 3);
-- writeline(output, I);
-- end process;
end;
library ieee;
use ieee.std_logic_1164.all;
entity my_inv is
port(a: in std_logic;
z: out std_logic);
end my_inv;
library ieee;
use ieee.std_logic_1164.all;
architecture behav of my_inv is
begin
-- z <= NOT a after 1 ns;
z <= NOT a;
end;
--library ieee;
--use ieee.std_logic_1164.all;
--entity inv is
-- port(a: in std_logic;
-- z: out std_logic);
--end inv;
--library ieee;
--use ieee.std_logic_1164.all;
--architecture behav of inv is
--begin
-- z <= NOT a after 1 ns;
-- z <= NOT a;
--end;
library ieee;
use ieee.std_logic_1164.all;
entity my_buf is
port (a: in std_logic;
z: out std_logic);
end my_buf;
library work;
use work.all;
architecture gate of my_buf is
component
my_inv port(a: in std_logic;
z: out std_logic);
end component;
component
inv port(a: in std_logic;
z: out std_logic);
end component;
signal t: std_logic;
begin
IV1: my_inv PORT MAP (a, t);
IV2: inv PORT MAP (t, z);
end gate;
generated by executing a PrimeSim XA command against the original SPICE netlist. The
cosim.v file contains the Verilog top module instantiating Verilog instances to replace
SPICE subcircuits. Then mixed-signal simulation is conducted against cosim.v, other
Verilog source files for digital instances, and the original SPICE netlist.
The procedure to run mixed-signal simulation for this design flow is described as follows:
1. Create a configuration file such as cosim.cfg for both PrimeSim XA and mixed-signal
simulation containing the following commands:
◦ set_args: Used with PrimeSim XA command-line options including the SPICE
netlist to run PrimeSim XA.
◦ digital_cell or digital_cell_inst: Specifies the Verilog instances in the
SPICE netlist.
◦ verilog_file: Specifies the Verilog file containing the Verilog module definitions.
Here is an example cosim.cfg file:
set_args spice/test.spi
digital_cell invd
verilog_file verilog/invd.v
In this example, invd.v defines the Verilog inverter and digital_cell defines the
digital partitions instantiated in cosim.v which is generated by PrimeSim XA.
2. Run PrimeSim XA with the configuration file. PrimeSim XA stops simulation after
generating cosim.v as shown in the following example:
% xa -cscfg cosim.cfg
After cosim.v is generated, you can skip step 2 in future mixed-signal simulation
runs if analog and digital partitioning and the Verilog port analog and digital interface
definitions remain unchanged.
3. Use the Verilog compiler to compile cosim.v together with other Verilog source files.
4. Start mixed-signal simulation from the top Verilog module defined in cosim.v and
the SPICE netlist. PrimeSim XA skips simulating the SPICE subcircuits specified in
digital_cell or digital_cell_inst commands.
The following example presents a simple inverter chain with a SPICE netlist on top and
inverter chain
two leaf inverters partitioned to Verilog. Sample files for include the following:
leaf inverter
• cosim.v: Verilog top module that instantiates two Verilog inverters. This digital
interface file is automatically generated by PrimeSim XA.
• test.spi: SPICE top netlist of an inverter chain.
• inv.spi: SPICE netlist for an inverter.
• invd.spi: SPICE netlist of the inverter to be partitioned to Verilog.
• buf.spi: A SPICE inverter chain.
• invd.v: A Verilog inverter module.
The sample files are as follows:
Example 62 cosim.v
`timescale 1ns / 10ps
module top;
wire w1; // x1.n1
wire \x1.n1 = w1;
wire w2; // out1
wire \out1 = w2;
wire w3; // x3.n1
wire \x3.n1 = w3;
wire w4; // out
wire \out = w4;
// Instance section
invd \x1.x2 (w1, w2);
invd \x3.x2 (w3, w4);
// interface nodes
initial begin
$snps_a2d_node(w1, "x1.n1");
$snps_d2a_node(w2, "out1");
$snps_a2d_node(w3, "x3.n1");
$snps_d2a_node(w4, "out");
end
initial $snps_module(1);
// By default, spiceflow mixed-signal simulation will
// use .tran time for the simulation time
// To specify the simulation time from verilog, add
// the "spice_finish 0" command
// in the cosim config file
// initial begin
// #100 $finish;
// end
endmodule
Example 63 test.spi
.param VDDVAL=3v
* global nodes
.global vdd vss gnd
* supplies
vvdd vdd 0 dc VDDVAL
vgnd gnd 0 dc 0v
* top level netlist
x1 in out1 buf
x2 out1 out2 inv
x3 out2 out buf
x4 out dummy inv
.inc models
.inc inv.spi
.inc invd.spi
.inc buf.spi
vin in 0 pwl 0n 0v 1n 0v 1.1n 3v 6n 3v 6.2n 0v r
.print v(*)
.tran 0.1n 100n
.end
Example 64 inv.spi
.subckt inv a z
m1 z a vdd vdd p l=0.5u w=5u as=1.0e-10 ad=1.0e-10 ps=0 pd=0
m2 z a 0 0 n l=0.5u w=3u as=1.0e-10 ad=1.0e-10 ps=0 pd=0
.ends
Example 65 invd.spi
.subckt invd a z
m1 z a vdd vdd p l=0.5u w=5u as=1.0e-10 ad=1.0e-10 ps=0 pd=0
m2 z a 0 0 n l=0.5u w=3u as=1.0e-10 ad=1.0e-10 ps=0 pd=0
.ends
Example 66 buf.spi
.subckt buf in out
x1 in n1 inv
x2 n1 out invd
.ends buf
Example 67 invd.v
`timescale 1ns/10ps
module invd (a, z);
input a;
output z;
assign z =~a;
endmodule
Note:
To simulate a VHDL block in a SPICE-top flow, create a Verilog wrapper for the
Verilog wrapper
VHDL entity with the same port definition and instantiate the VHDL entity in the
Verilog wrapper.
instantiated from the SPICE netlist. This is similar to the normal SPICE netlist-on-top
flow. Within the Verilog module, subblocks can be simulated in PrimeSim XA. The
Verilog module containing analog cells is similar to the top Verilog module in the normal
standalone Verilog netlist-on-top flow.
To use SPICE-on-top donut partitioning, perform the following steps:
SPICE-on-top donut partitioning
1. Specify the cosim view of the subblock in the Verilog module to be simulated in
PrimeSim XA. This is similar to the Verilog netlist-on-top flow where the hdl.var file
should contain the following syntax specifying the cosim view:
DEFINE VIEW_MAP (.cs => cosim )
2. Replace the module body of the subblock in the Verilog module to be simulated in
PrimeSim XA with the following syntax line:
initial $snps_module();
where buffer is the Verilog module name, and verilog/buf.v is the Verilog file
name.
4. Run PrimeSim XA with the configuration file. PrimeSim XA stops simulation after
generating cosim.v as shown in the following example:
% xa -cscfg cosim.cfg
Note:
After cosim.v is generated, step 4 can be skipped in future mixed-signal
simulation runs if analog and digital partitioning and the Verilog port analog
and digital interface definitions remain unchanged.
5. The Verilog compiler is used to compile cosim.v together with other Verilog source
files.
6. Start mixed-signal simulation from the top Verilog module defined in cosim.v and
the SPICE netlist. PrimeSim XA skips simulating the SPICE subcircuits specified
in digital_cell commands while partitioning the subblock specified in step 3 into
PrimeSim XA.
Figure 69 is an example of donut partitioning with a SPICE top. Within the SPICE top,
donut partitioning with SPICE top
the buffer is partitioned to Verilog while one of its subblocks, inva, is partitioned to be
simulated in PrimeSim XA.
* global nodes
.global vdd vss gnd
* supplies
vvdd vdd 0 dc VDDVAL
vgnd gnd 0 dc 0v
.inc models
.inc inva.spi
.inc invd.spi
.inc buf.spi
.end
output out;
wire n;
invd inst_invd (in, n);
inva inst_inva(n, out);
endmodule
endmodule
To save a simulation state, you can get into ncsim interactive mode and apply the save
ncsim interactive mode
To restart the simulation, use the ncsim command with the saved snapshot as shown in
the following example:
% ncsim snapshot_name
The value sets of some common configuration command arguments are as follows:
<bool>
0, 1
<positive number>
1, 2, 3, and so on
<double>
Floating point number
floating point number
<time>
Floating point number plus time unit. For example, 100p and 1n stand for 100
pico seconds and 1 nano second, respectively.
<file>
File name
For details on the configuration file commands, see the following:
• analog_cell
• define_print_variable
• define_strength
• digital_cell
• digital_cell_inst
• dump_interface
• dump_port_prop
• dump_setting
• map_subckt_name
• map_unfound_port
• set_args
• set_intr_mode
• set_port_prop
• verilog_file
analog_cell
Generates Verilog module templates containing the $snps_module() statement for analog
partitions in the Verilog as the top instance flow.
Syntax
analog_cell [-ext <file name extension>] [-dir <directory>] <cell 1>
Mixed-Signal Simulation Configuration Commands
analog_cell
Arguments
-ext
Specifies the file name extension for the generated Verilog module templates.
The default file name extension is cs.
-dir
Specifies the directory to put the generated Verilog module template. The default
directory is the current working directory.
cell name
Can be a wildcard.
-vmod
Specifies the submodule that remains in Verilog. Do not use wildcards.
Note:
When using the -vmod option, only one cell within an analog_cell
command may be used.
Description
The analog_cell command generates Verilog module templates containing the
$snps_module() statement for analog partitions in the Verilog as the top instance flow. If
the design module of an analog partition does not exist in the design library, mixed-signal
simulation stops after the template is generated. Then this new file must be compiled in
order to start mixed-signal simulation. If the design module of an analog partition already
exists in the design library, analog_cell does not generate the module template.
define_print_variable
Defines a print variable used as a reference voltage in the set_port_prop command.
Syntax
define_print_variable <print variable name> = <expression>
Mixed-Signal Simulation Configuration Commands
define_strength
Description
This command defines a print variable used as a reference voltage in the set_port_prop
command. The print variable is added to the snps_cosim.sp netlist file with a SPICE
.print statement.
Note:
The syntax for the print variable in define_print_variable is identical to the
.print statement syntax.
define_strength
Defines a strength table with resistances mapped to the seven Verilog strength levels.
Syntax
define_strength <strength table name> [<double>] [-<strength option>
Mixed-Signal Simulation Configuration Commands
define_strength
Description
This command defines a strength table with resistances mapped to the seven Verilog
strength levels.
Each -<strength option> is used to map to the corresponding Verilog strength level and
can be any of the following:
• -supply
• -strong
• -pull
• -weak
• -large
• -medium
• -small
The value inserted after -<strength option> is a strength resistor’s resistance. If a value
does not have an associated -<strength option>, it is set as the default value for the
remaining strength levels not specified using the -<strength option>.
<strength table name> is used in the -strength port property of the set_port_prop
command for strength resolution at inout ports. Verilog inputs are applied through the
resistor with respect to the Verilog strength level and PrimeSim XA resolves contributions
of both the Verilog- and SPICE-sides in order to obtain the final bidirectional net value.
bidirectional net value
digital_cell
Specifies the SPICE subcircuit to be partitioned to Verilog.
Syntax
digital_cell <sub-circuit name>
Mixed-Signal Simulation Configuration Commands
digital_cell
Description
In a SPICE flow, specifies the SPICE subcircuit to be partitioned to Verilog.
digital_cell_inst
Specifies the SPICE instance to be partitioned to Verilog.
Syntax
digital_cell_inst <SPICE instance name>
Mixed-Signal Simulation Configuration Commands
digital_cell_inst
Description
In a SPICE flow, specifies the SPICE instance to be partitioned to Verilog.
dump_interface
Produces a report file showing the mapping result between analog and digital ports.
Syntax
dump_interface [0|1|2]
Mixed-Signal Simulation Configuration Commands
dump_interface
Arguments
0
Do not dump the .csintf file.
1
Generates the .csintf file that lists all interface nodes and properties.
2
(Default) Generates the .csintf file at the end of mixed-signal simulation that
lists all interface nodes, properties, and the number of interface events for each
interface node.
Description
This command produces a report file showing the mapping result between analog and
digital ports.
Examples
Here is a .csintf file example.
a2d main.out2 xmain.out2 node=out2 vhi=2.1 vlo=0.9
d2a main.out1 xmain.out1 node=out1 logichv=3 logiclv=0 rise=1000
fall=1000 rm_glitch=1000
dump_port_prop
Outputs port properties associated with matching ports.
Syntax
dump_port_prop <file>
Mixed-Signal Simulation Configuration Commands
dump_port_prop
Description
Outputs what port properties have been associated with the matching ports.
dump_setting
Outputs configuration command settings to the PrimeSim XA log file.
dump configuration command
Syntax
dump_setting
Mixed-Signal Simulation Configuration Commands
dump_setting
<bool>
Description
Outputs configuration command settings to the PrimeSim XA log file. Default for <bool> is
dump configuration command
0.
map_subckt_name
Maps a module name to the correct subcircuit definition in the SPICE instantiation.
Syntax
map_subckt_name <module_name> <subckt_name>
Mixed-Signal Simulation Configuration Commands
map_subckt_name
Description
If the module name is different from the subcircuit name, this command maps it to the
correct subcircuit definition in the SPICE instantiation.
map_unfound_port
Maps an unfound port to the specified SPICE node name.
Syntax
map_unfound_port [-cell <pattern>] <map_node> <unfound_port> …
Mixed-Signal Simulation Configuration Commands
map_unfound_port
Description
When writing the interface netlist file, if a subcircuit has more ports than inst module ports,
interface netlist file
this command maps the unfound port to the specified SPICE node name.
The search priority is in a top-down order as follows:
1. Exact cell name.
cell name
3. Match unfound port list for rules without the -cell argument.
unfound port list
set_args
Passes the regular PrimeSim XA command-line argument to the PrimeSim XA tool.
Syntax
set_args <snps_args> …
Mixed-Signal Simulation Configuration Commands
set_args
Description
This command passes the regular PrimeSim XA command-line argument to the PrimeSim
XA tool. For example: set_args test.spi directs the PrimeSim XA tool to accept
test.spi as an input netlist.
set_intr_mode
Sets the interactive mode.
Syntax
set_intr_mode <bool>
Mixed-Signal Simulation Configuration Commands
set_intr_mode
Description
By default, Ctrl+C stops simulation in the Verilog simulator’s interactive mode. To move
between the interactive modes of the Verilog simulator and the PrimeSim XA tool, use the
following commands:
• call snps_intr_mode: Leaves the Verilog simulator’s interactive mode and enters the
PrimeSim XA interactive mode.
• quit: Leaves the PrimeSim XA interactive mode and returns to the Verilog simulator’s
PrimeSim
interactiveXA
mode
interactive mode.
If set_intr_mode is set to 1, Ctrl+C stops the simulation in PrimeSim XA’s interactive
mode instead of the Verilog simulator's interactive mode. PrimeSim XA interactive
Verilog interactive mode
commands can be applied to debug the simulation. In this case, Verilog’s interactive mode
cannot be entered by users. Default for <bool> is 0.
set_port_prop
Description
Applies specified properties to matched cells or instances and their ports.
The port properties apply to the matched cells or instances and their ports.
• -cell is used for cell based port properties.
• -inst is used for instance-based port properties.
• Port names match Verilog port definitions that are case-sensitive.
• This specified value overrides any default value.
• If more than one rule is found for a particular property, the last rule is used.
• Without any cell or port pattern specified, the default value is used.
The options for port properties are listed below under Arguments.
Syntax
set_port_prop [-cell <pattern>|-inst <pattern>]
[-port <pattern>] <-port property1> <value1> <-port property2> <value2> …
[-follow_ov_param] [-no_a2d <bool>] [-no_d2a <bool>]
[-cap capacitance_value] [-res resistance_value] [-linear <bool>]
[-csrc <bool>]
Arguments
-logichv <double>|<output variable>
[default] v(vdd) where vdd is the detected voltage supply node. If no detected
vdd, the default is 3.
where logichv is the output variable and '0.7 * v(vdd)' is the voltage
expression.
-logiclv <double>|<output variable>
[default] 0
Set port logic0 voltage.
Its value can be a double number or an output variable which is a string identifier
starting with an alphabetic letter.
-logicxv <double>|<output variable>
[default] (logichv - logiclv) *0.5
Set port logic X voltage.
Its value can be a double number or an output variable which is a string identifier
starting with an alphabetic letter.
-vhi <double>|<output variable>
[default] (logichv - logiclv) * 0.7
Set port logic1 threshold voltage.
Its value can be a double number or an output variable which is a string identifier
starting with an alphabetic letter.
-vlo <double> <output variable>
[default] (logichv - logiclv) * 0.3
Set port logic0 threshold voltage.
Its value can be a double number or an output variable which is a string identifier
starting with an alphabetic letter.
-timex <time>
[default] No state X report.
Report X when the output port voltage stays between -vlo and -vhi longer
than the specified <time>.
-slope <time>
[default] 1p
Set port rising and falling time.
-rise <time>
[default] 1p
Set port rising time.
-fall <time>
[default] 1p
Set port falling time.
-delay <time>
[default] 0
Set port delay. This delays the signal output to Verilog.
Only allow positive delay.
-delay1 <time>
[default] 0
Apply port delay to the rising edge only.
-delay0 <time>
[default] 0
Apply port delay to the falling edge only.
-delay_hz2st <time>
[default] 0
Apply port delay to signal changes from a Hi-Z state to a strong state.
-rm_glitch <time>
[default] -slope value
Remove glitches within <time> after Verilog input changes.
Apply to inout port for strength resolution with the resistor specified in
<strength name>.
-vsrc <bool>
[default] 0
Model input as a voltage source. It is partitioned into a smaller block and results
in a faster simulation runtime.
Only inputs without Hi-Z can use this option, otherwise, the simulation may be
incorrect.
-vprint <bool>
[default] 0
Insert a .print statement to print voltage value.
-lprint <bool>
[default] 0
Insert an .lprint statement to print voltage logic.
-follow_ov_param
Allows a user-defined expression to be dynamically evaluated along two digital-
to-analog (d2a) events (as opposed to being evaluated at the final value).
Because this option allows a dynamic change on the logic values of d2a
interface elements, you can model complex voltage-controlled voltage sources,
ideal level shifters, interface elements, and modulated voltage sources.
-no_a2d <bool>
[default] 0
Skips the a2d interface element insertion on the specified interface node.
-no_d2a <bool>
[default] 0
Skips the d2a interface element insertion on the specified interface node.
-cap capacitance_value
[default] 0
Adds node capacitance value to the interface node. The capacitance value is in
double precision and has the unit of Farad.
-res resistance_value
[default] 1
Adds node resistance value to the interface node. The resistance value is
in double precision and has the unit of Ohm. This value is used only when
-linear option is 0.
-linear <bool>
[default] 1
Generates a linear slope for d2a interface.
-csrc <bool>
[default] 0
Model interface as constant vsrc.
verilog_file
Specifies Verilog source file containing Verilog module definitions for digital_cell or
Verilog module definition file
digital_cell_inst.
Syntax
verilog_file <Verilog source file name>
Mixed-Signal Simulation Configuration Commands
verilog_file
Description
In a SPICE flow, this command specifies the Verilog source file containing the Verilog
Verilog module definition file
Rule 2
Search through channel connected voltage sources. The voltage levels of the voltage
channel connected voltage sources
sources are applied to the interface nodes. Rule 1 takes higher priority.
Mixed-signal simulation interactive commands are used with XA>, the PrimeSim XA
interactive mode prompt. The PrimeSim XA Command Reference: PrimeSim XA
Interactive Commands provides information on how to get into the PrimeSim XA
PrimeSim
interactiveXA
mode
interactive mode.
To get into PrimeSim XA interactive mode from the ncsim>, the NC-Verilog interactive
NC-Verilog
To continue simulation in NC-Verilog, issue the command cont from the PrimeSim XA
NC-Verilog PrimeSim
interactiveXA
mode
interactive mode prompt XA> and simulation continues. If you are prompted with ncsim>
after issuing the cont command at XA>, type run and NC-Verilog continues.
Note:
Currently only NC-Verilog is supported in mixed-signal simulation interactive
debugging.
Table 14 lists the commands used in mixed-signal simulation interactive debugging.
Command Function
csli lists all mixed-signal simulation interface nodes if no option is specified. A pattern
Mixed-Signal Simulation Interactive Mode Command
csli mixed-signal simulation interface nodes
can be used to search for certain names. You can choose to list a certain type of interface
node by specifying -a2d, -d2a, or -biput.
Table 15 List Interface Nodes: csli Syntax Descriptions
Parameter Description
pattern Pattern used to search for certain interface node names. Pattern matching is
based on the Tool Command Language (Tcl) API.
XA> csli *addr* -d2a Prints d2a interface nodes with names matching the pattern *addr*.
A typical result of csli command is shown in the following example. Note that <=>
denotes bidirectional ports:
bidirectional port
XA> csli
cosim interface nodes:
---------------------------------
id type node
---------------------------------
7 <=>a2d b[3]
6 <=>a2d db[2]
5 <=>a2d db[1]
4 <=>a2d db[0]
10 d2a pch2
12 d2a rd2
15 d2a wr2
7 <=>d2a db[3]
3 d2a addr[2]
6 <=>d2a db[2]
2 d2a addr[1]
5 <=>d2a db[1]
1 d2a addr[0]
4 <=>d2a db[0]
8 d2a en2
---------------------------------
Note:
In this example, the bidirectional ports have both a2d and d2a interface nodes:
7 <=>a2d db[3] and 7 <=>d2a db[3].
csh prints the global interface activity history in chronological order. If no argument is
Mixed-Signal Simulation Interactive Mode Command
csh global interface activity history
The number can be changed by using the max_history command in the mixed-signal
simulation configuration file as follows:
csnh and csinh print the activity of a specified interface node if available. Entries for the
Mixed Signal Simulation Interactive Mode Command
csnh Mixed-Signal Simulation Interactive Mode Command
csinh
specified node stored in the history buffer are printed in chronological order. Both a2d and
history buffer
d2a history are printed if available. The maximum number of entries printed each time by
csnh and csinh can be set by the command csnph. The default is 10.
The id corresponds to the id field in the output of the csli command. This id can also be
used in other PrimeSim XA interactive commands.
Table 18 PrimeSim XA Example
XA> csinh 10 Prints activity history of interface node with index 10.
csnph reports the current setting if no argument is given. If an argument is specified, the
Mixed-Signal Simulation Interactive Mode Command
csnph
number of entries to be printed by the csnh and csinh commands are set. The number is
limited between max_history and 0.
XA> csnph 20 Sets the maximum number of entries to be printed in each csnh and
csinh call to 20.
csnw and csinw set a watchpoint to the specified interface node. If no additional option
Mixed-Signal Simulation Interactive Mode Command
csnw Mixed-Signal Simulation Interactive Mode Command
csinw
is given, any activity on the interface node triggers the watchpoint and you enter the XA>
prompt. Use -a2d, -d2a, or -hz to catch a specific type of interface activity. If no argument
is given to csnw and csinw, a list of current watchpoints is printed. Previous watchpoint
settings are overridden by the new setting.
Table 20 Set watchpoint to interface node: csnw csinw Syntax Descriptions
Parameter Description
XA> csinw 5 -hz Sets watchpoint on interface node with id 5 to watch for Hi-Z events.
XA> csnw db[0] -d2a Sets watchpoint on d2a part of interface node db[0].
Delete Watchpoint
csdnw and csdinw delete the watchpoint specified by name or ID, or delete all watchpoints
Mixed-Signal Simulation Interactive Mode Command
csdinw watchpoint
if -a or -all option is used. If no argument is given, csdnw and csdinw print the list of
currently set watchpoints.
csdnw, csdinw
csdnw <name|-a|-all>
csdinw <id|-a|-all> Mixed-Signal Simulation Interactive Mode Command
csdnw
Creates an A-to-D interface element between the Verilog net and SPICE node.
A-to-D interface element
This system task behaves like a continuous assignment from a SPICE internal
node to the Verilog net.
$snps_add_cap (net, variable)
Verilog/SPICE system tasks
$snps_add_cap
This system task adds capacitance to the SPICE node connecting to the
interface net. It requires two arguments, one Verilog net and one Verilog
variable, constant, or parameter of real type. The Verilog net has to be an
interface connecting to a SPICE node. The second argument specifies
capacitance in Farad and represents the lumped sum capacitance of Verilog
farad
Creates a D-to-A interface element between the Verilog net and SPICE node.
D-to-A interface element SPICE node
This allows Verilog to connect the net directly to a SPICE internal node, instead
SPICE internal node
where test is a Verilog net in the module containing this system task and
xi1.xi2.sync is the hierarchical path name to identify a SPICE node.
Requires two arguments, one Verilog net and one Verilog variable of real type.
real type Verilog variable
The Verilog net has to be an interface connecting to a SPICE node. This system
task retrieves the analog voltage of the SPICE node at current time and assigns
the voltage to the variable.
$snps_inout_node (net, "SPICE node name")
Verilog/SPICE system tasks
$snps_inout_node
Creates one D-to-A interface element and one A-to-D interface element between
D-to-A interface element A-to-D interface element
the Verilog net and SPICE node. This is equivalent to one $snps_d2a_node()
and one $snps_a2d_node() combined.
$snps_module()
Verilog/SPICE system tasks
$snps_module
module body should contain nothing but only one initial block of this system
task.
$snps_save_waveform(obj1 [, level1], obj2 [, level2], ...)
Verilog/SPICE system tasks
$snps_save_waveform
file. The Verilog objects can be net, register, net bit, register bit, and module
instance. The optional level argument is valid only for module instance objects
and specifies all nets under the design hierarchy level. Its default value is 1. A 0-
level means the full hierarchy of the given instance.
$snps_set_volt (net, variable)
Verilog/SPICE system tasks
$snps_set_volt
Requires two arguments, one Verilog net and one Verilog variable, constant, or
parameter of real type. The Verilog net has to be an interface connecting to a
SPICE node. This system task assigns the value of the second argument to the
SPICE node as an analog voltage at current time.
mixed-signal simulation view Verilog module should clearly define an input or output port
rather than an inout port. This reduces the number of interface elements and improve
interface elements
simulation performance.
voltage source to the SPICE block. This improves PrimeSim XA simulation. Use the -vsrc
option of the set_port_prop configuration command to set ports as voltage sources.
definition. A bus notation is required to map each individual bit-level port back to Verilog
bus notation Verilog vector ports
vector ports. The default bus notation for SPICE netlist is square brackets []. Other bus
notations can be set by using a PrimeSim XA netlist option in the SPICE netlist as shown
in the following example:
.opt XA_BUS_FORMAT = "<%d>"
.opt XA_BUS_FORMAT = "_%d"
Partitioning Guidelines
This section describes the following:
• Partition Boundary With Clear Digital Behavior
• Avoid Partitioning at Timing Sensitive Signals
• Avoid Reach-in Signals in Analog Partitions
• Avoid Partitioning at Bidirectional Signals Involved Strength Fighting and Pass
Switches
• Avoid Fine Grain Partitioning
functionality, the boundary signals should have clear digital behavior and should not be
boundary signals voltage
voltage sensitive.
sensitivity
If the circuit design is timing sensitive at the interface signals, functionality errors may
circuit timing sensitivity interface signals
occur due to timing shift by a slight change in threshold voltages. There should be certain
timing shift threshold voltages interface
timing error margin for the interface signals. Also, the timing representation in Verilog may
signal timing error margin
not match the exact timing in SPICE. It is recommended not to partition at timing sensitive
signals.
an analog partition whose internal objects are not visible to Verilog elaborator.
Verilog elaborator
Reach-in signals can be replaced with a new Verilog net using either of the following
reach-in signals Verilog net
The system task associates the new Verilog net to the SPICE node that is equivalent to
the original reach-in signal.
terminal of a pass switch (the primitive gate tranif0 and tranif1) cannot be propagated to
pass switch primitive gate
the other end. A Verilog n-MOSFET gate is added in between the pass switch and the
interface signal to allow signal value passing through the pass switch. If the bidirectional
interface signals involve strength fighting, the final signal value is resolved by PrimeSim
strength fighting
XA. A resistor is added to incorporate the contribution of the digital signal in resolving
the final value. Special attention is required to map the resistance value, specified by the
resistance value
and unnecessary analog and digital signal conversion may also introduce functionality
functionality errors
errors.
or inout ports of digital and analog partitions. Verilog defines seven strength levels and
inout ports digital/analog partitions
rules to resolve strength fights. PrimeSim XA models Verilog strength as a resistor. The
Verilog signal input is applied through the resistor and PrimeSim XA resolves both Verilog
and SPICE contributions to obtain the final values of the bidirectional nets.
A strength table defines a set of resistance strength values that are mapped to Verilog
strength table
seven strength levels for use in strength resolution at inout ports. If Verilog-side signals
strength levels strength resolution Verilog-side signals
always win during strength fighting or there is no strength fighting at inout ports, it is not
necessary to introduce strength resistors.
strength resistors
The resistance presents a Verilog strength relative to a lumped sum SPICE impedance at
SPICE impedance
the bidirectional net. The SPICE impedance depends on the transistor model, technology,
and process used in the design. Therefore, a default strength table does not satisfy
default strength table
the requirement because the relative resistances are both design-dependent and port-
dependent.
Data flow direction must be available in order to select proper resistances. If the Verilog-
data flow direction
side signal wins the strength fight, the strength resistor’s resistance must be significantly
smaller than SPICE-side impedance. Conversely, if the SPICE-side signal wins the
strength fight, the resistance of the strength resistor must be significantly larger than the
SPICE-side impedance. The following two examples show how this works:
Examples
Assume the following for this example:
• Strength fighting occurs at port Y
• Simulation time is 10 ns
• The Verilog-side presents a weak logic0
• The SPICE-side has 3V and logic1 before strength resolution
• Data flows from the SPICE- to the Verilog-side at the 10 ns mark indicating that the
SPICE-side driving strength is stronger.
In this example, the final value at port Y should be logic1.
If the impedance at the SPICE-side is 1000 Ohms, then the proper resistance of the
strength resistor can be 10000 Ohms; in which case PrimeSim XA does the following:
• Resolves that the voltage at port Y to be 2.8V
• Sets port Y to logic1
In this case, the weak Verilog strength is mapped to a 1000 Ohm strength resistor.
• Later, at simulation time 20 ns:
• The Verilog-side presents a strong logic0 at port Y
based designs that contain both digital and analog partitions. This is accomplished
by using the Verilog/VHDL simulator to simulate the digital netlist; while PrimeSim XA
simulates the analog SPICE netlist. When complete, analog and/or digital simulation
results are available for designers to verify their designs.
now supported:
• ModelSim/PrimeSim XA Integration
• Running ModelSim/PrimeSim XA Mixed-Signal Simulation With Standalone ModelSim
• Running ModelSim/PrimeSim XA Mixed-Signal Simulation Under the ADMS
Environment
ModelSim/PrimeSim XA Integration
The libxa_vpi.so mixed-signal simulation library supports ModelSim integration with either
of the following:
• Standalone ModelSim
• In the ADMS environment
ADMS environment
In both Verilog and SPICE design partitioning flows, most mixed-signal simulation features
and limitations for NC-Verilog/VHDL are applicable to ModelSim. Because the cell view
and Verilog configurations for instance-based instantiation are not available in ModelSim,
users must modify the original Verilog source files to add the $snps_module() system
task to designate analog partitions.
Note:
save-restart is not supported in ModelSim/PrimeSim XA mixed-signal
simulation.
% vlib work
% vlog top.v
3. Use the -pli command-line option to link libxa_vpi.so into ModelSim for simulation
using the following syntax. In this example, top is the name of the top design module.
ModelSim
% vsim -c -pli
command
libxa_vpi.so +snps+cosim.cfg top
To enter PrimeSim XA interactive mode from ModelSim, press Ctrl+C during simulation
to pause at ModelSim interactive prompt, and use the command:
% vsim(paused) snps_intr_mode
% valib work
2. Compile the Verilog source code using the following ModelSim syntax. In this example,
-ms invokes the ModelSim compiler:
ModelSim
% valog top.v
command
-ms
3. Invoke ModelSim to run the simulation using the following syntax. In this example, top
is the name of the top design module.
ModelSim
% vasim top
command
-ms -pli libxa_vpi.so
Note:
The -c command-line option does not work for mixed-signal simulation in
batch mode.
References
[1] NC-Verilog/VHDL is a functional verification tool from Cadence Design Systems, Inc.
[2] Verilog-XL is functional verification tool from Cadence Design Systems, Inc.
G
FineSim VPI Cosimulation
This appendix describes the FineSim Pro tool support for mixed-mode simulation with
Verilog simulators using the Verilog Programming Interface (VPI) API.
Mixed-Mode Simulation
Mixed mode simulation involves combining digital and analog simulators in various ways.
However, it has been difficult to find efficient methods for synchronization between the
two domains. This is because the analog simulator uses dynamic time step control while
the digital simulator uses an event driven paradigm. In the FineSim Pro tool, efficient
synchronization algorithms have been developed and applied to mixed-mode simulation.
The FineSim Pro tool supports mixed-mode simulation with Verilog simulators using the
Verilog Programming Interface (VPI) API. Using this standard API allows the FineSim Pro
tool to be used with any vendor’s Verilog simulator.
Verilog Cosimulation
The FineSim Pro tool supports mixed-mode simulation with Verilog simulators. This is
referred to as Verilog cosimulation. The FineSim Pro tool includes a dynamic library,
finesim.so, which provides this support. When the Verilog simulator starts it loads
finesim.so and interacts with the FineSim Pro tool through the VPI API. The following
figure shows the interaction of the digital and analog simulators.
After the location of the library is set by using the LD_LIBRARY_PATH, the name of the
library, finesim.so, and the name of the startup function, finesim_startup, are
generally passed as command-line options to the Verilog simulator.
NCSim
ncverilog +access+rwc +loadvpi=finesim.so:finesim_startup ....
VCS
vcs -R +vpi -load finesim.so:finesim_startup +cli+3 ....
VerilogXL
verilog +access+rwc +loadvpi=finesim.so:finesim_startup
Examples
In general, analog and digital mixed circuits can be categorized into two kinds of circuit
styles. One style has the analog netlist as a design top instance, and digital instances are
instantiated from the analog netlist. The other style has the digital netlist as a design top
instance, and analog instances are instantiated from the digital netlist.
In this section, simple examples with the analog (SPICE) netlist and digital (Verilog) netlist
on top are given to show how the two circuit styles can be simulated with the FineSim Pro
tool.
In this example the main circuit is the SPICE netlist. The SPICE netlist includes both
analog and digital subcircuits. The first inverter is in SPICE, the second is in Verilog
format. In SPICE, sin is the input of the first inverter. The output of the first inverter, sinb
goes to the input of the second inverter, which is an instance of a Verilog module. The
output of the second inverter then goes to dout. Because analog and digital signals are
mixed, the FineSim Pro tool automatically inserts A2D and D2A blocks to convert the
signals from analog to digital and back again.
The following examples can be found in Lab 1_Spice_Top.
** Top Netlist **
X1 sin sinb sinv
X2 sinb dout vinv
Example 69 ms1.v
// ms1.v
`timescale 1ns/1ps
module top;
vinv I1 (sinb,dout);
initial begin
$finesim_config( ,
// show the progress of FineSim Pro
".option progress=0",
// run FineSim Pro command
".finesim -o ms1 ms1.sp"
);
$finesim_instance(I1,"X2"); // mapping each instance
$monitor(" %10.3f sinb= %b dout= %b", $realtime, sinb, dout);
$dumpfile("ms1.vcd");
$dumpvars(0, top);
end
endmodule
Note that the SPICE netlist includes a subcircuit wrapper for the digital block, vinv, which
includes the port list. This digital block is defined and instantiated in the Verilog netlist file.
In addition, the Verilog netlist file contains tasks for configuring the FineSim Pro simulation,
such as $finesim_config, $finesim_instance, in the top module. See FineSim Pro
$finesim_config $finesim_instance
Tasks for detailed information about the tasks used in the Verilog cosimulation.
Although in this example the top-level netlist is the SPICE netlist, it should be noted that
the Verilog simulator reads the Verilog netlist, as can be seen in the examples below. The
tasks in the Verilog netlist configure the FineSim Pro tool and start the top-level SPICE
simulation.
Run
% verilog +access+rwc +loadvpi=finesim.so:finesim_startup ms1.v
% ncverilog +access+rwc +loadvpi=finesim.so:finesim_startup ms1.v
In the example the main circuit is the Verilog netlist. The Verilog netlist includes both
analog and digital subcircuits. The first inverter is in Verilog, the second is in SPICE
format. In Verilog, din is the input of the first inverter. The output of the first inverter, dinb
goes to the input of the second inverter, which is an instance of a SPICE subcircuit. The
output of the second inverter then goes to sout. Because analog and digital signals are
mixed, the FineSim Pro tool automatically inserts D2A and A2D blocks to convert the
signals form digital to analog and back again.
Example 70 ms2.v
// ms2.v
`timescale 1ns/1ps
module top;
reg din;
wire dinb, sout;
vinv I1 (din,dinb);
sinv I2 (dinb,sout);
initial begin
$finesim_config( , ".finesim -o ms2 ms2.sp" );
$monitor(" %10.3f din=%b dinb=%b sout=%b",$realtime,din,dinb,sout);
$dumpfile("ms2.vcd");
$dumpvars(0);
din=0;
repeat(10) #10 din= ~din;
$finish;
end
endmodule
module vinv (i,o);
input i;
output o;
not #1 (o,i);
endmodule
module sinv (in,out);
input in;
output out;
reg out;
initial $finesim_module;
endmodule
Example 71 ms2.sp
* ms2.sp
* Mixed Sim - Verilog Top Example
vvdd VDD 0 dc 2.5
vvss VSS 0 dc 0
.global VSS VDD
.inc ./model.inc
.inc './finemix.sp' $ Automatically generated SPICE instance netlist
.option post
.tran 1p 100ns
.end
In Verilog top netlist style, the analog block in the Verilog netlist file is defined as a module
wrapper with port declarations and the $finesim_module task. The $finesim_module
task causes the FineSim Pro tool to generate a SPICE instance netlist and save it in the
file named finemix.sp. These analog blocks are defined and instantiated in the SPICE
netlist file. The finemix.sp should also be included in the SPICE netlist file.
See FineSim Pro Tasks for detailed information about the tasks used in the Verilog
cosimulation.
Run
% verilog +access+rwc +loadvpi=finesim.so:finesim_startup ms2.v
% ncverilog +access+rwc +loadvpi=finesim.so:finesim_startup ms2.v
Result
This example has a more complicated hierarchy. The top-level netlist is in Verilog, but
it contains eight instances of spice subcircuits. The SPICE netlist for these instances is
again automatically generated and is found in finemix_ms3.sp. Note that all the nets are
connected in the Verilog domain, including the ones colored red in the diagram above that
connect two analog blocks. Because these signals go through the Verilog domain, which is
digital, they are converted from analog to digital and then back again.
The FineSim cosimulation flow disables D2As and A2Ds before the simulation of the
specified offset time and then enables them after the specified offset time.
The FineSim simulation engine issues the following messages:
Message! D2As and A2Ds are not enabled at 0s.
Starting Transient Analysis ...
48.6ns (48.5 %)
Message! D2As and A2Ds are enabled at 50ns.
$finesim_config
Description
With this task, a variety of configuration commands can be defined. Configuration
commands can directly be specified, and/or configuration file name containing those
commands can be specified.
Syntax
$finesim_config( ["config_file_name"] [, "config_command"] ... );
Arguments
Argument Description
Examples
$finesim_config( "test.cfg" );
$finesim_config( , ".finesim test.sp");
$finesim_config( , ".option progress=0 accurate=1",
".a2d vdd25 vl=1.25 vh=1.25",
".d2a vdd25 vl=0 vh=2.5 vx=1.25 tr=0.3n tf=0.3n",
".finesim -out test test.sp");
In the first example, the configuration file name is specified. In the other example,
configuration commands are given directly.
$finesim_input
Description
With this task, you can connect a Verilog input to a SPICE output through an A2D module.
This task has the same meaning as the configuration command .INPUT.
Syntax
$finesim_input( net_name, "spice_node_name" [, "a2d_model_name" ] );
Arguments
Argument Description
Examples
$finesim_input( TOP.IN , "XI1.out" , "default" );
$finesim_output
Description
With this task, you can connect a Verilog output to a SPICE input through a D2A module.
This task has the same meaning as the configuration command .OUTPUT.
Syntax
$finesim_output( net_name, "spice_node_name" [, "d2a_model_name" ] );
Arguments
Argument Description
Examples
$finesim_output( TOP.OUT , "XI1.in" , "default" );
$finesim_inout
Description
With this task, you can connect a Verilog inout port to a SPICE port through D2A and/or
A2D modules. This task has the same meaning as the configuration command .INOUT.
Syntax
$finesim_inout( net_name, "spice_node_name" \
[, "D2A=d2a_model_name" ] [, "A2D=a2d_model_name"]);
Arguments
Argument Description
Examples
$finesim_inout( TOP.DATA , "XI1.data" , "D2A=default", "A2D=default" );
$finesim_module
Description
This task enables you to define a module as a SPICE subcircuit. If the subcircuit name is
not specified in the argument, the name of the Verilog module in which this task is defined
is used. If the subcircuit name is different from the module name, you can specify the
name. When this task is included in a Verilog module, the FineSim Pro tool automatically
generates a SPICE instance netlist which is saved in the file finemix.sp by default, and
internal A/D and D/A conversion modules. The save file name can be changed by using
.OPTION command within the $finesim_config task.
The generated SPICE file should be included in the SPICE netlist. The model used for
the A/D and D/A conversion can be specified by using Verilog statement defparam or
parameter with the keywords of finesim_a2d and finesim_d2a within the module which
$finesim_module task is included. If it is not specified, the DEFAULT model is used.
Arguments
Argument Description
Examples
$finesim_module;
or:
$finesim_module("inv");
$finesim_instance
Description
With this task, you can map a Verilog instance to a SPICE instance. The SPICE instance
should be an instance of a subcircuit wrapper that just includes the port definitions. This
task causes the Verilog instance to be simulated instead of the SPICE instance. Normally
it is used when the top-level netlist is a SPICE netlist. The model used for the A/D and
D/A conversion can be specified by using Verilog statement defparam or parameter with
the keywords of finesim_a2d and finesim_d2a within the instance module. If it is not
specified, the DEFAULT model is used.
See finesim_a2d / finesim_d2a Parameters for the details.
Syntax
$finesim_instance( instance_name, "spice_instance_name" );
Arguments
Argument Description
Examples
$finesim_instance( I1 , "X1" );
Configuration Commands
As described in the $finesim_config section, a variety of configuration commands can
be given using the task $finesim_config. These commands can either be put in a
configuration file specified in the $finesim_config task or included directly in the
$finesim_config task. In this section, each of those command statements is described in
detail.
This section describes the following:
• .RESISTANCE
• .A2D
• .D2A
• .SCOPE
• .INPUT
• .OUTPUT
• .INOUT
• .OPTION
• .FINESIM
• finesim_a2d / finesim_d2a Parameters
.RESISTANCE
Description
This command is used to define a model of signal strengths. In Verilog, net value is
represented by logic and strength. Verilog defines these different signal strengths: supply,
strong, pull, large, weak, medium, small, highz.
The .RESISTANCE command is used to specify the equivalent resistances that correspond
to these signal strengths. A resistance model is part of the specification of an A2D or D2A
converter.
Arguments
Argument Description
Examples
.resistance default 1 3k 4k 5k 50k 70k 90k 10g
.resistance VDD33R 1 3k 5k 10k 50k 80k 100k 20g
The following example illustrates how the .RESISTANCE, .A2D, and .D2A commands are
used together:
.resistance default 1 3k 4k 5k 50k 70k 90k 10g
.A2D default VL=1.25 VH=1.25 TX=1n R=default
.D2A default VL=0 VH=2.5 VX=1.25 TR=1n TF=1n R=default
.A2D
Description
This command is used to define a model for A/D conversion. Different models can be
defined for different input conditions.
Syntax
.A2D a2d_model_name [VL=real_value] [VH=real_value] \
[TX=real_value] [R=res_model_name]
Arguments
Argument Description
R=res_model_name The RESISTANCE model name for signal strengths. The default is
DEFAULT.
Argument Description
TX=real_value Show unknown state ("X") if the signal is between VL and VH for
longer than TX. The default is 1ns.
Examples
.A2D default VL=1.25 VH=1.25 TX=1n R=default
.A2D VDD33 VL=1.65 VH=1.65 TX=0n R=VDD33R
.D2A
Description
This command is used to define a model for D/A conversion. Different models can be
defined for different conditions.
Syntax
.D2A d2a_model_name [VL=real_value] [VH=real_value] [VX=real_value] \
[TR=real_value] [TF=real_value] [T0X=real_value] [TX1=real_value] \
[T1X=real_value] [TX0=real_value] [R=res_model_name]
Arguments
Argument Description
Argument Description
Examples
.D2A default VL=0 VH=2.5 VX=1.25 TR=1n TF=1n R=default
.D2A VDD33 VL=0 VH=3.3 VX=1.65 TR=0.5n TF=0.5n R=VDD33R
.SCOPE
Description
This command is used to define the naming scope for nets. The scope is a hierarchy
name separated by a delimiter dot(.). It is prepended to Verilog or SPICE net names to
create a full net name.
Syntax
.SCOPE [VERILOG=scope_name] [SPICE=scope_name]
Arguments
Argument Description
Examples
.SCOPE VERILOG=TOP.I1.I2 SPICE=XI1.XI2
.INPUT in out
.INPUT
Description
This command is used to connect a Verilog input to a SPICE output through an A2D
module. This command has the same meaning as the $finesim_input task.
Syntax
.INPUT verilog_net_name spice_net_name [A2D=a2d_model_name]
Arguments
Argument Description
spice_net_name Input net name to the SPICE module from the Verilog module.
verilog_net_name Output net name from the Verilog module to the SPICE module.
Examples
.INPUT TOP.IN XI1.out A2D=default
.OUTPUT
Description
This command is used to connect a Verilog output to a SPICE input through a D2A
module. This command has the same meaning as the $finesim_output task.
Syntax
.OUTPUT verilog_net_name spice_net_name [D2A=d2a_model_name]
Arguments
Argument Description
spice_net_name Output net name from the SPICE module to the Verilog module.
verilog_net_name Input net name to the Verilog module from the SPICE module.
Examples
.OUTPUT TOP.OUT XI1.in D2A=default
.INOUT
Description
This command is used to connect a Verilog inout port to a SPICE port through A2D and/or
D2A modules. This command has the same meaning as the $finesim_inout task.
Syntax
.INOUT verilog_net_name spice_net_name [A2D=a2d_model_name]
[D2A=d2a_model_name]
Arguments
Argument Description
Examples
.INOUT TOP.data XI1.data D2A=default A2D=default
.OPTION
Description
By using this .OPTION command, you can specify various options.
Syntax
.OPTION [INST_FILE=file_name] [PROGRESS=0|1] [IMAX=integer_value] \
[IMODE=0|1] [ACCURATE=0|1] [dump_ie=0|1] [minimize_ie=0|1|2]
[bus_format="<%d>"] [port_map_by_name=0|1]
Arguments
Argument Description
INST_FILE=file_name Sets the file name for the SPICE instance netlist. If a Verilog module
has a $finesim_module task, a SPICE instance is automatically
generated in this file. The default file name is finemix.sp.
Argument Description
PROGRESS=0|1 Sets the mode for showing the status of the simulation progress. The
default value is 1 (on mode).
IMODE=0|1 Sets the interrupt mode for FineSim Pro execution. When IMODE=1,
a “Ctrl+C” causes the FineSim simulation engine to stop running.
The default value is 0 (off mode).
ACCURATE=0|1 Sets the re-calculation mode for A/D conversion. A value of 1 results
in more accurate timing, but causes the simulation to run more
slowly. The default value is 0 (off mode).
dump_ie=0|1 Sets to dump out A2D and D2A information into *.dumpie file. The
default value is 0 (off mode).
port_map_by_name 0|1 Defines whether the FineSim simulation engine uses the port order or
port name to map between the Verilog module and SPICE subcircuit.
The default is 0, which maps each cosimulation connection based
on the order the ports are defined. When set to 1, the FineSim
simulation engine maps the connection based on the name of the
port, so the port order in Verilog versus SPICE can be different, but
the name of the port has to be identical.
.FINESIM
Description
With this command, users can define the FineSim Pro command and arguments. The
command arguments and syntax are the same as those for the standalone FineSim Pro
tool.
Syntax
.FINESIM finesim_command_arguments
Arguments
Argument Description
finesim_command_arguments See the FineSim User Guide: Pro and SPICE Reference in for
details.
Examples
.FINESIM -out finesimout input.sp
Examples
The first example overrides the A/D conversion model name with "vdd_33_1" for instance
I2. The second specifies the A/D model name of "vdd_33" for all signals used within the
module. The third specifies the D/A model name of "vdd33" only for a signal A33. The
fourth specifies the A/D model name of "vdd_25" only for the first signal of bus DA.
This section describes the flow supported by the FineSim Pro tool.
• -genv
• finesim_bus_format
• finesim_port_map_by_name
• finesim_verilog_file
• finesim_verilog_instance
• finesim_verilog_module
• finesim_verilog_module_file
• finesim_verilog_subckt_file
-genv
Description
If this command option is given, Verilog instance is automatically generated according the
subcircuit definition in the deck file.
Syntax
finesim -genv[=1|2] deck_file
Examples
finesim -genv test.sp
finesim -genv=1 test.sp
finesim -genv=2 test.sp
The first example is the same as the second example, only the Verilog instance file is
created. The third example generates both a Verilog instance file and SPICE subcircuit
definition file.
finesim_bus_format
Description
Specifies bus format, where %d is mandatory, representing the bits. "<" ">" indicates the
bus characters, which can be modified to fit the bus characters.
Syntax
finesim_bus_format="<%d>"
finesim_port_map_by_name
Description
This option defines whether the FineSim tool uses the port order or port name to map
between the Verilog module and SPICE subckt. The default is 0, which maps each
cosimulation connection is based on the order the ports are defined. When set to 1, the
FineSim tool maps the connection based on the name of the port, so the port order in
Verilog versus SPICE can be different, but the name of the port must be identical.
Syntax
finesim_port_map_by_name=1
finesim_verilog_file
Description
Sets the file name for Verilog instance file. Default file name is "finemix.v".
Syntax
.option finesim_verilog_file=file_name
Examples
.option finesim_verilog_file="inv.v"
finesim_verilog_instance
Description
Specifies a SPICE instance to be replaced by a Verilog module. Note that this option can
only work with the command option -genv. If the subckt name is the same as the module
name, the module name can be omitted.
Syntax
.option finesim_verilog_instance="instance_name:module_name ..."
Examples
.option finesim_verilog_instance="x1.x2.x3:inv x1.x2.x4:buf"
In this example, SPICE instances x1.x2.x3 and x1.x2.x4 are replaced by the Verilog
module inv and buf, respectively.
finesim_verilog_module
Description
Specifies a SPICE subcircuit to be replaced by a Verilog module. If the subcircuit name
is that same as the module name, the module name can be omitted. This option can be
specified multiple times.
Syntax
.option finesim_verilog_module="subckt_name:module_name ... "
Examples
.option finesim_verilog_module="inv buf:BUF nand2:Nand2"
The example means the cosimulation uses the inv, BUF, and Nand2 Verilog modules on
the digital side, not the inv, buf, and nand2 subcircuits in the analog netlist.
finesim_verilog_module_file
Description
This option specifies the Verilog file containing the Verilog module definitions. This option
is used when the Verilog instance file is generated by finesim -genv.
Syntax
finesim_verilog_module_file="filename"
finesim_verilog_subckt_file
Description
Sets the file name for a new SPICE subcircuit definition file. If command option
-genv=2 is given, a new SPICE subcircuit definition file is generated. This subcircuit
is empty because this subcircuit is replaced by a Verilog module. Default file name is
"finemix_subckt.sp".
Syntax
.option finesim_verilog_subckt_file=file_name
Examples
.option finesim_verilog_subckt_file="pll.sp"
** Top Netlist **
X1 sin sinb sinv
X2 sinb dout vinv
.tran 1p 100ns
.end
In this example, suppose you want to replace the vinv subcircuit with the vinv module
on the Verilog side. First, add the .option finesim_verilog_module="vinv" to the
test.sp deck file, and then execute command finesim -genv=2 test.sp in the
terminal. Then the finemix.v and finemix_subckt.sp files are automatically generated.
Third, include finemix.v in the Verilog file and include finemix_subckt.sp in the
test.sp deck file separately. Now, the automatic Verilog instance generation flow is done
and you can continue to run the cosimulation.
Parallel Cosimulation
The FineSim Pro tool has applied its parallel simulation technology to cosimulation. It
solves the performance bottleneck of slower transistor level simulation in a cosimulation
environment. To use this feature, modify the finesim command to run the parallel FineSim
Pro tool with the -np switch, as shown in the following example:
//You can change a 1CPU serial run of
.finesim -spice -o 1CPU input.spi
//to an 8CPU run of
.finesim -np 8 -spice -o 8CPU input.spi
For the output [MSB:LSB] name that is causing the issue, add "wire scalared [MSB:LSB]
name". Alternatively, you can set the signal as "output reg".
H
PrimeSim VPI Cosimulation
This appendix describes the PrimeSim Pro tool support for mixed-mode simulation with
Verilog simulators using the Verilog Programming Interface (VPI) API.
Mixed-Mode Simulation
Mixed mode simulation involves combining digital and analog simulators in various ways.
However, it has been difficult to find efficient methods for synchronization between the
two domains. This is because the analog simulator uses dynamic time step control while
the digital simulator uses an event driven paradigm. In the PrimeSim Pro tool, efficient
synchronization algorithms have been developed and applied to mixed-mode simulation.
The PrimeSim Pro tool supports mixed-mode simulation with Verilog simulators using the
Verilog Programming Interface (VPI) API. Using this standard API allows the PrimeSim
Pro tool to be used with any vendor’s Verilog simulator.
Verilog Cosimulation
The PrimeSim Pro tool supports mixed-mode simulation with Verilog simulators. This is
referred to as Verilog cosimulation. The PrimeSim Pro tool includes a dynamic library,
primesim.so, which provides this support. When the Verilog simulator starts it loads
primesim.so and interacts with the PrimeSim Pro tool through the VPI API. The following
figure shows the interaction of the digital and analog simulators.
After the location of the library is set by using the LD_LIBRARY_PATH, the name of the
library, primesim.so, and the name of the startup function, primesim_startup, are
generally passed as command-line options to the Verilog simulator.
NCSim
ncverilog +access+rwc +loadvpi=primesim.so:primesim_startup ....
VCS
vcs -R +vpi -load primesim.so:primesim_startup +cli+3 ....
VerilogXL
verilog +access+rwc +loadvpi=primesim.so:primesim_startup
Examples
In general, analog and digital mixed circuits can be categorized into two kinds of circuit
styles. One style has the analog netlist as a design top instance, and digital instances are
instantiated from the analog netlist. The other style has the digital netlist as a design top
instance, and analog instances are instantiated from the digital netlist.
In this section, simple examples with the analog (SPICE) netlist and digital (Verilog) netlist
on top are given to show how the two circuit styles can be simulated with the PrimeSim
Pro tool.
In this example the main circuit is the SPICE netlist. The SPICE netlist includes both
analog and digital subcircuits. The first inverter is in SPICE, the second is in Verilog
format. In SPICE, sin is the input of the first inverter. The output of the first inverter, sinb
goes to the input of the second inverter, which is an instance of a Verilog module. The
output of the second inverter then goes to dout. Because analog and digital signals are
mixed, the PrimeSim Pro tool automatically inserts A2D and D2A blocks to convert the
signals from analog to digital and back again.
The following examples can be found in Lab 1_Spice_Top.
** Top Netlist **
X1 sin sinb sinv
X2 sinb dout vinv
Example 73 ms1.v
// ms1.v
`timescale 1ns/1ps
module top;
vinv I1 (sinb,dout);
initial begin
$primesim_config( ,
// show the progress of PrimeSim Pro
".option progress=0",
// run PrimeSim Pro command
".primesim -o ms1 ms1.sp"
);
$primesim_instance(I1,"X2"); // mapping each instance
$monitor(" %10.3f sinb= %b dout= %b", $realtime, sinb, dout);
$dumpfile("ms1.vcd");
$dumpvars(0, top);
end
endmodule
Note that the SPICE netlist includes a subcircuit wrapper for the digital block, vinv, which
includes the port list. This digital block is defined and instantiated in the Verilog netlist file.
In addition, the Verilog netlist file contains tasks for configuring the PrimeSim Pro
simulation, such as $primesim_config, $primesim_instance, in the top module.
$finesim_config $finesim_instance
See PrimeSim Pro Tasks for detailed information about the tasks used in the Verilog
cosimulation.
Although in this example the top-level netlist is the SPICE netlist, it should be noted that
the Verilog simulator reads the Verilog netlist, as can be seen in the examples below. The
tasks in the Verilog netlist configure the PrimeSim Pro tool and start the top-level SPICE
simulation.
Run
% verilog +access+rwc +loadvpi=primesim.so:primesim_startup ms1.v
% ncverilog +access+rwc +loadvpi=primesim.so:primesim_startup ms1.v
In the example the main circuit is the Verilog netlist. The Verilog netlist includes both
analog and digital subcircuits. The first inverter is in Verilog, the second is in SPICE
format. In Verilog, din is the input of the first inverter. The output of the first inverter, dinb
goes to the input of the second inverter, which is an instance of a SPICE subcircuit. The
output of the second inverter then goes to sout. Because analog and digital signals are
mixed, the PrimeSim Pro tool automatically inserts D2A and A2D blocks to convert the
signals form digital to analog and back again.
Example 74 ms2.v
// ms2.v
`timescale 1ns/1ps
module top;
reg din;
wire dinb, sout;
vinv I1 (din,dinb);
sinv I2 (dinb,sout);
initial begin
$primesim_config( , ".primesim -o ms2 ms2.sp" );
$monitor(" %10.3f din=%b dinb=%b sout=%b",$realtime,din,dinb,sout);
$dumpfile("ms2.vcd");
$dumpvars(0);
din=0;
repeat(10) #10 din= ~din;
$finish;
end
endmodule
module vinv (i,o);
input i;
output o;
not #1 (o,i);
endmodule
module sinv (in,out);
input in;
output out;
reg out;
initial $primesim_module;
endmodule
Example 75 ms2.sp
* ms2.sp
* Mixed Sim - Verilog Top Example
vvdd VDD 0 dc 2.5
vvss VSS 0 dc 0
.global VSS VDD
.inc ./model.inc
.inc './primemix.sp' $ Automatically generated SPICE instance netlist
.option post
.tran 1p 100ns
.end
In Verilog top netlist style, the analog block in the Verilog netlist file is defined as a module
wrapper with port declarations and the $primesim_module task. The $primesim_module
task causes the PrimeSim Pro tool to generate a SPICE instance netlist and save it in the
file named primemix.sp. These analog blocks are defined and instantiated in the SPICE
netlist file. The primemix.sp should also be included in the SPICE netlist file.
See PrimeSim Pro Tasks for detailed information about the tasks used in the Verilog
cosimulation.
Run
% verilog +access+rwc +loadvpi=primesim.so:primesim_startup ms2.v
% ncverilog +access+rwc +loadvpi=primesim.so:primesim_startup ms2.v
Result
This example has a more complicated hierarchy. The top-level netlist is in Verilog, but
it contains eight instances of spice subcircuits. The SPICE netlist for these instances is
again automatically generated and is found in primemix_ms3.sp. Note that all the nets are
connected in the Verilog domain, including the ones colored red in the diagram above that
connect two analog blocks. Because these signals go through the Verilog domain, which is
digital, they are converted from analog to digital and then back again.
The PrimeSim cosimulation flow disables D2As and A2Ds before the simulation of the
specified offset time and then enables them after the specified offset time.
The PrimeSim simulation engine issues the following messages:
Message! D2As and A2Ds are not enabled at 0s.
Starting Transient Analysis ...
48.6ns (48.5 %)
Message! D2As and A2Ds are enabled at 50ns.
$primesim_config
Description
With this task, a variety of configuration commands can be defined. Configuration
commands can directly be specified, and/or configuration file name containing those
commands can be specified.
Syntax
$primesim_config( ["config_file_name"] [, "config_command"] ... );
Arguments
Argument Description
Examples
$primesim_config( "test.cfg" );
$primesim_config( , ".primesim test.sp");
$primesim_config( , ".option progress=0 accurate=1",
".a2d vdd25 vl=1.25 vh=1.25",
".d2a vdd25 vl=0 vh=2.5 vx=1.25 tr=0.3n tf=0.3n",
".primesim -out test test.sp");
In the first example, the configuration file name is specified. In the other example,
configuration commands are given directly.
$primesim_input
Description
With this task, you can connect a Verilog input to a SPICE output through an A2D module.
This task has the same meaning as the configuration command .INPUT.
Syntax
$primesim_input( net_name, "spice_node_name" [, "a2d_model_name" ] );
Arguments
Argument Description
Examples
$primesim_input( TOP.IN , "XI1.out" , "default" );
$primesim_output
Description
With this task, you can connect a Verilog output to a SPICE input through a D2A module.
This task has the same meaning as the configuration command .OUTPUT.
Syntax
$primesim_output( net_name, "spice_node_name" [, "d2a_model_name" ] );
Arguments
Argument Description
Examples
$primesim_output( TOP.OUT , "XI1.in" , "default" );
$primesim_inout
Description
With this task, you can connect a Verilog inout port to a SPICE port through D2A and/or
A2D modules. This task has the same meaning as the configuration command .INOUT.
Syntax
$primesim_inout( net_name, "spice_node_name" \
[, "D2A=d2a_model_name" ] [, "A2D=a2d_model_name"]);
Arguments
Argument Description
Examples
$primesim_inout( TOP.DATA , "XI1.data" , "D2A=default", "A2D=default" );
$primesim_module
Description
This task enables you to define a module as a SPICE subcircuit. If the subcircuit name is
not specified in the argument, the name of the Verilog module in which this task is defined
is used. If the subcircuit name is different from the module name, you can specify the
name. When this task is included in a Verilog module, the PrimeSim Pro tool automatically
generates a SPICE instance netlist which is saved in the file primemix.sp by default, and
internal A/D and D/A conversion modules. The save file name can be changed by using
.OPTION command within the $primesim_config task.
The generated SPICE file should be included in the SPICE netlist. The model used for
the A/D and D/A conversion can be specified by using Verilog statement defparam or
parameter with the keywords of primesim_a2d and primesim_d2a within the module
Arguments
Argument Description
Examples
$primesim_module;
or:
$primesim_module("inv");
$primesim_instance
Description
With this task, you can map a Verilog instance to a SPICE instance. The SPICE instance
should be an instance of a subcircuit wrapper that just includes the port definitions. This
task causes the Verilog instance to be simulated instead of the SPICE instance. Normally
it is used when the top-level netlist is a SPICE netlist. The model used for the A/D and
D/A conversion can be specified by using Verilog statement defparam or parameter with
the keywords of primesim_a2d and primesim_d2a within the instance module. If it is not
specified, the DEFAULT model is used.
See primesim_a2d / primesim_d2a Parameters for the details.
Syntax
$primesim_instance( instance_name, "spice_instance_name" );
Arguments
Argument Description
Examples
$primesim_instance( I1 , "X1" );
Configuration Commands
As described in $primesim_config, a variety of configuration commands can be given
using the task $primesim_config. These commands can either be put in a configuration
file specified in the $primesim_config task or included directly in the $primesim_config
task. In this section, each of those command statements is described in detail.
This section describes the following:
• .RESISTANCE
• .A2D
• .D2A
• .SCOPE
• .INPUT
• .OUTPUT
• .INOUT
• .OPTION
• .PRIMESIM
• primesim_a2d / primesim_d2a Parameters
.RESISTANCE
Description
This command is used to define a model of signal strengths. In Verilog, net value is
represented by logic and strength. Verilog defines these different signal strengths: supply,
strong, pull, large, weak, medium, small, highz.
The .RESISTANCE command is used to specify the equivalent resistances that correspond
to these signal strengths. A resistance model is part of the specification of an A2D or D2A
converter.
Consider D2A, S being the signal strength:
• if (S == supply) apply R7 as resistance of the Thevenin equivalent circuit.
• if (S == strong) apply R6 as resistance of the Thevenin equivalent circuit.
Arguments
Argument Description
Examples
.resistance default 1 3k 4k 5k 50k 70k 90k 10g
.resistance VDD33R 1 3k 5k 10k 50k 80k 100k 20g
The following example illustrates how the .RESISTANCE, .A2D, and .D2A commands are
used together:
.resistance default 1 3k 4k 5k 50k 70k 90k 10g
.A2D default VL=1.25 VH=1.25 TX=1n R=default
.D2A default VL=0 VH=2.5 VX=1.25 TR=1n TF=1n R=default
.A2D
Description
This command is used to define a model for A/D conversion. Different models can be
defined for different input conditions.
Syntax
.A2D a2d_model_name [VL=real_value] [VH=real_value] \
[TX=real_value] [R=res_model_name]
Arguments
Argument Description
R=res_model_name The RESISTANCE model name for signal strengths. The default is
DEFAULT.
TX=real_value Show unknown state ("X") if the signal is between VL and VH for
longer than TX. The default is 1ns.
Examples
.A2D default VL=1.25 VH=1.25 TX=1n R=default
.A2D VDD33 VL=1.65 VH=1.65 TX=0n R=VDD33R
.D2A
Description
This command is used to define a model for D/A conversion. Different models can be
defined for different conditions.
Syntax
.D2A d2a_model_name [VL=real_value] [VH=real_value] [VX=real_value] \
[TR=real_value] [TF=real_value] [T0X=real_value] [TX1=real_value] \
[T1X=real_value] [TX0=real_value] [R=res_model_name]
Arguments
Argument Description
Examples
.D2A default VL=0 VH=2.5 VX=1.25 TR=1n TF=1n R=default
.D2A VDD33 VL=0 VH=3.3 VX=1.65 TR=0.5n TF=0.5n R=VDD33R
.SCOPE
Description
This command is used to define the naming scope for nets. The scope is a hierarchy
name separated by a delimiter dot(.). It is prepended to Verilog or SPICE net names to
create a full net name.
Syntax
.SCOPE [VERILOG=scope_name] [SPICE=scope_name]
Arguments
Argument Description
Examples
.SCOPE VERILOG=TOP.I1.I2 SPICE=XI1.XI2
.INPUT in out
.INPUT
Description
This command is used to connect a Verilog input to a SPICE output through an A2D
module. This command has the same meaning as the $primesim_input task.
Syntax
.INPUT verilog_net_name spice_net_name [A2D=a2d_model_name]
Arguments
Argument Description
spice_net_name Input net name to the SPICE module from the Verilog module.
verilog_net_name Output net name from the Verilog module to the SPICE module.
Examples
.INPUT TOP.IN XI1.out A2D=default
.OUTPUT
Description
This command is used to connect a Verilog output to a SPICE input through a D2A
module. This command has the same meaning as the $primesim_output task.
Syntax
.OUTPUT verilog_net_name spice_net_name [D2A=d2a_model_name]
Arguments
Argument Description
spice_net_name Output net name from the SPICE module to the Verilog module.
verilog_net_name Input net name to the Verilog module from the SPICE module.
Examples
.OUTPUT TOP.OUT XI1.in D2A=default
.INOUT
Description
This command is used to connect a Verilog inout port to a SPICE port through A2D and/or
D2A modules. This command has the same meaning as the $primesim_inout task.
Syntax
.INOUT verilog_net_name spice_net_name [A2D=a2d_model_name]
[D2A=d2a_model_name]
Arguments
Argument Description
Argument Description
Examples
.INOUT TOP.data XI1.data D2A=default A2D=default
.OPTION
Description
By using this .OPTION command, you can specify various options.
Syntax
.OPTION [INST_FILE=file_name] [PROGRESS=0|1] [IMAX=integer_value] \
[IMODE=0|1] [ACCURATE=0|1] [dump_ie=0|1] [minimize_ie=0|1|2]
[bus_format="<%d>"] [port_map_by_name=0|1]
Arguments
Argument Description
INST_FILE=file_name Sets the file name for the SPICE instance netlist. If a Verilog module
has a $primesim_module task, a SPICE instance is automatically
generated in this file. The default file name is primemix.sp.
PROGRESS=0|1 Sets the mode for showing the status of the simulation progress. The
default value is 1 (on mode).
IMODE=0|1 Sets the interrupt mode for PrimeSim Pro execution. When
IMODE=1, a “Ctrl+C” causes the PrimeSim simulation engine to
stop running. The default value is 0 (off mode).
ACCURATE=0|1 Sets the re-calculation mode for A/D conversion. A value of 1 results
in more accurate timing, but causes the simulation to run more
slowly. The default value is 0 (off mode).
dump_ie=0|1 Sets to dump out A2D and D2A information into *.dumpie file. The
default value is 0 (off mode).
Argument Description
port_map_by_name 0|1 Defines whether the PrimeSim simulation engine uses the port
order or port name to map between the Verilog module and
SPICE subcircuit. The default is 0, which maps each cosimulation
connection based on the order the ports are defined. When set to 1,
the PrimeSim simulation engine maps the connection based on the
name of the port, so the port order in Verilog versus SPICE can be
different, but the name of the port has to be identical.
.PRIMESIM
Description
With this command, users can define the PrimeSim Pro command and arguments. The
command arguments and syntax are the same as those for the standalone PrimeSim Pro
tool.
Syntax
.PRIMESIM primesim_command_arguments
Arguments
Argument Description
primesim_command_argume See the "Running the PrimeSim Tool" chapter in the PrimeSim
nts User Guide: Pro and SPICE in for details.
Examples
.PRIMESIM -out primesimout input.sp
Examples
The first example overrides the A/D conversion model name with "vdd_33_1" for instance
I2. The second specifies the A/D model name of "vdd_33" for all signals used within the
module. The third specifies the D/A model name of "vdd33" only for a signal A33. The
fourth specifies the A/D model name of "vdd_25" only for the first signal of bus DA.
This section describes the flow supported by the PrimeSim Pro tool.
• -genv
• primesim_bus_format
• primesim_port_map_by_name
• primesim_verilog_file
• primesim_verilog_instance
• primesim_verilog_module
• primesim_verilog_module_file
• primesim_verilog_subckt_file
-genv
Description
If this command option is given, Verilog instance is automatically generated according the
subcircuit definition in the deck file.
Syntax
primesim -genv[=1|2] deck_file
Examples
primesim -genv test.sp
primesim -genv=1 test.sp
primesim -genv=2 test.sp
The first example is the same as the second example, only the Verilog instance file is
created. The third example generates both a Verilog instance file and SPICE subcircuit
definition file.
primesim_bus_format
Description
Specifies bus format, where %d is mandatory, representing the bits. "<" ">" indicates the
bus characters, which can be modified to fit the bus characters.
Syntax
primesim_bus_format="<%d>"
primesim_port_map_by_name
Description
This option defines whether the PrimeSim tool uses the port order or port name to map
between the Verilog module and SPICE subckt. The default is 0, which maps each
cosimulation connection is based on the order the ports are defined. When set to 1, the
PrimeSim tool maps the connection based on the name of the port, so the port order in
Verilog versus SPICE can be different, but the name of the port must be identical.
Syntax
primesim_port_map_by_name=1
primesim_verilog_file
Description
Sets the file name for Verilog instance file. Default file name is "primemix.v".
Syntax
.option primesim_verilog_file=file_name
Examples
.option primesim_verilog_file="inv.v"
primesim_verilog_instance
Description
Specifies a SPICE instance to be replaced by a Verilog module. Note that this option can
only work with the command option -genv. If the subckt name is the same as the module
name, the module name can be omitted.
Syntax
.option primesim_verilog_instance="instance_name:module_name ..."
Examples
.option primesim_verilog_instance="x1.x2.x3:inv x1.x2.x4:buf"
In this example, SPICE instances x1.x2.x3 and x1.x2.x4 are replaced by the Verilog
module inv and buf, respectively.
primesim_verilog_module
Description
Specifies a SPICE subcircuit to be replaced by a Verilog module. If the subcircuit name
is that same as the module name, the module name can be omitted. This option can be
specified multiple times.
Syntax
.option primesim_verilog_module="subckt_name:module_name ... "
Examples
.option primesim_verilog_module="inv buf:BUF nand2:Nand2"
The example means the cosimulation uses the inv, BUF, and Nand2 Verilog modules on
the digital side, not the inv, buf, and nand2 subcircuits in the analog netlist.
primesim_verilog_module_file
Description
This option specifies the Verilog file containing the Verilog module definitions. This option
is used when the Verilog instance file is generated by primesim -genv.
Syntax
primesim_verilog_module_file="filename"
primesim_verilog_subckt_file
Description
Sets the file name for a new SPICE subcircuit definition file. If command option
-genv=2 is given, a new SPICE subcircuit definition file is generated. This subcircuit
is empty because this subcircuit is replaced by a Verilog module. Default file name is
"primemix_subckt.sp".
Syntax
.option primesim_verilog_subckt_file=file_name
Examples
.option primesim_verilog_subckt_file="pll.sp"
** Top Netlist **
X1 sin sinb sinv
X2 sinb dout vinv
.tran 1p 100ns
.end
In this example, suppose you want to replace the vinv subcircuit with the vinv module
on the Verilog side. First, add the .option primesim_verilog_module="vinv" to
the test.sp deck file, and then execute command primesim -genv=2 test.sp in
the terminal. Then the primemix.v and primemix_subckt.sp files are automatically
generated. Third, include primemix.v in the Verilog file and include primemix_subckt.sp
in the test.sp deck file separately. Now, the automatic Verilog instance generation flow is
done and you can continue to run the cosimulation.
Parallel Cosimulation
The PrimeSim Pro tool has applied its parallel simulation technology to cosimulation. It
solves the performance bottleneck of slower transistor level simulation in a cosimulation
environment. To use this feature, modify the primesim command to run the parallel
PrimeSim Pro tool with the -np switch, as shown in the following example:
//You can change a 1CPU serial run of
.primesim -spice -o 1CPU input.spi
//to an 8CPU run of
.primesim -np 8 -spice -o 8CPU input.spi
For the output [MSB:LSB] name that is causing the issue, add "wire scalared [MSB:LSB]
name". Alternatively, you can set the signal as "output reg".
I
Reserved Keywords
This appendix describes the reserved keywords. When using the Verilog-SPICE, VHDL/
Verilog-SPICE or Verilog-AMS-SPICE flows, or Verilog-AMS-SPICE, these terms are
treated as keywords in the Verilog modules. If any of the following keywords are used as
net names, port names, instance names or module names in the Verilog (D) modules, you
must rename these keywords to avoid compilation errors.
Glossary
A2A through-net
A net that is used only for port connections between two SPICE subcircuits in a Verilog
view.
A2D
An analog-to-digital interface element.
BA (back-annotation)
Back-annotation (BA) is a process of stitching the parasitic RCs back to the design
netlist through connectivity information (net name, instance name, pin name) inside the
parasitic file.
bidirectional switch
A device that conducts in both directions. In such cases, signals on either side of
the device can be the driver signal. A bidirectional switch is typically used to enable
isolation between buses or signals.
D2A
A digital-to-analog interface element.
D2D through-net
A net that is only used for port connections between two Verilog modules in a SPICE
view.
donut configuration
A description of the design using different views across different levels of hierarchy.
For example: Verilog-SPICE-Verilog or SPICE-VHDL-SPICE are considered donut
configurations.
DSPF
A detailed standard parasitic format (DSPF) output netlist format is generated by an
extraction tool, and describes interconnect information. Actual net parasitic resistance
and capacitance component information is contained in this format.
GUI
A graphical user interface (GUI).
HAR
Hierarchical array reduction (HAR) that speeds-up the simulation for memory designs
(DRAM and SRAM).
instantiation
The process of creating an instance from a module definition or simulator primitive,
and defining the connectivity and parameters of that instance.
mixed-net
A net that connects the discrete domain (digital) to the continuous domain (analog).
All nodes that exist at the boundary between VCS and PrimeSim XA are considered
mixed-nets.
mixed-signal
A circuit containing analog- and digital-style components.
multiple view
In a given design, at a particular hierarchy, if more than one representation is available
for simulation (from the choices of Verilog, SPICE, and Verilog-A), it is considered a
multiple view.
PLI
A programming language interface (PLI) of Verilog HDL is a mechanism for interfacing
Verilog programs with programs written in the C language. PLI also provides a
mechanism for accessing internal databases of the simulator from the C program.
real data type
The Verilog or VHDL data type defined in IEEE Std 1264-1996 and Std 1364-2001.
resistance map file
An ASCII file that equates MOSFET "on" resistance to Verilog drive strength; the
resistance map file contains the signal conversion data between a SPICE analog value
to a Verilog digital value, and a Verilog digital value to a SPICE analog value.
SDF
A standard delay format (SDF) file stores the timing data generated by EDA tools for
use in any stage of a design process. The data in the SDF file is represented in a tool-
independent way and includes the following information: delay, timing check, timing
constraint, incremental and absolute delay.
simv
A Verilog simulator command.
single view
In a given design, at a particular hierarchy, if there is only one view available for
simulation (from the choices of Verilog, SPICE, and Verilog-A), it is considered a
single view. A single view is automatically selected for simulation as it is the only view
available.
SPEF
A standard parasitic extraction format (SPEF) file is an IEEE standard format. This file
provides a standard median to pass parasitic information between EDA tools during
any stage in the design process. This format contains actual net parasitic resistance
and capacitance components.
SPICE netlist
In the present context, the term SPICE netlist is used in place of transistor-level netlist.
SPICE-top
The top level of the design hierarchy is described in a transistor-level netlist format.
SPICE view
In a given design, at a particular hierarchy, if a SPICE module is available and is used
to simulate a particular block, it is considered a SPICE view for that block.
VCS
A Synopsys simulator for Verilog, VHDL, and mixed-HDL design descriptions.
Verilog dummy module
A module that is the Verilog place holder for a transistor block. A dummy module is an
empty module containing only the module declaration and port declarations.
Verilog-top
The top level of the design hierarchy is described in Verilog RTL or gate-level netlist
format.
Verilog view
In a given design, at a particular hierarchy, if a Verilog module is available and is used
to simulate a particular block, it is considered a Verilog view for that block.
Verilog wrapper
A Verilog netlist comprising an empty module. Only the module name and port
description are in the wrapper.
VHDL
VHSIC HDL
vhdlan
A VHDL analyzer command.
vlogan
A Verilog analyzer command.
VPD
An output format for VCS. VPD uses the VCD+ (value change dump) format.
wreal data type
A Verilog-AMS wire of type "real" which allows modules to exchange "real" values
through ports. Also, a real net data type used in a Verilog wrapper module in the
VHDL/Verilog-SPICE flow to interface a real VHDL port to a top-level SPICE net or
connect a SPICE port to a top-level VHDL real net.
XMR
A feature that is extensively used in Verilog testbenches, and is referred to as a cross-
module reference or Verilog hierarchical referencing. This feature enables simple
probing into, or monitoring of, buried signals without requiring the signals to be routed
to the top of the design for observation. No declaration of global signals in a package is
required for this feature, nor is any modification of the original monitored code.