Estoy intentando aprender la palabra clave GENERIC en VHDL:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity adder is
generic (N: integer := 4);
Port ( Cin : in STD_LOGIC;
x : in STD_LOGIC_VECTOR (N - 1 downto 0);
y : in STD_LOGIC_VECTOR (N - 1 downto 0);
s : out STD_LOGIC_VECTOR (N - 1 downto 0);
Cout : out STD_LOGIC);
end adder;
architecture RippleCarryAdder of adder is
component fullAdder
Port ( Cin : in STD_LOGIC;
x : in STD_LOGIC;
y : in STD_LOGIC;
s : out STD_LOGIC;
Cout : out STD_LOGIC);
end component;
SIGNAL C : STD_LOGIC_VECTOR(1 TO N - 1) ;
begin
-- First stage gets the carry in
stage0: fullAdder PORT MAP (Cin, X(0), Y(0), S(0), C(1));
-- Middle stages follow the same pattern
gen_stage:
for I in 1 to N - 2 generate
stageX: fullAdder PORT MAP (C(I), X(I), Y(I), S(I), C(I + 1));
end generate gen_stage;
-- Last stage spits the carry out
stageN_1: fullAdder PORT MAP (C(N - 1), X(N - 1), Y(N - 1), S(N - 1), Cout);
end RippleCarryAdder;
Recibo el error: símbolo no definido 'N'. para la señal interna [la línea que dice: SEÑAL C: STD_LOGIC_VECTOR (1 A N - 1);]
¿Cómo puedo usar mi valor genérico N en la señal interna de mi arquitectura?