05.07.2013 Views

Xilinx Synthesis Technology User Guide

Xilinx Synthesis Technology User Guide

Xilinx Synthesis Technology User Guide

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 Language Support<br />

compiled in the library IEEE. In order to use one of these types, the<br />

following two lines must be added to the VHDL specification:<br />

library IEEE;<br />

use IEEE.STD_LOGIC_1164.all;<br />

The types UNSIGNED and SIGNED (defined as an array of<br />

STD_LOGIC) are declared in the STD_LOGIC_ARITH IEEE package.<br />

This package is compiled in the library IEEE. In order to use these<br />

types, the following two lines must be added to the VHDL<br />

specification:<br />

library IEEE;<br />

use IEEE.STD_LOGIC_ARITH.all;<br />

Multi-dimensional Array Types<br />

XST supports multi-dimensional array types of up to three<br />

dimensions. Arrays can be signals, constants, or VHDL variables. You<br />

can do assignments and arithmetic operations with arrays. You can<br />

also pass multi-dimensional arrays to functions, and use them in<br />

instantiations.<br />

The array must be fully constrained in all dimensions. An example is<br />

shown below:<br />

subtype WORD8 is STD_LOGIC_VECTOR (7 downto 0);<br />

type TAB12 is array (11 downto 0) of WORD8;<br />

type TAB03 is array (2 downto 0) of TAB12;<br />

You can also declare and array as a matrix as in the following<br />

example:<br />

subtype TAB13 is array (7 downto 0,4 downto 0)<br />

of STD_LOGIC_VECTOR (8 downto 0);<br />

The following examples demonstrate the various uses of<br />

multi-dimensional array signals and variables in assignments.<br />

Consider the declarations:<br />

subtype WORD8 is STD_LOGIC_VECTOR (7 downto 0);<br />

type TAB05 is array (4 downto 0) of WORD8;<br />

type TAB03 is array (2 downto 0) of TAB05;<br />

XST <strong>User</strong> <strong>Guide</strong> 6-5

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

Saved successfully!

Ooh no, something went wrong!