From 8a55c84b32b119b826df12792f1823757dc10d43 Mon Sep 17 00:00:00 2001 From: Romain Broucquart <romain.broucquart@synchrotron-soleil.fr> Date: Mon, 21 Mar 2022 16:47:40 +0100 Subject: [PATCH] Change frame detection * Need at least SOP and EOP. * If any other flag is missing, raise error --- hdl/combpm_protocol_electron.vhd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hdl/combpm_protocol_electron.vhd b/hdl/combpm_protocol_electron.vhd index 499d562..636a385 100644 --- a/hdl/combpm_protocol_electron.vhd +++ b/hdl/combpm_protocol_electron.vhd @@ -62,7 +62,7 @@ architecture rtl of combpm_protocol_electron is signal flag_rsvd : std_logic; signal flag_crc : std_logic; signal flag_all : std_logic; - signal flag_any : std_logic; + signal flag_frame : std_logic; signal packet_bpmid : std_logic_vector(9 downto 0); signal packet_startframe : std_logic; @@ -132,7 +132,7 @@ begin -- Any and all flag flag_all <= flag_sop and flag_eop and flag_dummy and flag_rsvd and flag_crc and gt_interfaceready; - flag_any <= (flag_sop or flag_eop or flag_crc) and gt_interfaceready; + flag_frame <= flag_sop and flag_eop and gt_interfaceready; ---------------------------- -- FRAME FIELD EXTRACTION -- @@ -280,7 +280,7 @@ begin ------------------------ -- CONTROL AND STATUS -- ------------------------ - frame_error <= flag_all xor flag_any; + frame_error <= flag_frame and not flag_all; frame_valid_cnt <= std_logic_vector(cnt_valid_r); frame_invalid_cnt <= std_logic_vector(cnt_invalid_r); frame_seq_cnt <= std_logic_vector(last_cnt_seq_r); @@ -321,7 +321,7 @@ begin end if; -- Invalid frame counter - if (flag_all xor flag_any) = '1' then + if (flag_frame and not flag_all) = '1' then cnt_invalid_r <= cnt_invalid_r+1; end if; @@ -338,7 +338,7 @@ begin end if; -- Invalid frame rate counter - if (flag_all xor flag_any) = '1' then + if (flag_frame and not flag_all) = '1' then rate_invalid_r <= rate_invalid_r+1; end if; end if; -- GitLab