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.

VHDL to Verilog mappings<br />

Mapping data types UM-195<br />

For Verilog states with ambiguous strength:<br />

bit receives '0'<br />

std_logic receives 'X' if either the 0 or 1 st rength component is greater than or equal to<br />

strong strength<br />

std_logic receives 'W' if both the 0 <strong>and</strong> 1 strength components are less than strong<br />

strength<br />

VHDL generics<br />

VHDL type Verilog type<br />

integer integer or real<br />

real integer or real<br />

time integer or real<br />

physical integer or real<br />

enumeration integer or real<br />

string string literal<br />

When a scalar type receives a real value, the real is converted to an integer by truncating<br />

the decimal portion.<br />

Type time is treated specially: the Verilog number is converted to a time value according<br />

to the ‘timescale directive of the module.<br />

Physical <strong>and</strong> enumeration types receive a value that corresponds to the position number<br />

indicated by the Verilog number. In VHDL this is equivalent to T'VAL(P), where T is the<br />

type, VAL is the predefined function attribute that returns a value given a position number,<br />

<strong>and</strong> P is the position number.<br />

VHDL type bit is mapped to Verilog states as follows:<br />

bit Verilog<br />

'0' St0<br />

'1' St1<br />

VHDL type std_logic is mapped to Verilog states as follows:<br />

std_logic Verilog<br />

'U' StX<br />

'X' StX<br />

'0' St0<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!