Main Content

Simulation Speed Improvement Tips

Obtaining Baseline Performance Numbers

You can baseline the performance numbers by timing the execution of the HDL and the Simulink® model separately and adding them together; you may not expect better performance than that. Make sure that the separate simulations are representative: running an HDL-only simulator with unrealistic input stimulus could be much faster than when realistic input stimulus is provided.

Analyzing Simulation Performance

While cosimulation entails a certain amount of overhead, sometimes the HDL simulation itself also slows performance. Ask yourself these questions when trying to analyze and improve performance:

ConsiderationSuggestions for Improving Speed
Are you are using NFS or other remote file systems?How fast is the file system? Consider using a different type or expect that the file system you're using will impact performance.
Are you using separate machines for Simulink and the HDL simulator?How fast is the network? Wait until the network is quieter or contact your system administrator for advice on improving the connection.
Are you using the same machine for Simulink and the HDL simulator?
  • Are you using shared pipes instead of sockets? Shared memory is faster.

  • Are the Simulink and HDL processes large enough to cause swaps to disk? Consider adding more memory; otherwise be aware that you're running a huge process and expect it to impact performance.

Are you using optimal (that is, as large as possible) Simulink sample rates on the HDL Cosimulation block?

For example, if you set the output sample rate to 1 but only use every 10th sample, you could make the rate 10 and reduce the traffic between Simulink and the HDL simulator.

Another example is if you place a very fast clock as an input to the HDL Cosimulation block, but have none of the other inputs need such a fast rate. In that case, you should generate the clock in HDL or (Xcelium™ and ModelSim™ users only) via the Clocks or Simulation pane on the HDL Cosimulation block.

ModelSim users: Are you compiling/elaborating the HDL using the vopt flow?Use -voptargs=+acc to optimize your design for maximum (HDL) simulator speed (ModelSim users only).

Are you using Simulink Accelerator™ mode?

Acceleration mode can speed up the execution of your model. For more information about acceleration, see What Is Acceleration? (Simulink).

Accelerator mode not supported for Vivado® simulator. Vivado users should use normal mode for cosimulation.

If you have the Communications Toolbox™ software, have you considered using Framed signals?Framed signals reduce the number of Simulink/HDL interactions.