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.

VHDL: instantiating Verilog<br />

Verilog instantiation criteria<br />

Component declaration<br />

VHDL: instantiating Verilog UM-203<br />

Once you have generated a component declaration for a Verilog module, you can<br />

instantiate the component just like any other VHDL component. You can reference a<br />

Verilog module in the entity aspect of a component configuration – all you need to do is<br />

specify a module name instead of an entity name. You can also specify an optional<br />

secondary name for an optimized sub-module. Further, you can reference a Verilog<br />

configuration in the configuration aspect of a VHDL component configuration - just<br />

specify a Verilog configuration name instead of a VHDL configuration name.<br />

A Verilog design unit may be instantiated within VHDL if it meets the following criteria:<br />

The design unit is a module or configuration. UDPs are not allowed.<br />

The ports are named ports (see "Modules with unnamed ports" (UM-206) below).<br />

The ports are not connected to bidirectional pass switches (it is not possible to h<strong>and</strong>le pass<br />

switches in VHDL).<br />

A Verilog module that is compiled into a library can be referenced from a VHDL design as<br />

though the module is a VHDL entity. Likewise, a Verilog configuration can be referenced<br />

as though it were a VHDL configuration.<br />

The interface to the module can be extracted from the library in the form of a component<br />

declaration by running vgencomp (CR-330). Given a library <strong>and</strong> module name, vgencomp<br />

(CR-330) writes a component declaration to st<strong>and</strong>ard output.<br />

The default component port types are:<br />

std_logic<br />

std_logic_vector<br />

Optionally, you can choose:<br />

bit <strong>and</strong> bit_vector<br />

vl_logic <strong>and</strong> vl_logic_vector<br />

VHDL <strong>and</strong> Verilog identifiers<br />

The VHDL identifiers for the component name, port names, <strong>and</strong> generic names are the<br />

same as the Verilog identifiers for the module name, port names, <strong>and</strong> parameter names. If<br />

a Verilog identifier is not a valid VHDL 1076-1987 identifier, it is converted to a VHDL<br />

1076-1993 extended identifier (in which case you must compile the VHDL with the -93 or<br />

higher switch). Any uppercase letters in Verilog identifiers are converted to lowercase in<br />

the VHDL identifier, except in the following cases:<br />

The Verilog module was compiled with the -93 switch. This means vgencomp (CR-330)<br />

should use VHDL 1076-1993 extended identifiers in the component declaration to<br />

preserve case in the Verilog identifiers that contain uppercase letters.<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!