If I have an enumerated type type flag_t is (ZERO, OFLOW, NEG);
in the architecture of my entity, is there some way that one of the outputs of said entity is of type flag_t
?
In other words, why does the following code fail to compile, and how to achieve this correctly.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity alu is
port (
a: in std_logic_vector(15 downto 0);
b: in std_logic_vector(15 downto 0);
res: out std_logic_vector(15 downto 0);
flags: out flag_t
);
end alu;
architecture Behavioral of alu is
type flag_t is (ZERO, OFLOW, NEG);
begin
end Behavioral;
(Vivado reports an error on that code on line 9
saying Error: <flag_t> is not declared
, which makes sense since it's only defined in the architecture portion.