* Code cleanup

* Varius fixes
* Code Comment
This commit is contained in:
Greek 2020-10-24 17:00:52 +02:00
parent 73dbc87c08
commit 74515d0ecc
4 changed files with 1448 additions and 1012 deletions

View File

@ -134,7 +134,7 @@ PARTICICPANT DATA
+ LEASE_DEADLINE +
12| |
+-------------------------------------------------------------+
13|P|S|M| EXTRA_FLAGS |Q|
13| UNUSED |P|S|M|Q|
+-------------------------------------------------------------+
14| |
+ ACKNACK_RES_TIME +
@ -192,7 +192,7 @@ ENDPOINT MATCH FRAME
+-------------------------------------------------------------+
06| IPv4_ADDRESS |
+-------------------------------------------------------------+
07| UDP_PORT | EXTRA_FLAGS |Q|
07| UDP_PORT | UNUSED |Q|
+-------------------------------------------------------------+
ENDPOINT UNMATCH FRAME

View File

@ -100,5 +100,11 @@ DESIGN DECISIONS
* !REJECTED! (Use the unused extra flags in the stored participant data)
Use the lowest bit of the Heartbeat/Acknack Deadline stored in the Participant Data to differentiate
between Delay and Suppression. This reduces the resolution from 0.23 ns to 0.47 ns
-- Input FIFO Guard
-- Output FIFO Guard
-- Memory Operation Guard
-- Ignore in-line QoS
-- Only relevant for Endpoint Discovery Protocol
-- Check QoS Compatibility (Unmark match on incompatibility)
-- COMPATIBLE (DDS v1.4): offered >= requested, with INSTANCE < TOPIC < GROUP

File diff suppressed because it is too large Load Diff

View File

@ -95,6 +95,7 @@ package rtps_package is
constant ENDPOINT_TYPE_STRING : ENDPOINT_STRING_TYPE := (0 => "Placeholder" & (12 to 256 => NUL));
constant ENDPOINT_TYPE : ENDPOINT_STRING_SLV_TYPE; -- Deferred to Package Body
constant ENDPOINT_DURABILITY : QOS_TYPE := (0 => VOLATILE_DURABILITY_QOS);
-- TODO: Make sure GROUP is not selected
constant ENDPOINT_PRESENTATION : QOS_TYPE := (0 => INSTANCE_PRESENTATION_QOS);
constant ENDPOINT_COHERENT_ACCESS : std_logic_vector(0 to MAX_ENDPOINTS-1) := (others => '0');
constant ENDPOINT_ORDERED_ACCESS : std_logic_vector(0 to MAX_ENDPOINTS-1) := (others => '0');
@ -114,11 +115,25 @@ package rtps_package is
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_HEARTBEAT_PERIOD : ENDPOINT_DURATION_TYPE := (0 => (to_unsigned(3,32),to_unsigned(0,32))); -- 3s
constant ENDPOINT_HEARTBEAT_RESPONSE_DELAY : ENDPOINT_DURATION_TYPE := (0 => (to_unsigned(0,32),to_unsigned(2147483648,32))); -- 500 ms
constant ENDPOINT_HEARTBEAT_SUPPRESSION_DELAY : ENDPOINT_DURATION_TYPE := (0 => (to_unsigned(0,32),to_unsigned(0,32)));
constant ENDPOINT_ACKNACK_RESPONSE_DELAY : ENDPOINT_DURATION_TYPE := (0 => (to_unsigned(0,32),to_unsigned(858993459,32))); -- 200 ms
constant ENDPOINT_ACKNACK_SUPPRESSION_DELAY : ENDPOINT_DURATION_TYPE := (0 => (to_unsigned(0,32),to_unsigned(0,32)));
constant PARTICIPANT_HEARTBEAT_PERIOD : DURATION_TYPE := (to_unsigned(3,32),to_unsigned(0,32)); -- 3s
constant PARTICIPANT_HEARTBEAT_RESPONSE_DELAY : DURATION_TYPE := (to_unsigned(0,32),to_unsigned(2147483648,32)); -- 500 ms
constant PARTICIPANT_HEARTBEAT_SUPPRESSION_DELAY : DURATION_TYPE := (to_unsigned(0,32),to_unsigned(0,32));
constant PARTICIPANT_ACKNACK_RESPONSE_DELAY : DURATION_TYPE := (to_unsigned(0,32),to_unsigned(858993459,32)); -- 200 ms
constant PARTICIPANT_ACKNACK_SUPPRESSION_DELAY : DURATION_TYPE := (to_unsigned(0,32),to_unsigned(0,32));
constant DURATION_DELTA : DURATION_TYPE := (to_unsigned(0,32),to_unsigned(429496730,32)); --100 ms
constant DEFAULT_PARTICIPANT_LEASE_DURATION : DOUBLE_WORD_ARRAY := (to_unsigned(100,32),to_unsigned(0,32);
constant PARTICIPANT_LEASE_DURATION : DOUBLE_WORD_ARRAY := DEFAULT_PARTICIPANT_LEASE_DURATION;
-- NOTE: The buffer will not only store participants, but also endpoint data
-- Used to determine the size of the built-inendpoint buffer
-- Used to determine the size of the builtin endpoint buffer
constant MAX_REMOTE_PARTICIPANTS : natural := 50;
--*****DDSI-RTPS 2.3*****
@ -358,11 +373,23 @@ package rtps_package is
function convert_from_double_word (seq: DOUBLE_WORD_ARRAY) return unsigned;
function convert_to_double_word (seq: unsigned(63 downto 0)) return DOUBLE_WORD_ARRAY;
function ">" (L,R: DOUBLE_WORD_ARRAY) return boolean;
function ">" (L: DOUBLE_WORD_ARRAY, R: natural) return boolean;
function ">" (L: natural, R: DOUBLE_WORD_ARRAY) return boolean;
function "<" (L,R: DOUBLE_WORD_ARRAY) return boolean;
function "<" (L: DOUBLE_WORD_ARRAY, R: natural) return boolean;
function "<" (L: natural, R: DOUBLE_WORD_ARRAY) return boolean;
function ">=" (L,R: DOUBLE_WORD_ARRAY) return boolean;
function ">=" (L: DOUBLE_WORD_ARRAY, R: natural) return boolean;
function ">=" (L: natural, R: DOUBLE_WORD_ARRAY) return boolean;
function "<=" (L,R: DOUBLE_WORD_ARRAY) return boolean;
function "<=" (L: DOUBLE_WORD_ARRAY, R: natural) return boolean;
function "<=" (L: natural, R: DOUBLE_WORD_ARRAY) return boolean;
function "=" (L,R: DOUBLE_WORD_ARRAY) return boolean;
function "=" (L: DOUBLE_WORD_ARRAY, R: natural) return boolean;
function "=" (L: natural, R: DOUBLE_WORD_ARRAY) return boolean;
function "/=" (L,R: DOUBLE_WORD_ARRAY) return boolean;
function "/=" (L: DOUBLE_WORD_ARRAY, R: natural) return boolean;
function "/=" (L: natural, R: DOUBLE_WORD_ARRAY) return boolean;
function "+" (L,R: DOUBLE_WORD_ARRAY) return DOUBLE_WORD_ARRAY;
function "+" (L: DOUBLE_WORD_ARRAY, R: natural) return DOUBLE_WORD_ARRAY;
function "+" (L: natural, R: DOUBLE_WORD_ARRAY) return DOUBLE_WORD_ARRAY;
@ -431,7 +458,7 @@ package body rtps_package is
begin
ret := (others => others => '0'));
for i in 0 to ret'length-1 loop
ret(i) := std_logic_vector(to_unsigned(character'POS(str(i)), 8)) & std_logic_vector(to_unsigned(character'POS(str(i+1)), 8)) & std_logic_vector(to_unsigned(character'POS(str(i+2)), 8)) & std_logic_vector(to_unsigned(character'POS(str(i+3)), 8));
ret(i) := std_logic_vector(to_unsigned(character'POS(str(i*4)), 8)) & std_logic_vector(to_unsigned(character'POS(str((i*4)+1)), 8)) & std_logic_vector(to_unsigned(character'POS(str((i*4)+2)), 8)) & std_logic_vector(to_unsigned(character'POS(str((i*4)+3)), 8));
end loop;
return ret;
end function;
@ -960,31 +987,91 @@ package body rtps_package is
return convert_from_double_word(L) > convert_from_double_word(R);
end function;
function ">" (L: DOUBLE_WORD_ARRAY, R: natural) return boolean is
begin
return convert_from_double_word(L) > R;
end function;
function ">" (L: natural, R: DOUBLE_WORD_ARRAY) return boolean is
begin
return L > convert_from_double_word(R);
end function;
function "<" (L,R: DOUBLE_WORD_ARRAY) return boolean is
begin
return convert_from_double_word(L) < convert_from_double_word(R);
end function;
function "<" (L: DOUBLE_WORD_ARRAY, R: natural) return boolean is
begin
return convert_from_double_word(L) < R;
end function;
function "<" (L: natural, R: DOUBLE_WORD_ARRAY) return boolean is
begin
return L < convert_from_double_word(R);
end function;
function ">=" (L,R: DOUBLE_WORD_ARRAY) return boolean is
begin
return convert_from_double_word(L) >= convert_from_double_word(R);
end function;
function ">=" (L: DOUBLE_WORD_ARRAY, R: natural) return boolean is
begin
return convert_from_double_word(L) >= R;
end function;
function ">=" (L: natural, R: DOUBLE_WORD_ARRAY) return boolean is
begin
return L >= convert_from_double_word(R);
end function;
function "<=" (L,R: DOUBLE_WORD_ARRAY) return boolean is
begin
return convert_from_double_word(L) <= convert_from_double_word(R);
end function;
function "<=" (L: DOUBLE_WORD_ARRAY, R: natural) return boolean is
begin
return convert_from_double_word(L) <= R;
end function;
function "<=" (L: natural, R: DOUBLE_WORD_ARRAY) return boolean is
begin
return L <= convert_from_double_word(R);
end function;
function "=" (L,R: DOUBLE_WORD_ARRAY) return boolean;
begin
return convert_from_double_word(L) = convert_from_double_word(R);
end function;
function "=" (L: DOUBLE_WORD_ARRAY, R: natural) return boolean is
begin
return convert_from_double_word(L) = R;
end function;
function "=" (L: natural, R: DOUBLE_WORD_ARRAY) return boolean is
begin
return L = convert_from_double_word(R);
end function;
function "/=" (L,R: DOUBLE_WORD_ARRAY) return boolean is
begin
return convert_from_double_word(L) /= convert_from_double_word(R);
end function;
function "/=" (L: DOUBLE_WORD_ARRAY, R: natural) return boolean is
begin
return convert_from_double_word(L) /= R;
end function;
function "/=" (L: natural, R: DOUBLE_WORD_ARRAY) return boolean is
begin
return L /= convert_from_double_word(R);
end function;
function "+" (L,R: DOUBLE_WORD_ARRAY) return DOUBLE_WORD_ARRAY is
begin
return convert_to_double_word(convert_from_double_word(L) + convert_from_double_word(R));