24.03.2013 Views

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

UM-318 12 - Profiling performance <strong>and</strong> memory use<br />

Introducing performance <strong>and</strong> memory profiling<br />

A statistical sampling profiler<br />

A memory allocation profiler<br />

<strong>ModelSim</strong> <strong>SE</strong> User’s <strong>Manual</strong><br />

The profiler provides an interactive graphical representation of both memory <strong>and</strong> CPU<br />

usage on a per instance basis. It shows you what part of your design is consuming resources<br />

(CPU cycles or memory), allowing you to more quickly find problem areas in your code.<br />

The profiler enables those familiar with the design <strong>and</strong> validation environment to find firstlevel<br />

improvements in a matter of minutes. For example, the statistical sampling profiler<br />

might show the following:<br />

non-accelerated VITAL library cells that are impacting simulation run time<br />

objects in the sensitivity list that are not required, resulting in a process that consumes<br />

more simulation time than necessary<br />

a testbench process that is active even though it is not needed<br />

an inefficient C module<br />

r<strong>and</strong>om number processes that are consuming simulation resources in a testbench running<br />

in non-r<strong>and</strong>om mode<br />

With this information, you can make changes to the VHDL or Verilog source code that will<br />

speed up the simulation.<br />

The memory allocation profiler provides insight into how much memory different parts of<br />

the design are consuming. The two major areas of concern are typically: 1) memory usage<br />

during elaboration, <strong>and</strong> 2) during simulation. If memory is exhausted during elaboration,<br />

for example, memory profiling may provide insights into what part(s) of the design are<br />

memory intensive. Or, if your HDL or PLI/FLI code is allocating memory <strong>and</strong> not freeing<br />

it when appropriate, the memory profiler will indicate excessive memory use in particular<br />

portions of the design.<br />

The profiler’s statistical sampling profiler samples the current simulation at a userdetermined<br />

rate (every milliseconds of real or "wall-clock" time, not simulation time)<br />

<strong>and</strong> records what is executing at each sample point. The advantage of statistical sampling<br />

is that an entire simulation need not be run to get good information about what parts of your<br />

design are using the most simulation time. A few thous<strong>and</strong> samples, for example, can be<br />

accumulated before pausing the simulation to see where simulation time is being spent.<br />

The statistical profiler reports only on the samples that it can attribute to user code. For<br />

example, if you use the -nodebug argument to vcom (CR-311) or vlog (CR-358), it cannot<br />

report sample results.<br />

The profiler’s memory allocation profiler records every memory allocation <strong>and</strong><br />

deallocation that takes place in the context of elaborating <strong>and</strong> simulating the design. It<br />

makes a record of the design element that is active at the time of allocation so memory<br />

resources can be attributed to appropriate parts of the design. This provides insights into<br />

memory usage that can help you re-code designs to, for example, minimize memory use,<br />

correct memory leaks, <strong>and</strong> change optimization parameters used at compile time.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!