A
Amal
Guest
How does one declare an array constant with only one element?
type a_t is array(natural range <> of std_logic_vector(7 downto 0);
constant a1 : a_t := (
"00000000"
);
constant a2 : a_t := (
"00000000",
"00000001"
);
a2 passes compiler, but a1 gives error:
###### test.vhd(26): "00000000"
#
# ** Error: test.vhd(26): String literal found where type a_t, whose
element type ieee.std_logic_1164.std_logic_vector is not an
enumeration type, was expected.
The following works, but is there any other ways?
constant a1 : a_t := (
0=> "00000000"
);
-- Amal
type a_t is array(natural range <> of std_logic_vector(7 downto 0);
constant a1 : a_t := (
"00000000"
);
constant a2 : a_t := (
"00000000",
"00000001"
);
a2 passes compiler, but a1 gives error:
###### test.vhd(26): "00000000"
#
# ** Error: test.vhd(26): String literal found where type a_t, whose
element type ieee.std_logic_1164.std_logic_vector is not an
enumeration type, was expected.
The following works, but is there any other ways?
constant a1 : a_t := (
0=> "00000000"
);
-- Amal