From 127b371004b0c7486f1b3c8f8828141427ff30f7 Mon Sep 17 00:00:00 2001 From: Greek Date: Wed, 21 Oct 2020 17:30:39 +0200 Subject: [PATCH] * Initialise all counters with 0 --- src/rtps_builtin_endpoint.vhd | 442 +++++++++++++++++----------------- 1 file changed, 222 insertions(+), 220 deletions(-) diff --git a/src/rtps_builtin_endpoint.vhd b/src/rtps_builtin_endpoint.vhd index 7210f6a..e9aeb1d 100644 --- a/src/rtps_builtin_endpoint.vhd +++ b/src/rtps_builtin_endpoint.vhd @@ -457,7 +457,7 @@ begin -- Latch Source Entity ID src_entityid_next <= data_in; -- Reset Counter - cnt_next <= 1; + cnt_next <= 0; -- Next Stage stage_next <= PACKET_SRC_GUIDPREFIX; end if; @@ -466,11 +466,11 @@ begin rd_sig <= '1'; -- Latch Src GUIDPrefix case (cnt) is - when 1 => + when 0 => guid_next(0) <= data_in; - when 2 => + when 1 => guid_next(1) <= data_in; - when 3 => + when 2 => guid_next(2) <= data_in; guid_next(3) <= (others => '0'); -- Start Participant Search @@ -502,7 +502,7 @@ begin message_type_next <= PDP; stage_next <= LATCH_SEQ_NR; -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; -- Reset Participant Match participant_match_next <= '1'; end if; @@ -513,7 +513,7 @@ begin message_type_next <= EDP; stage_next <= PROCESS_ACKNACK; --ACKNACK Processing -- Initialise Counter - cnt_next <= 1; + cnt_next <= 0; end if; when ENTITYID_SEDP_BUILTIN_PUBLICATIONS_DETECTOR => -- SANITY CHECK: Ignore if no Readers @@ -524,12 +524,12 @@ begin message_type_next <= EDP; stage_next <= PROCESS_HEARTBEAT; -- HEARTBEAT Processing -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; when SID_DATA => message_type_next <= EDP; stage_next <= LATCH_SEQ_NR; -- DATA Processing -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; -- QoS is publisher-offered is_subscriber_next <= '0'; -- Reset Endpoint Mask (ALL READERS) @@ -544,7 +544,7 @@ begin message_type_next <= EDP; stage_next <= PROCESS_ACKNACK; --ACKNACK Processing -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; end if; when ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_DETECTOR => -- SANITY CHECK: Ignore if no Writers @@ -555,12 +555,12 @@ begin message_type_next <= EDP; stage_next <= PROCESS_HEARTBEAT; -- HEARTBEAT Processing -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; when SID_DATA => message_type_next <= EDP; stage_next <= LATCH_SEQ_NR; -- DATA Processing -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; -- QoS is subscriber-requested is_subscriber_next <= '1'; -- Reset Endpoint Mask (ALL WRITERS) @@ -574,7 +574,7 @@ begin message_type_next <= MESSAGE; stage_next <= PROCESS_ACKNACK; --ACKNACK Processing -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; end if; when ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER => -- Only HEARTBEATs and DATA are relevant (GAPs irrelevant, since depth is 1) @@ -583,12 +583,12 @@ begin message_type_next <= MESSAGE; stage_next <= PROCESS_HEARTBEAT; -- HEARTBEAT Processing -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; when SID_DATA => message_type_next <= MESSAGE; stage_next <= LATCH_SEQ_NR; -- DATA Processing -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; end case; when others => null; @@ -607,7 +607,7 @@ begin message_type_next <= PDP; stage_next <= LATCH_SEQ_NR; -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; -- Reset Participant Match participant_match_next <= '1'; @@ -619,7 +619,7 @@ begin message_type_next <= EDP; stage_next <= PROCESS_ACKNACK; --ACKNACK Processing -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; end if; when ENTITYID_SEDP_BUILTIN_PUBLICATIONS_ANNOUNCER => -- SANITY CHECK: Ignore if no Readers @@ -630,12 +630,12 @@ begin message_type_next <= EDP; stage_next <= PROCESS_HEARTBEAT; -- HEARTBEAT Processing -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; when SID_DATA => message_type_next <= EDP; stage_next <= LATCH_SEQ_NR; -- DATA Processing -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; -- QoS is publisher-offered is_subscriber_next <= '0'; -- Reset Endpoint Mask (ALL READERS) @@ -650,7 +650,7 @@ begin message_type_next <= EDP; stage_next <= PROCESS_ACKNACK; --ACKNACK Processing -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; end if; when ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_ANNOUNCER => -- SANITY CHECK: Ignore if no Writers @@ -661,12 +661,12 @@ begin message_type_next <= EDP; stage_next <= PROCESS_HEARTBEAT; -- HEARTBEAT Processing -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; when SID_DATA => message_type_next <= EDP; stage_next <= LATCH_SEQ_NR; -- DATA Processing -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; -- QoS is subscriber-requested is_subscriber_next <= '1'; -- Reset Endpoint Mask (ALL WRITERS) @@ -680,7 +680,7 @@ begin message_type_next <= MESSAGE; stage_next <= PROCESS_ACKNACK; --ACKNACK Processing -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; end if; when ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER => -- Only HEARTBEATs and DATA are relevant (GAPs irrelevant, since depth is 1) @@ -689,12 +689,12 @@ begin message_type_next <= MESSAGE; stage_next <= PROCESS_HEARTBEAT; -- HEARTBEAT Processing -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; when SID_DATA => message_type_next <= MESSAGE; stage_next <= LATCH_SEQ_NR; -- DATA Processing -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; end case; when others => null; @@ -706,9 +706,9 @@ begin cnt_next <= cnt + 1; -- Latch Sequence Number case (cnt) is - when 1 => + when 0 => seq_nr_next(0) <= unsigned(data_in); - when 2 => + when 1 => seq_nr_next(1) <= unsigned(data_in); stage_next <= PROCESS_DATA; when others => @@ -853,42 +853,42 @@ begin stage_next <= LATCH_LOCATOR; addr_latch_index_next <= '0'; -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; end if; when PID_MULTICAST_LOCATOR => if(qos_flag = '0' and message_type = EDP) then stage_next <= LATCH_LOCATOR; addr_latch_index_next <= '0'; -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; end if; when PID_DEFAULT_UNICAST_LOCATOR => if(qos_flag = '0' and message_type = DPD) then stage_next <= LATCH_LOCATOR; addr_latch_index_next <= '0'; -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; end if; when PID_DEFAULT_MULTICAST_LOCATOR => if(qos_flag = '0' and message_type = DPD) then stage_next <= LATCH_LOCATOR; addr_latch_index_next <= '0'; -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; end if; when PID_METATRAFFIC_UNICAST_LOCATOR => if(qos_flag = '0' and message_type = DPD) then stage_next <= LATCH_LOCATOR; addr_latch_index_next <= '1'; -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; end if; when PID_METATRAFFIC_MULTICAST_LOCATOR => if(qos_flag = '0' and message_type = DPD) then stage_next <= LATCH_LOCATOR; addr_latch_index_next <= '1'; -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; end if; when PID_EXPECTS_INLINE_QOS => stage_next <= LATCH_EXPECTS_INLINE_QOS; @@ -904,7 +904,7 @@ begin if(qos_flag = '0' and message_type = DPD) then stage_next <= LATCH_GUID; -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; end if; when PID_GROUP_GUID => -- Ignore @@ -926,7 +926,7 @@ begin if(qos_flag = '0' and message_type = EPD) then stage_next <= LATCH_GUID; -- Initialise counter - cnt_next <= 1; + cnt_next <= 0; end if; when PID_CONTENT_FILTER_INFO => -- Ignore @@ -1288,31 +1288,33 @@ begin rd_sig <= '1'; -- Increment Counter (Default) cnt_next <= cnt + 1; - -- Locator Kind - if (cnt = 1) then - -- Check if UDPv4 Locator - if (data_in_swapped /= LOCATOR_KIND_UDPv4) then - stage_next <= SKIP_PARAMETER; - end if; - -- Locator Port - elsif (cnt = 2) then - -- Latch Source Port - if (addr_latch_index = '0') then - port_latch_1 <= data_in_swapped(port_latch_1'length-1 downto 0); - else - port_latch_2 <= data_in_swapped(port_latch_2'length-1 downto 0); - end if; - -- Locator Addr (IPv4) - elsif (cnt = 6) then - -- Latch Src Addr - if (addr_latch_index = '0') then - addr_latch_1 <= data_in_swapped; - else - addr_latch_2 <= data_in_swapped; - end if; - -- Exit Stage - stage_next <= SKIP_PARAMETER; - end if; + + case (cnt) is + -- Locator Kind + when 0 => + -- Check if UDPv4 Locator + if (data_in_swapped /= LOCATOR_KIND_UDPv4) then + stage_next <= SKIP_PARAMETER; + end if; + -- Locator Port + when 1 => + -- Latch Source Port + if (addr_latch_index = '0') then + port_latch_1 <= data_in_swapped(port_latch_1'length-1 downto 0); + else + port_latch_2 <= data_in_swapped(port_latch_2'length-1 downto 0); + end if; + -- Locator Addr (IPv4) + when 5 => + -- Latch Src Addr + if (addr_latch_index = '0') then + addr_latch_1 <= data_in_swapped; + else + addr_latch_2 <= data_in_swapped; + end if; + -- Exit Stage + stage_next <= SKIP_PARAMETER; + end case; end if; when LATCH_EXPECTS_INLINE_QOS => if (empty = '0') then @@ -1331,19 +1333,19 @@ begin -- Check if GUID Prefix valid (Should be the same as the GUID Prefix of the Packet) -- and update the Entity ID case (cnt) is - when 1 => + when 0 => if (data_in /= guid(0)) then stage_next <= SKIP_PACKET; end if; - when 2 => + when 1 => if (data_in /= guid(1)) then stage_next <= SKIP_PACKET; end if; - when 3 => + when 2 => if (data_in /= guid(2)) then stage_next <= SKIP_PACKET; end if; - when 4 => + when 3 => -- NOTE: Even though the mem_ctrl_prc is currently using the guid signal, it only uses the first -- 3 bytes (GUIDPrefix) for the SEARCH_PARTICIPANT guid_next(3) <= data_in; @@ -1482,7 +1484,7 @@ begin endpoint_unmatch_next <= (others => '0'); -- Propagate Match Changes to local Endpoints stage_next <= INFORM_ENDPOINTS_MATCH; - cnt_next <= 1; + cnt_next <= 0; end if; -- Match in buffer (Existing Endpoint) else @@ -1500,7 +1502,7 @@ begin start_mem_op <= '1'; -- Propagate Match Changes to local Endpoints stage_next <= INFORM_ENDPOINTS_MATCH; - cnt_next <= 1; + cnt_next <= 0; else -- Remove endpoint from buffer mem_opcode <= REMOVE_ENDPOINT; @@ -1510,7 +1512,7 @@ begin endpoint_unmatch_next <= convert_from_bitmask_array(endpoint_mask_array, MAX_ENDPOINTS); -- Propagate Match Changes to local Endpoints stage_next <= INFORM_ENDPOINTS_UNMATCH; - cnt_next <= 1; + cnt_next <= 0; end if; end if; end if; @@ -1533,7 +1535,7 @@ begin endpoint_unmatch_next <= convert_from_bitmask_array(endpoint_mask_array, MAX_ENDPOINTS); -- Propagate Match Changes to local Endpoints stage_next <= INFORM_ENDPOINTS_UNMATCH; - cnt_next <= 1; + cnt_next <= 0; -- Buffer has no more orphans else -- DONE @@ -1547,17 +1549,17 @@ begin -- Enable Write wr_sig <= '1'; case (cnt) is - when 1 => + when 0 => output_sig <= OPCODE_MATCH; - when 2 => + when 1 => output_sig <= guid(0); - when 3 => + when 2 => output_sig <= guid(1); - when 4 => + when 3 => output_sig <= guid(2); - when 5 => + when 4 => output_sig <= guid(3); - when 6 => + when 5 => -- Use Address set by PID if (addr_latch_1 /= (addr_latch_1'reverse_range => '0')) then output_sig <= addr_latch_1; @@ -1565,7 +1567,7 @@ begin else output_sig <= mem_def_addr; end if; - when 7 => + when 6 => -- Use Port set by PID if (port_latch_1 /= (port_latch_1'reverse_range => '0')) then output_sig <= port_latch_1 & mem_xflags; @@ -1577,6 +1579,7 @@ begin -- If there are endpoints to unmatch, inform them if (endpoint_unmatch /= (endpoint_unmatch'range => '0')) then stage_next <= INFORM_ENDPOINTS_UNMATCH; + cnt_next <= 0; else -- DONE stage_next <= SKIP_PACKET; @@ -1590,15 +1593,15 @@ begin -- Enable Write wr_sig <= '1'; case (cnt) is - when 1 => + when 0 => output_sig <= OPCODE_UNMATCH; - when 2 => + when 1 => output_sig <= guid(0); - when 3 => + when 2 => output_sig <= guid(1); - when 4 => + when 3 => output_sig <= guid(2); - when 5 => + when 4 => output_sig <= guid(3); -- If we are in the middle of an orphan purge process, return to the search stage @@ -1653,7 +1656,7 @@ begin start_mem_op <= '1'; -- Send Acknack stage_next <= SEND_ACKNACK; - cnt_next <= 1; + cnt_next <= 0; end if; -- Acknack Response Time else @@ -1711,13 +1714,13 @@ begin cnt_next <= cnt + 1; -- Latch Sequence Number case (cnt) is - when 1 => + when 0 => first_seq_nr_next(0) <= data_in; - when 2 => + when 1 => first_seq_nr_next(1) <= data_in; - when 3 => + when 2 => last_seq_nr_next(0) <= data_in; - when 4 => + when 3 => last_seq_nr_next(1) <= data_in; stage_next <= PROCESS_HEARTBEAT_SEQUENCE_NUMBERS; end case; @@ -1771,90 +1774,90 @@ begin case (cnt) is -- OUTPUT HEADER -- Src IPv4 Address - when 1 => + when 0 => output_sig <= DEFAULT_IPv4_MULTICAST_ADDRESS; -- Dest IPv4 Address - when 2 => + when 1 => output_sig <= mem_participant_data.meta_addr; -- Src and Dest UDPv4 Ports - when 3 => + when 2 => output_sig <= META_IPv4_UNICAST_PORT & mem_participant_data.meta_port; -- RTPS MESSAGE HEADER - when 4 => + when 3 => output_sig <= PROTOCOL_RTPS; - when 5 => + when 4 => output_sig <= PROTOCOLVERSION_2_4 & VENDORID; - when 6 => + when 5 => output_sig <= GUIDPREFIX(0); - when 7 => + when 6 => output_sig <= GUIDPREFIX(1); - when 8 => + when 7 => output_sig <= GUIDPREFIX(2); -- ACKNACK RTPS SUBMESSAGE (Publication) -- RTPS Submessage Header - when 9 => + when 8 => output_sig <= SID_ACKNACK & "00000010" & std_logic_vector(to_unsigned(24, 16)); -- Reader Entity ID - when 10 => + when 9 => output_sig <= ENTITYID_SEDP_BUILTIN_PUBLICATIONS_DETECTOR; -- Writer Entity ID - when 11 => + when 10 => output_sig <= ENTITYID_SEDP_BUILTIN_PUBLICATIONS_ANNOUNCER; -- Sequence Number Set (Bitmap Base 1/2) - when 12 => + when 11 => output_sig <= mem_participant_data.pub_seq_nr(0); -- Sequence Number Set (Bitmap Base 2/2) - when 13 => + when 12 => output_sig <= mem_participant_data.pub_seq_nr(1); -- Sequence Number Set (NumBits) - when 14 => + when 13 => output_sig <= (others => '0'); -- Count - when 15 => + when 14 => output_sig <= count; -- ACKNACK RTPS SUBMESSAGE (Subscription) -- RTPS Submessage Header - when 16 => + when 15 => output_sig <= SID_ACKNACK & "00000010" & std_logic_vector(to_unsigned(24, 16)); -- Reader Entity ID - when 17 => + when 16 => output_sig <= ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_DETECTOR; -- Writer Entity ID - when 18 => + when 17 => output_sig <= ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_ANNOUNCER; -- Sequence Number Set (Bitmap Base 1/2) - when 19 => + when 18 => output_sig <= mem_participant_data.sub_seq_nr(0); -- Sequence Number Set (Bitmap Base 2/2) - when 20 => + when 19 => output_sig <= mem_participant_data.sub_seq_nr(1); -- Sequence Number Set (NumBits) - when 21 => + when 20 => output_sig <= (others => '0'); -- Count - when 22 => + when 21 => output_sig <= count; -- ACKNACK RTPS SUBMESSAGE (Message) -- RTPS Submessage Header - when 23 => + when 22 => output_sig <= SID_ACKNACK & "00000010" & std_logic_vector(to_unsigned(24, 16)); -- Reader Entity ID - when 24 => + when 23 => output_sig <= ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER; -- Writer Entity ID - when 25 => + when 24 => output_sig <= ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER; -- Sequence Number Set (Bitmap Base 1/2) - when 26 => + when 25 => output_sig <= mem_participant_data.mes_seq_nr(0); -- Sequence Number Set (Bitmap Base 2/2) - when 27 => + when 26 => output_sig <= mem_participant_data.mes_seq_nr(1); -- Sequence Number Set (NumBits) - when 28 => + when 27 => output_sig <= (others => '0'); -- Count - when 29 => + when 28 => output_sig <= count; -- Signal Last Word last_word_out <= '1'; @@ -1870,9 +1873,9 @@ begin -- Latch Sequence Number -- NOTE: Because we always sent the entire history cache, we only need to look at the SequenceNumberSetBase to determine if we need to sent data or not case (cnt) is - when 1 => + when 0 => first_seq_nr_next(0) <= data_in; - when 2 => + when 1 => first_seq_nr_next(1) <= data_in; stage_next <= PROCESS_ACKNACK_SEQUENCE_NUMBERS end case; @@ -2020,7 +2023,7 @@ begin -- Exit Condition if (cnt = (READER_ENDPOINT_DATA.length-1)) then last_word_out <= '1'; - cnt_next <= 1; + cnt_next <= 0; stage_next <= SEND_MES_DATA; end if; end if; @@ -2038,26 +2041,26 @@ begin case (cnt) is -- OUTPUT HEADER -- Src IPv4 Address - when 1 => + when 0 => output_sig <= DEFAULT_IPv4_MULTICAST_ADDRESS; -- Dest IPv4 Address - when 2 => + when 1 => output_sig <= mem_participant_data.meta_addr; -- Src and Dest UDPv4 Ports - when 3 => + when 2 => output_sig <= META_IPv4_UNICAST_PORT & mem_participant_data.meta_port; -- RTPS MESSAGE HEADER - when 4 => + when 3 => output_sig <= PROTOCOL_RTPS; - when 5 => + when 4 => output_sig <= PROTOCOLVERSION_2_4 & VENDORID; - when 6 => + when 5 => output_sig <= GUIDPREFIX(0); - when 7 => + when 6 => output_sig <= GUIDPREFIX(1); - when 8 => + when 7 => output_sig <= GUIDPREFIX(2); - cnt_next <= 1; + cnt_next <= 0; stage_next <= SEND_MAN_LIVE; end case; end if; @@ -2070,50 +2073,50 @@ begin case (cnt) is -- DATA RTPS SUBMESSAGE (Participant Message) -- RTPS Submessage Header - when 1 => + when 0 => output_sig <= SID_DATA & "00000100" & std_logic_vector(to_unsigned(44, 16)); -- ExtraFlags, octetsToInlineQoS - when 2 => + when 1 => output_sig <= x"0000" & std_logic_vector(to_unsigned(16, 16)); -- Reader Entity ID - when 3 => + when 2 => output_sig <= ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER; -- Writer Entity ID - when 4 => + when 3 => output_sig <= ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER; -- Sequence Number 1/2 - when 5 => + when 4 => output_sig <= man_live_seq_nr(0); -- Sequence Number 2/2 - when 6 => + when 5 => output_sig <= man_live_seq_nr(1); -- Serialized Payload Header - when 7 => + when 6 => output_sig <= CDR_BE & x"0000"; -- Serialized Payload BEGIN -- GUID Prefix 1/3 - when 8 => + when 7 => output_sig <= GUIDPREFIX(0); -- GUID Prefix 2/3 - when 9 => + when 8 => output_sig <= GUIDPREFIX(1); -- GUID Prefix 3/3 - when 10 => + when 9 => output_sig <= GUIDPREFIX(3); -- Participant Message Kind - when 11 => + when 10 => output_sig <= PARTICIPANT_MESSAGE_DATA_KIND_MANUAL_LIVELINESS_UPDATE; -- Data Length - when 12 => + when 11 => output_sig <= (others => '0'); -- If manual and automatic sequence numbers are not consecutive, we need to send a GAP Message if (live_gap_start /= auto_live_seq_nr) then stage_next <= SEND_MES_GAP; - cnt_next <= 1; + cnt_next <= 0; -- Else Continue with Automatic Liveliness else stage_next <= SEND_MES_AUTO_LIVE; - cnt_next <= 1; + cnt_next <= 0; end if; end case; end if; @@ -2126,31 +2129,31 @@ begin case (cnt) is -- DATA RTPS SUBMESSAGE (Participant Message) -- RTPS Submessage Header - when 1 => + when 0 => output_sig <= SID_GAP & "00000000" & std_logic_vector(to_unsigned(28, 16)); -- Reader Entity ID - when 2 => + when 1 => output_sig <= ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER; -- Writer Entity ID - when 3 => + when 2 => output_sig <= ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER; -- GAP Start Sequence Number 1/2 - when 4 => + when 3 => output_sig <= live_gap_start(0); -- GAP Start Sequence Number 2/2 - when 5 => + when 4 => output_sig <= live_gap_start(1); -- GAP End Sequence Number Set (Bitmap Base 1/2) - when 6 => + when 5 => output_sig <= live_gap_end(0); -- GAP End Sequence Number Set (Bitmap Base 2/2) - when 7 => + when 6 => output_sig <= live_gap_end(1); -- GAP End Sequence Number Set (NumBits) - when 8 => + when 7 => output_sig <= (others => '0'); stage_next <= SEND_MES_AUTO_LIVE; - cnt_next <= 1; + cnt_next <= 0; end case; end if; when SEND_MES_AUTO_LIVE => @@ -2162,41 +2165,41 @@ begin case (cnt) is -- DATA RTPS SUBMESSAGE (Participant Message) -- RTPS Submessage Header - when 1 => + when 0 => output_sig <= SID_DATA & "00000100" & std_logic_vector(to_unsigned(44, 16)); -- ExtraFlags, octetsToInlineQoS - when 2 => + when 1 => output_sig <= x"0000" & std_logic_vector(to_unsigned(16, 16)); -- Reader Entity ID - when 3 => + when 2 => output_sig <= ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER; -- Writer Entity ID - when 4 => + when 3 => output_sig <= ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER; -- Sequence Number 1/2 - when 5 => + when 4 => output_sig <= auto_live_seq_nr(0); -- Sequence Number 2/2 - when 6 => + when 5 => output_sig <= auto_live_seq_nr(1); -- Serialized Payload Header - when 7 => + when 6 => output_sig <= CDR_BE & x"0000"; -- Serialized Payload BEGIN -- GUID Prefix 1/3 - when 8 => + when 7 => output_sig <= GUIDPREFIX(0); -- GUID Prefix 2/3 - when 9 => + when 8 => output_sig <= GUIDPREFIX(1); -- GUID Prefix 3/3 - when 10 => + when 9 => output_sig <= GUIDPREFIX(3); -- Participant Message Kind - when 11 => + when 10 => output_sig <= PARTICIPANT_MESSAGE_DATA_KIND_AUTOMATIC_LIVELINESS_UPDATE; -- Data Length - when 12 => + when 11 => output_sig <= (others => '0'); last_word_out <= '1'; stage_next <= IDLE; @@ -2277,11 +2280,10 @@ begin when REMOVE_PARTICIPANT => mem_stage_next <= REMOVE_PARTICIPANT; mem_addr_next <= addr_res; - mem_cnt_next <= 1; + mem_cnt_next <= 0; when REMOVE_ENDPOINT => mem_stage_next <= REMOVE_ENDPOINT; mem_addr_next <= addr_res; - mem_cnt_next <= 1; when UPDATE_ENDPOINT => mem_stage_next <= UPDATE_ENDPOINT; mem_addr_next <= addr_res + 4; @@ -2325,22 +2327,22 @@ begin mem_stage_next <= UPDATE_PARTICIPANT; if (update_participant_flags(PARTICIPANT_DATA_FLAG) = '1') then mem_addr_next <= addr_res + 3; - mem_cnt_next <= 1; + mem_cnt_next <= 0; elsif (update_participant_flags(LEASE_DEADLINE_FLAG) = '1') then mem_addr_next <= addr_res + 10; - mem_cnt_next <= 8; + mem_cnt_next <= 7; elsif (update_participant_flags(EXTRA_FLAGS_FLAG) = '1') then mem_addr_next <= addr_res + 12; - mem_cnt_next <= 10; + mem_cnt_next <= 9; elsif (update_participant_flags(ACKNACK_RES_TIME_FLAG) = '1') then mem_addr_next <= addr_res + 13; - mem_cnt_next <= 11; + mem_cnt_next <= 10; elsif (update_participant_flags(HEARTBEAT_RES_TIME_FLAG) = '1') then mem_addr_next <= addr_res + 15; - mem_cnt_next <= 13; + mem_cnt_next <= 12; elsif (update_participant_flags(EDP_SEQ_NR_FLAG) = '1') then mem_addr_next <= addr_res + 17; - mem_cnt_next <= 15; + mem_cnt_next <= 14; end if; when others => null; @@ -2534,7 +2536,7 @@ begin -- Default Address Increment mem_addr_next <= mem_addr + 1; -- Latch Endpoint Bitmask - -- TODO: Use a different integer ranged in the smalled possible range? + -- TODO: Use a different integer ranged in the smallest possible range? endpoint_mask_array_next(mem_cnt) <= mem_read_data; -- Exit Condition if (mem_cnt = ENDPOINT_BITMASK_SIZE-1) then @@ -2627,7 +2629,7 @@ begin max_participant_addr_next <= tmp; -- DONE mem_stage_next <= INSERT_PARTICIPANT; - mem_cnt_next <= 1; + mem_cnt_next <= 0; end if; end if; when 1 => @@ -2661,7 +2663,7 @@ begin else -- Found Empty Slot, DONE mem_stage_next <= INSERT_PARTICIPANT; - mem_cnt_next <= 1; + mem_cnt_next <= 0; end if; end if; end case; @@ -2673,73 +2675,73 @@ begin mem_cnt_next <= mem_cnt + 1; case (mem_cnt) is - when 1 => + when 0 => -- GUIDPrefix 1/3 mem_write_data <= guid(0); - when 2 => + when 1 => -- GUIDPrefix 2/3 mem_write_data <= guid(1); - when 3 => + when 2 => -- GUIDPrefix 3/3 mem_write_data <= guid(2); - when 4 => + when 3 => -- Metatraffic IPv4 Address mem_write_data <= addr_latch_2; - when 5 => + when 4 => -- Default Endpoint IPv4 Address mem_write_data <= addr_latch_1; - when 6 => + when 5 => -- UDPv4 Ports mem_write_data <= port_latch_2 & port_latch_1; - when 7 => + when 6 => -- SPDP Sequence Number 1/2 mem_write_data <= std_logic_vector(seq_nr(0)); - when 8 => + when 7 => -- SPDP Sequence Number 2/2 mem_write_data <= std_logic_vector(seq_nr(1)); - when 9 => + when 8 => -- Lease Duration 1/2 mem_write_data <= std_logic_vector(lease_duration(0)); - when 10 => + when 9 => -- Lease Duration 2/2 mem_write_data <= std_logic_vector(lease_duration(1)); - when 11 => + when 10 => -- Lease Deadline 1/2 mem_write_data <= std_logic_vector(lease_deadline(0)); - when 12 => + when 11 => -- Lease Deadline 2/2 mem_write_data <= std_logic_vector(lease_deadline(1)); - when 13 => + when 12 => -- Extra Flags mem_write_data <= extra_flags; - when 14 => + when 13 => -- ACKNACK DEADLINE 1/2 mem_write_data <= (others => '0'); - when 15 => + when 14 => -- ACKNACK DEADLINE 2/2 mem_write_data <= (others => '0'); - when 16 => + when 15 => -- HEARTBEAT DEADLINE 1/2 mem_write_data <= (others => '0'); - when 17 => + when 16 => -- HEARTBEAT DEADLINE 2/2 mem_write_data <= (others => '0'); - when 18 => + when 17 => -- Publication Sequence Number 1/2 mem_write_data <= (others => '0'); - when 19 => + when 18 => -- Publication Sequence Number 2/2 mem_write_data <= (others => '0'); - when 20 => + when 19 => -- Subscription Sequence Number 1/2 mem_write_data <= (others => '0'); - when 21 => + when 20 => -- Subscription Sequence Number 2/2 mem_write_data <= (others => '0'); - when 22 => + when 21 => -- Participant Message Sequence Number 1/2 mem_write_data <= (others => '0'); - when 23 => + when 22 => -- Participant Message Sequence Number 2/2 mem_write_data <= (others => '0'); end case; @@ -2772,7 +2774,7 @@ begin max_endpoint_addr <= mem_addr_base; -- DONE mem_stage_next <= INSERT_PARTICIPANT; - mem_cnt_next <= 1; + mem_cnt_next <= 0; end if; end if; when 1 => @@ -2787,7 +2789,7 @@ begin if (reset_max_pointer = '0') then -- Found Empty Slot, DONE mem_stage_next <= INSERT_ENDPOINT; - mem_cnt_next <= 1; + mem_cnt_next <= 0; end if; end if; end case; @@ -2799,16 +2801,16 @@ begin mem_cnt_next <= mem_cnt + 1; case (mem_cnt) is - when 1 => + when 0 => -- Entity ID mem_write_data <= guid(3); - when 2 => + when 1 => -- GUIDPrefix 1/3 mem_write_data <= guid(0); - when 3 => + when 2 => -- GUIDPrefix 2/3 mem_write_data <= guid(1); - when 4 => + when 3 => -- GUIDPrefix 3/3 mem_write_data <= guid(2); @@ -2936,43 +2938,43 @@ begin -- Default Address Increment mem_addr_next <= mem_addr + 1; case (mem_cnt) is - when 1 => + when 0 => -- Metatraffic IPv4 Address mem_write_data <= addr_latch_2; if (update_participant_flags(PARTICIPANT_DATA_FLAG) = '1') then mem_wr <= '1'; end if; - when 2 => + when 1 => -- Default Endpoint IPv4 Address mem_write_data <= addr_latch_1; if (update_participant_flags(PARTICIPANT_DATA_FLAG) = '1') then mem_wr <= '1'; end if; - when 3 => + when 2 => -- UDPv4 Ports mem_write_data <= port_latch_2 & port_latch_1; if (update_participant_flags(PARTICIPANT_DATA_FLAG) = '1') then mem_wr <= '1'; end if; - when 4 => + when 3 => -- SPDP Sequence Number 1/2 mem_write_data <= std_logic_vector(seq_nr(0)); if (update_participant_flags(PARTICIPANT_DATA_FLAG) = '1') then mem_wr <= '1'; end if; - when 5 => + when 4 => -- SPDP Sequence Number 2/2 mem_write_data <= std_logic_vector(seq_nr(1)); if (update_participant_flags(PARTICIPANT_DATA_FLAG) = '1') then mem_wr <= '1'; end if; - when 6 => + when 5 => -- Lease Duration 1/2 mem_write_data <= std_logic_vector(lease_duration(0)); if (update_participant_flags(PARTICIPANT_DATA_FLAG) = '1') then mem_wr <= '1'; end if; - when 7 => + when 6 => -- Lease Duration 2/2 mem_write_data <= std_logic_vector(lease_duration(1)); if (update_participant_flags(PARTICIPANT_DATA_FLAG) = '1') then @@ -2982,13 +2984,13 @@ begin if (update_participant_flags(5 downto 1) = (5 downto 1 => '0')) then mem_stage_next <= IDLE; end if; - when 8 => + when 7 => -- Lease Deadline 1/2 mem_write_data <= std_logic_vector(lease_deadline(0)); if (update_participant_flags(LEASE_DEADLINE_FLAG) = '1') then mem_wr <= '1'; end if; - when 9 => + when 8 => -- Lease Deadline 2/2 mem_write_data <= std_logic_vector(lease_deadline(1)); if (update_participant_flags(LEASE_DEADLINE_FLAG) = '1') then @@ -2998,7 +3000,7 @@ begin if (update_participant_flags(5 downto 2) = (5 downto 2 => '0')) then mem_stage_next <= IDLE; end if; - when 10 => + when 9 => -- Extra Flags mem_write_data <= extra_flags; if (update_participant_flags(PARTICIPANT_DATA_FLAG) = '1') then @@ -3008,13 +3010,13 @@ begin if (update_participant_flags(5 downto 3) = (5 downto 3 => '0')) then mem_stage_next <= IDLE; end if; - when 11 => + when 10 => -- ACKNACK DEADLINE 1/2 mem_write_data <= std_logic_vector(acknack_res_time(0)); if (update_participant_flags(ACKNACK_RES_TIME_FLAG) = '1') then mem_wr <= '1'; end if; - when 12 => + when 11 => -- ACKNACK DEADLINE 2/2 mem_write_data <= std_logic_vector(acknack_res_time(1)); if (update_participant_flags(ACKNACK_RES_TIME_FLAG) = '1') then @@ -3024,13 +3026,13 @@ begin if (update_participant_flags(5 downto 4) = (5 downto 4 => '0')) then mem_stage_next <= IDLE; end if; - when 13 => + when 12 => -- HEARTBEAT DEADLINE 1/2 mem_write_data <= std_logic_vector(heartbeat_res_time(0)); if (update_participant_flags(HEARTBEAT_RES_TIME_FLAG) = '1') then mem_wr <= '1'; end if; - when 14 => + when 13 => -- HEARTBEAT DEADLINE 2/2 mem_write_data <= std_logic_vector(heartbeat_res_time(1)); if (update_participant_flags(HEARTBEAT_RES_TIME_FLAG) = '1') then @@ -3040,37 +3042,37 @@ begin if (update_participant_flags(5 downto 5) = (5 downto 5 => '0')) then mem_stage_next <= IDLE; end if; - when 15 => + when 14 => -- Publication Sequence Number 1/2 mem_write_data <= std_logic_vector(seq_nr(0)); if (update_participant_flags(EDP_SEQ_NR_FLAG) = '1' and message_type = EDP and is_subscriber = '0') then mem_wr <= '1'; end if; - when 16 => + when 15 => -- Publication Sequence Number 2/2 mem_write_data <= std_logic_vector(seq_nr(1)); if (update_participant_flags(EDP_SEQ_NR_FLAG) = '1' and message_type = EDP and is_subscriber = '0') then mem_wr <= '1'; end if; - when 17 => + when 16 => -- Subscription Sequence Number 1/2 mem_write_data <= std_logic_vector(seq_nr(0)); if (update_participant_flags(EDP_SEQ_NR_FLAG) = '1' and message_type = EDP and is_subscriber = '1') then mem_wr <= '1'; end if; - when 18 => + when 17 => -- Subscription Sequence Number 2/2 mem_write_data <= std_logic_vector(seq_nr(1)); if (update_participant_flags(EDP_SEQ_NR_FLAG) = '1' and message_type = EDP and is_subscriber = '1') then mem_wr <= '1'; end if; - when 19 => + when 18 => -- Participant Message Sequence Number 1/2 mem_write_data <= std_logic_vector(seq_nr(0)); if (update_participant_flags(EDP_SEQ_NR_FLAG) = '1' and message_type = MESSAGE) then mem_wr <= '1'; end if; - when 20 => + when 19 => -- Participant Message Sequence Number 2/2 mem_write_data <= std_logic_vector(seq_nr(1)); if (update_participant_flags(EDP_SEQ_NR_FLAG) = '1' and message_type = MESSAGE) then