Get email delivery of the Cadence blog featured here
As an analog/mixed-signal designer, verification engineer, or CAD expert, you use Spectre® APS for analyzing your designs. Do you sometimes wonder if it were possible to optimize Spectre APS further for accuracy or performance? If yes, then this blog is for you. In this blog, you'll get to know how you can optimize Spectre APS performance for analog and mixed-signal designs using some important options. You'll also understand how you can address some typical setup problems that cause performance issues and how to use some of the advanced methods to optimize simulation performance.
Pre-layout Simulation Accuracy/Performance Trade-Off
For pre-layout simulation, you can use the following two options to adjust accuracy and performance:
When running the simulation on a new analog/mixed-signal design, we recommended that you start with the ++aps=moderate setting and use the default values for all other solver options. If Spectre APS accuracy isn’t sufficient, you can improve the accuracy incrementally by moving to +aps=moderate, ++aps=conservative, and +aps=conservative till the required accuracy is achieved. If the ++aps=moderate run provides good accuracy, and you want more performance, move to +aps=liberal and ++aps=liberal to improve the performance incrementally while ensuring that the highest performance setting still provides sufficient accuracy.
You can also set the errpreset and ++aps options in the High-Performance Simulation Options form in Virtuoso® ADE, as shown below.
Use the +mt command-line option to enable multithreading, which provides additional Spectre APS performance gains over a single-threaded simulation run (-mt). For small-to-medium sized designs, 4 core simulations (+mt=4) provide the best performance, while for large and post-layout designs, 8 (+mt=8) or 16 (+mt=16) core simulations are recommended. By default, Spectre APS uses 8 cores (if available on the machine), however, it reduces the number of cores based on the design size. You can use the +query=mtinfo command-line option to identify the number of cores recommended for a given design without running the actual simulation. This information is provided in the Pre-Simulation Summary section of the Spectre log file, as shown below.
~~~~~~~~~~~~~~~~~~~~~~Pre-Simulation Summary~~~~~~~~~~~~~~~~~~~~~~ - (APS) Multi-threading. The recommended number of threads is 16, consider adding +mt=16 on command line. ~~~~~~~~~~~~~~~~~~~~~~
The number of threads can also be defined in the High-Performance Simulation Options form in Virtuoso ADE. The Auto selection uses the default Spectre multithreading behavior. When running a multithreaded simulation on a compute farm, set #Threads to lsf to allow LSF to allocate the cores.
Spectre reports the number of threads used in the log file with the following message.
Multithreading Enabled: 16 threads in the system with 36 available processors.
Post-layout Simulation Accuracy/Performance Trade-Off
While errpreset, ++aps, and multithreading also apply to post-layout designs, using the +postlayout option is the key for achieving good Spectre APS post-layout simulation performance. The +postlayout option enables optimized simulation technology to calculate the DC operating point for large designs, performs RC reduction including coupling cap handling, and deploys enhanced matrix solving for RC-dominated designs. For most analog/mixed signal designs, the +postlayout=hpa (high precision analog) setting provides the best performance and accuracy trade-off because it uses conservative RC reduction. For very sensitive designs and extreme accuracy measurements, you can use the +postlayout=upa (ultra precision analog) setting, which disables RC reduction, however, it still takes advantage of all other Spectre APS post-layout technologies. For high performance requirements in functional verification, +postlayout may be used, which uses more aggressive RC reduction.
The post-layout settings can also be defined in the High-Performance Simulation Options form in the Virtuoso ADE. The +postlayout setting is called Default in Virtuoso ADE.
When RC reduction is enabled with +postlayout or +postlayout=hpa, the reduction rate is reported in the Spectre log file, as shown below.
Parasitics Reduction Enabled. (Resistors reduced by 80.53% Capacitors reduced by 88.36%, 71.97% of capacitors are coupling after RC reduction).
High Voltage Applications
High voltage applications are challenging for circuit simulation because with relref=sigglobal in moderate and liberal mode, voltage references are used globally over all signals. A maximum voltage of 10V from a high-voltage domain may impact the simulation accuracy of the neighboring 1V voltage domain. This problem may also be visible in non-high voltage applications where Verilog-A blocks create large voltage/current values artificially, or in designs with dangling nodes carrying large voltages. The related scenarios can be identified by checking the maximum value quantities in the Spectre log file:
Maximum value achieved for any signal of each quantity:V: V(I4.net01) = 25.93 VI: I(V1:p) = 103 mA~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Post-Transient Simulation Summary~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - The circuit contains signals of the voltage > 10V, consider to set highvoltage=yes to get better accuracy and convergence ability.
If a high voltage scenario is identified, it is recommended to use the highvoltage=yes option. This option introduces voltage binning for different voltage domains (bin_relref=yes), excludes Verilog-A terminals from convergence checking (default since Spectre 17.1 ISR10), excludes dangling node voltages from quantity checking (default since Spectre 17.1 ISR4), and overcomes the high-voltage related challenges.
The highvoltage option can also be set in the Main tab of the Simulator Options form, as shown below.
Typical Spectre APS Setup Issues
While debugging customer cases for performance and accuracy issues, we’ve noticed that many such problems are due to an incorrect Spectre APS set up. These problems significantly slow down the simulation or degrade simulation accuracy. They can be addressed easily by understanding their impact on the simulation and taking the corrective action. Some of the problems and their solutions are listed below.
Note that there may be high-precision designs, or simulation/measurement requirements, that need custom tolerances. In addition, you might encounter convergence challenges for which you require special gmin/cmin settings. It is fine to tune these settings if you are not able to achieve what you need with the recommended errpreset settings with default tolerances.
Many users assume that Spectre APS does post-layout optimization and RC reduction by default. However, Spectre APS, by default, does not enable any post-layout optimization/reduction, and may therefore be extremely slow on RC dominated post-layout designs. Check the Post-layout Simulation Accuracy/Performance Trade-Off section for proper post-layout settings.
Saving large numbers of waveforms, especially current waveforms, degrades Spectre APS performance significantly. Therefore, you should save only the waveforms you need and avoid saving everything (save=all, currents=all, subcktprovelvl=10), if not required. The Spectre log file provides information about how many waveforms are created and prints a warning if performance degradation is expected.
Output and IC/nodeset summary: save 355350(current) save 130338(voltage)WARNING (SPECTRE-294): Too many saved signals. Slow initialization is expected!
Spectre provides some powerful features, such as asserts for device voltage and current checking, info for design information printing, and design checks for analyzing design problems like high impedance nodes or leakage paths. These features, although important, degrade Spectre APS performance. Therefore, if you do not require these features you should disable them for maximum performance gain. The enabled features are listed in the Spectre log file, as shown below.
Analysis and control statement inventory:
Design checks inventory:
Sometimes, maxstep is used to increase simulation accuracy or to improve periodic measurement (i.e. FFT) precision. It is recommended to use errpreset to tune the simulation accuracy. If you want to enforce time steps at periodic measurement points, use strobeperiod instead of maxstep.
Extremely small rise and fall times in Spectre source elements, or in Verilog-A modules, may cause Spectre time step rejections and significantly degrade Spectre APS performance. Therefore, it is recommended to use similar rise and fall times, as the circuit being simulated.
While Verilog-A behavioral modelling provides great flexibility for writing behavioral models, it may significantly degrade Spectre APS simulation performance, if written inappropriately. Typical problems include initial calculations being performed at each time step, transition statements like cross/above/boundstep limiting and rejecting time steps, transition filter functions missing, and using resistance instead of conductance equations.
Therefore, it is highly recommended to run the Spectre AHDL linter (-ahdllint=warn) utility on any newly-written Verilog-A model, and address any reported modelling issue. The AHDL linter utility can also be enabled in the Miscellaneous tab of the Simulator Options form in Virtuoso ADE, as shown below.
With every release, Spectre APS is enhanced for better performance. As a result, when you use an older version of Spectre, you miss out the performance enhancements that have been made in the latest version. Therefore, we recommend that you use the latest Spectre release for your designs.
Spectre APS performance is impacted when a machine is heavily overloaded, if there are network performance issues, or if sufficient memory isn't available. Insufficient memory can lead to swapping and slow down the simulation. You can check the available memory in the header of the Spectre log file. Machine loading and network communication problems can be observed by checking the CPU load or the utilization reported in the Spectre log file. A CPU load close to 100% could point to a heavily overloaded machine. A utilization below 90% for a single core simulation, below 150% for a 4 core job, or a utilization below 300% for a 8 core simulation may point to an overloaded machine, or network problems.
User: stefanw Host: lnx-stefanw HostID: CD0A11B8 PID: 11716Memory available: 10.1099 GB physical: 16.6440 GB During simulation, the CPU load for active processors is : Spectre 0 (99.9 %) 1 (99.7 %) 2 (99.7 %) 3 (99.7 %) 4 (99.7 %) 5 (99.7 %)Time used: CPU = 10.8 ks (2h 59m 57s), elapsed = 18 ks (4h 59m 49s), util. = 60%.
Tips for Further Performance Improvements
Following are some tips that will enable you to enhance the performance of Spectre APS further after you have already followed the steps on how to resolve any setup issue.
For designs that take a long time in calculating the operating point, use the +dcopt command-line option which provides a performance-optimized DC calculation. The option may cause minor degradation in the accuracy of the DC solution and is therefore not a solution for designs that are highly sensitive to an accurate DC solution.The +dcopt option can also be set in the Environment Options form in Virtuoso ADE, as shown below.
The dynamic parameter feature enables you to define different solver settings for different time windows. If your design has different accuracy requirements for different time windows, you can use the dynamic parameters to speed up the overall simulation.Dynamic parameters can be defined by selecting transient analysis (tran) in the Choosing Analyses form in Virtuoso ADE, as shown below.
If multiple simulations have the same start-up sequence, you can use the savetime and recover options to run the start-up sequence once, save the simulation state at the end of the start-up sequence, and then restart all other simulations based on the saved state. The savetime value or the recover file can be set in the State File tab of the Transient Options form in Virtuoso ADE, as shown below.
If some portions of the design are digital, and you can afford some accuracy degradation on the digital blocks, you can improve the simulation performance by using Spectre XPS MS. Spectre XPS MS shares the use model with Spectre APS and enhances the performance by using the Spectre XPS FastSPICE tool for the digital portion of the design. The accuracy of the analog portion is still maintained by using the Spectre APS engine. Spectre XPS MS requires the power supplies of the digital blocks to be ideal voltage sources, otherwise, digital detection will require setting up voltage generator nodes and voltages.Spectre XPS MS can also be enabled in the High-Performance Simulation Options form in Virtuoso ADE, as shown below.
Debugging Spectre APS Performance Issues
By utilizing the tips given above, you can address a majority of your Spectre APS performance issues. In addition, Spectre APS provides a simulation diagnostic mode, which can be enabled by using the +diagnose command-line option, or the +diagnose=detailed netlist option. The diagnostic mode analyzes the simulation statistics over the transient simulation time and reports detailed information on which signals/devices/elements cause convergence problems, time step reductions/rejections, and slow down simulation performance.
The diagnostics mode can also be enabled in the Check tab of the Simulator Options form in Virtuoso ADE, as shown below.
If you run into Spectre APS performance issues, which you cannot resolve, it is recommended that you run the simulation using the +diagnose command-line option and discuss the diagnostics report with your Cadence support AE.
You may also contact your Cadence support AE for guidance.
For more information on Cadence products and services, visit www.cadence.com.
About Spectre Tech Tips
Spectre Tech Tips is a blog series aimed at exploring the capabilities and potential of Spectre®. In addition to providing insight into the useful features and enhancements in Spectre, this series broadcasts the voice of different bloggers and experts, who share their knowledge and experience on all things related to Spectre. Enter your email address in the Subscriptions box at the top of the page and click SUBSCRIBE NOW to receive notifications about our latest Spectre Tech Tips posts.