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.

Creating foreign architectures with sm_entity<br />

VHDL SmartModel interface UM-619<br />

The <strong>ModelSim</strong> sm_entity tool automatically creates entities <strong>and</strong> foreign architectures for<br />

SmartModels. Its usage is as follows:<br />

Syntax<br />

sm_entity<br />

[-] [-xe] [-xa] [-c] [-all] [-v] [-93] [...]<br />

Arguments<br />

-<br />

Read SmartModel names from st<strong>and</strong>ard input.<br />

-xe<br />

Do not generate entity declarations.<br />

-xa<br />

Do not generate architecture bodies.<br />

-c<br />

Generate component declarations.<br />

-all<br />

Select all models installed in the SmartModel library.<br />

-v<br />

Display progress messages.<br />

-93<br />

Use extended identifiers where needed.<br />

<br />

Name of a SmartModel (see the SmartModel library documentation for details on<br />

SmartModel names).<br />

By default, the sm_entity tool writes an entity <strong>and</strong> foreign architecture to stdout for each<br />

SmartModel name listed on the comm<strong>and</strong> line. Optionally, you can include the component<br />

declaration (-c), exclude the entity (-xe), <strong>and</strong> exclude the architecture (-xa).<br />

The simplest way to prepare SmartModels for use with <strong>ModelSim</strong> VHDL is to generate the<br />

entities <strong>and</strong> foreign architectures for all installed SmartModels, <strong>and</strong> compile them into a<br />

library named lmc. This is easily accomplished with the following comm<strong>and</strong>s:<br />

% sm_entity -all > sml.vhd<br />

% vlib lmc<br />

% vcom -work lmc sml.vhd<br />

To instantiate the SmartModels in your VHDL design, you also need to generate<br />

component declarations for the SmartModels. Add these component declarations to a<br />

package named sml (for example), <strong>and</strong> compile the package into the lmc library:<br />

% sm_entity -all -c -xe -xa > smlcomp.vhd<br />

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

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

Saved successfully!

Ooh no, something went wrong!