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.

Creating foreign architectures with hm_entity<br />

VHDL hardware model interface UM-629<br />

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

hardware models. Its usage is as follows:<br />

Syntax<br />

hm_entity<br />

[-xe] [-xa] [-c] [-93] <br />

Arguments<br />

-xe<br />

Do not generate entity declarations.<br />

-xa<br />

Do not generate architecture bodies.<br />

-c<br />

Generate component declarations.<br />

-93<br />

Use extended identifiers where needed.<br />

<br />

Hardware model shell software filename (see Logic Modeling documentation from<br />

Synopsys for details on shell software files)<br />

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

hardware model. Optionally, you can include the component declaration (-c), exclude the<br />

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

Once you have created the entity <strong>and</strong> foreign architecture, you must compile it into a<br />

library. For example, the following comm<strong>and</strong>s compile the entity <strong>and</strong> foreign architecture<br />

for a hardware model named LMTEST:<br />

% hm_entity LMTEST.MDL > lmtest.vhd<br />

% vlib lmc<br />

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

To instantiate the hardware model in your VHDL design, you will also need to generate a<br />

component declaration. If you have multiple hardware models, you may want to add all of<br />

their component declarations to a package so that you can easily reference them in your<br />

design. The following comm<strong>and</strong> writes the component declaration to stdout for the<br />

LMTEST hardware model.<br />

% hm_entity -c -xe -xa LMTEST.MDL<br />

Paste the resulting component declaration into the appropriate place in your design or into<br />

a package.<br />

The following is an example of the entity <strong>and</strong> foreign architecture created by hm_entity for<br />

the CY7C285 hardware model:<br />

library ieee;<br />

use ieee.std_logic_1164.all;<br />

entity cy7c285 is<br />

generic ( DelayRange : STRING := "Max" );<br />

port ( A0 : in std_logic;<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!