* Update .gitignore

* Split rtps_package
This commit is contained in:
Greek 2020-11-02 14:39:27 +01:00
parent ee9746272f
commit 9acd98b32e
10 changed files with 1292 additions and 1061 deletions

1
.gitignore vendored
View File

@ -17,6 +17,7 @@
#***QUARTUS***
#Project File
!*.qpf
!*.qsf
#Settings File
!*.qsf
#QSYS File

View File

@ -4,6 +4,8 @@ use ieee.numeric_std.all;
use work.math_pkg.all;
use work.rtps_package.all;
use work.user_config.all;
use work.rtps_config_package.all;
-- TODO: Skip Packet while we are waiting for memory operation to complete
-- TODO: add_res is still valid after removal. So we could continue searching the next orphan endpoint from that address on
@ -14,17 +16,17 @@ entity rtps_builtin_endpoint is
reset : in std_logic; -- Synchronous Reset
empty : in std_logic; -- Input FIFO empty flag
rd : out std_logic; -- Input FIFO read signal
data_in : in std_logic_vector(31 downto 0); -- Input FIFO data signal
data_in : in std_logic_vector(WORD_WIDTH-1 downto 0); -- Input FIFO data signal
last_word_in : in std_logic;
time : in DOUBLE_WORD_ARRAY;
endpoint_output : out USER_ENDPOINT_OUTPUT;
endpoint_full : in std_logic_vector(0 to MAX_ENDPOINTS-1);
endpoint_wr : out std_logic_vector(0 to MAX_ENDPOINTS-1);
rtps_output : out std_logic_vector(31 downto 0);
time : in TIME_TYPE;
endpoint_output : out std_logic_vector(WORD_WIDTH-1 downto 0);
endpoint_full : in std_logic_vector(0 to NUM_ENDPOINTS-1);
endpoint_wr : out std_logic_vector(0 to NUM_ENDPOINTS-1);
rtps_output : out std_logic_vector(WORD_WIDTH-1 downto 0);
rtps_wr : out std_logic;
rtps_full : in std_logic;
last_word_out : out std_logic;
alive : in std_logic_vector(0 to MAX_ENDPOINTS-1)
alive : in std_logic_vector(0 to NUM_ENDPOINTS-1)
);
end entity;
@ -101,22 +103,22 @@ architecture arch of rtps_builtin_endpoint is
-- * MESSAGE Participant Message Data
type MESSAGE_TYPE_TYPE is (NONE, PDP, EDP, MESSAGE);
-- String Content
type STRING_CONTENT_TYPE is (TOPIC_NAME, TYPE_NAME, DOMAIN_TAG);
type STRING_CONTENT_TYPE is (TOPIC_NAME_TYPE, TYPE_NAME_TYPE, DOMAIN_TAG_TYPE);
-- Record of all Participant Data stored in memory
type PARTICIPANT_DATA_TYPE is record
meta_addr : std_logic_vector(31 downto 0);
def_addr : std_logic_vector(31 downto 0);
meta_port : std_logic_vector(15 downto 0);
def_port : std_logic_vector(15 downto 0);
meta_addr : std_logic_vector(IPv4_ADDRESS_WIDTH-1 downto 0);
def_addr : std_logic_vector(IPv4_ADDRESS_WIDTH-1 downto 0);
meta_port : std_logic_vector(UDP_PORT_WIDTH-1 downto 0);
def_port : std_logic_vector(UDP_PORT_WIDTH-1 downto 0);
extra_flags : std_logic_vector(EXTRA_FLAGS_WIDTH-1 downto 0);
lease_duration : DOUBLE_WORD_ARRAY;
lease_deadline : DOUBLE_WORD_ARRAY;
heartbeat_res_time : DOUBLE_WORD_ARRAY;
acknack_res_time : DOUBLE_WORD_ARRAY;
spdp_seq_nr : DOUBLE_WORD_ARRAY;
pub_seq_nr : DOUBLE_WORD_ARRAY;
sub_seq_nr : DOUBLE_WORD_ARRAY;
mes_seq_nr : DOUBLE_WORD_ARRAY;
lease_duration : DURATION_TYPE;
lease_deadline : TIME_TYPE;
heartbeat_res_time : TIME_TYPE;
acknack_res_time : TIME_TYPE;
spdp_seq_nr : SEQUENCE_NR_TYPE;
pub_seq_nr : SEQUENCE_NR_TYPE;
sub_seq_nr : SEQUENCE_NR_TYPE;
mes_seq_nr : SEQUENCE_NR_TYPE;
end record;
--*****CONSTANT DECLARATION*****
@ -153,13 +155,13 @@ architecture arch of rtps_builtin_endpoint is
-- Signifies if the Reader Endpoint expects in-line QoS
constant EXPECTS_INLINE_QOS_FLAG : natural := 0;
-- Highest Sequence Number of Publisher Data
constant PUB_SEQUENCE_NR : DOUBLE_WORD_ARRAY := convert_to_double_word(to_unsigned(NUM_WRITERS, 64));
constant PUB_SEQUENCE_NR : SEQUENCE_NR_TYPE := convert_to_double_word(to_unsigned(NUM_WRITERS, 64));
-- Highest Sequence Number of Subscriber Data
constant SUB_SEQUENCE_NR : DOUBLE_WORD_ARRAY := convert_to_double_word(to_unsigned(NUM_READERS, 64));
constant SUB_SEQUENCE_NR : SEQUENCE_NR_TYPE := convert_to_double_word(to_unsigned(NUM_READERS, 64));
-- Constant for Sequence Number 1
constant SEQUENCE_NR_START : DOUBLE_WORD_ARRAY := convert_to_double_word(to_unsigned(1, 64));
constant SEQUENCE_NR_START : SEQUENCE_NR_TYPE := convert_to_double_word(to_unsigned(1, 64));
-- Heartbeat/Liveliness Assertion Period
constant HEARTBEAT_PERIOD : DOUBLE_WORD_ARRAY := work.rtps_package.min(MIN_ENDPOINT_LEASE_DURATION, PARTICIPANT_HEARTBEAT_PERIOD) - DURATION_DELTA;
constant HEARTBEAT_PERIOD : DURATION_TYPE := work.rtps_package.min(MIN_ENDPOINT_LEASE_DURATION, PARTICIPANT_HEARTBEAT_PERIOD) - DURATION_DELTA;
-- Constant for zero Participant Data
constant ZERO_PARTICIPANT_DATA : PARTICIPANT_DATA_TYPE := (
meta_addr => (others => '0'),
@ -190,39 +192,39 @@ architecture arch of rtps_builtin_endpoint is
-- Signal used to reset the word counter
signal reset_read_cnt : std_logic;
-- Word (4-Byte) counter (Counts words read from input fifo)
signal read_cnt : unsigned(13 downto 0) := (others => '0');
signal read_cnt : unsigned(SUBMESSAGE_LENGTH_WIDTH-3 downto 0) := (others => '0');
-- RTPS Submessage ID Latch
signal opcode, opcode_next : std_logic_vector(SUBMESSAGE_ID_WIDTH-1 downto 0) := (others => '0');
-- RTPS Submessage Flags Latch
signal flags, flags_next : std_logic_vector(7 downto 0) := (others => '0');
signal flags, flags_next : std_logic_vector(SUBMESSAGE_FLAGS_WIDTH-1 downto 0) := (others => '0');
-- UDPv4 Source Port Latch
signal src_port, src_port_next : std_logic_vector(15 downto 0) := (others => '0');
signal src_port, src_port_next : std_logic_vector(UDP_PORT_WIDTH-1 downto 0) := (others => '0');
-- IPv4 Source Address Latch
signal src_addr, src_addr_next : std_logic_vector(31 downto 0) := (others => '0');
signal src_addr, src_addr_next : std_logic_vector(IPv4_ADDRESS_WIDTH-1 downto 0) := (others => '0');
-- Source Entity ID Latch
signal src_entityid, src_entityid_next : std_logic_vector(31 downto 0) := (others => '0');
signal src_entityid, src_entityid_next : std_logic_vector(ENTITYID_WIDTH-1 downto 0) := (others => '0');
-- Destination Entity ID Latch
signal dest_entityid, dest_entityid_next : std_logic_vector(31 downto 0) := (others => '0');
signal dest_entityid, dest_entityid_next : std_logic_vector(ENTITYID_WIDTH-1 downto 0) := (others => '0');
-- Source GUID Latch
signal guid, guid_next : GUID_TYPE := (others => (others => '0'));
-- RTPS DATA Submessage Sequence Number Latch
signal seq_nr, seq_nr_next : DOUBLE_WORD_ARRAY := (others => (others => '0'));
signal seq_nr, seq_nr_next : SEQUENCE_NR_TYPE := (others => (others => '0'));
-- Word aligned End of Parameter
signal parameter_end, parameter_end_next : unsigned(15 downto 0) := (others => '0');
signal parameter_end, parameter_end_next : unsigned(PARAMETER_LENGTH_WIDTH-1 downto 0) := (others => '0');
-- RTPS DATA Submessage Content Type
signal message_type, message_type_next : MESSAGE_TYPE_TYPE := NONE;
-- Data in represented in Big Endian
signal data_in_swapped : std_logic_vector(31 downto 0) := (others => '0');
signal data_in_swapped : std_logic_vector(WORD_WIDTH-1 downto 0) := (others => '0');
-- Byte Length of string
signal string_length, string_length_next : unsigned(31 downto 0) := (others => '0');
signal string_length, string_length_next : unsigned(WORD_WIDTH-1 downto 0) := (others => '0');
-- Counter of compared string words (4-Byte)
signal compare_length, compare_length_next : unsigned(29 downto 0) := (others => '0');
signal compare_length, compare_length_next : unsigned(WORD_WIDTH-3 downto 0) := (others => '0');
-- Bitmask of local Endpoint Matches
signal endpoint_mask, endpoint_mask_next : std_logic_vector(0 to MAX_ENDPOINTS-1) := (others => '0');
signal endpoint_mask, endpoint_mask_next : std_logic_vector(0 to NUM_ENDPOINTS-1) := (others => '0');
-- Bitmask of new local Endpoint Matches
signal endpoint_match, endpoint_match_next : std_logic_vector(0 to MAX_ENDPOINTS-1) := (others => '0');
signal endpoint_match, endpoint_match_next : std_logic_vector(0 to NUM_ENDPOINTS-1) := (others => '0');
-- Bitmask of local Endpoint unmatches
signal endpoint_unmatch, endpoint_unmatch_next : std_logic_vector(0 to MAX_ENDPOINTS-1) := (others => '0');
signal endpoint_unmatch, endpoint_unmatch_next : std_logic_vector(0 to NUM_ENDPOINTS-1) := (others => '0');
-- Bitmask of local Endpoint Matches stored in Memory
signal endpoint_mask_array, endpoint_mask_array_next : ENDPOINT_BITMASK_ARRAY_TYPE := (others => (others => '0'));
-- Signifies if the source of the Participant Data is compatible with our Participant
@ -230,7 +232,7 @@ architecture arch of rtps_builtin_endpoint is
-- Signifies if the Packet is comming from a Subscriber Endpoint
signal is_subscriber, is_subscriber_next : std_logic := '0';
-- Signal storing times for memory operations (Participant Lease Deadline, HEARTBEAT/ACKNACK Response/Suppression Time)
signal deadline, deadline_next : DOUBLE_WORD_ARRAY := (others => (others => '0'));
signal deadline, deadline_next : TIME_TYPE := (others => (others => '0'));
-- Signifies that the read Locator is a Metatraffic Locator
signal is_meta_addr, is_meta_addr_next : std_logic := '0';
-- General Purpose counter
@ -261,25 +263,25 @@ architecture arch of rtps_builtin_endpoint is
-- Lowest Endpoint Memory Address (Points to first Word of last occupied Endpoint Frame)
signal max_endpoint_addr, max_endpoint_addr_next : unsigned(BUILTIN_BUFFER_ADDR_WIDTH-1 downto 0) := (others => '0');
-- Memory Data Read and Write Signals
signal mem_read_data, mem_write_data : std_logic_vector(31 downto 0) := (others => '0');
signal mem_read_data, mem_write_data : std_logic_vector(WORD_WIDTH-1 downto 0) := (others => '0');
-- Memory Read and Write Enable Signals
signal mem_rd, mem_wr : std_logic := '0';
-- General Purpose Counter (Memory FSM)
signal mem_cnt, mem_cnt_next : natural range 0 to max(22, ENDPOINT_BITMASK_SIZE-1) := 0;
-- Contains the Sequence Number stored in the Buffer of the current relevant Message Type (Participant/Publisher/Subscriber/Message Data)
signal mem_seq_nr, mem_seq_nr_next : DOUBLE_WORD_ARRAY := (others => (others => '0'));
signal mem_seq_nr, mem_seq_nr_next : SEQUENCE_NR_TYPE := (others => (others => '0'));
-- Signifies the next expected Sequence Number of the current relevant Message Type (Participant/Publisher/Subscriber/Message Data)
signal next_seq_nr, next_seq_nr_next : DOUBLE_WORD_ARRAY := (others => (others => '0'));
signal next_seq_nr, next_seq_nr_next : SEQUENCE_NR_TYPE := (others => (others => '0'));
-- Latch used to store the first Sequence Number in ACKNACK/HEARTBEAT/GAP Messages
signal first_seq_nr, first_seq_nr_next : DOUBLE_WORD_ARRAY := (others => (others => '0'));
signal first_seq_nr, first_seq_nr_next : SEQUENCE_NR_TYPE := (others => (others => '0'));
-- Latch used to store the last Sequence Number in HEARTBEAT/GAP Messages
signal last_seq_nr, last_seq_nr_next : DOUBLE_WORD_ARRAY := (others => (others => '0'));
signal last_seq_nr, last_seq_nr_next : SEQUENCE_NR_TYPE := (others => (others => '0'));
-- Signifies if we currently do a Orphan Endpoint Search (Endpoint whose parent Participant was removed)
signal is_orphan_search, is_orphan_search_next : std_logic := '0';
-- Intermediate write enable signal.
signal wr_sig : std_logic := '0';
-- Intermediate Output Signal
signal output_sig : std_logic_vector(31 downto 0) := (others => '0');
signal output_sig : std_logic_vector(WORD_WIDTH-1 downto 0) := (others => '0');
-- Signifies if we currently are resetting the MAX Participant/Endpoint Pointer
signal reset_max_pointer, reset_max_pointer_next : std_logic := '0';
-- Signifies if we currently are doing a Participant Stale Entry Check (Used to start Stale Checks between packet handling)
@ -297,40 +299,40 @@ architecture arch of rtps_builtin_endpoint is
-- Signifies when "mem_seq_nr" and "next_seq_nr" signals are valid
signal seq_prc_done, seq_prc_done_next : std_logic := '0';
-- Signal containing the HEARTBEAT/ACKNACK count of all built-in Endpoints
signal count, count_next : unsigned(31 downto 0) := (others => '0');
signal count, count_next : unsigned(COUNT_WIDTH-1 downto 0) := (others => '0');
-- Toggle set when at least one Endpoint has asserted the "alive" signal, until reset
signal endpoint_alive : std_logic := '0';
-- Resets the "endpoint_alive" signal
signal reset_endpoint_alive : std_logic := '0';
-- NOTE: The "auto_live_seq_nr" is always higher than "man_live_seq_nr"
-- Contains the highest Sequence Number for automatic liveliness updates
signal auto_live_seq_nr, auto_live_seq_nr_next : DOUBLE_WORD_ARRAY := (others => (others => '0'));
signal auto_live_seq_nr, auto_live_seq_nr_next : SEQUENCE_NR_TYPE := (others => (others => '0'));
-- Contains the highest Sequence Number for manual by participant liveliness updates
signal man_live_seq_nr, man_live_seq_nr_next : DOUBLE_WORD_ARRAY := (others => (others => '0'));
signal man_live_seq_nr, man_live_seq_nr_next : SEQUENCE_NR_TYPE := (others => (others => '0'));
-- Points to the first Sequence Number after "man_live_seq_nr" (Signifies the start of the GAP between "man_live_seq_nr" and "auto_live_seq_nr")
signal live_gap_start, live_gap_start_next : DOUBLE_WORD_ARRAY := (others => (others => '0'));
signal live_gap_start, live_gap_start_next : SEQUENCE_NR_TYPE := (others => (others => '0'));
-- Points to the first Sequence Number before "auto_live_seq_nr" (Signifies the end of the GAP between "man_live_seq_nr" and "auto_live_seq_nr")
signal live_gap_end, live_gap_end_next : DOUBLE_WORD_ARRAY := (others => (others => '0'));
signal live_gap_end, live_gap_end_next : SEQUENCE_NR_TYPE := (others => (others => '0'));
-- Participant Announcement Timeout Time
signal announcement_time, announcement_time_next : DOUBLE_WORD_ARRAY := (others => (others => '0'));
signal announcement_time, announcement_time_next : TIME_TYPE := (others => (others => '0'));
-- Heartbeat/Liveliness Assertion Timeout Time
signal heartbeat_time, heartbeat_time_next : DOUBLE_WORD_ARRAY := (others => (others => '0'));
signal heartbeat_time, heartbeat_time_next : TIME_TYPE := (others => (others => '0'));
-- Signifies if we are currently in a Liveliness Assertion
signal is_live_assert, is_live_assert_next : std_logic := '0';
-- Signifies the content of the string read from input
signal string_content, string_content_next : STRING_CONTENT_TYPE := TOPIC_NAME;
signal string_content, string_content_next : STRING_CONTENT_TYPE := TOPIC_NAME_TYPE;
-- Signifies that the expects_inline_qos Flag was explicitly set via a Parameter ID
signal expects_inline_qos_set, expects_inline_qos_set_next : std_logic := '0';
-- Endpoint Locator IPv4 Address Latch
signal def_addr, def_addr_next : std_logic_vector(31 downto 0) := (others => '0');
signal def_addr, def_addr_next : std_logic_vector(IPv4_ADDRESS_WIDTH-1 downto 0) := (others => '0');
-- Metatraffic Locator IPv4 Address Latch
signal meta_addr, meta_addr_next : std_logic_vector(31 downto 0) := (others => '0');
signal meta_addr, meta_addr_next : std_logic_vector(IPv4_ADDRESS_WIDTH-1 downto 0) := (others => '0');
-- Endpoint UDPv4 Port Latch
signal def_port, def_port_next : std_logic_vector(15 downto 0) := (others => '0');
signal def_port, def_port_next : std_logic_vector(UDP_PORT_WIDTH-1 downto 0) := (others => '0');
-- Metatraffic UDPv4 Port Latch
signal meta_port, meta_port_next : std_logic_vector(15 downto 0) := (others => '0');
signal meta_port, meta_port_next : std_logic_vector(UDP_PORT_WIDTH-1 downto 0) := (others => '0');
-- Participant Lease Duration Latch
signal lease_duration, lease_duration_next : DOUBLE_WORD_ARRAY := (others => (others => '0'));
signal lease_duration, lease_duration_next : DURATION_TYPE := (others => (others => '0'));
-- Extra Flags Latch
signal extra_flags, extra_flags_next : std_logic_vector(EXTRA_FLAGS_WIDTH-1 downto 0) := (others => '0');
@ -490,10 +492,8 @@ begin
output_prc : process(all)
begin
-- Data Signal
for i in 0 to MAX_ENDPOINTS-1 loop
endpoint_output(i) <= output_sig;
end loop;
rtps_output <= output_sig;
endpoint_output <= output_sig;
rtps_output <= output_sig;
--Write Enable Signal
endpoint_wr <= (others => '0');
@ -577,7 +577,7 @@ begin
-- SKIP_PARAMETER Skip rest of Parameter
-- SKIP_PACKET Skip rest of Packet
parse_prc: process(all)
variable tmp_endpoint_mask : std_logic_vector(0 to MAX_ENDPOINTS-1) := (others => '0');
variable tmp_endpoint_mask : std_logic_vector(0 to NUM_ENDPOINTS-1) := (others => '0');
begin
--DEFAULT Registered
stage_next <= stage;
@ -1113,7 +1113,7 @@ begin
when PARTICIPANT_MESSAGE_DATA_KIND_AUTOMATIC_LIVELINESS_UPDATE =>
-- Unmark all readers without automatic liveliness QoS
for i in 0 to NUM_READERS-1 loop
if (AUTOMATIC_LIVELINESS_QOS /= ENDPOINT_LIVELINESS(i)) then
if (AUTOMATIC_LIVELINESS_QOS /= ENDPOINT_LIVELINESS_QOS(i)) then
endpoint_mask_next(i) <= '0';
end if;
end loop;
@ -1123,7 +1123,7 @@ begin
when PARTICIPANT_MESSAGE_DATA_KIND_MANUAL_LIVELINESS_UPDATE =>
-- Unmark all readers without manual by participant liveliness QoS
for i in 0 to NUM_READERS-1 loop
if (MANUAL_BY_PARTICIPANT_LIVELINESS_QOS /= ENDPOINT_LIVELINESS(i)) then
if (MANUAL_BY_PARTICIPANT_LIVELINESS_QOS /= ENDPOINT_LIVELINESS_QOS(i)) then
endpoint_mask_next(i) <= '0';
end if;
end loop;
@ -1533,7 +1533,7 @@ begin
mem_op_start <= '1';
-- Mark UNMATCHES
endpoint_match_next <= (others => '0');
endpoint_unmatch_next <= convert_from_bitmask_array(endpoint_mask_array, MAX_ENDPOINTS);
endpoint_unmatch_next <= convert_from_bitmask_array(endpoint_mask_array, NUM_ENDPOINTS);
-- Propagate Unmatches to local Endpoints
stage_next <= INFORM_ENDPOINTS_UNMATCH;
cnt_next <= 0;
@ -1550,7 +1550,7 @@ begin
-- Reset Word Counter
reset_read_cnt <= '1';
-- Latch Parameter End (In order to skip parameters)
parameter_end_next <= unsigned(endian_swap(endian_flag,parameter_length));
parameter_end_next <= unsigned(big_endian_swap(endian_flag,parameter_length));
-- DEFAULT STAGE
stage_next <= SKIP_PARAMETER;
@ -1578,7 +1578,7 @@ begin
if(qos_flag = '0' and message_type = PDP) then
stage_next <= LATCH_STRING_LENGTH;
-- Mark String contents (Needed for string comparison)
string_content_next <= DOMAIN_TAG;
string_content_next <= DOMAIN_TAG_TYPE;
end if;
when PID_PROTOCOL_VERSION =>
-- Ignore in-line QoS
@ -1643,7 +1643,7 @@ begin
if(qos_flag = '0' and message_type = EDP) then
stage_next <= LATCH_STRING_LENGTH;
-- Mark String contents (Needed for string comparison)
string_content_next <= TOPIC_NAME;
string_content_next <= TOPIC_NAME_TYPE;
end if;
when PID_TYPE_NAME =>
-- Ignore in-line QoS
@ -1651,7 +1651,7 @@ begin
if(qos_flag = '0' and message_type = EDP) then
stage_next <= LATCH_STRING_LENGTH;
-- Mark String contents (Needed for string comparison)
string_content_next <= TYPE_NAME;
string_content_next <= TYPE_NAME_TYPE;
end if;
when PID_DURABILITY =>
-- Ignore in-line QoS
@ -1866,20 +1866,20 @@ begin
-- Unmark matches on string comparison missmatch
case (string_content) is
when TOPIC_NAME =>
for i in 0 to MAX_ENDPOINTS-1 loop
when TOPIC_NAME_TYPE =>
for i in 0 to NUM_ENDPOINTS-1 loop
if (data_in /= ENDPOINT_TOPIC(i)(cnt)) then
endpoint_mask_next(i) <= '0';
end if;
end loop;
when TYPE_NAME =>
for i in 0 to MAX_ENDPOINTS-1 loop
when TYPE_NAME_TYPE =>
for i in 0 to NUM_ENDPOINTS-1 loop
if (data_in /= ENDPOINT_TYPE(i)(cnt)) then
endpoint_mask_next(i) <= '0';
end if;
end loop;
when DOMAIN_TAG =>
if (data_in /= work.rtps_package.DOMAIN_TAG(cnt)) then
when DOMAIN_TAG_TYPE =>
if (data_in /= DOMAIN_TAG(cnt)) then
participant_match_next <= '0';
end if;
when others =>
@ -1964,10 +1964,13 @@ begin
-- Locator Port
when 1 =>
-- Latch Source Port
if (is_meta_addr = '0') then
def_port_next <= data_in_swapped(def_port'length-1 downto 0);
else
meta_port_next <= data_in_swapped(meta_port'length-1 downto 0);
-- SANITY CHECK: Check if UDP Port valid
if (data_in_swapped(UDP_PORT_INVALID'range) /= UDP_PORT_INVALID) then
if (is_meta_addr = '0') then
def_port_next <= data_in_swapped(def_port'length-1 downto 0);
else
meta_port_next <= data_in_swapped(meta_port'length-1 downto 0);
end if;
end if;
-- Locator Address 1/4
when 2 =>
@ -1981,10 +1984,13 @@ begin
-- Locator Address 4/4 (IPv4)
when 5 =>
-- Latch Src Addr
if (is_meta_addr = '0') then
def_addr_next <= data_in_swapped;
else
meta_addr_next <= data_in_swapped;
-- SANITY CHECK: Check if IPv4 Address valid
if (data_in_swapped /= IPv4_ADDRESS_INVALID) then
if (is_meta_addr = '0') then
def_addr_next <= data_in_swapped;
else
meta_addr_next <= data_in_swapped;
end if;
end if;
-- DONE
stage_next <= SKIP_PARAMETER;
@ -2058,15 +2064,15 @@ begin
-- Check QoS Compatibility (Unmark match on incompatibility)
-- COMPATIBLE (DDS v1.4): offered >= requested, with VOLATILE < TRANSIENT_LOCAL < TRANSIENT < PERSISTENT
for i in 0 to MAX_ENDPOINTS-1 loop
for i in 0 to NUM_ENDPOINTS-1 loop
-- data-in is Subscriber-Requested
if (is_subscriber = '1') then
if (unsigned(data_in_swapped) > unsigned(ENDPOINT_DURABILITY(i))) then
if (unsigned(data_in_swapped) > unsigned(ENDPOINT_DURABILITY_QOS(i))) then
endpoint_mask_next(i) <= '0';
end if;
-- data-in is Publisher-Offered
else
if (unsigned(data_in_swapped) < unsigned(ENDPOINT_DURABILITY(i))) then
if (unsigned(data_in_swapped) < unsigned(ENDPOINT_DURABILITY_QOS(i))) then
endpoint_mask_next(i) <= '0';
end if;
end if;
@ -2084,15 +2090,15 @@ begin
when 0 =>
-- Check QoS Compatibility (Unmark match on incompatibility)
-- COMPATIBLE (DDS v1.4): offered <= requested
for i in 0 to MAX_ENDPOINTS-1 loop
for i in 0 to NUM_ENDPOINTS-1 loop
-- data-in is Subscriber-Requested
if (is_subscriber = '1') then
if (unsigned(data_in_swapped) < ENDPOINT_DEADLINE(i)(0)) then
if (unsigned(data_in_swapped) < ENDPOINT_DEADLINE_QOS(i)(0)) then
endpoint_mask_next(i) <= '0';
end if;
-- data-in is Publisher-Offered
else
if (unsigned(data_in_swapped) > ENDPOINT_DEADLINE(i)(0)) then
if (unsigned(data_in_swapped) > ENDPOINT_DEADLINE_QOS(i)(0)) then
endpoint_mask_next(i) <= '0';
end if;
end if;
@ -2100,15 +2106,15 @@ begin
when 1 =>
-- Check QoS Compatibility (Unmark match on incompatibility)
-- COMPATIBLE (DDS v1.4): offered <= requested
for i in 0 to MAX_ENDPOINTS-1 loop
for i in 0 to NUM_ENDPOINTS-1 loop
-- data-in is Subscriber-Requested
if (is_subscriber = '1') then
if (unsigned(data_in_swapped) < ENDPOINT_DEADLINE(i)(1)) then
if (unsigned(data_in_swapped) < ENDPOINT_DEADLINE_QOS(i)(1)) then
endpoint_mask_next(i) <= '0';
end if;
-- data-in is Publisher-Offered
else
if (unsigned(data_in_swapped) > ENDPOINT_DEADLINE(i)(1)) then
if (unsigned(data_in_swapped) > ENDPOINT_DEADLINE_QOS(i)(1)) then
endpoint_mask_next(i) <= '0';
end if;
end if;
@ -2126,15 +2132,15 @@ begin
-- Check QoS Compatibility (Unmark match on incompatibility)
-- COMPATIBLE (DDS v1.4): offered >= requested, with AUTOMATIC < MANUAL_BY_PARTICIPANT < MANUAL_BY_TOPIC
for i in 0 to MAX_ENDPOINTS-1 loop
for i in 0 to NUM_ENDPOINTS-1 loop
-- data-in is Subscriber-Requested
if (is_subscriber = '1') then
if (unsigned(data_in_swapped) > unsigned(ENDPOINT_LIVELINESS(i))) then
if (unsigned(data_in_swapped) > unsigned(ENDPOINT_LIVELINESS_QOS(i))) then
endpoint_mask_next(i) <= '0';
end if;
-- data-in is Publisher-Offered
else
if (unsigned(data_in_swapped) < unsigned(ENDPOINT_LIVELINESS(i))) then
if (unsigned(data_in_swapped) < unsigned(ENDPOINT_LIVELINESS_QOS(i))) then
endpoint_mask_next(i) <= '0';
end if;
end if;
@ -2153,7 +2159,7 @@ begin
when 0 =>
-- Check QoS Compatibility (Unmark match on incompatibility)
-- COMPATIBLE (DDS v1.4): offered <= requested
for i in 0 to MAX_ENDPOINTS-1 loop
for i in 0 to NUM_ENDPOINTS-1 loop
-- data-in is Subscriber-Requested
if (is_subscriber = '1') then
if (unsigned(data_in_swapped) > ENDPOINT_LEASE_DURATION(i)(0)) then
@ -2169,7 +2175,7 @@ begin
when 1 =>
-- Check QoS Compatibility (Unmark match on incompatibility)
-- COMPATIBLE (DDS v1.4): offered <= requested
for i in 0 to MAX_ENDPOINTS-1 loop
for i in 0 to NUM_ENDPOINTS-1 loop
-- data-in is Subscriber-Requested
if (is_subscriber = '1') then
if (unsigned(data_in_swapped) > ENDPOINT_LEASE_DURATION(i)(1)) then
@ -2195,15 +2201,15 @@ begin
-- Check QoS Compatibility (Unmark match on incompatibility)
-- COMPATIBLE (DDS v1.4): offered >= requested, with BEST_EFFORT < RELIABLE
for i in 0 to MAX_ENDPOINTS-1 loop
for i in 0 to NUM_ENDPOINTS-1 loop
-- data-in is Subscriber-Requested
if (is_subscriber = '1') then
if (unsigned(data_in_swapped) > unsigned(ENDPOINT_RELIABILITY(i))) then
if (unsigned(data_in_swapped) > unsigned(ENDPOINT_RELIABILITY_QOS(i))) then
endpoint_mask_next(i) <= '0';
end if;
-- data-in is Publisher-Offered
else
if (unsigned(data_in_swapped) < unsigned(ENDPOINT_RELIABILITY(i))) then
if (unsigned(data_in_swapped) < unsigned(ENDPOINT_RELIABILITY_QOS(i))) then
endpoint_mask_next(i) <= '0';
end if;
end if;
@ -2220,15 +2226,15 @@ begin
-- Check QoS Compatibility (Unmark match on incompatibility)
-- COMPATIBLE (DDS v1.4): offered >= requested, with BY_RECEPTION_TIMESTAMP < BY_SOURCE_TIMESTAMP
for i in 0 to MAX_ENDPOINTS-1 loop
for i in 0 to NUM_ENDPOINTS-1 loop
-- data-in is Subscriber-Requested
if (is_subscriber = '1') then
if (unsigned(data_in_swapped) > unsigned(ENDPOINT_DESTINATION_ORDER(i))) then
if (unsigned(data_in_swapped) > unsigned(ENDPOINT_DESTINATION_ORDER_QOS(i))) then
endpoint_mask_next(i) <= '0';
end if;
-- data-in is Publisher-Offered
else
if (unsigned(data_in_swapped) < unsigned(ENDPOINT_DESTINATION_ORDER(i))) then
if (unsigned(data_in_swapped) < unsigned(ENDPOINT_DESTINATION_ORDER_QOS(i))) then
endpoint_mask_next(i) <= '0';
end if;
end if;
@ -2260,29 +2266,29 @@ begin
when 0 =>
-- Check QoS Compatibility (Unmark match on incompatibility)
-- COMPATIBLE (DDS v1.4): offered >= requested, with INSTANCE < TOPIC < GROUP
for i in 0 to MAX_ENDPOINTS-1 loop
for i in 0 to NUM_ENDPOINTS-1 loop
-- data-in is Subscriber-Requested
if (is_subscriber = '1') then
if (unsigned(data_in_swapped) > unsigned(ENDPOINT_PRESENTATION(i))) then
if (unsigned(data_in_swapped) > unsigned(ENDPOINT_PRESENTATION_QOS(i))) then
endpoint_mask_next(i) <= '0';
end if;
-- data-in is Publisher-Offered
else
if (unsigned(data_in_swapped) < unsigned(ENDPOINT_PRESENTATION(i))) then
if (unsigned(data_in_swapped) < unsigned(ENDPOINT_PRESENTATION_QOS(i))) then
endpoint_mask_next(i) <= '0';
end if;
end if;
end loop;
when 1 =>
-- Check QoS Compatibility (Unmark match on incompatibility)
for i in 0 to MAX_ENDPOINTS-1 loop
for i in 0 to NUM_ENDPOINTS-1 loop
-- data-in is Subscriber-Requested
-- COMPATIBLE (DDS v1.4): requested=FALSE or requested=offered=TRUE
if (is_subscriber = '1') then
if (data_in(23) = '1' and ENDPOINT_COHERENT_ACCESS(i) = '0') then
if (data_in(23) = '1' and ENDPOINT_COHERENT_ACCESS(i) = FALSE) then
endpoint_mask_next(i) <= '0';
end if;
if (data_in(15) = '1' and ENDPOINT_ORDERED_ACCESS(i) = '0') then
if (data_in(15) = '1' and ENDPOINT_ORDERED_ACCESS(i) = FALSE) then
endpoint_mask_next(i) <= '0';
end if;
end if;
@ -2405,7 +2411,7 @@ begin
-- At least one local Endpoint match
if (endpoint_mask /= (endpoint_mask'range => '0')) then
-- Mark Endpoint match changes
tmp_endpoint_mask := convert_from_bitmask_array(endpoint_mask_array, MAX_ENDPOINTS);
tmp_endpoint_mask := convert_from_bitmask_array(endpoint_mask_array, NUM_ENDPOINTS);
tmp_endpoint_mask := tmp_endpoint_mask xor endpoint_mask;
-- Mark UNMATCHES
endpoint_unmatch_next <= tmp_endpoint_mask xor endpoint_mask;
@ -2424,7 +2430,7 @@ begin
mem_op_start <= '1';
-- Mark UNMATCHES
endpoint_match_next <= (others => '0');
endpoint_unmatch_next <= convert_from_bitmask_array(endpoint_mask_array, MAX_ENDPOINTS);
endpoint_unmatch_next <= convert_from_bitmask_array(endpoint_mask_array, NUM_ENDPOINTS);
-- Propagate Unmatches to local Endpoints
stage_next <= INFORM_ENDPOINTS_UNMATCH;
cnt_next <= 0;
@ -4020,7 +4026,7 @@ begin
stage <= IDLE;
return_stage <= IDLE;
message_type <= NONE;
string_content <= DOMAIN_TAG;
string_content <= DOMAIN_TAG_TYPE;
mem_stage <= IDLE;
opcode <= (others => '0');
flags <= (others => '0');

759
src/rtps_config_package.vhd Normal file
View File

@ -0,0 +1,759 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.math_pkg.all;
use work.rtps_package.all;
use work.user_config.all;
-- TODO: Convert ALL integers to natural, and remove all conversions (Arithmetics between natural and unsigned are directly supported)
package rtps_config_package is
constant VENDORID : std_logic_vector(VENDORID_WIDTH-1 downto 0) := VENDORID_UNKNOWN;
constant GUIDPREFIX : GUIDPREFIX_TYPE; -- Deferred to Package Body
type ENTITYID_TYPE is array (0 to NUM_ENDPOINTS-1) of std_logic_vector(ENTITYID_WIDTH-1 downto 0);
constant ENTITYID : ENTITYID_TYPE; -- Deferred to Package Body
constant DOMAIN_ID : std_logic_vector(DOMAIN_ID_WIDTH-1 downto 0) := std_logic_vector(to_unsigned(USER_DOMAIN_ID, DOMAIN_ID_WIDTH));
-- Smallest Writer Endpoint Lease Duration
constant MIN_ENDPOINT_LEASE_DURATION : DURATION_TYPE; -- Deferred to package Body
-- (see DDSI-RTPS 2.3 Section 9.6.1)
-- PB + DG * domain_id + d0
constant META_IPv4_MULTICAST_PORT: std_logic_vector(UDP_PORT_WIDTH-1 downto 0) := std_logic_vector(to_unsigned(PORT_CONFIG_PB + PORT_CONFIG_D0 + PORT_CONFIG_DG*USER_DOMAIN_ID, UDP_PORT_WIDTH));
-- (see DDSI-RTPS 2.3 Section 9.6.1)
-- PB + DG * domainId + d1 + PG * participant_id
-- participant_id=0
constant META_IPv4_UNICAST_PORT : std_logic_vector(UDP_PORT_WIDTH-1 downto 0) := std_logic_vector(to_unsigned(PORT_CONFIG_PB + PORT_CONFIG_D1 + PORT_CONFIG_DG*USER_DOMAIN_ID, UDP_PORT_WIDTH));
-- (see DDSI-RTPS 2.3 Section 9.6.1)
-- PB + DG * domainId + d2
constant USER_IPv4_MULTICAST_PORT: std_logic_vector(UDP_PORT_WIDTH-1 downto 0) := std_logic_vector(to_unsigned(PORT_CONFIG_PB + PORT_CONFIG_D2 + PORT_CONFIG_DG*USER_DOMAIN_ID, UDP_PORT_WIDTH));
-- (see DDSI-RTPS 2.3 Section 9.6.1)
-- PB + DG * domainId + d3 + PG * participant_id
-- participant_id=0
constant USER_IPv4_UNICAST_PORT : std_logic_vector(UDP_PORT_WIDTH-1 downto 0) := std_logic_vector(to_unsigned(PORT_CONFIG_PB + PORT_CONFIG_D3 + PORT_CONFIG_DG*USER_DOMAIN_ID, UDP_PORT_WIDTH));
-- 4-Byte Word Size of a Participant Entry in Memory
constant PARTICIPANT_FRAME_SIZE : natural := 23;
-- 4-Byte Word Size of Endpoint Bitmask in Memory
constant ENDPOINT_BITMASK_SIZE : natural := round_div(NUM_ENDPOINTS, 32);
type ENDPOINT_BITMASK_ARRAY_TYPE is array (0 to ENDPOINT_BITMASK_SIZE-1) of std_logic_vector(0 to WORD_WIDTH-1);
-- 4-Byte Word Size of a Endpoint Entry in Memory
constant ENDPOINT_FRAME_SIZE : natural := 4 + ENDPOINT_BITMASK_SIZE;
-- Built-in Endpoint Memory Buffer 4-Byte Word Size
constant BUILTIN_BUFFER_SIZE : natural := MAX_REMOTE_PARTICIPANTS*PARTICIPANT_FRAME_SIZE;
-- ENDPOINT FRAME OPCODES
constant ENDPOINT_MATCH_OPCODE_WIDTH: natural := 32;
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";
constant OPCODE_LIVELINESS_UPDATE : std_logic_vector(ENDPOINT_MATCH_OPCODE_WIDTH-1 downto 0) := x"55000002";
-- Marks the Reader Endpoint in the Endpoint Array
constant ENDPOINT_READERS : std_logic_vector(0 to NUM_ENDPOINTS-1) := (0 to NUM_READERS-1 => '1', others => '0');
type WORD_ARRAY_TYPE is array (natural range <>) of std_logic_vector(WORD_WIDTH-1 downto 0);
type OUTPUT_DATA_TYPE is record
-- Limit DATA to MAX UDPv4 Payload Size - RTPS Header (65487 Bytes)
data : WORD_ARRAY_TYPE(0 to 16371);
length : natural;
end record;
constant READER_ENDPOINT_DATA : OUTPUT_DATA_TYPE; --Deferred to package body
constant WRITER_ENDPOINT_DATA : OUTPUT_DATA_TYPE; --Deferred to package body
constant PARTICIPANT_DATA : OUTPUT_DATA_TYPE; --Deferred to package body
type STRING_WORD_ARRAY_TYPE is array (0 to (256/(WORD_WIDTH/8))-1) of std_logic_vector(WORD_WIDTH-1 downto 0);
type ENDPOINT_STRING_TYPE is array (0 to NUM_ENDPOINTS-1) of STRING_WORD_ARRAY_TYPE;
constant ENDPOINT_TOPIC : ENDPOINT_STRING_TYPE; --Deferred to package body
constant ENDPOINT_TYPE : ENDPOINT_STRING_TYPE; --Deferred to package body
constant DOMAIN_TAG : STRING_WORD_ARRAY_TYPE; -- Deferred to package body
-- Swap "data" to Big Endian representation.
function big_endian_swap(is_little_endian : std_logic; data : std_logic_vector) return std_logic_vector;
function big_endian_swap(is_little_endian : std_logic; data : unsigned) return unsigned;
end package;
package body rtps_config_package is
procedure assertions is
begin
assert (NUM_ENDPOINTS = (NUM_READERS+NUM_WRITERS)) severity failure;
assert (ENDPOINT_WITH_KEY'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_TOPIC_STRING'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_TYPE_STRING'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_HEARTBEAT_PERIOD'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_HEARTBEAT_RESPONSE_DELAY'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_HEARTBEAT_SUPPRESSION_DELAY'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_ACKNACK_RESPONSE_DELAY'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_ACKNACK_SUPPRESSION_DELAY'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_DURABILITY_QOS'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_DURABILITY_SERVICE_CLEANUP_DELAY'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_DURABILITY_SERVICE_HISTORY'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_DURABILITY_SERVICE_HISTORY_DEPTH'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_DURABILITY_SERVICE_MAX_SAMPLES'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_DURABILITY_SERVICE_MAX_INSTANCES'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_DURABILITY_SERVICE_MAX_SAMPLES_PER_INSTANCE'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_PRESENTATION_QOS'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_COHERENT_ACCESS'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_ORDERED_ACCESS'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_DEADLINE_QOS'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_LATENCY_BUDGET_QOS'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_OWNERSHIP_QOS'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_OWNERSHIP_STRENGTH_QOS'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_LIVELINESS_QOS'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_LEASE_DURATION'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_TIME_BASED_FILTER_QOS'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_RELIABILITY_QOS'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_MAX_BLOCKING_TIME'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_TRANSPORT_PRIORITY_QOS'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_LIFESPAN_QOS'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_DESTINATION_ORDER_QOS'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_HISTORY_QOS'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_HISTORY_DEPTH'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_MAX_SAMPLES'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_MAX_INSTANCES'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_MAX_SAMPLES_PER_INSTANCE'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_AUTODISPOSE_UNREGISTERED_INSTANCES'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_AUTOPURGE_NOWRITER_SAMPLES_DELAY'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (ENDPOINT_AUTOPURGE_DISPOSED_SAMPLES_DELAY'length = NUM_ENDPOINTS) report "Endpoint arrays have to be NUM_ENDPOINTS long" severity failure;
assert (PARTICIPANT_ANNOUNCEMENT_PERIOD+DURATION_DELTA <= PARTICIPANT_LEASE_DURATION) report "Participant Announcement Period has to be less than the Participant Lease Duration" severity failure;
for i in 0 to NUM_ENDPOINTS-1 loop
assert (unsigned(ENDPOINT_DURABILITY_QOS(i)) < unsigned(TRANSIENT_DURABILITY_QOS)) report "TRANSIENT and PERSISTENT Durability QoS not supported" severity failure;
assert (ENDPOINT_PRESENTATION_QOS(i) /= GROUP_PRESENTATION_QOS) report "GROUP Presentation QoS not supported" severity failure;
assert (ENDPOINT_DEADLINE_QOS(i) >= ENDPOINT_TIME_BASED_FILTER_QOS(i)) report "DEADLINE Qos cannot be less than TIME_BASED_FILTER QoS" severity failure;
assert (ENDPOINT_OWNERSHIP_QOS(i) = SHARED_OWNERSHIP_QOS) report "Only SHARED Ownership QoS supported" severity failure;
assert (unsigned(ENDPOINT_MAX_SAMPLES(i)) >= unsigned(ENDPOINT_MAX_SAMPLES_PER_INSTANCE(i))) report "MAX_SAMPLES cannot be less than MAX_SAMPLES_PER_INSTANCE in Resource Limits QoS" severity failure;
end loop;
end procedure;
function booelan_to_std_logic(input : boolean) return std_logic is
variable ret : std_logic := '0';
begin
ret := '0';
if (input = TRUE) then
ret := '1';
end if;
return ret;
end function;
function gen_entyid return ENTITYID_TYPE is
variable ret : ENTITYID_TYPE;
begin
ret := (others => (others => '0'));
for i in 0 to ret'length-1 loop
-- (see DDSI-RTPS 2.3 Section 9.3.1.2)
-- Entity Kind Mapping
ret(i)(7 downto 6) := USER_DEFINED_ENTITY;
if (i <= NUM_READERS-1) then
if (ENDPOINT_WITH_KEY(i)) then
ret(i)(5 downto 0) := READER_WITH_KEY;
else
ret(i)(5 downto 0) := READER_NO_KEY;
end if;
else
if (ENDPOINT_WITH_KEY(i)) then
ret(i)(5 downto 0) := WRITER_WITH_KEY;
else
ret(i)(5 downto 0) := WRITER_NO_KEY;
end if;
end if;
-- ID Mapping
ret(i)(ENTITYID_WIDTH-1 downto 8) := std_logic_vector(to_unsigned(i,ENTITYID_WIDTH-8));
end loop;
return ret;
end function;
constant ENTITYID : ENTITYID_TYPE := gen_entyid;
function gen_guidprefix return GUIDPREFIX_TYPE is
variable tmp : std_logic_vector(GUIDPREFIX_WIDTH-1 downto 0) := (others => '0');
variable ret : GUIDPREFIX_TYPE := (others => (others => '0'));
begin
tmp := (others => '0');
ret := (others => (others => '0'));
-- First two bytes have to be Vendor ID (see DDSI-RTPS 2.3 Section 9.3.1.5)
tmp(GUIDPREFIX_WIDTH-1 downto GUIDPREFIX_WIDTH-VENDORID_WIDTH) := VENDORID;
-- Next we insert the MAC address for uniqueness
tmp(GUIDPREFIX_WIDTH-VENDORID_WIDTH-1 downto GUIDPREFIX_WIDTH-VENDORID_WIDTH-48) := MAC_ADDRESS;
-- Next we insert the Domain ID
tmp(DOMAIN_ID_WIDTH-1 downto 0) := DOMAIN_ID;
-- Convert to return type
for i in 0 to ret'length-1 loop
ret(i) := tmp(GUIDPREFIX_WIDTH-(i*ret(i)'length)-1 downto GUIDPREFIX_WIDTH-(i*ret(i)'length)-ret(i)'length);
end loop;
return ret;
end function;
constant GUIDPREFIX : GUIDPREFIX_TYPE := gen_guidprefix;
function find_min_lease_duration return DURATION_TYPE is
variable ret : DURATION_TYPE := (others => (others => '0'));
begin
ret := DURATION_INFINITE;
-- Sanity Check
if (NUM_WRITERS = 0) then
return ret;
end if;
-- Iterate through writers
for i in NUM_READERS to NUM_ENDPOINTS-1 loop
-- Do not consider "MANUAL_BY_TOPIC" Liveliness
if (ENDPOINT_LIVELINESS_QOS(i) /= MANUAL_BY_TOPIC_LIVELINESS_QOS) then
-- Find Minimum Lease Duration
if (ENDPOINT_LEASE_DURATION(i) < ret) then
ret := ENDPOINT_LEASE_DURATION(i);
end if;
end if;
end loop;
return ret;
end function;
constant MIN_ENDPOINT_LEASE_DURATION : DURATION_TYPE := find_min_lease_duration;
function convert_string (str : string(1 to 256)) return STRING_WORD_ARRAY_TYPE is
variable ret : STRING_WORD_ARRAY_TYPE := (others => (others => '0'));
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*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)) & std_logic_vector(to_unsigned(character'POS(str((i*4)+4)), 8));
end loop;
return ret;
end function;
function convert_endpoint_string (string_array : USER_STRING_ARRAY_TYPE) return ENDPOINT_STRING_TYPE is
variable ret : ENDPOINT_STRING_TYPE := (others => (others => (others => '0')));
begin
ret := (others => (others => (others => '0')));
for i in 0 to ret'length-1 loop
ret(i) := convert_string(string_array(i));
end loop;
return ret;
end function;
constant ENDPOINT_TOPIC : ENDPOINT_STRING_TYPE := convert_endpoint_string(ENDPOINT_TOPIC_STRING);
constant ENDPOINT_TYPE : ENDPOINT_STRING_TYPE := convert_endpoint_string(ENDPOINT_TYPE_STRING);
constant DOMAIN_TAG : STRING_WORD_ARRAY_TYPE := convert_string(USER_DOMAIN_TAG);
function string_len (str : STRING_WORD_ARRAY_TYPE) return natural is
variable ret : natural := 0;
begin
ret := 0;
for i in 0 to str'length-1 loop
for j in 0 to (str(i)'length/8)-1 loop
-- Count Bytes
ret := ret + 1;
-- Exit on first NULL byte (NULL Byte included in count)
if (str(i)(str(i)'length-j*8-1 downto str(i)'length-j*8-8) = (7 downto 0 => '0')) then
exit;
end if;
end loop;
end loop;
return ret;
end function;
function gen_reader_endpoint_data return OUTPUT_DATA_TYPE is
variable ret : OUTPUT_DATA_TYPE := (data => (others => (others => '0')), length => 0);
variable ind : natural := 0;
variable len : natural := 0;
variable tmp : natural := 0;
begin
ret.data := (others => (others => '0'));
ret.length := 0;
-- Sanity Check
if (NUM_READERS = 0) then
return ret;
end if;
len := 0;
ind := 0;
-- RTPS Submessages
-- One DATA Submessage for each Reader
for i in 0 to NUM_READERS-1 loop
-- RTPS Submessage Header
ret.data(ind) := SID_DATA & "00000100" & x"0000";
-- DATA Header (extraFlags, octetsToInlineQoS)
len := len + 1;
ret.data(ind+len) := x"0000" & std_logic_vector(to_unsigned(16, 16));
-- DATA Header (Reader Entity ID)
len := len + 1;
ret.data(ind+len) := ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_DETECTOR;
-- DATA Header (Writer Entity ID)
len := len + 1;
ret.data(ind+len) := ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_ANNOUNCER;
-- DATA Header (Sequence Number)
len := len + 1;
ret.data(ind+len) := (others => '0');
-- DATA Header (Sequence Number)
len := len + 1;
ret.data(ind+len) := std_logic_vector(to_unsigned(i+1, ret.data(0)'length));
-- Serialized Payload Header
len := len + 1;
ret.data(ind+len) := PL_CDR_BE & x"0000";
-- Serialized Payload BEGIN
-- GUID
len := len + 1;
ret.data(ind+len):= PID_ENDPOINT_GUID & std_logic_vector(to_unsigned(16, 16));
len := len + 1;
ret.data(ind+len) := GUIDPREFIX(0);
len := len + 1;
ret.data(ind+len) := GUIDPREFIX(1);
len := len + 1;
ret.data(ind+len) := GUIDPREFIX(2);
len := len + 1;
ret.data(ind+len) := ENTITYID(i);
-- EXPECTS INLINE QOS (Only relevant for Reader endpoints)
len := len + 1;
ret.data(ind+len) := PID_EXPECTS_INLINE_QOS & std_logic_vector(to_unsigned(4, 16));
len := len + 1;
ret.data(ind+len) := (24 => '1', others => '0');
-- TOPIC NAME
tmp := string_len(ENDPOINT_TOPIC(i));
len := len + 1;
ret.data(ind+len) := PID_TOPIC_NAME & std_logic_vector(to_unsigned((round_div(tmp,4)+1)*4, 16));
len := len + 1;
ret.data(ind+len) := std_logic_vector(to_unsigned(tmp, 32));
for j in 0 to round_div(tmp,4)-1 loop
len := len + 1;
ret.data(ind+len) := ENDPOINT_TOPIC(i)(j);
end loop;
-- TYPE NAME
tmp := string_len(ENDPOINT_TYPE(i));
len := len + 1;
ret.data(ind+len) := PID_TYPE_NAME & std_logic_vector(to_unsigned((round_div(tmp,4)+1)*4, 16));
len := len + 1;
ret.data(ind+len) := std_logic_vector(to_unsigned(tmp, 32));
for j in 0 to round_div(tmp,4)-1 loop
len := len + 1;
ret.data(ind+len) := ENDPOINT_TYPE(i)(j);
end loop;
-- DURABILITY
if (ENDPOINT_DURABILITY_QOS(i) /= DEFAULT_DURABILITY_QOS) then
len := len + 1;
ret.data(ind+len) := PID_DURABILITY & std_logic_vector(to_unsigned(4, 16));
len := len + 1;
ret.data(ind+len) := ENDPOINT_DURABILITY_QOS(i);
end if;
-- DEADLINE
if (ENDPOINT_DEADLINE_QOS(i) /= DEFAULT_DEADLINE_QOS) then
len := len + 1;
ret.data(ind+len) := PID_DEADLINE & std_logic_vector(to_unsigned(8, 16));
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_DEADLINE_QOS(i)(0));
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_DEADLINE_QOS(i)(1));
end if;
-- LIVELINESS
if (ENDPOINT_LIVELINESS_QOS(i) /= DEFAULT_LIVELINESS_QOS or ENDPOINT_LEASE_DURATION(i) /= DEFAULT_LEASE_DURATION) then
len := len + 1;
ret.data(ind+len) := PID_LIVELINESS & std_logic_vector(to_unsigned(12, 16));
len := len + 1;
ret.data(ind+len) := ENDPOINT_LIVELINESS_QOS(i);
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_LEASE_DURATION(i)(0));
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_LEASE_DURATION(i)(1));
end if;
-- RELIABILITY
if (ENDPOINT_RELIABILITY_QOS(i) /= DEFAULT_RELIABILTY_QOS or ENDPOINT_MAX_BLOCKING_TIME(i) /= DEFAULT_MAX_BLOCKING_TIME) then
len := len + 1;
ret.data(ind+len) := PID_RELIABILITY & std_logic_vector(to_unsigned(12, 16));
len := len + 1;
ret.data(ind+len) := ENDPOINT_RELIABILITY_QOS(i);
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_MAX_BLOCKING_TIME(i)(0));
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_MAX_BLOCKING_TIME(i)(1));
end if;
-- DESTINATION ORDER
if (ENDPOINT_DESTINATION_ORDER_QOS(i) /= DEFAULT_DESTINATION_ORDER_QOS) then
len := len + 1;
ret.data(ind+len) := PID_DESTINATION_ORDER & std_logic_vector(to_unsigned(4, 16));
len := len + 1;
ret.data(ind+len) := ENDPOINT_DESTINATION_ORDER_QOS(i);
end if;
-- PRESENTATION
if (ENDPOINT_PRESENTATION_QOS(i) /= DEFAULT_PRESENTATION_QOS or ENDPOINT_COHERENT_ACCESS(i) /= DEFAULT_COHERENT_ACCESS or ENDPOINT_ORDERED_ACCESS(i) /= DEFAULT_ORDERED_ACCESS) then
len := len + 1;
ret.data(ind+len) := PID_PRESENTATION & std_logic_vector(to_unsigned(8, 16));
len := len + 1;
ret.data(ind+len) := ENDPOINT_PRESENTATION_QOS(i);
len := len + 1;
ret.data(ind+len) := (24 => booelan_to_std_logic(ENDPOINT_COHERENT_ACCESS(i)), 16 => booelan_to_std_logic(ENDPOINT_ORDERED_ACCESS(i)), others => '0');
end if;
-- SENTINEL
len := len + 1;
ret.data(ind+len) := PID_SENTINEL & std_logic_vector(to_unsigned(0, 16));
-- Fix Submessage Length
ret.data(ind)(15 downto 0) := std_logic_vector(to_unsigned(len*4, 16));
-- Reset Pointers
ind := ind + len + 1;
len := 0;
end loop;
-- Store Total Length
ret.length := ind;
return ret;
end function;
constant READER_ENDPOINT_DATA : OUTPUT_DATA_TYPE := gen_reader_endpoint_data;
function gen_writer_endpoint_data return OUTPUT_DATA_TYPE is
variable ret : OUTPUT_DATA_TYPE := (data => (others => (others => '0')), length => 0);
variable ind : natural := 0;
variable len : natural := 0;
variable tmp : natural := 0;
begin
ret.data := (others => (others => '0'));
ret.length := 0;
-- Sanity Check
if (NUM_WRITERS = 0) then
return ret;
end if;
len := 0;
ind := 0;
-- RTPS Submessages
-- One DATA Submessage for each Writer Endpoint
for i in NUM_READERS to NUM_ENDPOINTS-1 loop
-- RTPS Submessage Header
ret.data(ind) := SID_DATA & "00000100" & x"0000";
-- DATA Header (extraFlags, octetsToInlineQoS)
len := len + 1;
ret.data(ind+len) := x"0000" & std_logic_vector(to_unsigned(16, 16));
-- DATA Header (Reader Entity ID)
len := len + 1;
ret.data(ind+len) := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_DETECTOR;
-- DATA Header (Writer Entity ID)
len := len + 1;
ret.data(ind+len) := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_ANNOUNCER;
-- DATA Header (Sequence Number)
len := len + 1;
ret.data(ind+len) := (others => '0');
-- DATA Header (Sequence Number)
len := len + 1;
ret.data(ind+len) := std_logic_vector(to_unsigned(i-NUM_READERS+1, ret.data'length(1)));
-- Serialized Payload Header
len := len + 1;
ret.data(ind+len) := PL_CDR_BE & x"0000";
-- Serialized Payload BEGIN
-- GUID
len := len + 1;
ret.data(ind+len):= PID_ENDPOINT_GUID & std_logic_vector(to_unsigned(16, 16));
len := len + 1;
ret.data(ind+len) := GUIDPREFIX(0);
len := len + 1;
ret.data(ind+len) := GUIDPREFIX(1);
len := len + 1;
ret.data(ind+len) := GUIDPREFIX(2);
len := len + 1;
ret.data(ind+len) := ENTITYID(i);
-- TOPIC NAME
tmp := string_len(ENDPOINT_TOPIC(i));
len := len + 1;
ret.data(ind+len) := PID_TOPIC_NAME & std_logic_vector(to_unsigned((round_div(tmp,4)+1)*4, 16));
len := len + 1;
ret.data(ind+len) := std_logic_vector(to_unsigned(tmp, 32));
for j in 0 to round_div(tmp,4)-1 loop
len := len + 1;
ret.data(ind+len) := ENDPOINT_TOPIC(i)(j);
end loop;
-- TYPE NAME
tmp := string_len(ENDPOINT_TYPE(i));
len := len + 1;
ret.data(ind+len) := PID_TYPE_NAME & std_logic_vector(to_unsigned((round_div(tmp,4)+1)*4, 16));
len := len + 1;
ret.data(ind+len) := std_logic_vector(to_unsigned(tmp, 32));
for j in 0 to round_div(tmp,4)-1 loop
len := len + 1;
ret.data(ind+len) := ENDPOINT_TYPE(i)(j);
end loop;
-- DURABILITY
if (ENDPOINT_DURABILITY_QOS(i) /= DEFAULT_DURABILITY_QOS) then
len := len + 1;
ret.data(ind+len) := PID_DURABILITY & std_logic_vector(to_unsigned(4, 16));
len := len + 1;
ret.data(ind+len) := ENDPOINT_DURABILITY_QOS(i);
end if;
-- DEADLINE
if (ENDPOINT_DEADLINE_QOS(i) /= DEFAULT_DEADLINE_QOS) then
len := len + 1;
ret.data(ind+len) := PID_DEADLINE & std_logic_vector(to_unsigned(8, 16));
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_DEADLINE_QOS(i)(0));
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_DEADLINE_QOS(i)(1));
end if;
-- LIVELINESS
if (ENDPOINT_LIVELINESS_QOS(i) /= DEFAULT_LIVELINESS_QOS or ENDPOINT_LEASE_DURATION(i) /= DEFAULT_LEASE_DURATION) then
len := len + 1;
ret.data(ind+len) := PID_LIVELINESS & std_logic_vector(to_unsigned(12, 16));
len := len + 1;
ret.data(ind+len) := ENDPOINT_LIVELINESS_QOS(i);
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_LEASE_DURATION(i)(0));
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_LEASE_DURATION(i)(1));
end if;
-- RELIABILITY
if (ENDPOINT_RELIABILITY_QOS(i) /= DEFAULT_RELIABILTY_QOS or ENDPOINT_MAX_BLOCKING_TIME(i) /= DEFAULT_MAX_BLOCKING_TIME) then
len := len + 1;
ret.data(ind+len) := PID_RELIABILITY & std_logic_vector(to_unsigned(12, 16));
len := len + 1;
ret.data(ind+len) := ENDPOINT_RELIABILITY_QOS(i);
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_MAX_BLOCKING_TIME(i)(0));
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_MAX_BLOCKING_TIME(i)(1));
end if;
-- LIFESPAN
if (ENDPOINT_LIFESPAN_QOS(i) /= DEFAULT_LIFESPAN_QOS) then
len := len + 1;
ret.data(ind+len) := PID_LIFESPAN & std_logic_vector(to_unsigned(8, 16));
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_LIFESPAN_QOS(i)(0));
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_LIFESPAN_QOS(i)(1));
end if;
-- DESTINATION ORDER
if (ENDPOINT_DESTINATION_ORDER_QOS(i) /= DEFAULT_DESTINATION_ORDER_QOS) then
len := len + 1;
ret.data(ind+len) := PID_DESTINATION_ORDER & std_logic_vector(to_unsigned(4, 16));
len := len + 1;
ret.data(ind+len) := ENDPOINT_DESTINATION_ORDER_QOS(i);
end if;
-- PRESENTATION
if (ENDPOINT_PRESENTATION_QOS(i) /= DEFAULT_PRESENTATION_QOS or ENDPOINT_COHERENT_ACCESS(i) /= DEFAULT_COHERENT_ACCESS or ENDPOINT_ORDERED_ACCESS(i) /= DEFAULT_ORDERED_ACCESS) then
len := len + 1;
ret.data(ind+len) := PID_PRESENTATION & std_logic_vector(to_unsigned(8, 16));
len := len + 1;
ret.data(ind+len) := ENDPOINT_PRESENTATION_QOS(i);
len := len + 1;
ret.data(ind+len) := (24 => booelan_to_std_logic(ENDPOINT_COHERENT_ACCESS(i)), 16 => booelan_to_std_logic(ENDPOINT_ORDERED_ACCESS(i)), others => '0');
end if;
-- SENTINEL
len := len + 1;
ret.data(ind+len) := PID_SENTINEL & std_logic_vector(to_unsigned(0, 16));
-- Fix Submessage Length
ret.data(ind)(15 downto 0) := std_logic_vector(to_unsigned(len*4, 16));
-- Reset Pointers
ind := ind + len + 1;
len := 0;
end loop;
-- Store Total Length
ret.length := ind;
return ret;
end function;
constant WRITER_ENDPOINT_DATA : OUTPUT_DATA_TYPE := gen_writer_endpoint_data;
function gen_participant_data return OUTPUT_DATA_TYPE is
variable ret : OUTPUT_DATA_TYPE := (data => (others => (others => '0')), length => 0);
variable ind : natural := 0;
variable len : natural := 0;
variable tmp : natural := 0;
begin
ret.data := (others => (others => '0'));
ret.length := 0;
len := 0;
ind := 0;
-- RTPS DATA SUBMESSAGE
-- RTPS Submessage Header
ret.data(ind) := SID_DATA & "00000100" & x"0000";
-- DATA Header (extraFlags, octetsToInlineQoS)
len := len + 1;
ret.data(ind+len) := x"0000" & std_logic_vector(to_unsigned(16, 16));
-- DATA Header (Reader Entity ID)
len := len + 1;
ret.data(ind+len) := ENTITYID_SPDP_BUILTIN_PARTICIPANT_DETECTOR;
-- DATA Header (Writer Entity ID)
len := len + 1;
ret.data(ind+len) := ENTITYID_SPDP_BUILTIN_PARTICIPANT_ANNOUNCER;
-- DATA Header (Sequence Number)
len := len + 1;
ret.data(ind+len) := (others => '0');
-- DATA Header (Sequence Number)
len := len + 1;
ret.data(ind+len) := std_logic_vector(to_unsigned(1, ret.data(ind+len)'length));
-- Serialized Payload Header
len := len + 1;
ret.data(ind+len) := PL_CDR_BE & x"0000";
-- Serialized Payload BEGIN
-- GUID
len := len + 1;
ret.data(ind+len):= PID_PARTICIPANT_GUID & std_logic_vector(to_unsigned(16, 16));
len := len + 1;
ret.data(ind+len) := GUIDPREFIX(0);
len := len + 1;
ret.data(ind+len) := GUIDPREFIX(1);
len := len + 1;
ret.data(ind+len) := GUIDPREFIX(2);
len := len + 1;
ret.data(ind+len) := ENTITYID_PARTICIPANT;
-- DOMAIN ID
len := len + 1;
ret.data(ind+len):= PID_DOMAIN_ID & std_logic_vector(to_unsigned(4, 16));
len := len + 1;
ret.data(ind+len):= DOMAIN_ID;
-- DOMAIN TAG
-- TODO: Check if Guard works
if (USER_DOMAIN_TAG /= "") then
tmp := string_len(DOMAIN_TAG);
len := len + 1;
ret.data(ind+len) := PID_DOMAIN_TAG & std_logic_vector(to_unsigned((round_div(tmp,4)+1)*4, 16));
len := len + 1;
ret.data(ind+len) := std_logic_vector(to_unsigned(tmp, 32));
for j in 0 to round_div(tmp,4)-1 loop
len := len + 1;
ret.data(ind+len) := DOMAIN_TAG(j);
end loop;
end if;
-- PROTOCOL VERSION
len := len + 1;
ret.data(ind+len) := PID_PROTOCOL_VERSION & std_logic_vector(to_unsigned(4, 16));
len := len + 1;
ret.data(ind+len) := (others => '0');
ret.data(ind+len)(31 downto 16) := PROTOCOLVERSION_2_4;
-- VENDORID
len := len + 1;
ret.data(ind+len) := PID_VENDORID & std_logic_vector(to_unsigned(4, 16));
len := len + 1;
ret.data(ind+len) := (others => '0');
ret.data(ind+len)(31 downto 16) := VENDORID;
-- TODO: Expects inline QoS of Participant
-- METATRAFFIC UNICAST LOCATOR
len := len + 1;
ret.data(ind+len) := PID_METATRAFFIC_UNICAST_LOCATOR & std_logic_vector(to_unsigned(24, 16));
len := len + 1;
ret.data(ind+len) := LOCATOR_KIND_UDPv4;
len := len + 1;
ret.data(ind+len) := (others => '0');
ret.data(ind+len)(15 downto 0) := META_IPv4_UNICAST_PORT;
len := len + 1;
ret.data(ind+len) := (others => '0');
len := len + 1;
ret.data(ind+len) := (others => '0');
len := len + 1;
ret.data(ind+len) := (others => '0');
len := len + 1;
ret.data(ind+len) := DEFAULT_IPv4_META_ADDRESS;
-- METATRAFFIC MULTICAST LOCATOR
len := len + 1;
ret.data(ind+len) := PID_METATRAFFIC_MULTICAST_LOCATOR & std_logic_vector(to_unsigned(24, 16));
len := len + 1;
ret.data(ind+len) := LOCATOR_KIND_UDPv4;
len := len + 1;
ret.data(ind+len) := (others => '0');
ret.data(ind+len)(15 downto 0) := META_IPv4_MULTICAST_PORT;
len := len + 1;
ret.data(ind+len) := (others => '0');
len := len + 1;
ret.data(ind+len) := (others => '0');
len := len + 1;
ret.data(ind+len) := (others => '0');
len := len + 1;
ret.data(ind+len) := DEFAULT_IPv4_META_ADDRESS;
-- DEFAULT UNICAST LOCATOR
len := len + 1;
ret.data(ind+len) := PID_DEFAULT_UNICAST_LOCATOR & std_logic_vector(to_unsigned(24, 16));
len := len + 1;
ret.data(ind+len) := LOCATOR_KIND_UDPv4;
len := len + 1;
ret.data(ind+len) := (others => '0');
ret.data(ind+len)(15 downto 0) := USER_IPv4_UNICAST_PORT;
len := len + 1;
ret.data(ind+len) := (others => '0');
len := len + 1;
ret.data(ind+len) := (others => '0');
len := len + 1;
ret.data(ind+len) := (others => '0');
len := len + 1;
ret.data(ind+len) := DEFAULT_IPv4_META_ADDRESS;
-- DEFAULT MULTICAST LOCATOR
len := len + 1;
ret.data(ind+len) := PID_METATRAFFIC_MULTICAST_LOCATOR & std_logic_vector(to_unsigned(24, 16));
len := len + 1;
ret.data(ind+len) := LOCATOR_KIND_UDPv4;
len := len + 1;
ret.data(ind+len) := (others => '0');
ret.data(ind+len)(15 downto 0) := USER_IPv4_MULTICAST_PORT;
len := len + 1;
ret.data(ind+len) := (others => '0');
len := len + 1;
ret.data(ind+len) := (others => '0');
len := len + 1;
ret.data(ind+len) := (others => '0');
len := len + 1;
ret.data(ind+len) := DEFAULT_IPv4_META_ADDRESS;
-- LEASE DURATION
if (PARTICIPANT_LEASE_DURATION /= DEFAULT_PARTICIPANT_LEASE_DURATION) then
len := len + 1;
ret.data(ind+len) := PID_PARTICIPANT_LEASE_DURATION & std_logic_vector(to_unsigned(8, 16));
len := len + 1;
ret.data(ind+len) := std_logic_vector(PARTICIPANT_LEASE_DURATION(0));
len := len + 1;
ret.data(ind+len) := std_logic_vector(PARTICIPANT_LEASE_DURATION(1));
end if;
-- AVAILABLE ENDPOINTS
len := len + 1;
ret.data(ind+len) := PID_BUILTIN_ENDPOINT_SET & std_logic_vector(to_unsigned(4, 16));
len := len + 1;
ret.data(ind+len) := (DISC_BUILTIN_ENDPOINT_PARTICIPANT_ANNOUNCER => '1', DISC_BUILTIN_ENDPOINT_PARTICIPANT_DETECTOR => '1', BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_WRITER => '1', BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_READER => '1', others => '0');
if (NUM_READERS > 0) then
ret.data(ind+len)(DISC_BUILTIN_ENDPOINT_PUBLICATIONS_DETECTOR) := '1';
ret.data(ind+len)(DISC_BUILTIN_ENDPOINT_SUBSCRIPTIONS_ANNOUNCER):= '1';
end if;
if (NUM_WRITERS > 0) then
ret.data(ind+len)(DISC_BUILTIN_ENDPOINT_PUBLICATIONS_ANNOUNCER) := '1';
ret.data(ind+len)(DISC_BUILTIN_ENDPOINT_SUBSCRIPTIONS_DETECTOR) := '1';
end if;
-- MANUAL LIVELINESS COUNT
len := len + 1;
ret.data(ind+len) := PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT & std_logic_vector(to_unsigned(4, 16));
len := len + 1;
ret.data(ind+len) := (others => '0');
-- SENTINEL
len := len + 1;
ret.data(ind+len) := PID_SENTINEL & std_logic_vector(to_unsigned(0, 16));
-- Store Length
ret.length := ind + len + 1;
return ret;
end function;
constant PARTICIPANT_DATA : OUTPUT_DATA_TYPE := gen_participant_data;
-- Returns the 'data' argument either as is, or with reversed Byte order, depending on the
-- 'is_little_endian' argument.
function big_endian_swap(is_little_endian : std_logic; data : std_logic_vector) return std_logic_vector is
variable ret : std_logic_vector(data'range);
begin
-- Assert that Data Signal is Byte aligned
assert (data'length mod 8 = 0) severity failure;
-- Little Endian
if (is_little_endian = '1') then
-- Reverse byte Order
for i in 0 to (data'length/8)-1 loop
ret(i*8+8-1 downto i*8) := data(((data'length/8)-1-i)*8+8-1 downto ((data'length/8)-1-i)*8);
end loop;
-- Big Endian
else
ret := data;
end if;
return ret;
end function;
-- Returns the 'data' argument either as is, or with reversed Byte order, depending on the
-- 'is_little_endian' argument.
function big_endian_swap(is_little_endian : std_logic; data : unsigned) return unsigned is
begin
return unsigned(big_endian_swap(is_little_endian, std_logic_vector(data)));
end function;
end package body;

View File

@ -4,6 +4,8 @@ use ieee.numeric_std.all;
use work.math_pkg.all;
use work.rtps_package.all;
use work.user_config.all;
use work.rtps_config_package.all;
-- Checksum has to be checked before
-- TODO: Change "endian-swap" to "big-endian" throughout
@ -14,13 +16,13 @@ entity rtps_handler is
reset : in std_logic; -- Synchronous Reset
empty : in std_logic; -- Input FIFO empty flag
rd : out std_logic; -- Input FIFO read signal
data_in : in std_logic_vector(31 downto 0); -- Input FIFO data signal
builtin_output : out std_logic_vector(31 downto 0); -- Output FIFO (Built-In Endpoint) data signal
data_in : in std_logic_vector(WORD_WIDTH-1 downto 0); -- Input FIFO data signal
builtin_output : out std_logic_vector(WORD_WIDTH-1 downto 0); -- Output FIFO (Built-In Endpoint) data signal
builtin_full : in std_logic; -- Output FIFO (Built-In Endpoint) full signal
builtin_wr : out std_logic; -- Output FIFO (Built-In Endpoint) write signal
user_output : out std_logic_vector(31 downto 0); -- Output FIFO (User Endpoints) data signal
user_full : in std_logic_vector(0 to MAX_ENDPOINTS-1); -- Output FIFO (User Endpoints) full signal
user_wr : out std_logic_vector(0 to MAX_ENDPOINTS-1); -- Output FIFO (User Endpoints) write signal
user_output : out std_logic_vector(WORD_WIDTH-1 downto 0); -- Output FIFO (User Endpoints) data signal
user_full : in std_logic_vector(0 to NUM_ENDPOINTS-1); -- Output FIFO (User Endpoints) full signal
user_wr : out std_logic_vector(0 to NUM_ENDPOINTS-1); -- Output FIFO (User Endpoints) write signal
last_word_out : out std_logic -- Output FIFO Last Word signal
);
end entity;
@ -75,29 +77,29 @@ architecture arch of rtps_handler is
-- Signal used to reset the word counter
signal reset_read_cnt : std_logic;
-- 4-Byte Word counter (Counts words read from input FIFO)
signal read_cnt : unsigned(13 downto 0) := (others => '0');
signal read_cnt : unsigned(UDP_HEADER_LENGTH_WIDTH-3 downto 0) := (others => '0');
-- Total packet length (4-Byte Words)
signal packet_length, packet_length_next : unsigned(13 downto 0) := (others => '0');
signal packet_length, packet_length_next : unsigned(UDP_HEADER_LENGTH_WIDTH-3 downto 0) := (others => '0');
-- End of Submessage from the beginning of the UDP Packet in Bytes
signal sub_end, sub_end_next : unsigned(15 downto 0) := (others => '0');
signal sub_end, sub_end_next : unsigned(SUBMESSAGE_LENGTH_WIDTH-1 downto 0) := (others => '0');
-- End of DATA Submessage Sub-Header (Beginning of inlineQoS/Payload) from the beginning of the UDP Packet in Bytes
signal data_header_end, data_header_end_next : unsigned(15 downto 0) := (others => '0');
signal data_header_end, data_header_end_next : unsigned(SUBMESSAGE_LENGTH_WIDTH-1 downto 0) := (others => '0');
-- Input Signal Latch. Used to read 4-Byte aligned from input (see align_prc)
signal align_sig, align_sig_next : std_logic_vector(23 downto 0) := (others => '0');
signal align_sig, align_sig_next : std_logic_vector((3*BYTE_WIDTH)-1 downto 0) := (others => '0');
-- 4-Byte Aligned Input (see align_prc)
signal data_in_aligned : std_logic_vector(31 downto 0);
signal data_in_aligned : std_logic_vector(WORD_WIDTH-1 downto 0);
-- 4-Byte Alignement offset (see align_prc)
signal align_offset, align_offset_next : std_logic_vector(1 downto 0) := (others => '0');
-- 4-Byte Alignement offset latch
signal offset_latch, offset_latch_next : std_logic_vector(1 downto 0) := (others => '0');
-- IPv4 Source Address latch
signal src_addr, src_addr_next : std_logic_vector(31 downto 0) := (others => '0');
signal src_addr, src_addr_next : std_logic_vector(IPv4_ADDRESS_WIDTH-1 downto 0) := (others => '0');
-- UDP Source Port latch
signal src_port, src_port_next : std_logic_vector(15 downto 0) := (others => '0');
signal src_port, src_port_next : std_logic_vector(UDP_PORT_WIDTH-1 downto 0) := (others => '0');
-- Denotes if processed Message is Metatraffic
signal is_metatraffic, is_metatraffic_next : std_logic := '0';
-- RTPS Submessage Flag latch
signal flags, flags_next : std_logic_vector(7 downto 0) := (others => '0');
signal flags, flags_next : std_logic_vector(SUBMESSAGE_FLAGS_WIDTH-1 downto 0) := (others => '0');
-- Reader Entity ID latch
signal reader_entityid, reader_entityid_next : std_logic_vector(ENTITYID_WIDTH-1 downto 0) := (others => '0');
-- Writer Entity ID latch
@ -105,18 +107,18 @@ architecture arch of rtps_handler is
-- Source GUID Prefix latch
signal src_guidprefix, src_guidprefix_next : GUIDPREFIX_TYPE := (others => (others => '0'));
-- Vector denoting the Destination User Endpoints of the Message
signal user_endpoint, user_endpoint_next : std_logic_vector(0 to MAX_ENDPOINTS-1) := (others => '0');
signal user_endpoint, user_endpoint_next : std_logic_vector(0 to NUM_ENDPOINTS-1) := (others => '0');
-- Denotes if the Message is destined for the Built-in Endpoints
signal builtin_endpoint, builtin_endpoint_next : std_logic := '0';
-- numLocator latch
-- NOTE: Since Submessages are limited to 2^16 Bytes, we can limit this also to 16 bits
signal numlocators, numlocators_next : unsigned(15 downto 0) := (others => '0');
signal numlocators, numlocators_next : unsigned(SUBMESSAGE_LENGTH_WIDTH-1 downto 0) := (others => '0');
-- Denotes if a suitable Locator has been found
signal locator_match, locator_match_next : std_logic := '0';
-- Denotes if the Source of the Message is a Reader Endpoint
signal src_is_reader, src_is_reader_next : std_logic := '0';
-- Intermediate Output Data Signal
signal output_sig : std_logic_vector(31 downto 0) := (others => '0');
signal output_sig : std_logic_vector(WORD_WIDTH-1 downto 0) := (others => '0');
-- Intermediate Write Enable Signal
signal wr_sig : std_logic := '0';
-- Submessage ID latch (Used as OPCODE by Endpoints)
@ -127,13 +129,13 @@ architecture arch of rtps_handler is
-- TODO: Recheck range
signal cnt, cnt_next : natural range 0 to 8 := 0;
-- Input in Big Endian representation
signal data_in_swapped : std_logic_vector(31 downto 0) := (others => '0');
signal data_in_swapped : std_logic_vector(WORD_WIDTH-1 downto 0) := (others => '0');
-- Sequence Number latch
signal seq_nr, seq_nr_next : DOUBLE_WORD_ARRAY := (others => (others => '0'));
signal seq_nr, seq_nr_next : SEQUENCE_NR_TYPE := (others => (others => '0'));
-- Indicates the Destination IP Address
signal ip_addr_type, ip_addr_type_next : IPv4_ADDRESS_TYPE := INVALID;
-- Alias "substitution"
signal rtps_sub_length, rtps_sub_data_length : unsigned(15 downto 0) := (others => '0');
signal rtps_sub_length, rtps_sub_data_length : unsigned(SUBMESSAGE_LENGTH_WIDTH-1 downto 0) := (others => '0');
--*****ALIAS DEFINATION*****
-- UDP HEADER
@ -148,7 +150,7 @@ architecture arch of rtps_handler is
alias rtps_sub_id : std_logic_vector(7 downto 0) is data_in(31 downto 24);
alias rtps_sub_flags : std_logic_vector(7 downto 0) is data_in(23 downto 16);
-- Apparently illegal alias expression
--alias rtps_sub_length : unsigned(15 downto 0) is unsigned(endian_swap(rtps_sub_flags(0), data_in(15 downto 0)));
--alias rtps_sub_length : unsigned(15 downto 0) is unsigned(big_endian_swap(rtps_sub_flags(0), data_in(15 downto 0)));
-- RTPS SUBMESSAGE FLAGS
alias rtps_sub_endianness : std_logic is flags(0);
alias rtps_sub_multicast : std_logic is flags(1);
@ -158,7 +160,7 @@ architecture arch of rtps_handler is
alias rtps_sub_key : std_logic is flags(3);
-- RTPS DATA SUBMESSAGE HEADER
-- Apparently illegal alias expression
--alias rtps_sub_data_length : unsigned(15 downto 0) is unsigned(endian_swap(rtps_sub_endianness, data_in(15 downto 0)));
--alias rtps_sub_data_length : unsigned(15 downto 0) is unsigned(big_endian_swap(rtps_sub_endianness, data_in(15 downto 0)));
--*****FUNCTION DECLARATION*****
@ -177,10 +179,10 @@ architecture arch of rtps_handler is
begin
-- ALIAS SUBSTITUTION
rtps_sub_length <= unsigned(endian_swap(rtps_sub_flags(0), data_in(15 downto 0)));
rtps_sub_length <= unsigned(big_endian_swap(rtps_sub_flags(0), data_in(15 downto 0)));
-- NOTE: While "rtps_sub_length" has to use the flag directly form the "data_in" signal to determine Endianness, here the
-- "flags" signal is already valid (and thus also its aliases)
rtps_sub_data_length <= unsigned(endian_swap(rtps_sub_endianness, data_in(15 downto 0)));
rtps_sub_data_length <= unsigned(big_endian_swap(rtps_sub_endianness, data_in(15 downto 0)));
rd <= rd_sig;
@ -265,7 +267,7 @@ begin
-- SKIP_SUB Skip rest of Submessage
-- SKIP_PACKET Skip rest of UDP Packet
parse_prc: process(all)
variable tmp : std_logic_vector(0 to MAX_ENDPOINTS-1) := (others => '0');
variable tmp : std_logic_vector(0 to NUM_ENDPOINTS-1) := (others => '0');
variable dest : std_logic_vector(ENTITYID_WIDTH-1 downto 0) := (others => '0');
begin
--DEFAULT Registered
@ -717,7 +719,7 @@ begin
-- We only store UDPv4 Locators
if (locator_match = '1') then
-- We only store valid Locators
if (data_in_swapped = (data_in_swapped'reverse_range => '0')) then
if (data_in_swapped(UDP_PORT_INVALID'range) = UDP_PORT_INVALID) then
locator_match_next <= '0';
else
src_port_next <= data_in_swapped(src_port_next'length-1 downto 0);
@ -735,7 +737,7 @@ begin
-- Locator Address 4/4 (IPv4 Address)
when 5 =>
-- We only store valid UDPv4 Locators
if (locator_match = '1' and data_in_swapped /= (data_in_swapped'reverse_range => '0')) then
if (locator_match = '1' and data_in_swapped /= IPv4_ADDRESS_INVALID) then
src_addr_next <= data_in_swapped;
-- Extract only first matching Locator and ignore the rest
stage_next <= SKIP_SUB;
@ -758,7 +760,7 @@ begin
-- IPv4 Address
when 0 =>
-- Store only valid Locators
if (data_in_swapped = (data_in_swapped'reverse_range => '0')) then
if (data_in_swapped = IPv4_ADDRESS_INVALID) then
locator_match_next <= '0';
else
locator_match_next <= '1';
@ -767,7 +769,7 @@ begin
-- UDPv4 Port
when 1 =>
-- Store only valid Locators
if (locator_match = '1' and data_in_swapped /= (data_in_swapped'reverse_range => '0')) then
if (locator_match = '1' and data_in_swapped(UDP_PORT_INVALID'range) /= UDP_PORT_INVALID) then
src_port_next <= data_in_swapped(src_port_next'length-1 downto 0);
stage_next <= SKIP_SUB;
-- Parse Multicast if available

File diff suppressed because it is too large Load Diff

View File

@ -14,12 +14,14 @@ entity test is
clk : in std_logic; -- Input Clock
reset : in std_logic; -- Synchronous Reset
input : in std_logic_vector(31 downto 0);
cnt : out natural range 0 to MAX_ENDPOINTS
cnt : out natural range 0 to NUM_ENDPOINTS
);
end entity;
architecture arch of test is
signal test_var : natural := 0;
-- Compares argument 'ref' with every element of 'ar', and returns the index of the last match.
-- If no match is found, array length is returned.
function match_id_endpoint (ref : std_logic_vector(ENTITYID_WIDTH-1 downto 0); ar : ENTITYID_TYPE) return natural is
@ -38,7 +40,10 @@ begin
process(all)
begin
cnt <= match_id_endpoint(input, ENTITYID);
cnt <= 0;
if (test_var < to_unsigned(input)) then
cnt <= match_id_endpoint(input, ENTITYID);
end if;
end process;

View File

@ -3,6 +3,7 @@ use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
package test_package is
--generic( generic_var : natural := 1 );
-- Number of Domains
constant NUM_DOMAIN : integer := 1;
@ -23,6 +24,8 @@ package test_package is
type DOMAIN_ID_TYPE is array (NUM_DOMAIN-1 downto 0) of std_logic_vector(DOMAIN_ID_WIDTH-1 downto 0);
type TEST_ARRAY is array (natural range <>) of string(1 to 256);
function gen_domain_ids (user_id : USER_DOMAIN_ID_TYPE) return DOMAIN_ID_TYPE;

123
src/user_config.vhd Normal file
View File

@ -0,0 +1,123 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.rtps_package.all;
package user_config is
--*****USER CONFIG*****
-- NOTE: All strings have to be padded to 256 characters
-- Unicast IPv4 Address used by all RTPS Entities [Default 192.168.0.80]
constant DEFAULT_IPv4_ADDRESS : std_logic_vector(IPv4_ADDRESS_WIDTH-1 downto 0) := x"C0A80080";
-- Number of RTPS Writer Endpoints
constant NUM_WRITERS : natural := 0;
-- Number of RTPS Reader Endpoints
constant NUM_READERS : natural := 1;
-- Number of RTPS Endpoints (Do not modify)
constant NUM_ENDPOINTS : natural := NUM_READERS+NUM_WRITERS;
-- PB Value of Default Port Generation (see DDSI-RTPS 2.3 Section 9.6.1)
constant PORT_CONFIG_PB : natural := 7400;
-- DG Value of Default Port Generation (see DDSI-RTPS 2.3 Section 9.6.1)
constant PORT_CONFIG_DG : natural := 250;
-- PG Value of Default Port Generation (see DDSI-RTPS 2.3 Section 9.6.1)
constant PORT_CONFIG_PG : natural := 2;
-- D0 Value of Default Port Generation (see DDSI-RTPS 2.3 Section 9.6.1)
constant PORT_CONFIG_D0 : natural := 0;
-- D1 Value of Default Port Generation (see DDSI-RTPS 2.3 Section 9.6.1)
constant PORT_CONFIG_D1 : natural := 10;
-- D2 Value of Default Port Generation (see DDSI-RTPS 2.3 Section 9.6.1)
constant PORT_CONFIG_D2 : natural := 1;
-- D3 Value of Default Port Generation (see DDSI-RTPS 2.3 Section 9.6.1)
constant PORT_CONFIG_D3 : natural := 11;
-- MAC Address of underlying network stack (Used to generate GUIDs)
constant MAC_ADDRESS : std_logic_vector(47 downto 0) := x"97917E0BA8CF";
-- Domain ID
constant USER_DOMAIN_ID : natural := 1;
-- Domain TAG
constant USER_DOMAIN_TAG : string(1 to 256) := (others => NUL); --""
--***RTPS ENDPOINTS***
-- Array denoting if Endpoints use Keyed Topics
constant ENDPOINT_WITH_KEY : USER_BOOLEAN_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => FALSE);
-- Array mapping Topic Names to Endpoints
constant ENDPOINT_TOPIC_STRING : USER_STRING_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (0 => "Placeholder" & (12 to 256 => NUL));
-- Array mapping Type Names to Endpoints
constant ENDPOINT_TYPE_STRING : USER_STRING_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (0 => "Placeholder" & (12 to 256 => NUL));
-- *TIMING CHARACTERISTICS*
-- Timing Characteristics for Participant
constant PARTICIPANT_ANNOUNCEMENT_PERIOD : DURATION_TYPE := gen_duration(30,0); -- 30 s
constant PARTICIPANT_LEASE_DURATION : DURATION_TYPE := DEFAULT_PARTICIPANT_LEASE_DURATION;
-- Denotes how much faster then the deadline/period we schedule in order to account for transport delay.
constant DURATION_DELTA : DURATION_TYPE := gen_duration(0, 100*(10**6)); -- 100 ms
-- Timing Characteristics for built-in Endpoints
constant PARTICIPANT_HEARTBEAT_PERIOD : DURATION_TYPE := gen_duration(1,0); -- 1 s
constant PARTICIPANT_HEARTBEAT_RESPONSE_DELAY : DURATION_TYPE := gen_duration(0,500*(10**6)); -- 500 ms
constant PARTICIPANT_HEARTBEAT_SUPPRESSION_DELAY : DURATION_TYPE := gen_duration(0,0);
constant PARTICIPANT_ACKNACK_RESPONSE_DELAY : DURATION_TYPE := gen_duration(3,200*(10**6)); -- 200 ms
constant PARTICIPANT_ACKNACK_SUPPRESSION_DELAY : DURATION_TYPE := gen_duration(0,0);
-- Array mapping Timing Characteristics to Endpoints
constant ENDPOINT_HEARTBEAT_PERIOD : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => gen_duration(1,0)); -- 1 s
constant ENDPOINT_HEARTBEAT_RESPONSE_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => gen_duration(0,500*(10**6))); -- 500 ms
constant ENDPOINT_HEARTBEAT_SUPPRESSION_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => gen_duration(0,0));
constant ENDPOINT_ACKNACK_RESPONSE_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => gen_duration(3,200*(10**6))); -- 200 ms
constant ENDPOINT_ACKNACK_SUPPRESSION_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => gen_duration(0,0));
--***ENDPOINT DDS QOS***
-- Array mapping DURABILITY QoS to Endpoints
constant ENDPOINT_DURABILITY_QOS : USER_ENUMERATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_QOS);
constant ENDPOINT_DURABILITY_SERVICE_CLEANUP_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_CLEANUP_DELAY);
constant ENDPOINT_DURABILITY_SERVICE_HISTORY : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_HISTORY);
constant ENDPOINT_DURABILITY_SERVICE_HISTORY_DEPTH : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_HISTORY_DEPTH);
constant ENDPOINT_DURABILITY_SERVICE_MAX_SAMPLES : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_MAX_SAMPLES);
constant ENDPOINT_DURABILITY_SERVICE_MAX_INSTANCES : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_MAX_INSTANCES);
constant ENDPOINT_DURABILITY_SERVICE_MAX_SAMPLES_PER_INSTANCE : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_MAX_SAMPLES_PER_INSTANCE);
-- Array mapping PRESENTATION QoS to Endpoints
constant ENDPOINT_PRESENTATION_QOS : USER_ENUMERATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_PRESENTATION_QOS);
constant ENDPOINT_COHERENT_ACCESS : USER_BOOLEAN_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_COHERENT_ACCESS);
constant ENDPOINT_ORDERED_ACCESS : USER_BOOLEAN_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_ORDERED_ACCESS);
-- Array mapping DEADLINE QoS to Endpoints
constant ENDPOINT_DEADLINE_QOS : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DEADLINE_QOS);
-- Array mapping LATENCY_BUDGET QoS to Endpoints
constant ENDPOINT_LATENCY_BUDGET_QOS : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_LATENCY_BUDGET_QOS);
-- Array mapping OWNERSHIP QoS to Endpoints
constant ENDPOINT_OWNERSHIP_QOS : USER_ENUMERATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_OWNERSHIP_QOS);
-- Array mapping OWNERSHIP_STRENGTH QoS to Endpoints (Only relevant to Writers)
constant ENDPOINT_OWNERSHIP_STRENGTH_QOS : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_OWNERSHIP_STRENGTH_QOS);
-- Array mapping LIVELINESS QoS to Endpoints
constant ENDPOINT_LIVELINESS_QOS : USER_ENUMERATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_LIVELINESS_QOS);
constant ENDPOINT_LEASE_DURATION : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_LEASE_DURATION);
-- Array mapping TIME_BASED_FILTER QoS to Endpoints (Only relevant to Readers)
constant ENDPOINT_TIME_BASED_FILTER_QOS : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_TIME_BASED_FILTER_QOS);
-- XXX: PARTITION QoS Ignored
-- Array mapping RELIABILITY QoS to Endpoints
constant ENDPOINT_RELIABILITY_QOS : USER_ENUMERATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_RELIABILTY_QOS);
-- (Only relevant to Writers)
constant ENDPOINT_MAX_BLOCKING_TIME : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_MAX_BLOCKING_TIME);
-- Array mapping TRANSPORT_PRIORITY QoS to Endpoints (Only relevant to Writers)
constant ENDPOINT_TRANSPORT_PRIORITY_QOS : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_TRANSPORT_PRIORITY_QOS);
-- Array mapping LIFESPAN QoS to Endpoints (Only relevant to Writers)
constant ENDPOINT_LIFESPAN_QOS : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_LIFESPAN_QOS);
-- Array mapping DESTINATION_ORDER QoS to Endpoints
constant ENDPOINT_DESTINATION_ORDER_QOS : USER_ENUMERATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DESTINATION_ORDER_QOS);
-- Array mapping HISTORY QoS to Endpoints
constant ENDPOINT_HISTORY_QOS : USER_ENUMERATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_HISTORY_QOS);
constant ENDPOINT_HISTORY_DEPTH : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_HISTORY_DEPTH);
-- Array mapping RESOURCE_LIMITS QoS to Endpoints
constant ENDPOINT_MAX_SAMPLES : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_MAX_SAMPLES);
constant ENDPOINT_MAX_INSTANCES : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_MAX_INSTANCES);
constant ENDPOINT_MAX_SAMPLES_PER_INSTANCE : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_MAX_SAMPLES_PER_INSTANCE);
-- XXX: ENTITY_FACTORY QoS Ignored
-- Array mapping WRITER_DATA_LIFECYCLE QoS to Endpoints (Only relevant to Writers)
constant ENDPOINT_AUTODISPOSE_UNREGISTERED_INSTANCES : USER_BOOLEAN_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_AUTODISPOSE_UNREGISTERED_INSTANCES);
-- Array mapping Reader_DATA_LIFECYCLE QoS to Endpoints (Only relevant to Readers)
constant ENDPOINT_AUTOPURGE_NOWRITER_SAMPLES_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_AUTOPURGE_NOWRITER_SAMPLES_DELAY);
constant ENDPOINT_AUTOPURGE_DISPOSED_SAMPLES_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_AUTOPURGE_DISPOSED_SAMPLES_DELAY);
-- NOTE: The buffer will not only store participants, but also endpoint data
-- Used to determine the size of the builtin endpoint buffer
constant MAX_REMOTE_PARTICIPANTS : natural := 50;
end package;

View File

@ -1,8 +1,8 @@
# -------------------------------------------------------------------------- #
#
# Copyright (C) 2018 Intel Corporation. All rights reserved.
# Copyright (C) 2020 Intel Corporation. All rights reserved.
# Your use of Intel Corporation's design tools, logic functions
# and other software and tools, and its AMPP partner logic
# and other software and tools, and any partner logic
# functions, and any output files from any of the foregoing
# (including device programming or simulation files), and any
# associated documentation or information are expressly subject
@ -12,13 +12,14 @@
# agreement, including, without limitation, that your use is for
# the sole purpose of programming logic devices manufactured by
# Intel and sold by Intel or its authorized distributors. Please
# refer to the applicable agreement for further details.
# refer to the applicable agreement for further details, at
# https://fpgasoftware.intel.com/eula.
#
# -------------------------------------------------------------------------- #
#
# Quartus Prime
# Version 18.1.0 Build 625 09/12/2018 SJ Lite Edition
# Date created = 12:05:11 May 29, 2020
# Version 20.1.0 Build 711 06/05/2020 SJ Lite Edition
# Date created = 13:33:09 November 02, 2020
#
# -------------------------------------------------------------------------- #
#
@ -37,24 +38,22 @@
set_global_assignment -name FAMILY "Cyclone V"
set_global_assignment -name DEVICE 5CSEBA6U23I7
set_global_assignment -name TOP_LEVEL_ENTITY test
set_global_assignment -name ORIGINAL_QUARTUS_VERSION 18.1.0
set_global_assignment -name PROJECT_CREATION_TIME_DATE "12:05:11 MAY 29, 2020"
set_global_assignment -name LAST_QUARTUS_VERSION "18.1.0 Lite Edition"
set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files
set_global_assignment -name MIN_CORE_JUNCTION_TEMP "-40"
set_global_assignment -name MAX_CORE_JUNCTION_TEMP 100
set_global_assignment -name ERROR_CHECK_FREQUENCY_DIVISOR 256
set_global_assignment -name DEVICE 5CGXFC7C7F23C8
set_global_assignment -name TOP_LEVEL_ENTITY rtps_builtin_endpoint
set_global_assignment -name ORIGINAL_QUARTUS_VERSION 20.1.0
set_global_assignment -name PROJECT_CREATION_TIME_DATE "13:33:09 NOVEMBER 02, 2020"
set_global_assignment -name LAST_QUARTUS_VERSION "20.1.0 Lite Edition"
set_global_assignment -name VHDL_FILE ../../src/user_config.vhd -hdl_version VHDL_2008
set_global_assignment -name VHDL_FILE ../../src/single_port_ram.vhd -hdl_version VHDL_2008
set_global_assignment -name VHDL_FILE ../../src/rtps_package.vhd -hdl_version VHDL_2008
set_global_assignment -name VHDL_FILE ../../src/rtps_handler.vhd -hdl_version VHDL_2008
set_global_assignment -name VHDL_FILE ../../src/rtps_config_package.vhd -hdl_version VHDL_2008
set_global_assignment -name VHDL_FILE ../../src/rtps_builtin_endpoint.vhd -hdl_version VHDL_2008
set_global_assignment -name VHDL_FILE ../../src/math_pkg.vhd -hdl_version VHDL_2008
set_global_assignment -name MIN_CORE_JUNCTION_TEMP 0
set_global_assignment -name MAX_CORE_JUNCTION_TEMP 85
set_global_assignment -name POWER_PRESET_COOLING_SOLUTION "23 MM HEAT SINK WITH 200 LFPM AIRFLOW"
set_global_assignment -name POWER_BOARD_THERMAL_MODEL "NONE (CONSERVATIVE)"
set_global_assignment -name VHDL_FILE ../../src/rtps_handler.vhd -hdl_version VHDL_2008
set_global_assignment -name VHDL_FILE ../../src/single_port_ram.vhd -hdl_version VHDL_2008
set_global_assignment -name VHDL_FILE ../../src/rtps_builtin_endpoint.vhd -hdl_version VHDL_2008
set_global_assignment -name VHDL_FILE ../../src/rtps_package.vhd -hdl_version VHDL_2008
set_global_assignment -name VHDL_FILE ../../src/test_package.vhd -hdl_version VHDL_2008
set_global_assignment -name VHDL_FILE ../../src/test.vhd -hdl_version VHDL_2008
set_global_assignment -name VHDL_FILE ../../src/math_pkg.vhd -hdl_version VHDL_2008
set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top
set_global_assignment -name PARTITION_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top
set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top

View File

@ -73,16 +73,28 @@
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/../../src/test_package.vhd">
<FileInfo SFType="VHDL2008">
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/../../src/test.vhd">
<FileInfo SFType="VHDL2008">
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/../../src/rtps_handler.vhd">
<FileInfo SFType="VHDL2008">
<Attr Name="AutoDisabled" Val="1"/>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<Config>
<Option Name="DesignMode" Val="RTL"/>
<Option Name="TopModule" Val="rtps_handler"/>
<Option Name="TopAutoSet" Val="TRUE"/>
<Option Name="TopModule" Val="test"/>
</Config>
</FileSet>
<FileSet Name="constrs_1" Type="Constrs" RelSrcDir="$PSRCDIR/constrs_1">
@ -98,6 +110,7 @@
</Config>
</FileSet>
<FileSet Name="sim_1" Type="SimulationSrcs" RelSrcDir="$PSRCDIR/sim_1">
<Filter Type="Srcs"/>
<Config>
<Option Name="DesignMode" Val="RTL"/>
<Option Name="TopModule" Val="rtps_handler"/>
@ -136,9 +149,7 @@
<Runs Version="1" Minor="10">
<Run Id="synth_1" Type="Ft3:Synth" SrcSet="sources_1" Part="xc7z020clg484-1" ConstrsSet="constrs_1" Description="Vivado Synthesis Defaults" AutoIncrementalCheckpoint="false" WriteIncrSynthDcp="false" State="current" Dir="$PRUNDIR/synth_1" IncludeInArchive="true">
<Strategy Version="1" Minor="2">
<StratHandle Name="Vivado Synthesis Defaults" Flow="Vivado Synthesis 2018">
<Desc>Vivado Synthesis Defaults</Desc>
</StratHandle>
<StratHandle Name="Vivado Synthesis Defaults" Flow="Vivado Synthesis 2018"/>
<Step Id="synth_design"/>
</Strategy>
<GeneratedRun Dir="$PRUNDIR" File="gen_run.xml"/>
@ -147,9 +158,7 @@
</Run>
<Run Id="impl_1" Type="Ft2:EntireDesign" Part="xc7z020clg484-1" ConstrsSet="constrs_1" Description="Default settings for Implementation." AutoIncrementalCheckpoint="false" WriteIncrSynthDcp="false" State="current" Dir="$PRUNDIR/impl_1" SynthRun="synth_1" IncludeInArchive="true" GenFullBitstream="true">
<Strategy Version="1" Minor="2">
<StratHandle Name="Vivado Implementation Defaults" Flow="Vivado Implementation 2018">
<Desc>Default settings for Implementation.</Desc>
</StratHandle>
<StratHandle Name="Vivado Implementation Defaults" Flow="Vivado Implementation 2018"/>
<Step Id="init_design"/>
<Step Id="opt_design"/>
<Step Id="power_opt_design"/>