05.07.2013 Views

Xilinx Synthesis Technology User Guide

Xilinx Synthesis Technology User Guide

Xilinx Synthesis Technology User Guide

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.

XST <strong>User</strong> <strong>Guide</strong><br />

Component Configuration<br />

Associating an entity/architecture pair to a component instance<br />

provides the means of linking components with the appropriate<br />

model (entity/architecture pair). XST supports component<br />

configuration in the declarative part of the architecture:<br />

for instantiation_list: component_name use<br />

LibName.entity_Name(Architecture_Name);<br />

Example 6-2 shows how to use a configuration clause for component<br />

instantiation. The example contains the following “for all” statement:<br />

for all : NAND2 use entity work.NAND2(ARCHI);<br />

This statement indicates that all NAND2 components will use the<br />

entity NAND2 and Architecture ARCHI.<br />

Note When the configuration clause is missing for a component<br />

instantiation, XST links the component to the entity with the same<br />

name (and same interface) and the selected architecture to the most<br />

recently compiled architecture. If no entity/architecture is found, a<br />

black box is generated during the synthesis.<br />

Generic Parameter Declaration<br />

Generic parameters may also be declared in the entity declaration<br />

part. XST supports all types for generics including integer, boolean,<br />

string, real, std_logic_vector, etc.. An example use of generic<br />

parameters would be setting the width of the design. In VHDL,<br />

describing circuits with generic ports has the advantage that the same<br />

component can be repeatedly instantiated with different values of<br />

generic ports as shown in Example 6-4.<br />

Example 6-4 Generic Instantiation of Components<br />

Library IEEE;<br />

use IEEE.std_logic_1164.all;<br />

use IEEE.std_logic_unsigned.all;<br />

entity addern is<br />

generic (width : integer := 8);<br />

port (A,B : in std_logic_vector (width-1 downto 0);<br />

Y : out std_logic_vector (width-1 downto 0));<br />

end addern;<br />

architecture bhv of addern is<br />

6-14 <strong>Xilinx</strong> Development System

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

Saved successfully!

Ooh no, something went wrong!