Skip to content
Snippets Groups Projects
Commit 8a55c84b authored by BRONES Romain's avatar BRONES Romain
Browse files

Change frame detection

* Need at least SOP and EOP.
* If any other flag is missing, raise error
parent 6447829e
Branches
Tags
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment