* Endoint Match/Unmatch
This commit is contained in:
parent
495cf94a9f
commit
b8dc9e9482
142
src/TODO.txt
142
src/TODO.txt
@ -73,6 +73,12 @@ ENDPOINT FIFO PACKET FORMAT
|
|||||||
+---------------------------------------------------------------+
|
+---------------------------------------------------------------+
|
||||||
| SRC_ENTITYID |
|
| SRC_ENTITYID |
|
||||||
+---------------------------------------------------------------+
|
+---------------------------------------------------------------+
|
||||||
|
| |
|
||||||
|
+ +
|
||||||
|
| SRC_GUIDPREFIX |
|
||||||
|
+ +
|
||||||
|
| |
|
||||||
|
+---------------------------------------------------------------+
|
||||||
| DEST_ENTITYID [only for Builtin Destinations] |
|
| DEST_ENTITYID [only for Builtin Destinations] |
|
||||||
+---------------------------------------------------------------+
|
+---------------------------------------------------------------+
|
||||||
| |
|
| |
|
||||||
@ -102,6 +108,104 @@ HEARTBEAT messages (and even ignore GAP messages).
|
|||||||
|
|
||||||
PARTICICPANT DATA
|
PARTICICPANT DATA
|
||||||
=================
|
=================
|
||||||
|
32..............24..............16..............8...............0
|
||||||
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
01| |
|
||||||
|
+ +
|
||||||
|
02| GUIDPREFIX |
|
||||||
|
+ +
|
||||||
|
03| |
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
04| META_IPv4_ADDRESS |
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
05| DEFAULT_IPv4_ADDRESS |
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
06| META_UDP_PORT | DEFAULT_UDP_PORT |
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
| UNUSED | EXTRA_FLAGS |Q|
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
07| LEASE_DURATION |
|
||||||
|
+ +
|
||||||
|
08| |
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
09| LEASE_DEADLINE |
|
||||||
|
+ +
|
||||||
|
10| |
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
12| |
|
||||||
|
+ SPDP_SEQ_NR +
|
||||||
|
13| |
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
14| |
|
||||||
|
+ PUBLICATION_SEQ_NR +
|
||||||
|
15| |
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
16| |
|
||||||
|
+ SUBSCRIPTION_SEQ_NR +
|
||||||
|
17| |
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
18| |
|
||||||
|
+ MESSAGE_SEQ_NR +
|
||||||
|
19| |
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
|
||||||
|
ENDPOINT DATA
|
||||||
|
=============
|
||||||
|
32..............24..............16..............8...............0
|
||||||
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
01| ENTITYID |
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
02| |
|
||||||
|
+ +
|
||||||
|
03| GUIDPREFIX |
|
||||||
|
+ +
|
||||||
|
04| |
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
05| |
|
||||||
|
~ ENDPOINT_BITMASK ~
|
||||||
|
**| |
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
|
||||||
|
ENDPOINT MATCH FRAME
|
||||||
|
====================
|
||||||
|
32..............24..............16..............8...............0
|
||||||
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
01| OPCODE |
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
02| |
|
||||||
|
+ +
|
||||||
|
03| GUIDPREFIX |
|
||||||
|
+ +
|
||||||
|
04| |
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
05| ENTITYID |
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
06| IPv4_ADDRESS |
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
07| UDP_PORT | EXTRA_FLAGS |Q|
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
|
||||||
|
ENDPOINT UNMATCH FRAME
|
||||||
|
======================
|
||||||
|
32..............24..............16..............8...............0
|
||||||
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
01| OPCODE |
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
02| |
|
||||||
|
+ +
|
||||||
|
03| GUIDPREFIX |
|
||||||
|
+ +
|
||||||
|
04| |
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
05| ENTITYID |
|
||||||
|
+---------------------------------------------------------------+
|
||||||
|
|
||||||
|
LOCAL ENDPOINT BUFFER
|
||||||
|
=====================
|
||||||
32..............24..............16..............8...............0
|
32..............24..............16..............8...............0
|
||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
+---------------------------------------------------------------+
|
+---------------------------------------------------------------+
|
||||||
@ -111,42 +215,6 @@ PARTICICPANT DATA
|
|||||||
+ +
|
+ +
|
||||||
| |
|
| |
|
||||||
+---------------------------------------------------------------+
|
+---------------------------------------------------------------+
|
||||||
| META_IPv4_ADDRESS |
|
|
||||||
+---------------------------------------------------------------+
|
|
||||||
| DEFAULT_IPv4_ADDRESS |
|
|
||||||
+---------------------------------------------------------------+
|
|
||||||
| META_UDP_PORT | DEFAULT_UDP_PORT |
|
|
||||||
+---------------------------------------------------------------+
|
|
||||||
| LEASE_DURATION |
|
|
||||||
+ +
|
|
||||||
| |
|
|
||||||
+---------------------------------------------------------------+
|
|
||||||
| LEASE_DEADLINE |
|
|
||||||
+ +
|
|
||||||
| |
|
|
||||||
+---------------------------------------------------------------+
|
|
||||||
| EXTRA_FLAGS |
|
|
||||||
+---------------------------------------------------------------+
|
|
||||||
|
|
||||||
|
|
||||||
32..............24..............16..............8...............0
|
|
||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
||||||
+---------------------------------------------------------------+
|
|
||||||
| ENTITYID |
|
|
||||||
+---------------------------------------------------------------+
|
|
||||||
| PARTICICPANT_INDEX |
|
|
||||||
+---------------------------------------------------------------+
|
|
||||||
| |
|
|
||||||
~ ENDPOINT_BITMASK ~
|
|
||||||
| |
|
|
||||||
+---------------------------------------------------------------+
|
|
||||||
|
|
||||||
|
|
||||||
32..............24..............16..............8...............0
|
|
||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
||||||
+---------------------------------------------------------------+
|
|
||||||
| PARTICICPANT_INDEX |
|
|
||||||
+---------------------------------------------------------------+
|
|
||||||
| ENTITYID |
|
| ENTITYID |
|
||||||
+---------------------------------------------------------------+
|
+---------------------------------------------------------------+
|
||||||
| IPv4_ADDRESS |
|
| IPv4_ADDRESS |
|
||||||
@ -158,6 +226,8 @@ PARTICICPANT DATA
|
|||||||
| (READER_ONLY) |
|
| (READER_ONLY) |
|
||||||
+---------------------------------------------------------------+
|
+---------------------------------------------------------------+
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TOPIC KEYS
|
TOPIC KEYS
|
||||||
==========
|
==========
|
||||||
Nominally the key is part of the serialized data of a data submessage.
|
Nominally the key is part of the serialized data of a data submessage.
|
||||||
|
|||||||
@ -55,4 +55,15 @@ package body math_pkg is
|
|||||||
end if;
|
end if;
|
||||||
return ret_value;
|
return ret_value;
|
||||||
end function;
|
end function;
|
||||||
|
|
||||||
|
function round_div(constant divident, divisor : in integer) return integer is
|
||||||
|
variable ret : integer;
|
||||||
|
begin
|
||||||
|
ret := divident / divisor;
|
||||||
|
if (divident mod divisor /= 0) then
|
||||||
|
ret := ret + divisor;
|
||||||
|
end if;
|
||||||
|
return ret;
|
||||||
|
end function;
|
||||||
|
|
||||||
end package body;
|
end package body;
|
||||||
File diff suppressed because it is too large
Load Diff
@ -6,6 +6,9 @@ use work.math_pkg.all;
|
|||||||
use work.rtps_package.all;
|
use work.rtps_package.all;
|
||||||
|
|
||||||
-- TODO: Remove alignment logic for RTPS Submessages, since all Submessages are 32-bit aligned
|
-- TODO: Remove alignment logic for RTPS Submessages, since all Submessages are 32-bit aligned
|
||||||
|
-- TODO: Merge CHECK_SUB_END and SKIP_SUB stages
|
||||||
|
-- TODO: Fix payload length
|
||||||
|
-- TODO: Change all Endpoint Bit Vectors to "to" Ranges
|
||||||
-- Checksum has to be checked before
|
-- Checksum has to be checked before
|
||||||
|
|
||||||
entity rtps_handler is
|
entity rtps_handler is
|
||||||
@ -111,6 +114,8 @@ architecture arch of rtps_handler is
|
|||||||
signal src_entityid, src_entityid_next : std_logic_vector(ENTITYID_WIDTH-1 downto 0) := (others => '0');
|
signal src_entityid, src_entityid_next : std_logic_vector(ENTITYID_WIDTH-1 downto 0) := (others => '0');
|
||||||
-- Destination Endpoint Entity ID latch
|
-- Destination Endpoint Entity ID latch
|
||||||
signal dest_entityid, dest_entityid_next : std_logic_vector(ENTITYID_WIDTH-1 downto 0) := (others => '0');
|
signal dest_entityid, dest_entityid_next : std_logic_vector(ENTITYID_WIDTH-1 downto 0) := (others => '0');
|
||||||
|
-- Source GUID Prefix latch
|
||||||
|
signal guidprefix, guidprefix_next : GUIDPREFIX_ARRAY_TYPE := (others => (others => '0'));
|
||||||
-- Vector denoting the Destination User Endpoints of the Message
|
-- Vector denoting the Destination User Endpoints of the Message
|
||||||
signal user_endpoint, user_endpoint_next : std_logic_vector(MAX_ENDPOINTS-1 downto 0) := (others => '0');
|
signal user_endpoint, user_endpoint_next : std_logic_vector(MAX_ENDPOINTS-1 downto 0) := (others => '0');
|
||||||
-- Denoting if the Message is destined for the Built-in Endpoints
|
-- Denoting if the Message is destined for the Built-in Endpoints
|
||||||
@ -133,6 +138,7 @@ architecture arch of rtps_handler is
|
|||||||
-- Denotes if Message is DATA Submessage
|
-- Denotes if Message is DATA Submessage
|
||||||
signal is_data, is_data_next : std_logic := '0';
|
signal is_data, is_data_next : std_logic := '0';
|
||||||
-- General Purpose counter
|
-- General Purpose counter
|
||||||
|
-- TODO: Recheck range
|
||||||
signal cnt, cnt_next : integer range 0 to max(GUIDPREFIX_WIDTH/32, 6) := 0;
|
signal cnt, cnt_next : integer range 0 to max(GUIDPREFIX_WIDTH/32, 6) := 0;
|
||||||
|
|
||||||
--*****ALIAS DEFINATION*****
|
--*****ALIAS DEFINATION*****
|
||||||
@ -348,6 +354,7 @@ begin
|
|||||||
domain_id_next <= domain_id;
|
domain_id_next <= domain_id;
|
||||||
flags_next <= flags;
|
flags_next <= flags;
|
||||||
src_entityid_next <= src_entityid;
|
src_entityid_next <= src_entityid;
|
||||||
|
guidprefix_next <= guidprefix;
|
||||||
dest_entityid_next <= dest_entityid;
|
dest_entityid_next <= dest_entityid;
|
||||||
user_endpoint_next <= user_endpoint;
|
user_endpoint_next <= user_endpoint;
|
||||||
builtin_endpoint_next <= builtin_endpoint;
|
builtin_endpoint_next <= builtin_endpoint;
|
||||||
@ -501,13 +508,17 @@ begin
|
|||||||
when RTPS_HEADER_3 =>
|
when RTPS_HEADER_3 =>
|
||||||
if (empty = '0') then
|
if (empty = '0') then
|
||||||
rd_sig <= '1';
|
rd_sig <= '1';
|
||||||
-- Sender GUID_Prefix
|
-- Increment Counter
|
||||||
--TODO <= data_in;
|
|
||||||
if (cnt = GUIDPREFIX_WIDTH/32) then
|
|
||||||
-- Next Stage
|
|
||||||
stage_next <= RTPS_SUB_HEADER;
|
|
||||||
else
|
|
||||||
cnt_next <= cnt + 1;
|
cnt_next <= cnt + 1;
|
||||||
|
|
||||||
|
-- Latch Sender GUID_Prefix
|
||||||
|
if (cnt = 1) then
|
||||||
|
guidprefix_next(0) <= data_in;
|
||||||
|
elsif (cnt = 2) then
|
||||||
|
guidprefix_next(1) <= data_in;
|
||||||
|
elsif (cnt = 3) then
|
||||||
|
guidprefix_next(2) <= data_in;
|
||||||
|
stage_next <= RTPS_SUB_HEADER;
|
||||||
end if;
|
end if;
|
||||||
end if;
|
end if;
|
||||||
-- NOTE: From here on, due to the nature of the RTPS Protocol, 32-bit word alignement
|
-- NOTE: From here on, due to the nature of the RTPS Protocol, 32-bit word alignement
|
||||||
@ -748,8 +759,9 @@ begin
|
|||||||
rd_sig <= '1';
|
rd_sig <= '1';
|
||||||
-- Increment Counter (Default)
|
-- Increment Counter (Default)
|
||||||
cnt_next <= cnt + 1;
|
cnt_next <= cnt + 1;
|
||||||
|
case (cnt) is
|
||||||
-- Locator Kind
|
-- Locator Kind
|
||||||
if (cnt = 1) then
|
when 1 =>
|
||||||
-- Check if UDPv4 Locator
|
-- Check if UDPv4 Locator
|
||||||
if (endian_swap(rtps_sub_endianness, aligned_data_in) = LOCATOR_KIND_UDPv4) then
|
if (endian_swap(rtps_sub_endianness, aligned_data_in) = LOCATOR_KIND_UDPv4) then
|
||||||
locator_match_next <= '1';
|
locator_match_next <= '1';
|
||||||
@ -757,13 +769,13 @@ begin
|
|||||||
locator_match_next <= '0';
|
locator_match_next <= '0';
|
||||||
end if;
|
end if;
|
||||||
-- Locator Port
|
-- Locator Port
|
||||||
elsif (cnt = 2) then
|
when 2 =>
|
||||||
if (locator_match = '1') then
|
if (locator_match = '1') then
|
||||||
-- Latch Source Port
|
-- Latch Source Port
|
||||||
src_port_next <= endian_swap(rtps_sub_endianness, aligned_data_in)(src_port_next'length-1 downto 0);
|
src_port_next <= endian_swap(rtps_sub_endianness, aligned_data_in)(src_port_next'length-1 downto 0);
|
||||||
end if;
|
end if;
|
||||||
-- Locator Addr (IPv4)
|
-- Locator Addr (IPv4)
|
||||||
elsif (cnt = 6) then
|
when 6 =>
|
||||||
if (locator_match = '1') then
|
if (locator_match = '1') then
|
||||||
-- Latch Src Addr
|
-- Latch Src Addr
|
||||||
src_addr_next <= endian_swap(rtps_sub_endianness, aligned_data_in);
|
src_addr_next <= endian_swap(rtps_sub_endianness, aligned_data_in);
|
||||||
@ -775,7 +787,9 @@ begin
|
|||||||
numlocators_next <= numlocators - 1;
|
numlocators_next <= numlocators - 1;
|
||||||
-- Reset Counter
|
-- Reset Counter
|
||||||
cnt_next <= 1;
|
cnt_next <= 1;
|
||||||
end if;
|
when others =>
|
||||||
|
null;
|
||||||
|
end case;
|
||||||
-- Latch Input for alignment purposes
|
-- Latch Input for alignment purposes
|
||||||
align_sig_next <= data_in(23 downto 0);
|
align_sig_next <= data_in(23 downto 0);
|
||||||
end if;
|
end if;
|
||||||
@ -783,20 +797,26 @@ begin
|
|||||||
when INFO_SRC_HEADER =>
|
when INFO_SRC_HEADER =>
|
||||||
if (empty = '0') then
|
if (empty = '0') then
|
||||||
rd_sig <= '1';
|
rd_sig <= '1';
|
||||||
-- Second Word of INFO_SRC Submessage
|
|
||||||
case (cnt) is
|
case (cnt) is
|
||||||
|
-- Second Word of INFO_SRC Submessage
|
||||||
when 2 =>
|
when 2 =>
|
||||||
-- Default Next Stage
|
|
||||||
stage_next <= SKIP_SUB;
|
|
||||||
-- Check Major Protocol Version
|
-- Check Major Protocol Version
|
||||||
if (aligned_data_in(31 downto 24) /= PROTOCOLVERSION_2_4(15 downto 8)) then
|
if (aligned_data_in(31 downto 24) /= PROTOCOLVERSION_2_4(15 downto 8)) then
|
||||||
-- Protocol not supported, skip rest of Packet
|
-- Protocol not supported, skip rest of Packet
|
||||||
stage_next <= SKIP_PACKET;
|
stage_next <= SKIP_PACKET;
|
||||||
end if;
|
end if;
|
||||||
|
when 3 =>
|
||||||
|
guidprefix_next(0) <= aligned_data_in;
|
||||||
|
when 4 =>
|
||||||
|
guidprefix_next(1) <= aligned_data_in;
|
||||||
|
when 5 =>
|
||||||
|
guidprefix_next(2) <= aligned_data_in;
|
||||||
|
stage_next <= CHECK_SUB_END;
|
||||||
when others =>
|
when others =>
|
||||||
null;
|
null;
|
||||||
end case;
|
end case;
|
||||||
-- TODO: Check how many addres are synthesized for cnt/cnt_next
|
-- TODO: Check how many adders are synthesized for cnt/cnt_next
|
||||||
cnt_next <= cnt + 1;
|
cnt_next <= cnt + 1;
|
||||||
-- Latch Input for alignment purposes
|
-- Latch Input for alignment purposes
|
||||||
align_sig_next <= data_in(23 downto 0);
|
align_sig_next <= data_in(23 downto 0);
|
||||||
@ -813,7 +833,6 @@ begin
|
|||||||
-- Next Stage (Dynamic)
|
-- Next Stage (Dynamic)
|
||||||
stage_next <= return_stage;
|
stage_next <= return_stage;
|
||||||
else
|
else
|
||||||
-- TODO: Check how many addres are synthesized for cnt/cnt_next
|
|
||||||
cnt_next <= cnt + 1;
|
cnt_next <= cnt + 1;
|
||||||
end if;
|
end if;
|
||||||
-- Latch Input for alignment purposes
|
-- Latch Input for alignment purposes
|
||||||
@ -924,6 +943,15 @@ begin
|
|||||||
when 4 =>
|
when 4 =>
|
||||||
output_sig <= src_entityid;
|
output_sig <= src_entityid;
|
||||||
wr_sig <= '1';
|
wr_sig <= '1';
|
||||||
|
when 5 =>
|
||||||
|
output_sig <= guidprefix(0);
|
||||||
|
wr_sig <= '1';
|
||||||
|
when 6 =>
|
||||||
|
output_sig <= guidprefix(1);
|
||||||
|
wr_sig <= '1';
|
||||||
|
when 7 =>
|
||||||
|
output_sig <= guidprefix(2);
|
||||||
|
wr_sig <= '1';
|
||||||
-- Next Stage
|
-- Next Stage
|
||||||
if (builtin_endpoint = '1') then
|
if (builtin_endpoint = '1') then
|
||||||
-- If the destination is a built-in Endpoint, push also the destination ID,
|
-- If the destination is a built-in Endpoint, push also the destination ID,
|
||||||
@ -1091,6 +1119,7 @@ begin
|
|||||||
domain_id <= 0;
|
domain_id <= 0;
|
||||||
flags <= (others => '0');
|
flags <= (others => '0');
|
||||||
src_entityid <= (others => '0');
|
src_entityid <= (others => '0');
|
||||||
|
guidprefix <= (others => (others => '0'));
|
||||||
dest_entityid <= (others => '0');
|
dest_entityid <= (others => '0');
|
||||||
user_endpoint <= (others => '0');
|
user_endpoint <= (others => '0');
|
||||||
numlocators <= (others => '0');
|
numlocators <= (others => '0');
|
||||||
@ -1118,6 +1147,7 @@ begin
|
|||||||
domain_id <= domain_id_next;
|
domain_id <= domain_id_next;
|
||||||
flags <= flags_next;
|
flags <= flags_next;
|
||||||
src_entityid <= src_entityid_next;
|
src_entityid <= src_entityid_next;
|
||||||
|
guidprefix <= guidprefix_next;
|
||||||
dest_entityid <= dest_entityid_next;
|
dest_entityid <= dest_entityid_next;
|
||||||
user_endpoint <= user_endpoint_next;
|
user_endpoint <= user_endpoint_next;
|
||||||
numlocators <= numlocators_next;
|
numlocators <= numlocators_next;
|
||||||
|
|||||||
@ -2,6 +2,8 @@ library ieee;
|
|||||||
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
||||||
use ieee.numeric_std.all;
|
use ieee.numeric_std.all;
|
||||||
|
|
||||||
|
use work.math_pkg.all;
|
||||||
|
|
||||||
package rtps_package is
|
package rtps_package is
|
||||||
|
|
||||||
--*****USER CONFIG*****
|
--*****USER CONFIG*****
|
||||||
@ -36,7 +38,7 @@ package rtps_package is
|
|||||||
constant MAC_ADDRESS : std_logic_vector(47 downto 0) := x"97917E0BA8CF";
|
constant MAC_ADDRESS : std_logic_vector(47 downto 0) := x"97917E0BA8CF";
|
||||||
-----------------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------------
|
||||||
-- *DO NOT MODIFY BEGIN*
|
-- *DO NOT MODIFY BEGIN*
|
||||||
type USER_DOMAIN_ID_TYPE is array (NUM_DOMAIN-1 downto 0) of integer;
|
type USER_DOMAIN_ID_TYPE is array (0 to NUM_DOMAIN-1) of integer;
|
||||||
-- *DO NOT MODIFY END*
|
-- *DO NOT MODIFY END*
|
||||||
-----------------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------------
|
||||||
-- Array of Domain IDs
|
-- Array of Domain IDs
|
||||||
@ -44,14 +46,14 @@ package rtps_package is
|
|||||||
|
|
||||||
-----------------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------------
|
||||||
-- *DO NOT MODIFY BEGIN*
|
-- *DO NOT MODIFY BEGIN*
|
||||||
type ENDPOINT_DOMAIN_MAP_TYPE is array (MAX_ENDPOINTS-1 downto 0) of integer;
|
type ENDPOINT_DOMAIN_MAP_TYPE is array (0 to MAX_ENDPOINTS-1) of integer;
|
||||||
type ENDPOINT_WITH_KEY_TYPE is array (MAX_ENDPOINTS-1 downto 0) of boolean;
|
type ENDPOINT_WITH_KEY_TYPE is array (0 to MAX_ENDPOINTS-1) of boolean;
|
||||||
type ENDPOINT_TOPIC_STRING_TYPE is array (MAX_ENDPOINTS-1 downto 0) of string(1 to 256);
|
type ENDPOINT_TOPIC_STRING_TYPE is array (0 to MAX_ENDPOINTS-1) of string(1 to 256);
|
||||||
type ENDPOINT_TOPIC_TYPE is array (MAX_ENDPOINTS-1 downto 0) of std_logic_vector(0 to (256*8)-1);
|
type ENDPOINT_TOPIC_TYPE is array (0 to MAX_ENDPOINTS-1) of std_logic_vector(0 to (256*8)-1);
|
||||||
subtype QOS_TYPE is array (MAX_ENDPOINTS-1 downto 0) of std_logic_vector(31 downto 0);
|
subtype QOS_TYPE is array (0 to MAX_ENDPOINTS-1) of std_logic_vector(31 downto 0);
|
||||||
subtype QOS_SLV_TYPE is array (MAX_ENDPOINTS-1 downto 0) of std_logic_vector(31 downto 0);
|
subtype QOS_SLV_TYPE is array (0 to MAX_ENDPOINTS-1) of std_logic_vector(31 downto 0);
|
||||||
type DURATION_TYPE is array (1 downto 0) of unsigned(31 downto 0);
|
type DURATION_TYPE is array (0 to 1) of unsigned(31 downto 0);
|
||||||
type ENDPOINT_DURATION_TYPE is array (MAX_ENDPOINTS-1 downto 0) of DURATION_TYPE;
|
type ENDPOINT_DURATION_TYPE is array (0 to MAX_ENDPOINTS-1) of DURATION_TYPE;
|
||||||
|
|
||||||
constant DURATION_INFINITE : DURATION_TYPE := (x"7fffffff", x"ffffffff");
|
constant DURATION_INFINITE : DURATION_TYPE := (x"7fffffff", x"ffffffff");
|
||||||
|
|
||||||
@ -98,8 +100,8 @@ package rtps_package is
|
|||||||
constant ENDPOINT_TOPIC : ENDPOINT_TOPIC_TYPE; -- Deferred to Package Body
|
constant ENDPOINT_TOPIC : ENDPOINT_TOPIC_TYPE; -- Deferred to Package Body
|
||||||
constant ENDPOINT_DURABILITY : QOS_TYPE := (0 => VOLATILE_DURABILITY_QOS);
|
constant ENDPOINT_DURABILITY : QOS_TYPE := (0 => VOLATILE_DURABILITY_QOS);
|
||||||
constant ENDPOINT_PRESENTATION : QOS_TYPE := (0 => INSTANCE_PRESENTATION_QOS);
|
constant ENDPOINT_PRESENTATION : QOS_TYPE := (0 => INSTANCE_PRESENTATION_QOS);
|
||||||
constant ENDPOINT_COHERENT_ACCESS : std_logic_vector(MAX_ENDPOINTS-1 downto 0) := (others => '0');
|
constant ENDPOINT_COHERENT_ACCESS : std_logic_vector(0 to MAX_ENDPOINTS-1) := (others => '0');
|
||||||
constant ENDPOINT_ORDERED_ACCESS : std_logic_vector(MAX_ENDPOINTS-1 downto 0) := (others => '0');
|
constant ENDPOINT_ORDERED_ACCESS : std_logic_vector(0 to MAX_ENDPOINTS-1) := (others => '0');
|
||||||
constant ENDPOINT_DEADLINE : ENDPOINT_DURATION_TYPE := (0 => DURATION_INFINITE); --TODO: Assert
|
constant ENDPOINT_DEADLINE : ENDPOINT_DURATION_TYPE := (0 => DURATION_INFINITE); --TODO: Assert
|
||||||
constant ENDPOINT_LIVELINESS : QOS_TYPE := (0 => AUTOMATIC_LIVELINESS_QOS);
|
constant ENDPOINT_LIVELINESS : QOS_TYPE := (0 => AUTOMATIC_LIVELINESS_QOS);
|
||||||
constant ENDPOINT_LEASE_DURATION : ENDPOINT_DURATION_TYPE := (0 => DURATION_INFINITE); --TODO: Assert
|
constant ENDPOINT_LEASE_DURATION : ENDPOINT_DURATION_TYPE := (0 => DURATION_INFINITE); --TODO: Assert
|
||||||
@ -116,6 +118,10 @@ package rtps_package is
|
|||||||
constant ENDPOINT_MAX_INSTANCES : QOS_SLV_TYPE := (0 => std_logic_vector(to_unsigned(0,32))); --TODO: Assert
|
constant ENDPOINT_MAX_INSTANCES : QOS_SLV_TYPE := (0 => std_logic_vector(to_unsigned(0,32))); --TODO: Assert
|
||||||
constant ENDPOINT_MAX_SAMP_PER_INST : QOS_SLV_TYPE := (0 => std_logic_vector(to_unsigned(0,32))); --TODO: Assert
|
constant ENDPOINT_MAX_SAMP_PER_INST : QOS_SLV_TYPE := (0 => std_logic_vector(to_unsigned(0,32))); --TODO: Assert
|
||||||
|
|
||||||
|
-- NOTE: The buffer will not only store participants, but also endpoint data
|
||||||
|
-- Used to determine the size of the built-inendpoint buffer
|
||||||
|
constant MAX_REMOTE_PARTICIPANTS : integer := 50;
|
||||||
|
|
||||||
--*****DDSI-RTPS 2.3*****
|
--*****DDSI-RTPS 2.3*****
|
||||||
|
|
||||||
-- Default Multicast Ipv4 Address (239.255.0.1)
|
-- Default Multicast Ipv4 Address (239.255.0.1)
|
||||||
@ -132,6 +138,7 @@ package rtps_package is
|
|||||||
constant PARAMETER_ID_WIDTH : integer := 16;
|
constant PARAMETER_ID_WIDTH : integer := 16;
|
||||||
constant PAYLOAD_REPRESENTATION_ID : integer := 16;
|
constant PAYLOAD_REPRESENTATION_ID : integer := 16;
|
||||||
constant PAYLOAD_REPRESENTATION_OPTIONS : integer := 16;
|
constant PAYLOAD_REPRESENTATION_OPTIONS : integer := 16;
|
||||||
|
constant SEQUENCE_NR_WIDTH : integer := 64;
|
||||||
|
|
||||||
-- 'RTPS' in Ascii code
|
-- 'RTPS' in Ascii code
|
||||||
constant PROTOCOL_RTPS : std_logic_vector(PROTOCOL_WIDTH-1 downto 0) := x"52545053";
|
constant PROTOCOL_RTPS : std_logic_vector(PROTOCOL_WIDTH-1 downto 0) := x"52545053";
|
||||||
@ -232,10 +239,10 @@ package rtps_package is
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
type DOMAIN_ID_TYPE is array (NUM_DOMAIN-1 downto 0) of std_logic_vector(DOMAIN_ID_WIDTH-1 downto 0);
|
type DOMAIN_ID_TYPE is array (0 to NUM_DOMAIN-1) of std_logic_vector(DOMAIN_ID_WIDTH-1 downto 0);
|
||||||
constant DOMAIN_ID : DOMAIN_ID_TYPE; -- Deferred to Package Body
|
constant DOMAIN_ID : DOMAIN_ID_TYPE; -- Deferred to Package Body
|
||||||
|
|
||||||
type DOMAIN_ENDPOINT_MAP_TYPE is array (NUM_DOMAIN-1 downto 0) of std_logic_vector(MAX_ENDPOINTS-1 downto 0);
|
type DOMAIN_ENDPOINT_MAP_TYPE is array (0 to NUM_DOMAIN-1) of std_logic_vector(MAX_ENDPOINTS-1 downto 0);
|
||||||
constant DOMAIN_ENDPOINT_MAP : DOMAIN_ENDPOINT_MAP_TYPE; -- Deferred to Package Body
|
constant DOMAIN_ENDPOINT_MAP : DOMAIN_ENDPOINT_MAP_TYPE; -- Deferred to Package Body
|
||||||
|
|
||||||
-- Since this implementation runs on the same network stack and the RTPS Endpoints (Readers & Writers)
|
-- Since this implementation runs on the same network stack and the RTPS Endpoints (Readers & Writers)
|
||||||
@ -244,17 +251,17 @@ package rtps_package is
|
|||||||
-- We generate just a single participant for every Domain, and later match the Endpoints to their respective
|
-- We generate just a single participant for every Domain, and later match the Endpoints to their respective
|
||||||
-- Domain (and thus also to their respective RTPS Participant).
|
-- Domain (and thus also to their respective RTPS Participant).
|
||||||
|
|
||||||
type IPv4_PORT_TYPE is array (NUM_DOMAIN-1 downto 0) of std_logic_vector(UDP_PORT_WIDTH-1 downto 0);
|
type IPv4_PORT_TYPE is array (0 to NUM_DOMAIN-1) of std_logic_vector(UDP_PORT_WIDTH-1 downto 0);
|
||||||
constant META_IPv4_MULTICAST_PORT: IPv4_PORT_TYPE; -- Deferred to Package Body
|
constant META_IPv4_MULTICAST_PORT: IPv4_PORT_TYPE; -- Deferred to Package Body
|
||||||
constant META_IPv4_UNICAST_PORT : IPv4_PORT_TYPE; -- Deferred to Package Body
|
constant META_IPv4_UNICAST_PORT : IPv4_PORT_TYPE; -- Deferred to Package Body
|
||||||
constant USER_IPv4_MULTICAST_PORT: IPv4_PORT_TYPE; -- Deferred to Package Body
|
constant USER_IPv4_MULTICAST_PORT: IPv4_PORT_TYPE; -- Deferred to Package Body
|
||||||
constant USER_IPv4_UNICAST_PORT : IPv4_PORT_TYPE; -- Deferred to Package Body
|
constant USER_IPv4_UNICAST_PORT : IPv4_PORT_TYPE; -- Deferred to Package Body
|
||||||
|
|
||||||
type GUIDPREFIX_TYPE is array (NUM_DOMAIN-1 downto 0) of std_logic_vector(GUIDPREFIX_WIDTH-1 downto 0);
|
type GUIDPREFIX_TYPE is array (0 to NUM_DOMAIN-1) of std_logic_vector(GUIDPREFIX_WIDTH-1 downto 0);
|
||||||
type GUIDPREFIX_ARRAY_TYPE is array (GUIDPREFIX_WIDTH/32-1 downto 0) of std_logic_vector(31 downto 0);
|
type GUIDPREFIX_ARRAY_TYPE is array (0 to GUIDPREFIX_WIDTH/32-1) of std_logic_vector(31 downto 0);
|
||||||
type GUID_ARRAY_TYPE is array ((GUIDPREFIX_WIDTH+ENTITYID_WIDTH)/32-1 downto 0) of std_logic_vector(31 downto 0);
|
type GUID_ARRAY_TYPE is array (0 to (GUIDPREFIX_WIDTH+ENTITYID_WIDTH)/32-1) of std_logic_vector(31 downto 0);
|
||||||
constant GUIDPREFIX : GUIDPREFIX_TYPE; -- Deferred to Package Body
|
constant GUIDPREFIX : GUIDPREFIX_TYPE; -- Deferred to Package Body
|
||||||
constant GUIDPREFIX_UNKNOWN : std_logic_vector(GUIDPREFIX_WIDTH-1 downto 0) := (others => '0');
|
constant GUIDPREFIX_UNKNOWN : std_logic_vector(0 to GUIDPREFIX_WIDTH-1) := (others => '0');
|
||||||
|
|
||||||
subtype ENTITY_KIND_H is std_logic_vector(1 downto 0);
|
subtype ENTITY_KIND_H is std_logic_vector(1 downto 0);
|
||||||
subtype ENTITY_KIND_L is std_logic_vector(5 downto 0);
|
subtype ENTITY_KIND_L is std_logic_vector(5 downto 0);
|
||||||
@ -272,7 +279,7 @@ package rtps_package is
|
|||||||
|
|
||||||
-- DDSI-RTPS 2.3 states that Entity IDs have to be unique within each Participant.
|
-- DDSI-RTPS 2.3 states that Entity IDs have to be unique within each Participant.
|
||||||
-- For simplicity and ease of mapping we make the Entity IDs unique across all Participant and Domains on this node.
|
-- For simplicity and ease of mapping we make the Entity IDs unique across all Participant and Domains on this node.
|
||||||
type ENTITYID_TYPE is array (MAX_ENDPOINTS-1 downto 0) of std_logic_vector(ENTITYID_WIDTH-1 downto 0);
|
type ENTITYID_TYPE is array (0 to MAX_ENDPOINTS-1) of std_logic_vector(ENTITYID_WIDTH-1 downto 0);
|
||||||
constant ENTITYID : ENTITYID_TYPE; -- Deferred to Package Body
|
constant ENTITYID : ENTITYID_TYPE; -- Deferred to Package Body
|
||||||
constant ENTITYID_UNKNOWN : std_logic_vector(ENTITYID_WIDTH-1 downto 0) := (others => '0');
|
constant ENTITYID_UNKNOWN : std_logic_vector(ENTITYID_WIDTH-1 downto 0) := (others => '0');
|
||||||
constant ENTITYID_PARTICIPANT : std_logic_vector(ENTITYID_WIDTH-1 downto 0) := (x"000001c1");
|
constant ENTITYID_PARTICIPANT : std_logic_vector(ENTITYID_WIDTH-1 downto 0) := (x"000001c1");
|
||||||
@ -309,11 +316,21 @@ package rtps_package is
|
|||||||
constant BEST_EFFORT_PARTICIPANT_MESSAGE_DATA_READER : integer := 0;
|
constant BEST_EFFORT_PARTICIPANT_MESSAGE_DATA_READER : integer := 0;
|
||||||
|
|
||||||
--*****CUSTOM*****
|
--*****CUSTOM*****
|
||||||
|
constant PARTICIPANT_FRAME_SIZE : integer := 12;
|
||||||
|
constant ENDPOINT_BITMASK_SIZE : integer := round_div(MAX_ENDPOINTS, 32);
|
||||||
|
constant ENDPOINT_FRAME_SIZE : integer := 2 + ENDPOINT_BITMASK_SIZE;
|
||||||
|
-- Limit Buffer to 32 bit Addresses
|
||||||
|
constant BUILTIN_BUFFER_SIZE : integer := min(MAX_ENDPOINTS*PARTICIPANT_FRAME_SIZE, 2**32);
|
||||||
--****************
|
--****************
|
||||||
|
|
||||||
type USER_ENDPOINT_OUTPUT is array (MAX_ENDPOINTS-1 downto 0) of std_logic_vector(31 downto 0);
|
constant ENDPOINT_MATCH_OPCODE_WIDTH: integer := 32;
|
||||||
type BUILTIN_ENDPOINT_TYPE is array (NUM_DOMAIN-1 downto 0) of std_logic_vector(31 downto 0);
|
|
||||||
|
constant OPCODE_MATCH : std_logic_vector(ENDPOINT_MATCH_OPCODE_WIDTH-1 downto 0) := x"55000000";
|
||||||
|
constant OPCODE_UNMATCH : std_logic_vector(ENDPOINT_MATCH_OPCODE_WIDTH-1 downto 0) := x"55000001";
|
||||||
|
|
||||||
|
type USER_ENDPOINT_OUTPUT is array (0 to MAX_ENDPOINTS-1) of std_logic_vector(31 downto 0);
|
||||||
|
type BUILTIN_ENDPOINT_TYPE is array (0 to NUM_DOMAIN-1) of std_logic_vector(31 downto 0);
|
||||||
|
type ENDPOINT_BITMASK_ARRAY_TYPE is array (0 to ENDPOINT_BITMASK_SIZE-1) of std_logic_vector(31 downto 0);
|
||||||
|
|
||||||
end package;
|
end package;
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ begin
|
|||||||
MEMORY_INIT_PARAM => "0",
|
MEMORY_INIT_PARAM => "0",
|
||||||
MEMORY_OPTIMIZATION => "true",
|
MEMORY_OPTIMIZATION => "true",
|
||||||
MEMORY_PRIMITIVE => "auto",
|
MEMORY_PRIMITIVE => "auto",
|
||||||
MEMORY_SIZE => DATA_WIDTH*(2**ADDR_WIDTH),
|
MEMORY_SIZE => MEMORY_SIZE,
|
||||||
MESSAGE_CONTROL => 0,
|
MESSAGE_CONTROL => 0,
|
||||||
READ_DATA_WIDTH_A => DATA_WIDTH,
|
READ_DATA_WIDTH_A => DATA_WIDTH,
|
||||||
READ_LATENCY_A => 1,
|
READ_LATENCY_A => 1,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user