Altera_Forum
Honored Contributor
17 years agoCorrectly using generate statements?
I'm trying to make a register in VHDL real quick. I have a simple DFF that I'm accessing as a component like so:
ARCHITECTURE Structure OF sixteenbitreg IS
Signal output : STD_LOGIC_VECTOR(15 downto 0);
COMPONENT onebitreg
PORT (D : IN STD_LOGIC;
en : IN STD_LOGIC;
clock : IN STD_LOGIC;
Q : OUT STD_LOGIC
);
END COMPONENT;
BEGIN
for i in 15 downto 0 generate
reg: onebitreg PORT MAP(regIn(i),en,clock,output(i));
end generate;
regOut<=output;
END Structure;
This doesn't compile correctly though, I don't think I'm doing it right.