* Added DDS/RTPS Documentation
* Added initial constant package
This commit is contained in:
commit
b118482e63
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
doc/*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||||
0
.gitignore
vendored
Normal file
0
.gitignore
vendored
Normal file
BIN
doc/DDS-XRCE_1-0.pdf
(Stored with Git LFS)
Normal file
BIN
doc/DDS-XRCE_1-0.pdf
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
doc/DDSI-RTPS_2-3.pdf
(Stored with Git LFS)
Normal file
BIN
doc/DDSI-RTPS_2-3.pdf
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
doc/DDS_1-4.pdf
(Stored with Git LFS)
Normal file
BIN
doc/DDS_1-4.pdf
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
doc/IDL_4-2.pdf
(Stored with Git LFS)
Normal file
BIN
doc/IDL_4-2.pdf
(Stored with Git LFS)
Normal file
Binary file not shown.
147
src/rtps_package.vhd
Normal file
147
src/rtps_package.vhd
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
library ieee;
|
||||||
|
use ieee.std_logic_1164.all;
|
||||||
|
use ieee.numeric_std.all;
|
||||||
|
|
||||||
|
package rtps_package is
|
||||||
|
|
||||||
|
|
||||||
|
subtype BYTE is std_logic_vector(7 downto 0);
|
||||||
|
|
||||||
|
type GUIDPREFIX_TYPE is array (11 downto 0) of BYTE;
|
||||||
|
constant GUIDPREFIX_UNKNOWN : GUIDPREFIX_TYPE := (others => (others => '0'));
|
||||||
|
|
||||||
|
type ENTITYID_TYPE is array (3 downto 0) of BYTE;
|
||||||
|
constant ENTITYID_UNKNOWN : ENTITYID_TYPE := (others => (others => '0'));
|
||||||
|
--alias ENTITYKIND : BYTE is ENTITYID(0);
|
||||||
|
--alias ENTITYKIND_UPPER : std_logic_vector(1 downto 0) is ENTITYKIND(7 downto 6);
|
||||||
|
--FOLLOWING MAP TO ENTITYKIND_UPPER
|
||||||
|
constant USER_DEFINED_ENTITY_KIND : std_logic_vector(1 downto 0) := "00";
|
||||||
|
constant BUILT_IN_ENTITY_KIND : std_logic_vector(1 downto 0) := "11";
|
||||||
|
constant VENDOR_SPECIFIC_ENTITY_KIND: std_logic_vector(1 downto 0) := "01";
|
||||||
|
--alias ENTITYKIND_LOWER : std_logic_vector(1 downto 0) is ENTITYKIND(5 downto 0);
|
||||||
|
--FOLLOWING MAP TO ENTITYKIND_LOWER
|
||||||
|
constant WRITER_WITH_KEY : std_logic_vector(5 downto 0) := "000010";
|
||||||
|
constant WRITER_NO_KEY : std_logic_vector(5 downto 0) := "000011";
|
||||||
|
constant READER_NO_KEY : std_logic_vector(5 downto 0) := "000100";
|
||||||
|
constant READER_WITH_KEY : std_logic_vector(5 downto 0) := "000111";
|
||||||
|
constant WRITER_GROUP : std_logic_vector(5 downto 0) := "001000";
|
||||||
|
constant READER_GROUP : std_logic_vector(5 downto 0) := "001001";
|
||||||
|
--
|
||||||
|
constant ENTITYID_PARTICIPANT : ENTITYID_TYPE := (x"00", x"00", x"01", x"c1");
|
||||||
|
constant ENTITYID_SEDP_BUILTIN_TOPICS_ANNOUNCER : ENTITYID_TYPE := (x"00", x"00", x"02", x"c2");
|
||||||
|
constant ENTITYID_SEDP_BUILTIN_TOPICS_DETECTOR : ENTITYID_TYPE := (x"00", x"00", x"02", x"c7");
|
||||||
|
constant ENTITYID_SEDP_BUILTIN_PUBLICATIONS_ANNOUNCER : ENTITYID_TYPE := (x"00", x"00", x"03", x"c2");
|
||||||
|
constant ENTITYID_SEDP_BUILTIN_PUBLICATIONS_DETECTOR : ENTITYID_TYPE := (x"00", x"00", x"03", x"c7");
|
||||||
|
constant ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_ANNOUNCER : ENTITYID_TYPE := (x"00", x"00", x"04", x"c2");
|
||||||
|
constant ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_DETECTOR : ENTITYID_TYPE := (x"00", x"00", x"04", x"c7");
|
||||||
|
constant ENTITYID_SPDP_BUILTIN_PARTICIPANT_ANNOUNCER : ENTITYID_TYPE := (x"00", x"01", x"00", x"c2");
|
||||||
|
constant ENTITYID_SPDP_BUILTIN_PARTICIPANT_DETECTOR : ENTITYID_TYPE := (x"00", x"01", x"00", x"c7");
|
||||||
|
constant ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER: ENTITYID_TYPE := (x"00", x"02", x"00", x"c2");
|
||||||
|
constant ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER: ENTITYID_TYPE := (x"00", x"02", x"00", x"c7");
|
||||||
|
|
||||||
|
type VENDORID_TYPE is array (1 downto 0) of BYTE;
|
||||||
|
--GUIDPREFIX(1 downto 0) <= VENDORID;
|
||||||
|
constant VENDORID_UNKNOWN : VENDORID_TYPE := (others => (others => '0'));
|
||||||
|
|
||||||
|
type PROTOCOLVERSION_TYPE is array (1 downto 0) of BYTE;
|
||||||
|
constant PROTOCOLVERSION_2_4 : PROTOCOLVERSION_TYPE := (x"02", x"04");
|
||||||
|
|
||||||
|
--General BITMAP SET Constants
|
||||||
|
constant NUMBITS_WIDTH : integer := 32;
|
||||||
|
constant BITMAP_WIDTH : integer := 32;
|
||||||
|
|
||||||
|
constant SEQUENCENUMBER_WIDTH : integer := 64;
|
||||||
|
type SEQUENCENUMBERSET_HEADER_TYPE is record {
|
||||||
|
bitmapBase : std_logic_vector(SEQUENCENUMBER_WIDTH-1 downto 0);
|
||||||
|
numBits : std_logic_vector(NUMBITS_WIDTH-1 downto 0);
|
||||||
|
};
|
||||||
|
|
||||||
|
subtype FRAGMENTNUMBER_WIDTH : integer := 32;;
|
||||||
|
type FRAGMENTNUMBERSET_HEADER_TYPE is record{
|
||||||
|
bitmapBase : std_logic_vector(FRAGMENTNUMBER_WIDTH-1 downto 0);
|
||||||
|
numBits : std_logic_vector(NUMBITS_WIDTH-1 downto 0);
|
||||||
|
};
|
||||||
|
|
||||||
|
--Fixed Point Q32.32
|
||||||
|
constant TIMESTAMP_WIDTH : integer := 64;
|
||||||
|
|
||||||
|
constant LOCATOR_KIND : integer := 32;
|
||||||
|
constant LOCATOR_PORT : integer := 32;
|
||||||
|
constant LOCATOR_ADDR : integer := 128;
|
||||||
|
type LOCATOR_TYPE is record{
|
||||||
|
kind : std_logic_vector(LOCATOR_KIND-1 downto 0);
|
||||||
|
port : std_logic_vector(LOCATOR_PORT-1 downto 0);
|
||||||
|
addr : std_logic_vector(LOCATOR_ADDR-1 downto 0);
|
||||||
|
};
|
||||||
|
constant NUMLOCATOR_WIDTH : integer := 32;
|
||||||
|
|
||||||
|
constant LOCATORUDPv4_PORT : integer := 32;
|
||||||
|
constant LOCATORUDPv4_ADDR : integer := 32;
|
||||||
|
type LOCATORUDPv4_TYPE is record{
|
||||||
|
addr : std_logic_vector(LOCATORUDPv4_ADDR-1 downto 0);
|
||||||
|
port : std_logic_vector(LOCATORUDPv4_PORT-1 downto 0);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
constant PARAMETERID_WIDTH : integer := 16;
|
||||||
|
constant PARAMETERLENGTH_WIDTH : integer := 16;
|
||||||
|
type PARAMETER_HEADER_TYPE is record{
|
||||||
|
pid : std_logic_vector(PARAMETERID_WIDTH-1 downto 0);
|
||||||
|
length : std_logic_vector(PARAMETERLENGTH_WIDTH-1 downto 0);
|
||||||
|
};
|
||||||
|
|
||||||
|
constant PID_PAD : std_logic_vector(PARAMETERID_WIDTH-1 downto 0) := (others => '0');
|
||||||
|
constant PID_SENTINEL : std_logic_vector(PARAMETERID_WIDTH-1 downto 0) := std_logic_vector(unsigned(1,PARAMETERID_WIDTH));
|
||||||
|
|
||||||
|
constant COUNT_WIDTH : integer := 32;
|
||||||
|
|
||||||
|
--TODO: GroupDigest?
|
||||||
|
|
||||||
|
constant PROTOCOLLD_WIDTH : integer := 32;
|
||||||
|
type RTPS_HEADER_TYPE is record{
|
||||||
|
protocol : std_logic_vector(PROTOCOLLD_WIDTH-1 downto 0);
|
||||||
|
version : PROTOCOLVERSION_TYPE;
|
||||||
|
vendorid : VENDORID_TYPE;
|
||||||
|
guidprefix : GUIDPREFIX_TYPE;
|
||||||
|
};
|
||||||
|
constant PROTOCOLLD_RTPS : std_logic_vector(PROTOCOLLD_WIDTH-1 downto 0) := x"52545053";
|
||||||
|
|
||||||
|
constant SUBMESSAGE_ID_WIDTH : integer := 8;
|
||||||
|
constant SUBMESSAGE_FLAGS_WIDTH : integer := 8;
|
||||||
|
constant SUBMESSAGE_LENGTH_WIDTH : integer := 16;
|
||||||
|
type RTPS_SUBMESSAGE_HEADER_TYPE is record{
|
||||||
|
id : std_logic_vector(SUBMESSAGE_ID_WIDTH-1 downto 0);
|
||||||
|
flags : std_logic_vector(SUBMESSAGE_FLAGS_WIDTH-1 downto 0);
|
||||||
|
length : std_logic_vector(SUBMESSAGE_LENGTH_WIDTH-1 downto 0);
|
||||||
|
};
|
||||||
|
|
||||||
|
constant SID_PAD : std_logic_vector(SUBMESSAGE_ID_WIDTH-1 downto 0) := x"01";
|
||||||
|
constant SID_ACKNACK : std_logic_vector(SUBMESSAGE_ID_WIDTH-1 downto 0) := x"06";
|
||||||
|
constant SID_HEARTBEAT : std_logic_vector(SUBMESSAGE_ID_WIDTH-1 downto 0) := x"07";
|
||||||
|
constant SID_GAP : std_logic_vector(SUBMESSAGE_ID_WIDTH-1 downto 0) := x"08";
|
||||||
|
constant SID_INFO_TS : std_logic_vector(SUBMESSAGE_ID_WIDTH-1 downto 0) := x"09";
|
||||||
|
constant SID_INFO_SRC : std_logic_vector(SUBMESSAGE_ID_WIDTH-1 downto 0) := x"0c";
|
||||||
|
constant SID_INFO_REPLY_IP4 : std_logic_vector(SUBMESSAGE_ID_WIDTH-1 downto 0) := x"0d";
|
||||||
|
constant SID_INFO_DST : std_logic_vector(SUBMESSAGE_ID_WIDTH-1 downto 0) := x"0e";
|
||||||
|
constant SID_INFO_REPLY : std_logic_vector(SUBMESSAGE_ID_WIDTH-1 downto 0) := x"0f";
|
||||||
|
constant SID_NACK_FRAG : std_logic_vector(SUBMESSAGE_ID_WIDTH-1 downto 0) := x"12";
|
||||||
|
constant SID_HEARTBEAT_FRAG : std_logic_vector(SUBMESSAGE_ID_WIDTH-1 downto 0) := x"13";
|
||||||
|
constant SID_DATA : std_logic_vector(SUBMESSAGE_ID_WIDTH-1 downto 0) := x"15";
|
||||||
|
constant SID_DATA_FRAG : std_logic_vector(SUBMESSAGE_ID_WIDTH-1 downto 0) := x"16";
|
||||||
|
--TODO: Enum it?
|
||||||
|
|
||||||
|
constant ENDIANNESS_FLAG_POS : integer := 0;
|
||||||
|
--ACKNACK
|
||||||
|
constant FINAL_FLAG_POS : integer := 1;
|
||||||
|
--DATA
|
||||||
|
constant INLINEQOS_FLAG_POS : integer := 1;
|
||||||
|
constant DATA_FLAG_POS : integer := 2;
|
||||||
|
constant KEY_FLAG_POS : integer := 3;
|
||||||
|
constant NONSTANDARDPAYLOAD_FLAG_POS: integer := 4;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end package;
|
||||||
|
|
||||||
|
package body rtps_package is
|
||||||
|
end package body;
|
||||||
Loading…
Reference in New Issue
Block a user