From 6a6f04f9544bfeee7697e510299cedaf7db3ebea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Boh=C3=A1=C4=8Dek?= Date: Fri, 2 Dec 2022 20:15:31 +0100 Subject: [PATCH] fix(link): check that characters in ilas parser are control characters ILAS parser did not check that characters are control characters, error would be encountered if there was R or A non-kout character --- src/data_link/ilas_parser.vhd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/data_link/ilas_parser.vhd b/src/data_link/ilas_parser.vhd index da7c80e..e1efa8e 100644 --- a/src/data_link/ilas_parser.vhd +++ b/src/data_link/ilas_parser.vhd @@ -125,25 +125,25 @@ begin -- architecture a1 -- If there is an error, stop processing. elsif ci_char_clk'event and ci_char_clk = '1' and processing_ilas = '1' then -- rising clock edge if reg_octet_index = 0 then -- Should be /R/ - if di_char.d8b /= R_character then + if di_char.d8b /= R_character or di_char.kout = '0' then err <= '1'; co_unexpected_char <= '1'; end if; - elsif di_char.d8b = R_character then + elsif di_char.d8b = R_character and di_char.kout = '1' then err <= '1'; co_unexpected_char <= '1'; elsif reg_octet_index = octets_in_multiframe - 1 then - if di_char.d8b /= A_character then -- Should be /A/ + if di_char.d8b /= A_character or di_char.kout = '0' then -- Should be /A/ err <= '1'; co_unexpected_char <= '1'; elsif reg_multiframe_index = 3 and err = '0' then finished <= '1'; end if; - elsif di_char.d8b = A_character then + elsif di_char.d8b = A_character and di_char.kout = '1' then err <= '1'; co_unexpected_char <= '1'; elsif reg_multiframe_index = 1 then - if reg_octet_index = 1 and di_char.d8b /= Q_character then -- Should be /Q/ + if reg_octet_index = 1 and (di_char.d8b /= Q_character or di_char.kout = '0') then -- Should be /Q/ err <= '1'; co_unexpected_char <= '1'; elsif reg_octet_index > 1 and reg_octet_index < 16 then -- This is config data -- 2.48.1