Documente Academic
Documente Profesional
Documente Cultură
December, 2017
Copyright Statement
© 2017 Cadence Design Systems, Inc. All rights reserved worldwide. Cadence and the Cadence logo are
registered trademarks of Cadence Design Systems, Inc. All others are the property of their respective
holders.
Contents
Purpose ..................................................................................................................... 4
Prerequisites .............................................................................................................. 4
Overview .................................................................................................................... 4
Introduction ................................................................................................................ 5
Support .................................................................................................................... 39
Feedback ................................................................................................................. 39
Purpose
This rapid adoption kit (RAK)/workshop database describes the usage of the commonly
used asserts available in Spectre and Spectre APS. Assert statement enables you to
perform checks on operating point parameters, model parameters, node voltages, device
currents. Sub circuit scoping is supported and asserts using boolean and non-boolean
expressions are also supported. These device checks are different from Safe Operating
Check (SOA) checks, through which the user can setup checks for circuit conditions,
operating regions and, device checking.
Prerequisites
Overview
This Rapid Adoption Kit (RAK) will demonstrate how to use the Spectre Asserts using
command line. At the end of this workshop, you will be able to write Spectre assert
statements.
This RAK is intended for design and verification engineers who are interested in using
asserts using Spectre/APS simulators to identify and debug violations in required circuit
behavior.
Introduction
The Spectre assert statement enables you to perform checks on design parameters,
node voltages, element currents, model parameters, operating point parameters, and
expressions. Typical applications are parameter out-of-range checks, and save operation
element voltage and current checks. Use of wildcards and subcircuit scoping are
supported. When multiple assert checks are used, the check and checklimit statements
enable you to manage which check is active during which analysis.
Note: The Spectre assert, check, and checklimit statements are supported only
in Spectre and Spectre APS. Spectre XPS does not support this functionality.
All asserts can be applied either globally to the entire design, or locally to specific blocks
of a design. The scoping options are available to define the scope of each design check.
The design checks can be applied to a specific subcircuit instance (dev=…), or to all
instances of a subckt definition (sub=”…”), or to an array of subcircuit
masters(subs=[…]), or to subcircuit master patterns (subs=[inv* *buf*]). For
further details on the scoping, please check the Spectre User Manual or use command
“% spectre -h”.
1. Spectre®
% spectre netlist.scs
2. Spectre® APS
If the netlist is in spice format that please add +spice in command line.
Use Model
The syntax used by the assert checks can be characterized by the following Spectre
syntax. The spice syntax is not supported.
Syntax
<Assert Name> assert <param=value> <expr=” MDL expression”>
Examples:
diode_vtg_assert assert mod=diode1 param=v min=-1 max=0.5
current_density_check assert dev=R1 expr="abs(I(1))>1u"
boolean_check assert mod=pch expr="(V(g,s)<-1 || V(g,s)>1)"
message="PMOS gate voltage exceeded" duration=0.1n
The next section demonstrates the commonly used asserts. Notice that for each assert,
its corresponding netlist <netlistName> is in the sub-directory that is named by
<netlistName>.
Voltage assert
The purpose of this section is to get familiar with the voltage assert. Here you will
learn how to create an assert for quickly figuring out forward biased diodes in the
entire circuit.
Action 1: Open the netlist voltage.scs, review the circuit and the assert
statement.
Checks the operating point vgs of model nch over device instances present in the
inv subckt and prints a warning Maximum voltage exceeded !! if the value
of vgs is less than -11 and higher than 1.0.
Checks the terminal voltage V(1) in the instance C1 and prints a warning cap
terminal voltage exceeded beyond +/-1V !! if the value of V(1) is less
than -1 and higher than 1.0. Here V(1)refers to the positive terminal of the
capacitor.
Checks the parameter v over all instances of the model diode1 and prints a
warning Maximum diode voltage exceeded - Improper bias - diode
forward biased !! if the value of v is less than -1 and higher than 0.5.
Figure 1
The top-level circuit is shown above.
Action 3: Open and review the log file voltage.log. Check for any warning
messages.
Here’s the waveform for this circuit. The associated assert name is written besides
the signal being used in that assert.
cap_vtg
vgs_invalid
diode_vtg_assert
Figure 2.
Marker is placed at 1.0V for vgs and out in above waveform plot.
The first assert statement will check value of vgs parameter for nch model. If it
goes above 1V, a warning message is written to the log file as below -
To generate the waveform plot below, right click on the name of signal, choose
Type-> points.
The first assert statement also outputs a message when value of vgs returns to
below 1V as shown below -
Similar warnings are displayed for other transistors. Please review the log file
carefully and understand the violations.
The second assert statement will be true @ V(1)>1 V for duration >=100 psec as
shown below -
Figure 4. Zoomed-in portion of the signal V(mid) at the start of violation ‘cap_vtg’.
Figure 5. Zoomed-in portion of the signal V(mid) near the end of violation ‘cap_vtg.
The third assert statement will check value of diode voltage for diode1 model. If it
goes below -1V for 1nsec, a warning message is written to the log file as below -
Figure 6. Zoomed-in portion of the diode voltage near the start of violation
‘diode_vtg_assert’.
From here on, voltage for D2 diode remains below -1V.
Here, as you may have seen, the voltage you want to check can be at a node in
the circuit or a sub circuit or a diode terminal or a voltage parameter of a transistor.
Current assert
Action 1: Open the netlist current.scs, review the circuit and the design check
statement.
Checks the current parameter i over all instances of the model diode1 and prints
a warning Danger: diode working outside of safe zone: current
exceeded !! if the value of i is less than -1mA and higher than 20mA for
duration>=1nsec.
Action 3: Open and review the log file current.log. Check for any warning
messages.
The assert will become true when i goes above 20mA for duration>=1nsec as
shown below –
Action 1: Open the netlist physical_dimensions.scs, review the circuit and the
design check statement.
Checks the expression w/l in the device instance MP1 and prints a warning
PMOS: Gate width over length ratio went beyond range!! if the
value of w/l is less than 3u and higher than 50u.
Action 3: Open and review the log file physical_dimensions.log. Check for any
warning messages.
The warning message is displayed just once and not at every time step since the
assert is always true in this case –
Action 3: Open and review the log file current_density.log. Check for any
warning messages.
As soon as I(1) returns to within bounds (< 1mA), below message is displayed
–
Boolean assert
Action 1: Open the netlist boolean.scs, review the circuit and the assert statement.
% spectre boolean.scs
Action 3: Open and review the log file boolean.log. Check for any warning
messages. Please review the waveform below –
The assert will become true when the expr becomes true for duration>=100psec
as shown below–
As soon as vgs returns to within bounds (< 1V), below message is displayed –
The simulator doesn’t wait for I(d)to go within bounds [-infinity < I(d) <
0.5mA] to display the above warning.
Checks the inline sub circuit parameter A1 in the device instance C2 and prints a
warning model poly_cap not allowed if the value of A1 is above 0.1fF and
returns the value of A1.
Action 3: Open and review the log file inline_subckt.log. Check for any warning
messages.
As you might have observed, you can exclude certain instances from the asserts.
Here for example, in the netlist, C3 is excluded from the assert check.
The next section contains detailed examples demonstrating new features in this
Spectre version along with already availabe features. As in last section, for each
assert, its corresponding netlist <netlistName> is in the sub-directory that is named
by <netlistName>. At the end, you will be able to write asserts with the knowledge
of how to skip asserts for certain subckts, enable and disable certain asserts using
a single statement, etc.
Workshop exercise
In this section, different dynamic checks are introduced and applied to simple circuits with
their output shown.
Checks the model parameter area over all device instances with the model
diode1 and prints a warning Danger: diode area is too HIGH !! if the
value of area is above 0.5n and returns the value of area.
You should use mod when you want to apply an assert to devices which use a
specific model. This check is useful in cases where the designer is aware of the
model of the violating devices.
Checks the length l of device instance MN1 in all instances of the subcircuits;
whose names match in? (in our case, it matches with inv) and prints a warning
Danger: length is > 40n !! if the value of l is above 40n and returns the
value of l.
You should use dev when you want to apply an assert to specific instances in the
whole circuit. This option is useful in cases where the designer is aware of the
violating devices or instances.
Checks the width w of device instance MN1 in all instances of the subcircuits and
prints a warning width > 1.5 u or width < 1u !! if the value of w is above
1.5u or below 1u and returns the value of w.
param is often used to quickly point out violating devices in the circuit. For
example, it can enable the designer in locating the dangerously big as well as
extremely devices which can break the circuit.
Checks the subcircuit parameter area in all instances of the subcircuits; whose
names match buffe? (in our case, it matches with buffer) and prints a warning
Danger: length is > 40n !! if the value of l is above 40n and returns the
value of l.
Checks the model parameter dtox over all device instances with the model nch
and prints a warning dtox is too HIGH !! if the value of dtox is above -
0.0002 or below -1 and returns the value of dtox.
Checks the nominal temperature tnom over all instances of the primitive type
bsim4 and prints a warning Primitive: temperature exceeded beyond
limit !! if the value of tnom is above 24 or below 0 and returns the value of
tnom.
Action 3: Open and review the log file example1.log. Check for any warning
messages.
2. assert – level
The purpose of this section is get familiar with the level option available in
Spectre assert. level allows you to control the severity level of the message if
the check fails. Its default value is warning. Possible values are none, notice,
warning, error, and fatal.
Action 1: Open the netlist example2.scs, review the circuit and the assert
statement.
These are like the voltage asserts described earlier (in first section) except the
value of level is specified here.
If the severity level is error, the Spectre circuit simulator aborts the
analysis when the first error-level violation occurs.
If the severity level is none, the Spectre circuit simulator will ignore to
report such violations and continues the analysis.
% spectre example2.scs
Action 3: Open and review the log file example2.log. Check for any
notice/error/warning messages.
As you can see above, since the level associated with diode_vtg_assert is
notice, it will report a notice and continue the simulation.
As the cap_vtg assert becomes true, it will error out and exit from the simulation
as seen above.
Note: You may also choose to specify severity through the checklimit
statement (described in example6 below). This overrides the severity levels
specified for individual assert checks.
3. assert – anal_types
User can specify a list of analysis types over which the assert is to be applied. By
default, the check is applied for all the analyses specified in the netlist. Possible values
are ac, dc, tran and noise.
Note: The anal_types parameter will be ignored if an invalid analysis type is specified.
Action 1: Open the netlist example3.scs, review the analyses and the assert
statement.
Checks the parameter v over all instances of the model diode1 over dc and dc
sweep analyses and prints a warning Maximum diode voltage exceeded -
Improper bias - diode forward biased !! if the value of v is less than
-1 and higher than 0.5.
% spectre example3.scs
Action 3: Open and review the log file example3.log. Check for any warning
messages. Below warning messages are displayed during dc sweep analysis –
The violations are reported just once when they occur and they are not printed
continuously at each time step afterwards even if they are true because they don’t
serve any purpose.
Action 1: Open the netlist example4.scs, review the circuit and the assert
statement.
Checks the parameter id of the model nch in all instances of the subcircuit inv
and prints a warning Maximum current exceeded !! if the value of id is less
than 1u and limits the number of violations to 4 for each checked instance.
Checks the parameter id of the model nch in all instances of the subcircuit inv
and prints a warning Maximum current exceeded !! if the value of id is less
than 1u and limits the number of violations to 3 for all checked instances during
the analysis.
Action 3: Open and review the log file example4.log. Check for any warning
messages.
Note: The warnings are displayed when the violation becomes true and when it
becomes false i.e., the value of the parameter being checked has returned to within
bounds.
As an exercise, perform –
And verify that maxvio_all option is working as expected. Similarly verify this
for maxvio_perinst_assert_4.
5. checklimit – check_windows
User can specify a time window over which the assert is to be checked in the
checklimit statement.
Action 1: Open the netlist example5.scs, review the circuit, assert and the
checklimit statement.
Checks the gate voltage V(g) over all instances of model nch from 0 to 1.3n
and prints a warning message if V(g) is higher than 0.9V or less than 0V and
returns the value of V(g).
Action 3: Open and review the log file example5.log. Check for any warning
messages.
Please compare the violations against the regular assert statement which outputs
violations over the complete simulation time window.
6. checklimit – enable/disable
You can enable or disable an assert or a group of asserts with the checklimit
statement. You can define one or more checklimit statements in the netlist, each
enabling or disabling individual asserts. The statement is applied to subsequent
transient, DC, and DC sweep analyses until the next checklimit statement appears.
By default, all asserts are enabled.
Action 1: Open the netlist example6.scs, review the assert and the checklimit
statements.
% spectre example6.scs
Action 3: Open and review the log file example6.log. Check for any error
messages.
Since, we have specified error as the severity level for all the enabled alerts,
the simulation is killed once the first error-level assert occurs.
Action 1: Open the netlist example7.scs, review the circuit, assert, checklimit
statements and options.
Sets the level for all asserts to notice. Please note the default value of level
is warning.
checkLimit_duration_1u checklimit
asserts=[vtg_range_invalid] param=duration value=1n
Sets the duration for the assert vtg_range_invalid to 1ns. Original value
was 0.1ns.
Action 3: Open and review the log file example7.log. Check for any warning/notice
messages.
Please note the value when violation is reported and the level of messages.
8. options – checklimit_skip_subs
At instances (for e.g., when iterations of circuit/device checks are performed), the
designer might already know which subcircuits do not contain violating instances. And
if the designer wants to skip such subcircuits from being checked, it can be
implemented by using checklimit_skip_subs=[...]which is a global option.
User can alternatively choose to add such subcircuits in a file and use
checklimit_skip_file parameter. This file contains the subcircuit masters or
subcircuit master patterns to be skipped in device checking. Patterns can have any
wildcard symbols.
Action 1: Open the netlist example8.scs, review the circuit, assert statements and
options.
Checks will be enabled for current_assert while checks will be disabled for
vtg_range_invalid and area_assert because the later asserts contain
subs=[buffer].
Action 3: Open and review the log file example8.log. Check for the asserts which
are enabled or ON.
9. options – checklimit_full_duration
The option checklimit_full_duration enables the designer to change the
reported duration of the violation.
If set to yes, assert violation includes the duration for which the violation takes
place, and uses interpolation when the value exceeds the max/min bound value.
Action 1: Open the netlist example9.scs, review the circuit, assert statements and
options.
Action 3: Open and review the log file example9.log. Please carefully review the
warning messages and the waveform below –
With checklimit_full_duration=no
With checklimit_full_duration=yes
To enable this, user can assign a group name to an assert, then use the global
option:
to suppress initialization warning message of the listed assert xxx and assert
group yyy.
o Double quotes are required to specify the group name for e.g.,
"group=yyy".
Action 1: Open the netlist example10.scs, review the circuit, assert statements and
options.
% spectre example10.scs
Action 3: Open and review the log file example10.log. Please carefully review the
warning messages.
Without using this global option, the log file contains 15 warning messages
related to asserts being ignored as below –
With this global option properly set, the log file now contains just 3 warning
messages related to asserts being ignored as below –
found.
Assert is ignored.
Support
Cadence Support Portal provides access to support resources, including an extensive
knowledge base, access to software updates for Cadence products, and the ability to
interact with Cadence Customer Support. Visit https://support.cadence.com.
Feedback
Email comments, questions, and suggestions to
content_feedback@cadence.com.