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.

Mapping data types<br />

Verilog to VHDL mappings<br />

Mapping data types UM-193<br />

Cross-language (HDL) instantiation does not require any extra effort on your part. As<br />

<strong>ModelSim</strong> loads a design it detects cross-language instantiations – made possible because<br />

a design unit's language type can be determined as it is loaded from a library – <strong>and</strong> the<br />

necessary adaptations <strong>and</strong> data type conversions are performed automatically. SystemC<br />

<strong>and</strong> HDL cross-language instantiation requires minor modification of SystemC source code<br />

(addition of SC_MODULE_EXPORT, sc_foreign_module, etc.).<br />

A VHDL instantiation of Verilog may associate VHDL signals <strong>and</strong> values with Verilog<br />

ports <strong>and</strong> parameters. Likewise, a Verilog instantiation of VHDL may associate Verilog<br />

nets <strong>and</strong> values with VHDL ports <strong>and</strong> generics. The same holds true for SystemC <strong>and</strong><br />

VHDL/Verilog ports.<br />

<strong>ModelSim</strong> automatically maps between the language data types as shown in the sections<br />

below.<br />

Verilog parameters<br />

Verilog type VHDL type<br />

integer integer<br />

real real<br />

string string<br />

The type of a Verilog parameter is determined by its initial value.<br />

Verilog ports<br />

The allowed VHDL types for ports connected to Verilog nets <strong>and</strong> for signals connected to<br />

Verilog ports are:<br />

Allowed VHDL types<br />

bit<br />

bit_vector<br />

std_logic<br />

std_logic_vector<br />

vl_logic<br />

vl_logic_vector<br />

The vl_logic type is an enumeration that defines the full state set for Verilog nets, including<br />

ambiguous strengths. The bit <strong>and</strong> std_logic types are convenient for most applications, but<br />

the vl_logic type is provided in case you need access to the full Verilog state set. For<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!