Using Component Declarations and Local Bindings
Component declarations define interfaces for idealized local objects
- Component declarations may be placed in architecture declarations or in package declarations
Component instantiations connect local signals to component interface signals
ARCHITECTURE struct_2 OF reg4 IS
CONSTANT enabled : level := '1';
FOR ALL : reg1 USE work.dff(behav)
PORT MAP(d=>d,clk=>clk,enable=>enabled,q=>q,qn=>OPEN);
r0 : reg1 PORT MAP (d=>d0,clk=>clk,q=>q0);
r1 : reg1 PORT MAP (d=>d1,clk=>clk,q=>q1);
r2 : reg1 PORT MAP (d=>d2,clk=>clk,q=>q2);
r3 : reg1 PORT MAP (d=>d3,clk=>clk,q=>q3);
Notes:
This example shows the three steps listed earlier:
1) A component declaration defines the interface to an idealized local component. Note that the component declaration may be placed in a package declaration and made visible to the architecture via a USE clause.
2) A binding indication assigns a VHDL entity/architecture object to component instances. In this case, all reg1 components will use the behav architecture description for the dff entity in the work library.
3) Instantiation statements create copies of the component to be plugged into the architecture description by connecting local signals to signals in the component interface.