S
Stef
I have a problem converting an enum with known encoding to a
std_logic_vector. Here's some fragments of the code:
entity controller is
port (
...
ledsel : out std_logic_vector(1 downto 0);
...
);
ctrl_proc : process(clock)
type opmode_t is (OPMODE_IDENT, OPMODE_CONFIG, OPMODE_ACQ);
attribute enum_encoding : string;
attribute enum_encoding of opmode_t : type is "00 01 10";
variable opmode_v : opmode_t;
I now want to assign opmode_v to the ledsel output and thought to do it
like this:
ledsel <= std_logic_vector(opmode_v);
That didn't work: " Illegal type conversion from opmode_t to
ieee.std_logic_1164.std_logic_vector (non-numeric to array)."
Is there another way to do it? Didn't find anythmh yet wityh google.
std_logic_vector. Here's some fragments of the code:
entity controller is
port (
...
ledsel : out std_logic_vector(1 downto 0);
...
);
ctrl_proc : process(clock)
type opmode_t is (OPMODE_IDENT, OPMODE_CONFIG, OPMODE_ACQ);
attribute enum_encoding : string;
attribute enum_encoding of opmode_t : type is "00 01 10";
variable opmode_v : opmode_t;
I now want to assign opmode_v to the ledsel output and thought to do it
like this:
ledsel <= std_logic_vector(opmode_v);
That didn't work: " Illegal type conversion from opmode_t to
ieee.std_logic_1164.std_logic_vector (non-numeric to array)."
Is there another way to do it? Didn't find anythmh yet wityh google.