Altera_Forum
Honored Contributor
8 years agoCompare two byte arrays
I have a list of commands and a command received from UART.
type commands is array(0 to COM_SIZE) of std_logic_vector(7 downto 0);
signal commands_list : commands(0 to COM_COUNT) :=
(
x"73746F700000", --stop
x"667764000000", --fwd
x"726576000000" --rev
);
type com_str is array (0 to COM_SIZE) of std_logic_vector(7 downto 0);
signal command : com_str;
I try to compare the hole array
for i in 0 to COM_COUNT loop
if (commands_list(i) /= command) then
--do something
end if;
end loop;
And every byte
for i in 0 to COM_COUNT loop
for j in 0 to name_len loop
if (commands_list(i)(j) /= command(j)) then
--do something
end if;
end loop;
end loop;
In both cases I get an error Error (10327): VHDL error at parser.vhd(253): can't determine definition of operator ""/="" -- found 0 possible definitions