Код
type str_t is array(integer range<>) of std_logic_vector(7 downto 0);
signal g_command : str_t(0 to COM_SIZE-1);
type commands is array(integer range<>) of str_t(0 to COM_SIZE-1);
constant commands_list : commands(0 to COM_COUNT-1) :=
(
0 => (0 => x"73", 1 => x"74", 2 => x"6F", 3 => x"70", 4 => x"00", 5 => x"00"), --stop
1 => (0 => x"66", 1 => x"77", 2 => x"64", 3 => x"00", 4 => x"00", 5 => x"00"), --fwd
2 => (0 => x"72", 1 => x"65", 2 => x"76", 3 => x"00", 4 => x"00", 5 => x"00"), --rev
3 => (0 => x"01", 1 => x"02", 2 => x"03", 3 => x"00", 4 => x"00", 5 => x"00") --123
);
signal g_command : str_t(0 to COM_SIZE-1);
type commands is array(integer range<>) of str_t(0 to COM_SIZE-1);
constant commands_list : commands(0 to COM_COUNT-1) :=
(
0 => (0 => x"73", 1 => x"74", 2 => x"6F", 3 => x"70", 4 => x"00", 5 => x"00"), --stop
1 => (0 => x"66", 1 => x"77", 2 => x"64", 3 => x"00", 4 => x"00", 5 => x"00"), --fwd
2 => (0 => x"72", 1 => x"65", 2 => x"76", 3 => x"00", 4 => x"00", 5 => x"00"), --rev
3 => (0 => x"01", 1 => x"02", 2 => x"03", 3 => x"00", 4 => x"00", 5 => x"00") --123
);
Вижу в g_command - '123'.
Сравниваю
Код
if(g_command = commands_list(3)) then
received_char <= X"03";
else
received_char <= X"01";
end if;
received_char <= X"03";
else
received_char <= X"01";
end if;
Получаю received_char <= X"01";
Нужно сравнивать чар-чар? иначе никак?