The declaration part of a structural description includes signal decalarations and component declarations.
An internal signal can be declared of any type supported
by the present VHDL subset except REG_BIT
and
REG_VECTOR
.
A component must be declared with exactly the same port description as in its entity specification. This means that local ports are to be declared with the same name, type and kind and in the same order.
A structural description is a set of component instanciation statements. Instances' ports are connected to each other trough signals in a port map specification. Both explicit and implicit port map specifications are supported by the ALLIANCE VHDL subset.
The present version of the VHDL compiler does not allow
unconnected ports (the OPEN
mode is not supported).
Only the concatenation operator (&
) can be used in the
actual part (effective signal conntected to a formal port)
of a port map specification.
ENTITY add_accu IS PORT ( clk : IN BIT; command : IN BIT; data_in : IN BIT_VECTOR ( 31 DOWNTO 0 ); data_out : OUT BIT_VECTOR ( 31 DOWNTO 0 ); cry_out : OUT BIT; vdd : IN BIT; vss : IN BIT ); END add_accu; ARCHITECTURE structural OF add_accu IS SIGNAL eff_data : BIT_VECTOR ( 31 DOWNTO 0 ); -- effective operande SIGNAL adder_out : BIT_VECTOR ( 31 DOWNTO 0 ); -- adder's result SIGNAL accu_out : BIT_VECTOR ( 31 DOWNTO 0 ); -- accumulator COMPONENT adder PORT (a : IN BIT_VECTOR ( 31 DOWNTO 0 ); b : IN BIT_VECTOR ( 31 DOWNTO 0 ); res : OUT BIT_VECTOR ( 31 DOWNTO 0 ) ); END COMPONENT; COMPONENT and_32 PORT (a : IN BIT_VECTOR ( 31 DOWNTO 0 ); cmd : IN BIT; res : OUT BIT_VECTOR ( 31 DOWNTO 0 ) ); END COMPONENT; COMPONENT falling_edge_reg PORT (din : IN BIT_VECTOR ( 31 DOWNTO 0 ); clk : IN BIT; dout : OUT BIT_VECTOR ( 31 DOWNTO 0 ) ); END COMPONENT; BEGIN my_adder : adder PORT MAP ( a => eff_data, b => accu_out, res => adder_out ); my_mux : and_32 PORT MAP ( cmd => command, a => accu_out, res => eff_data ); my_reg : falling_edge_reg PORT MAP ( din => adder_out, clk => clk, dout => accu_out ); END;
![]() Université Pierre et Marie Curie - CNRS |
![]() |