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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

UM-124 5 - Verilog simulation<br />

Optimizing Verilog designs<br />

Running vopt on your design<br />

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

Once all of your design files are compiled into libraries, you will often want to optimize the<br />

entire design to maximize simulator performance. The tool that performs global<br />

optimizations is called vopt (CR-371).<br />

Note: Gate-level designs should generally not be optimized with vopt. See "Optimizing<br />

gate-level designs" (UM-127) below for more details.<br />

The vopt comm<strong>and</strong> (CR-371) loads compiled design units from their libraries <strong>and</strong><br />

regenerates optimized code. The basic flow is as follows:<br />

Compile all your modules with vlog -vopt<br />

The -vopt argument notifies vlog that you intend to run vopt on the design. As a result,<br />

vlog does not produce code. If you exclude the -vopt argument, vlog produces code <strong>and</strong><br />

then vopt reproduces the code in an optimized format. The code production from vlog is<br />

therefore wasted.<br />

Run vopt on the top-level module to optimize the entire design<br />

Run vsim on the optimized design unit<br />

Example<br />

The following is an example invocation of vlog <strong>and</strong> vopt <strong>and</strong> the resulting transcript<br />

messages:<br />

% vlog -vopt cpu_rtl.v<br />

-- Compiling module fp_unit<br />

-- Compiling module mult_56<br />

-- Compiling module testbench<br />

-- Compiling module cpu<br />

-- Compiling module i_unit<br />

-- Compiling module mem_mux<br />

-- Compiling module memory32<br />

-- Compiling module op_unit<br />

Top level modules:<br />

testbench<br />

% vopt testbench -o mydesign<br />

Analyzing design...<br />

Optimizing 8 modules of which 6 are inlined:<br />

-- Inlining module i_unit(fast)<br />

-- Inlining module mem_mux(fast)<br />

-- Inlining module op_unit(fast)<br />

-- Inlining module memory32(fast)<br />

-- Inlining module mult_56(fast)<br />

-- Inlining module fp_unit(fast)<br />

-- Optimizing module cpu(fast)<br />

-- Optimizing module testbench(fast)

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

Saved successfully!

Ooh no, something went wrong!