I am often asked for guidelines on maximizing speed vs. accuracy for SpectreRF harmonic balance simulations. In a series of 3 blogs, I'll discuss some of the "knobs" that you can tweak, those being:
* Which Engine: Spectre or APS?
* Oversample vs Number of Harmonics
* Harmonic Trimming
Today, I'll discuss Knob 1. Choosing the appropriate engine....Spectre or APS?
The choice between Spectre vs APS boils down to the size of the circuit you are simulating (and the number of licenses you're willing to spend on the simulation.) APS takes more MMSIM tokens. See Article 20044367 .
Even for small circuits, APS will be faster than Spectre. This is because the CMOS models get more efficient and the solver gets more efficient when using APS, even if multithreading isn't turned on due to small circuit size.
For medium to large circuits (100+ devices), APS should be considerably faster. It is recommended that you start with 2 threads. (If you use 8 or 16 threads, the simulation may actually be slower than with 2 threads because the overhead cost of parallelization for the additional threads overshadows the speed advantage of additional threads for such small circuits.)
So, how can you determine how many threads to use? (i.e. determine the optimum number of threads to use for a particular circuit).
- Run your circuit in Spectre. Note the time it takes.
- Run your circuit in APS with a single thread. Note the time it takes.
- Run your circuit in APS with 2 threads. Note the time it takes.
- If the simulation gets slower, stick with single thread. If it gets faster, try 4 threads. You can try up to 16 threads.
Note that the "auto" setting has some limitations. It checks for the number of CPUs on the machine and automatically spawns that number of jobs (so if it finds 8 CPUs, it spawns 8 CPU threads). It does not look at circuit size. It doesn't look at CPU utilization on the machine. When using multithreading, you need to be careful. The software assumes that other jobs are not running on the various cores available. If there are other jobs running, they will slow those cores down...which in turn slows down all core jobs. In general, it is recommended to use 1 thread per core.
You can specify which cores to use with the '-processor' keyword. See Solution 11584226 for more information. (http://support.cadence.com/wps/mypoc/cos?uri=deeplinkmin:ViewSolution;solutionNumber=11584226)
Another thing to consider when using APS is the preserve_inst option. For information on how preserve_inst affects speed vs accuracy in APS, see Solution 11642414: How does the spectre option preserve_inst affect simulation? (http://support.cadence.com/wps/mypoc/cos?uri=deeplinkmin:ViewSolution;solutionNumber=11642414)
For more tips like this, please visit Cadence Online Support . Please note that you must be a Cadence Customer on Maintenance to access this website .
Stay tuned....next time I'll talk about Knob 2.... Oversample vs Number of Harmonics!
Have fun simulating!