* Add FWFT FIFO

* Added rtps_builtin_endpoint_test7 Level 1 testbench
	- Compiling and Passing
* Various Bug Fixes in rtps_builtin_endpoint
This commit is contained in:
Greek 2020-12-06 17:26:15 +01:00
parent 035ff837b0
commit 0f50e66942
12 changed files with 1564 additions and 255 deletions

View File

@ -0,0 +1,81 @@
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate -divider SYSTEM
add wave -noupdate /rtps_builtin_endpoint_test7/uut/clk
add wave -noupdate /rtps_builtin_endpoint_test7/uut/reset
add wave -noupdate -divider INPUT
add wave -noupdate /rtps_builtin_endpoint_test7/uut/empty
add wave -noupdate /rtps_builtin_endpoint_test7/uut/rd
add wave -noupdate -radix hexadecimal /rtps_builtin_endpoint_test7/uut/data_in
add wave -noupdate /rtps_builtin_endpoint_test7/uut/last_word_in
add wave -noupdate /rtps_builtin_endpoint_test7/uut/last_word_in_latch
add wave -noupdate -radix hexadecimal /rtps_builtin_endpoint_test7/uut/time
add wave -noupdate -divider OUTPUT
add wave -noupdate -radix hexadecimal /rtps_builtin_endpoint_test7/uut/data_out
add wave -noupdate /rtps_builtin_endpoint_test7/uut/last_word_out
add wave -noupdate /rtps_builtin_endpoint_test7/uut/rtps_wr
add wave -noupdate /rtps_builtin_endpoint_test7/uut/rtps_full
add wave -noupdate -divider TESTBENCH
add wave -noupdate /rtps_builtin_endpoint_test7/start
add wave -noupdate /rtps_builtin_endpoint_test7/stim_stage
add wave -noupdate /rtps_builtin_endpoint_test7/stimulus.length
add wave -noupdate /rtps_builtin_endpoint_test7/cnt_stim
add wave -noupdate /rtps_builtin_endpoint_test7/packet_sent
add wave -noupdate -divider {MAIN FSM}
add wave -noupdate /rtps_builtin_endpoint_test7/uut/stage
add wave -noupdate /rtps_builtin_endpoint_test7/uut/stage_next
add wave -noupdate /rtps_builtin_endpoint_test7/uut/cnt
add wave -noupdate -divider {MEM FSM}
add wave -noupdate -expand -group MEM_FSM /rtps_builtin_endpoint_test7/uut/mem_opcode
add wave -noupdate -expand -group MEM_FSM /rtps_builtin_endpoint_test7/uut/mem_op_start
add wave -noupdate -expand -group MEM_FSM /rtps_builtin_endpoint_test7/uut/mem_op_done
add wave -noupdate -expand -group MEM_FSM /rtps_builtin_endpoint_test7/uut/mem_stage
add wave -noupdate -expand -group MEM_FSM /rtps_builtin_endpoint_test7/uut/mem_stage_next
add wave -noupdate -expand -group MEM_FSM /rtps_builtin_endpoint_test7/uut/mem_cnt
add wave -noupdate -expand -group MEM_FSM -radix unsigned /rtps_builtin_endpoint_test7/uut/mem_addr_base
add wave -noupdate -expand -group MEM_FSM -radix unsigned /rtps_builtin_endpoint_test7/uut/addr_res
add wave -noupdate -divider GUARD
add wave -noupdate -radix unsigned /rtps_builtin_endpoint_test7/uut/read_cnt
add wave -noupdate -radix unsigned /rtps_builtin_endpoint_test7/uut/parameter_end
add wave -noupdate /rtps_builtin_endpoint_test7/uut/parse_prc/rd_guard
add wave -noupdate -divider MEMORY
add wave -noupdate -expand -group MEMORY -radix unsigned /rtps_builtin_endpoint_test7/uut/ram_inst/addr
add wave -noupdate -expand -group MEMORY /rtps_builtin_endpoint_test7/uut/ram_inst/wen
add wave -noupdate -expand -group MEMORY /rtps_builtin_endpoint_test7/uut/ram_inst/ren
add wave -noupdate -expand -group MEMORY -radix hexadecimal /rtps_builtin_endpoint_test7/uut/ram_inst/wr_data
add wave -noupdate -expand -group MEMORY -radix hexadecimal /rtps_builtin_endpoint_test7/uut/ram_inst/rd_data
add wave -noupdate -divider MISC
add wave -noupdate /rtps_builtin_endpoint_test7/uut/update_participant_flags
add wave -noupdate -radix unsigned /rtps_builtin_endpoint_test7/uut/seq_nr
add wave -noupdate -group FIFO -radix hexadecimal /rtps_builtin_endpoint_test7/fifo_inst/data_in
add wave -noupdate -group FIFO /rtps_builtin_endpoint_test7/fifo_inst/write
add wave -noupdate -group FIFO /rtps_builtin_endpoint_test7/fifo_inst/full
add wave -noupdate -group FIFO -radix hexadecimal /rtps_builtin_endpoint_test7/fifo_inst/data_out
add wave -noupdate -group FIFO /rtps_builtin_endpoint_test7/fifo_inst/read
add wave -noupdate -group FIFO /rtps_builtin_endpoint_test7/fifo_inst/empty
add wave -noupdate -group RTPS_OUT -radix hexadecimal /rtps_builtin_endpoint_test7/rtps_out_inst/data_in
add wave -noupdate -group RTPS_OUT /rtps_builtin_endpoint_test7/rtps_out_inst/last_word_in
add wave -noupdate -group RTPS_OUT /rtps_builtin_endpoint_test7/rtps_out_inst/rd
add wave -noupdate -group RTPS_OUT /rtps_builtin_endpoint_test7/rtps_out_inst/empty
add wave -noupdate -group RTPS_OUT -radix hexadecimal /rtps_builtin_endpoint_test7/rtps_out_inst/data_out
add wave -noupdate -group RTPS_OUT /rtps_builtin_endpoint_test7/rtps_out_inst/wr
add wave -noupdate -group RTPS_OUT /rtps_builtin_endpoint_test7/rtps_out_inst/full
add wave -noupdate -group RTPS_OUT /rtps_builtin_endpoint_test7/rtps_out_inst/selector
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {Begin {31125000 ps} 1} {Error {50874035 ps} 1} {Cursor {28075000 ps} 0}
quietly wave cursor active 2
configure wave -namecolwidth 149
configure wave -valuecolwidth 144
configure wave -justifyvalue left
configure wave -signalnamewidth 1
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ns
update
WaveRestoreZoom {50582404 ps} {51730746 ps}

67
src/FWFT_FIFO.vhd Normal file
View File

@ -0,0 +1,67 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity FWFT_FIFO is
generic(
FIFO_DEPTH : natural := 2;
DATA_WIDTH : natural := 32
);
port
(
reset : in std_logic;
clk : in std_logic;
data_in : in std_logic_vector(DATA_WIDTH-1 downto 0);
write : in std_logic;
read : in std_logic;
data_out : out std_logic_vector(DATA_WIDTH-1 downto 0);
empty : out std_logic;
full : out std_logic;
free : out natural range 0 to FIFO_DEPTH
);
end entity;
architecture arch of FWFT_FIFO is
-- *TYPE DECLARATIONS*
type FIFO_DATA_ARRAY is array (FIFO_DEPTH-1 downto 0) of std_logic_vector(DATA_WIDTH-1 downto 0);
-- *SIGNAL DECLARATIONS*
signal fifo_data : FIFO_DATA_ARRAY := (others => (others => '0'));
signal free_sig : natural range 0 to FIFO_DEPTH := FIFO_DEPTH;
begin
data_out <= fifo_data(0);
free <= free_sig;
empty <= '1' when (free_sig = FIFO_DEPTH) else '0';
full <= '1' when (free_sig = 0) else '0';
sync : process(clk, reset)
variable free_var : integer range 0 to FIFO_DEPTH;
begin
if(rising_edge(clk)) then
if(reset = '1') then
fifo_data <= (others => (others => '0'));
free_sig <= FIFO_DEPTH;
else
free_var := free_sig;
if(read = '1' and free_var < FIFO_DEPTH ) then
for i in 1 to (FIFO_DEPTH-1) loop
fifo_data(i-1) <= fifo_data(i);
end loop;
fifo_data(FIFO_DEPTH-1) <= (others => '0');
free_var := free_var + 1;
end if;
if(write = '1') then
if(free_var > 0) then
fifo_data(FIFO_DEPTH-free_var) <= data_in;
free_var := free_var - 1;
end if;
end if;
free_sig <= free_var;
end if;
end if;
end process;
end architecture;

View File

@ -24,7 +24,6 @@
* Does a RTPS reader subscribe to more than one Writer (If not using Groups)? * Does a RTPS reader subscribe to more than one Writer (If not using Groups)?
- Yes - Yes
* Since only positive Sequence Numbers are valid, why is the type signed? * Since only positive Sequence Numbers are valid, why is the type signed?
* Replace also Locator? (In order to prevent storing the Locators in multiple Endpoints)
* Store only one locator? Select the first supported multicast? Check for active ping response? Verify with source address? * Store only one locator? Select the first supported multicast? Check for active ping response? Verify with source address?
* What is the purpose of "manualLivelinessCount" in "SPDPdiscoveredParticipantData"? Since the liveliness is asserted by use of "ParticipantMessageData", what is the purpose of also sending an updated "SPDPdiscoveredParticipantData"? (Duplicates is out of the question, since it is not sent with the actual liveliness assertion) * What is the purpose of "manualLivelinessCount" in "SPDPdiscoveredParticipantData"? Since the liveliness is asserted by use of "ParticipantMessageData", what is the purpose of also sending an updated "SPDPdiscoveredParticipantData"? (Duplicates is out of the question, since it is not sent with the actual liveliness assertion)
* What does that mean?: * What does that mean?:
@ -56,6 +55,7 @@
* If a DATA Submessage is invalid in any way, the Sequence Number is never marked as received, and thus processing of remote Endpoints could stall on corrupt Messages. * If a DATA Submessage is invalid in any way, the Sequence Number is never marked as received, and thus processing of remote Endpoints could stall on corrupt Messages.
* If we have a memory collision during an Endpoint insertion, the Sequence Number anouncing the Endpoint is marked as processed, * If we have a memory collision during an Endpoint insertion, the Sequence Number anouncing the Endpoint is marked as processed,
but the endpoint will never be inserted even when later on there is memory space (Except if the endpoint send a DATA message we a newer Sequence Number) but the endpoint will never be inserted even when later on there is memory space (Except if the endpoint send a DATA message we a newer Sequence Number)
* Can a Participant unmatch an Endpoint by marking it's announcing sequence number in a GAP message?
* Fast-RTPS doen not follow DDSI-RTPS Specification * Fast-RTPS doen not follow DDSI-RTPS Specification
- Open Github Issue - Open Github Issue
@ -127,6 +127,13 @@ DESIGN DECISIONS
Since META traffic is not supposed to be generated as often , this should not produce any significant overhead. Since META traffic is not supposed to be generated as often , this should not produce any significant overhead.
As optimization, on new matched remote endpoints UNMATCH frames can be ignored. As optimization, on new matched remote endpoints UNMATCH frames can be ignored.
* The HEARTBEATs are sent out together with the liveliness assertions. This adds a 96-Byte overhead to the output RTPS Message.
This was done to prevent having to loop through the memory to find remote participant destination more than once.
* The Publisher, Subscriber, and Message Data is written on separate RTPS Messages, even though they are sent simutanously.
This decision was made to support as many local Endpoints as possible. We could make a compile-time if check and sent them in
the same RTPS Message/UDP Packet, but the overhead is quite small and not worth the hassle.
PROTOCOL UNCOMPLIANCE PROTOCOL UNCOMPLIANCE
===================== =====================
* Partition QoS * Partition QoS

View File

@ -199,7 +199,7 @@ begin
reset <= '0'; reset <= '0';
-- *PARTICIPANT* -- *PARTICIPANT*
Log("Current Time 0s", INFO); Log("Current Time: 0s", INFO);
Log("Match Participant 0 [Default Lease 100s]", INFO); Log("Match Participant 0 [Default Lease 100s]", INFO);
sub.writerSN := p_sn; sub.writerSN := p_sn;
participant := p0; participant := p0;
@ -253,7 +253,7 @@ begin
push_participant_reference; push_participant_reference;
SB_mem.Push(gen_participant_mem_frame(participant)); SB_mem.Push(gen_participant_mem_frame(participant));
Log("Current Time 15 s", INFO); Log("Current Time: 15 s", INFO);
start_test; start_test;
-- Progress Time (15 s) -- Progress Time (15 s)
test_time <= (unsigned(int(15, CDR_LONG_WIDTH)), unsigned(int(0, CDR_LONG_WIDTH))); test_time <= (unsigned(int(15, CDR_LONG_WIDTH)), unsigned(int(0, CDR_LONG_WIDTH)));
@ -262,7 +262,7 @@ begin
start_test; start_test;
wait_on_complete; wait_on_complete;
Log("Current Time 101 s", INFO); Log("Current Time: 101 s", INFO);
test_time <= (unsigned(int(101, CDR_LONG_WIDTH)), unsigned(int(0, CDR_LONG_WIDTH))); test_time <= (unsigned(int(101, CDR_LONG_WIDTH)), unsigned(int(0, CDR_LONG_WIDTH)));
participant := p0; participant := p0;

View File

@ -0,0 +1,995 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
library osvvm; -- Utility Library
context osvvm.OsvvmContext;
use work.rtps_package.all;
use work.user_config.all;
use work.rtps_config_package.all;
use work.rtps_test_package.all;
-- This testbench tests the rtps output of the builtin endpoint.
-- This test is a Level 1 Test (Meaning the input/output is not connected directly to the uut) in order to have output in the msae format as the input of the system and allow us to compare using existing data generators.
-- The testflow is as follows:
-- * 0s
-- - Match a remote participant
-- - Send HEARTBEAT 0 (Publisher, Empty, Final Flag) [Test Final Flag pasing]
-- * 0.105s
-- - No HEARTBEAT 0 Response
-- - Send HEARTBEAT 1 (Publisher, Empty) [Test empty HEARTBEAT Response]
-- - Send HEARTBEAT 2 (Subscriber, Empty, Final Flag) [Should not change anything, since ACKNACKs are sent in unison, and an ACKNACK is already scheduled]
-- - Send ACKNACK 1 (Message, Expecting SN 1) [Test normal ACKNACK Response]
-- * 0.210s
-- - HEARTBEAT 1 Response [All ACKNACKs sent]
-- - Liveliness of local Writer 4 (with MANUAL_BY_PARTICIPANT Liveliness QOS) is asserted for 1 clock cycle [Test manual liveliness assertion]
-- * 0.310s
-- - ACKNACK 1 Response
-- - Send HEARTBEAT 3 (Publisher, First SN 1, Last SN 5) [Test HEARTBEAT Suppression Delay]
-- * 0.415s
-- - No HEARTBEAT 3 Response
-- - Send HEARTBEAT 4 (Publisher, First SN 1, Last SN 5) [Test normal HARTBEAT Response]
-- - Send ACKNACK 2 (Publisher, Expecting 1) [Test ACKNACK Suppression Delay]
-- * 0.450s
-- - Send HEARTBEAT 5 (Subscriber, First Sn 2, Last SN 5) [Test HEARTBEAT Response Delay, Test HEARTBEAT Resposne Update]
-- * 0.520s
-- - HEARTBEAT 4/5 Response
-- - Send ACKNACK 3 (Publisher, Expecting SN 1) [Test normal ACKNACK Response]
-- * 0.620s
-- - No ACKNACK 2 Response
-- - Send ACKNACK 4 (Subscriber, Expecting SN 1) [Test ACKNACK Resposne Delay, Test ACKNACK Response Update]
-- * 0.725s
-- - ACKNACK 3/4 Response
-- * 1.000s
-- - Local HEARTBEAT generation
-- - Liveliness Assertion (Manual & Auto)
-- - Send ACKNACK 5 (Subscriber, Expecting SN 8) [Test ACKNACK SN Response]
-- * 1.205s
-- - ACKNACK 5 Response
-- * 1.500s
-- - Liveliness of local Writer 0 (with AUTOMATIC Liveliness QoS) is asserted for 1 clock cycle [Test ignoring of non-relavant local Liveliness assertion]
-- - Send ACKNACK 6 (Publihser, Expecting SN 18) [Test ACKNACK SN Response]
-- * 1.705s
-- - No ACKNACK 6 Response
-- * 2.000s
-- - Local HEARTBEAT generation
-- - Liveliness Assertion (Auto only)
-- - Send ACKNACK 7 (Message, Expecting SN 5) [Test GAP sending on ACKNACK Response]
-- - Send ACKNACK 8 (Publihser, Expecing SN 2) [Test full ACKNACK Response]
-- - Send ACKNaCK 9 (Subscriber, Expecting SN 8) [Test full ACKNACK Response]
-- * 2.205s
-- - ACKNACK 7/8/9 Response
-- - Liveliness of local Writer 4 (with MANUAL_BY_PARTICIPANT Liveliness QOS) is asserted for 1 clock cycle [Test manual liveliness assertion after GAP generation]
-- * 2.500s
-- - Send ACKNACK 10 (Message, Expecting SN 6) [Test ACKNACK SN Response]
-- * 2.705s
-- - No ACKNACK 10 Response
-- * 3.000s
-- - Local HEARTBEAT generation
-- - Liveliness Assertion (Manual & Auto)
entity rtps_builtin_endpoint_test7 is
end entity;
architecture testbench of rtps_builtin_endpoint_test7 is
-- *TYPE DECLARATION*
type TEST_STAGE_TYPE is (IDLE, BUSY);
-- *SIGNAL DECLARATION*
signal clk, in_empty, rd_sig, last_word_in, full, wr_sig : std_logic := '0';
signal reset : std_logic := '1';
signal data_in, data_out : std_logic_vector(WORD_WIDTH-1 downto 0) := (others => '0');
signal stim_stage : TEST_STAGE_TYPE := IDLE;
shared variable stimulus : TEST_PACKET_TYPE := EMPTY_TEST_PACKET;
signal packet_sent : std_logic := '0';
signal cnt_stim : natural := 0;
signal start : std_logic := '0';
shared variable SB_out : osvvm.ScoreBoardPkg_slv.ScoreBoardPType;
signal stim_done, check_done : std_logic := '0';
signal test_time : TIME_TYPE := TIME_ZERO;
signal fifo_in, fifo_out : std_logic_vector(WORD_WIDTH downto 0) := (others => '0');
signal fifo_wr, fifo_empty, fifo_full : std_logic := '0';
signal rtps_out_data : RTPS_OUT_DATA_TYPE := (others => (others => '0'));
signal rtps_out_rd, rtps_out_last_word_in, rtps_out_empty : std_logic_vector(0 to NUM_ENDPOINTS) := (others => '0');
signal alive : std_logic_vector (0 to NUM_ENDPOINTS-1) := (others => '0');
-- *FUNCTION DECLARATION*
procedure wait_on_complete is
begin
wait until rising_edge(packet_sent);
end procedure;
function gen_sn(input : natural) return SEQUENCENUMBER_TYPE is
variable ret : SEQUENCENUMBER_TYPE;
begin
ret(0) := (others => '0');
ret(1) := unsigned(int(input, WORD_WIDTH));
return ret;
end function;
procedure gen_acknack(participant : in PARTICIPANT_DATA_TYPE; count : in natural; pub_sn : in SEQUENCENUMBER_TYPE; sub_sn : in SEQUENCENUMBER_TYPE; mes_sn : in SEQUENCENUMBER_TYPE) is
variable sub : RTPS_SUBMESSAGE_TYPE := DEFAULT_RTPS_SUBMESSAGE;
variable OUT_HEADER : OUTPUT_HEADER_TYPE := DEFAULT_OUTPUT_HEADER;
variable rtps_header: RTPS_HEADER_TYPE := DEFAULT_RTPS_HEADER;
variable output : TEST_PACKET_TYPE := EMPTY_TEST_PACKET;
begin
-- NOTE: Ha to be made sure uut used same Locator
OUT_HEADER := (dest => get_loc(participant, TRUE), src => DEST_LOC.meta.locator(1));
-- OUTPUT HEADER
gen_output_header(OUT_HEADER, output);
-- RTPS HEADER
rtps_header := DEFAULT_RTPS_HEADER;
rtps_header.guidPrefix := GUIDPREFIX;
gen_rtps_header(rtps_header, output);
-- PUBLISHER ACKNACK
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_ACKNACK;
sub.writerId := ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_ANNOUNCER;
sub.readerId := ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_DETECTOR;
sub.readerSNState.base := pub_sn;
sub.count := std_logic_vector(to_unsigned(count, CDR_LONG_WIDTH));
sub.flags(SUBMESSAGE_FINAL_FLAG_POS) := '1';
gen_rtps_submessage(sub, output);
-- SUBSCRIBER ACKNACK
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_ACKNACK;
sub.writerId := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_ANNOUNCER;
sub.readerId := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_DETECTOR;
sub.count := std_logic_vector(to_unsigned(count, CDR_LONG_WIDTH));
sub.readerSNState.base := sub_sn;
sub.flags(SUBMESSAGE_FINAL_FLAG_POS) := '1';
gen_rtps_submessage(sub, output);
-- MESSAGE ACKNACK
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_ACKNACK;
sub.writerId := ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER;
sub.readerId := ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER;
sub.count := std_logic_vector(to_unsigned(count, CDR_LONG_WIDTH));
sub.readerSNState.base := mes_sn;
sub.flags(SUBMESSAGE_FINAL_FLAG_POS) := '1';
gen_rtps_submessage(sub, output);
fix_output_packet(output);
for i in 0 to output.length-1 loop
SB_out.Push(output.data(i));
end loop;
end procedure;
procedure gen_heartbeat(participant : in PARTICIPANT_DATA_TYPE; count : in natural; man_sn : in SEQUENCENUMBER_TYPE; auto_sn : in SEQUENCENUMBER_TYPE) is
variable sub : RTPS_SUBMESSAGE_TYPE := DEFAULT_RTPS_SUBMESSAGE;
variable OUT_HEADER : OUTPUT_HEADER_TYPE := DEFAULT_OUTPUT_HEADER;
variable rtps_header: RTPS_HEADER_TYPE := DEFAULT_RTPS_HEADER;
variable output : TEST_PACKET_TYPE := EMPTY_TEST_PACKET;
begin
-- NOTE: Has to be made sure uut used same Locator
OUT_HEADER := (dest => get_loc(participant, TRUE), src => DEST_LOC.meta.locator(1));
-- OUTPUT HEADER
gen_output_header(OUT_HEADER, output);
-- RTPS HEADER
rtps_header := DEFAULT_RTPS_HEADER;
rtps_header.guidPrefix := GUIDPREFIX;
gen_rtps_header(rtps_header, output);
-- PUBLISHER HEARTBEAT
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_HEARTBEAT;
sub.writerId := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_ANNOUNCER;
sub.readerId := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_DETECTOR;
sub.firstSN := gen_sn(1);
sub.lastSN := gen_sn(NUM_WRITERS);
sub.count := std_logic_vector(to_unsigned(count, CDR_LONG_WIDTH));
sub.flags(SUBMESSAGE_FINAL_FLAG_POS) := '1';
gen_rtps_submessage(sub, output);
-- SUBSCRIBER HEARTBEAT
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_HEARTBEAT;
sub.writerId := ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_ANNOUNCER;
sub.readerId := ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_DETECTOR;
sub.count := std_logic_vector(to_unsigned(count, CDR_LONG_WIDTH));
sub.firstSN := gen_sn(1);
sub.lastSN := gen_sn(NUM_READERS);
sub.flags(SUBMESSAGE_FINAL_FLAG_POS) := '1';
gen_rtps_submessage(sub, output);
-- MESSAGE HEARTBEAT
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_HEARTBEAT;
sub.writerId := ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER;
sub.readerId := ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER;
sub.count := std_logic_vector(to_unsigned(count, CDR_LONG_WIDTH));
sub.firstSN := man_sn;
sub.lastSN := auto_sn;
sub.flags(SUBMESSAGE_FINAL_FLAG_POS) := '1';
gen_rtps_submessage(sub, output);
-- MANUAL LIVELINESS
if (man_sn+1 = auto_sn) then
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_DATA;
sub.writerId := ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER;
sub.readerId := ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER;
sub.writerSN := man_sn;
sub.flags(SUBMESSAGE_DATA_FLAG_POS) := '1';
gen_liveliness_assertion(THIS_PARTICIPANT_DATA, TRUE, sub.data);
gen_rtps_submessage(sub, output);
end if;
-- AUTOMATIC LIVELINESS
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_DATA;
sub.writerId := ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER;
sub.readerId := ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER;
sub.writerSN := auto_sn;
sub.flags(SUBMESSAGE_DATA_FLAG_POS) := '1';
gen_liveliness_assertion(THIS_PARTICIPANT_DATA, FALSE, sub.data);
gen_rtps_submessage(sub, output);
fix_output_packet(output);
for i in 0 to output.length-1 loop
SB_out.Push(output.data(i));
end loop;
end procedure;
procedure gen_data(participant : in PARTICIPANT_DATA_TYPE; pub : in boolean; subs : in boolean; mes : in boolean; man_sn : in SEQUENCENUMBER_TYPE; auto_sn : in SEQUENCENUMBER_TYPE) is
variable fixed_readers : ENDPOINT_DATA_ARRAY_TYPE(0 to NUM_READERS-1) := gen_endpoint_array(TRUE);
variable fixed_writers : ENDPOINT_DATA_ARRAY_TYPE(0 to NUM_WRITERS-1) := gen_endpoint_array(FALSE);
variable sub : RTPS_SUBMESSAGE_TYPE := DEFAULT_RTPS_SUBMESSAGE;
variable OUT_HEADER : OUTPUT_HEADER_TYPE := DEFAULT_OUTPUT_HEADER;
variable rtps_header : RTPS_HEADER_TYPE := DEFAULT_RTPS_HEADER;
variable output : TEST_PACKET_TYPE := EMPTY_TEST_PACKET;
begin
-- NOTE: Ha to be made sure uut used same Locator
OUT_HEADER := (dest => get_loc(participant, TRUE), src => DEST_LOC.meta.locator(1));
-- *PUBLISHERS*
if (pub) then
-- OUTPUT HEADER
gen_output_header(OUT_HEADER, output);
-- RTPS HEADER
rtps_header := DEFAULT_RTPS_HEADER;
rtps_header.guidPrefix := GUIDPREFIX;
gen_rtps_header(rtps_header, output);
for i in 0 to NUM_WRITERS-1 loop
-- PUBLISHER DATA
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_DATA;
sub.writerId := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_ANNOUNCER;
sub.readerId := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_DETECTOR;
sub.writerSN := gen_sn(i+1);
sub.flags(SUBMESSAGE_DATA_FLAG_POS) := '1';
gen_endpoint_data(fixed_writers(i), sub.data);
gen_sentinel(sub.data);
gen_rtps_submessage(sub, output);
end loop;
fix_output_packet(output);
for i in 0 to output.length-1 loop
SB_out.Push(output.data(i));
end loop;
output := EMPTY_TEST_PACKET;
end if;
-- *SUBSCRIBERS*
if (subs) then
-- OUTPUT HEADER
gen_output_header(OUT_HEADER, output);
-- RTPS HEADER
rtps_header := DEFAULT_RTPS_HEADER;
rtps_header.guidPrefix := GUIDPREFIX;
gen_rtps_header(rtps_header, output);
for i in 0 to NUM_READERS-1 loop
-- PUBLISHER DATA
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_DATA;
sub.writerId := ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_ANNOUNCER;
sub.readerId := ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_DETECTOR;
sub.writerSN := gen_sn(i+1);
sub.flags(SUBMESSAGE_DATA_FLAG_POS) := '1';
gen_endpoint_data(fixed_readers(i), sub.data);
gen_sentinel(sub.data);
gen_rtps_submessage(sub, output);
end loop;
fix_output_packet(output);
for i in 0 to output.length-1 loop
SB_out.Push(output.data(i));
end loop;
output := EMPTY_TEST_PACKET;
end if;
-- *PARTICIPANT MESSAGE*
if (mes) then
-- OUTPUT HEADER
gen_output_header(OUT_HEADER, output);
-- RTPS HEADER
rtps_header := DEFAULT_RTPS_HEADER;
rtps_header.guidPrefix := GUIDPREFIX;
gen_rtps_header(rtps_header, output);
-- MANUAL LIVELINESS
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_DATA;
sub.writerId := ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER;
sub.readerId := ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER;
sub.writerSN := man_sn;
sub.flags(SUBMESSAGE_DATA_FLAG_POS) := '1';
gen_liveliness_assertion(THIS_PARTICIPANT_DATA, TRUE, sub.data);
gen_rtps_submessage(sub, output);
if (man_sn+1 /= auto_sn) then
-- GAP MESSAGE
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_GAP;
sub.writerId := ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER;
sub.readerId := ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER;
sub.gapStart := man_sn+1;
sub.gapList.base := auto_sn-1;
gen_rtps_submessage(sub, output);
end if;
-- AUTOMATIC LIVELINESS
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_DATA;
sub.writerId := ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER;
sub.readerId := ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER;
sub.writerSN := auto_sn;
sub.flags(SUBMESSAGE_DATA_FLAG_POS) := '1';
gen_liveliness_assertion(THIS_PARTICIPANT_DATA, FALSE, sub.data);
gen_rtps_submessage(sub, output);
fix_output_packet(output);
for i in 0 to output.length-1 loop
SB_out.Push(output.data(i));
end loop;
output := EMPTY_TEST_PACKET;
end if;
end procedure;
begin
-- Unit Under Test
uut : entity work.rtps_builtin_endpoint(arch)
port map (
clk => clk,
reset => reset,
empty => in_empty or packet_sent,
rd => rd_sig,
data_in => data_in,
data_out => fifo_in(WORD_WIDTH-1 downto 0),
last_word_in => last_word_in,
time => test_time,
endpoint_full => (others => '0'),
endpoint_wr => open,
rtps_wr => fifo_wr,
rtps_full => fifo_full,
last_word_out => fifo_in(WORD_WIDTH),
alive => alive
);
fifo_inst : entity work.FWFT_FIFO(arch)
generic map (
FIFO_DEPTH => 2,
DATA_WIDTH => WORD_WIDTH+1
)
port map
(
reset => reset,
clk => clk,
data_in => fifo_in,
write => fifo_wr,
read => rtps_out_rd(0),
data_out => fifo_out,
empty => fifo_empty,
full => fifo_full,
free => open
);
rtps_out_data <= (0 => fifo_out(WORD_WIDTH-1 downto 0), others => (others => '0'));
rtps_out_last_word_in <= (0 => fifo_out(WORD_WIDTH), others => '0');
rtps_out_empty <= (0 => fifo_empty, others => '1');
rtps_out_inst : entity work.rtps_out(arch)
port map (
clk => clk,
reset => reset,
data_in => rtps_out_data,
last_word_in=> rtps_out_last_word_in,
rd => rtps_out_rd,
empty => rtps_out_empty,
data_out => data_out,
wr => wr_sig,
full => full
);
stimulus_prc : process
variable sub : RTPS_SUBMESSAGE_TYPE := DEFAULT_RTPS_SUBMESSAGE;
variable RV : RandomPType;
variable p0, participant : PARTICIPANT_DATA_TYPE := DEFAULT_PARTICIPANT_DATA;
-- NOTE: The stale_check variable is set everytime a Participant Stale Check is done (which is done in last priority).
-- We use this together with mem_op_done to "synchronize" the stimulus process.
alias stale_check is <<signal uut.stale_check : std_logic>>;
alias mem_op_done is <<signal uut.mem_op_done : std_logic>>;
-- Wrapper to use procedure as function
impure function gen_rand_loc_2 return LOCATOR_TYPE is
variable ret : LOCATOR_TYPE := EMPTY_LOCATOR;
begin
gen_rand_loc(RV, ret);
return ret;
end function;
impure function gen_rand_entityid_2(reader : boolean) return std_logic_vector is
variable ret : std_logic_vector(ENTITYID_WIDTH-1 downto 0) := (others => '0');
begin
gen_rand_entityid(RV, reader, ret);
return ret;
end function;
impure function gen_rand_guid_prefix return GUIDPREFIX_TYPE is
variable ret : GUIDPREFIX_TYPE;
begin
ret := (0 => RV.RandSlv(WORD_WIDTH), 1 => RV.RandSlv(WORD_WIDTH), 2 => RV.RandSlv(WORD_WIDTH));
return ret;
end function;
procedure start_test is
begin
start <= '1';
wait until rising_edge(clk);
start <= '0';
wait until rising_edge(clk);
end procedure;
begin
assert (TEST_STRING = "TEST_CONFIG_1") report "user_config incompatible with testbench." severity FAILURE;
SetAlertLogName("L0-rtps_builtin_endpoint-stale_participant_handling");
SetAlertEnable(FAILURE, TRUE);
SetAlertEnable(ERROR, TRUE);
SetAlertEnable(WARNING, TRUE);
SetLogEnable(DEBUG, FALSE);
SetLogEnable(PASSED, FALSE);
SetLogEnable(INFO, TRUE);
RV.InitSeed(RV'instance_name);
-- Participant 0
p0.guidPrefix := gen_rand_guid_prefix;
p0.nr := 0;
p0.metatrafficUnicastLocatorList:= (numLocators => int(1,CDR_LONG_WIDTH), locator => (0 => gen_rand_loc_2, others => EMPTY_LOCATOR));
p0.defaultUnicastLocatorList := (numLocators => int(1,CDR_LONG_WIDTH), locator => (0 => gen_rand_loc_2, others => EMPTY_LOCATOR));
p0.availableBuiltinEndpoints(DISC_BUILTIN_ENDPOINT_SUBSCRIPTIONS_DETECTOR) := '1';
p0.availableBuiltinEndpoints(DISC_BUILTIN_ENDPOINT_PUBLICATIONS_ANNOUNCER) := '1';
Log("Initiating Test", INFO);
Log("Current Time: 0s", INFO);
test_time <= TIME_ZERO;
alive <= (others => '0');
stim_done <= '0';
start <= '0';
reset <= '1';
wait until rising_edge(clk);
wait until rising_edge(clk);
reset <= '0';
Log("Match Remote Participant", INFO);
-- RTPS SUBMESSAGE
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_DATA;
sub.writerId := ENTITYID_SPDP_BUILTIN_PARTICIPANT_ANNOUNCER;
sub.readerId := ENTITYID_SPDP_BUILTIN_PARTICIPANT_DETECTOR;
sub.writerSN := gen_sn(1);
sub.flags(SUBMESSAGE_DATA_FLAG_POS) := '1';
-- PARTICIPANT
participant := p0;
-- GENERATE STIMULUS
gen_participant_data(participant, sub.data);
gen_sentinel(sub.data);
gen_rtps_handler_out(sub, participant, stimulus);
start_test;
wait_on_complete;
stimulus := EMPTY_TEST_PACKET;
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
-- *ACKNACK*
Log("Send Remote Publisher Heartbeat [Empty, Final Flag] (No Response, Final Flag)", INFO);
-- RTPS SUBMESSAGE
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_HEARTBEAT;
sub.writerId := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_ANNOUNCER;
sub.readerId := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_DETECTOR;
sub.firstSN := gen_sn(1);
sub.lastSN := gen_sn(0);
sub.flags(SUBMESSAGE_FINAL_FLAG_POS) := '1';
-- PARTICIPANT
participant := p0;
-- GENERATE STIMULUS
gen_rtps_handler_out(sub, participant, stimulus);
start_test;
wait_on_complete;
stimulus := EMPTY_TEST_PACKET;
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
-- Progress time past the HEARTBEAT RESPONSE DELAY
Log("Current Time: 0.105s", INFO);
test_time <= gen_duration(0,105*(10**6));
Log("Send Remote Publisher Heartbeat [Empty] (Response)", INFO);
-- RTPS SUBMESSAGE
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_HEARTBEAT;
sub.writerId := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_ANNOUNCER;
sub.readerId := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_DETECTOR;
sub.firstSN := gen_sn(1);
sub.lastSN := gen_sn(0);
-- PARTICIPANT
participant := p0;
-- GENERATE STIMULUS
gen_rtps_handler_out(sub, participant, stimulus);
start_test;
wait_on_complete;
stimulus := EMPTY_TEST_PACKET;
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Send Remote Subscriber Heartbeat [Empty, Final Flag] (No Change)", INFO);
-- RTPS SUBMESSAGE
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_HEARTBEAT;
sub.writerId := ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_ANNOUNCER;
sub.readerId := ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_DETECTOR;
sub.firstSN := gen_sn(1);
sub.lastSN := gen_sn(0);
sub.flags(SUBMESSAGE_FINAL_FLAG_POS) := '1';
-- PARTICIPANT
participant := p0;
-- GENERATE STIMULUS
gen_rtps_handler_out(sub, participant, stimulus);
start_test;
wait_on_complete;
stimulus := EMPTY_TEST_PACKET;
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Send Remote Message AckNack [Expecting 1] (Response)", INFO);
-- RTPS SUBMESSAGE
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_ACKNACK;
sub.writerId := ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER;
sub.readerId := ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER;
sub.readerSNState.base := gen_sn(1);
-- PARTICIPANT
participant := p0;
-- GENERATE STIMULUS
gen_rtps_handler_out(sub, participant, stimulus);
start_test;
wait_on_complete;
stimulus := EMPTY_TEST_PACKET;
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Current Time: 0.210s", INFO);
test_time <= gen_duration(0,210*(10**6));
gen_acknack(p0, 1, gen_sn(1), gen_sn(1), gen_sn(1));
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Toggle local Writer 4 Liveliness for 1 clock cycle (MANUAL_BY_PARTICIPANT_QOS)", INFO);
alive(NUM_READERS+4) <= '1';
wait until rising_edge(clk);
alive <= (others => '0');
Log("Current Time: 0.310s", INFO);
test_time <= gen_duration(0,310*(10**6));
gen_data(p0, FALSE, FALSE, TRUE, gen_sn(1), gen_sn(2));
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Send Remote Publisher Heartbeat [First 1, Last 1] (No Response, Suppression Delay)", INFO);
-- RTPS SUBMESSAGE
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_HEARTBEAT;
sub.writerId := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_ANNOUNCER;
sub.readerId := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_DETECTOR;
sub.firstSN := gen_sn(1);
sub.lastSN := gen_sn(1);
-- PARTICIPANT
participant := p0;
-- GENERATE STIMULUS
gen_rtps_handler_out(sub, participant, stimulus);
start_test;
wait_on_complete;
stimulus := EMPTY_TEST_PACKET;
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Current Time: 0.415s", INFO);
test_time <= gen_duration(0,415*(10**6));
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Send Remote Publisher Heartbeat [First 1, Last 5] (Response)", INFO);
-- RTPS SUBMESSAGE
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_HEARTBEAT;
sub.writerId := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_ANNOUNCER;
sub.readerId := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_DETECTOR;
sub.firstSN := gen_sn(1);
sub.lastSN := gen_sn(5);
-- PARTICIPANT
participant := p0;
-- GENERATE STIMULUS
gen_rtps_handler_out(sub, participant, stimulus);
start_test;
wait_on_complete;
stimulus := EMPTY_TEST_PACKET;
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Send Remote Publisher AckNack [Expecting 1] (No Response, Suppression Delay)", INFO);
-- RTPS SUBMESSAGE
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_ACKNACK;
sub.writerId := ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_ANNOUNCER;
sub.readerId := ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_DETECTOR;
sub.readerSNState.base := gen_sn(1);
-- PARTICIPANT
participant := p0;
-- GENERATE STIMULUS
gen_rtps_handler_out(sub, participant, stimulus);
start_test;
wait_on_complete;
stimulus := EMPTY_TEST_PACKET;
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Current Time: 0.450s", INFO);
test_time <= gen_duration(0,450*(10**6));
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Send Remote Subscriber Heartbeat [First 2, Last 5] (Update Response)", INFO);
-- RTPS SUBMESSAGE
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_HEARTBEAT;
sub.writerId := ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_ANNOUNCER;
sub.readerId := ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_DETECTOR;
sub.firstSN := gen_sn(2);
sub.lastSN := gen_sn(5);
-- PARTICIPANT
participant := p0;
-- GENERATE STIMULUS
gen_rtps_handler_out(sub, participant, stimulus);
start_test;
wait_on_complete;
stimulus := EMPTY_TEST_PACKET;
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Current Time: 0.520s", INFO);
test_time <= gen_duration(0,520*(10**6));
gen_acknack(p0, 2, gen_sn(1), gen_sn(2), gen_sn(1));
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Send Remote Publisher AckNack [Expecting 1] (Response)", INFO);
-- RTPS SUBMESSAGE
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_ACKNACK;
sub.writerId := ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_ANNOUNCER;
sub.readerId := ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_DETECTOR;
sub.readerSNState.base := gen_sn(1);
-- PARTICIPANT
participant := p0;
-- GENERATE STIMULUS
gen_rtps_handler_out(sub, participant, stimulus);
start_test;
wait_on_complete;
stimulus := EMPTY_TEST_PACKET;
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Current Time: 0.620s", INFO);
test_time <= gen_duration(0,620*(10**6));
Log("Send Remote Subscriber AckNack [Expecting 1] (Update Response)", INFO);
-- RTPS SUBMESSAGE
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_ACKNACK;
sub.writerId := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_ANNOUNCER;
sub.readerId := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_DETECTOR;
sub.readerSNState.base := gen_sn(1);
-- PARTICIPANT
participant := p0;
-- GENERATE STIMULUS
gen_rtps_handler_out(sub, participant, stimulus);
start_test;
wait_on_complete;
stimulus := EMPTY_TEST_PACKET;
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Current Time: 0.725s", INFO);
test_time <= gen_duration(0,725*(10**6));
gen_data(p0, TRUE, TRUE, FALSE, SEQUENCENUMBER_UNKNOWN, SEQUENCENUMBER_UNKNOWN);
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Current Time: 1s", INFO);
test_time <= gen_duration(1,0);
gen_heartbeat(p0, 3, gen_sn(3), gen_sn(4));
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Send Remote Subscriber AckNack [Expecting 8] (Response)", INFO);
-- RTPS SUBMESSAGE
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_ACKNACK;
sub.writerId := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_ANNOUNCER;
sub.readerId := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_DETECTOR;
sub.readerSNState.base := gen_sn(8);
-- PARTICIPANT
participant := p0;
-- GENERATE STIMULUS
gen_rtps_handler_out(sub, participant, stimulus);
start_test;
wait_on_complete;
stimulus := EMPTY_TEST_PACKET;
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Current Time: 1.205s", INFO);
test_time <= gen_duration(1,205*(10**6));
gen_data(p0, TRUE, FALSE, FALSE, SEQUENCENUMBER_UNKNOWN, SEQUENCENUMBER_UNKNOWN);
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Current Time: 1.500s", INFO);
test_time <= gen_duration(1,500*(10**6));
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Toggle local Writer 0 Liveliness for 1 clock cycle (AUTOMATIC_QOS)", INFO);
alive(NUM_READERS) <= '1';
wait until rising_edge(clk);
alive <= (others => '0');
Log("Send Remote Publisher AckNack [Expecting 18] (No Response)", INFO);
-- RTPS SUBMESSAGE
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_ACKNACK;
sub.writerId := ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_ANNOUNCER;
sub.readerId := ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_DETECTOR;
sub.readerSNState.base := gen_sn(18);
-- PARTICIPANT
participant := p0;
-- GENERATE STIMULUS
gen_rtps_handler_out(sub, participant, stimulus);
start_test;
wait_on_complete;
stimulus := EMPTY_TEST_PACKET;
Log("Current Time: 1.705s", INFO);
test_time <= gen_duration(1,705*(10**6));
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Current Time: 2s", INFO);
test_time <= gen_duration(2,0);
gen_heartbeat(p0, 4, gen_sn(3), gen_sn(5));
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Send Remote Message AckNack [Expecting 5] (Response)", INFO);
-- RTPS SUBMESSAGE
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_ACKNACK;
sub.writerId := ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER;
sub.readerId := ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER;
sub.readerSNState.base := gen_sn(5);
-- PARTICIPANT
participant := p0;
-- GENERATE STIMULUS
gen_rtps_handler_out(sub, participant, stimulus);
start_test;
wait_on_complete;
stimulus := EMPTY_TEST_PACKET;
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Send Remote Publisher AckNack [Expecting 2] (No Response)", INFO);
-- RTPS SUBMESSAGE
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_ACKNACK;
sub.writerId := ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_ANNOUNCER;
sub.readerId := ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_DETECTOR;
sub.readerSNState.base := gen_sn(2);
-- PARTICIPANT
participant := p0;
-- GENERATE STIMULUS
gen_rtps_handler_out(sub, participant, stimulus);
start_test;
wait_on_complete;
stimulus := EMPTY_TEST_PACKET;
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Send Remote Subscriber AckNack [Expecting 8] (Response)", INFO);
-- RTPS SUBMESSAGE
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_ACKNACK;
sub.writerId := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_ANNOUNCER;
sub.readerId := ENTITYID_SEDP_BUILTIN_PUBLICATIONS_DETECTOR;
sub.readerSNState.base := gen_sn(8);
-- PARTICIPANT
participant := p0;
-- GENERATE STIMULUS
gen_rtps_handler_out(sub, participant, stimulus);
start_test;
wait_on_complete;
stimulus := EMPTY_TEST_PACKET;
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Current Time: 2.205s", INFO);
test_time <= gen_duration(2,205*(10**6));
gen_data(p0, TRUE, TRUE, TRUE, gen_sn(3), gen_sn(5));
Log("Toggle local Writer 4 Liveliness for 1 clock cycle (MANUAL_BY_PARTICIPANT_QOS)", INFO);
alive(NUM_READERS+4) <= '1';
wait until rising_edge(clk);
alive <= (others => '0');
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Current Time: 2.500s", INFO);
test_time <= gen_duration(2,500*(10**6));
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Send Remote Message AckNack [Expecting 6] (No Response)", INFO);
-- RTPS SUBMESSAGE
sub := DEFAULT_RTPS_SUBMESSAGE;
sub.submessageID := SID_ACKNACK;
sub.writerId := ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER;
sub.readerId := ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER;
sub.readerSNState.base := gen_sn(6);
-- PARTICIPANT
participant := p0;
-- GENERATE STIMULUS
gen_rtps_handler_out(sub, participant, stimulus);
start_test;
wait_on_complete;
stimulus := EMPTY_TEST_PACKET;
Log("Current Time: 2.705s", INFO);
test_time <= gen_duration(2,705*(10**6));
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
Log("Current Time: 3s", INFO);
test_time <= gen_duration(3,0);
gen_heartbeat(p0, 5, gen_sn(6), gen_sn(7));
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
wait on mem_op_done until rising_edge(mem_op_done) and stale_check = '1';
TranscriptOpen(RESULTS_FILE, APPEND_MODE);
SetTranscriptMirror;
stim_done <= '1';
wait until check_done = '1';
AlertIf(not SB_out.empty, "Incomplete test run");
ReportAlerts;
TranscriptClose;
std.env.stop;
wait;
end process;
clock_prc : process
begin
clk <= '0';
wait for 25 ns;
clk <= '1';
wait for 25 ns;
end process;
in_empty_prc : process
begin
in_empty <= '0';
wait until rd_sig = '1';
wait until rising_edge(clk);
in_empty <= '1';
wait until rising_edge(clk);
end process;
endpoint_full_prc : process
begin
full <= '0';
wait until wr_sig = '1';
wait until rising_edge(clk);
full <= '1';
wait until rising_edge(clk);
end process;
alert_prc : process(all)
begin
if rising_edge(clk) then
alertif(in_empty = '1' and rd_sig = '1', "Input FIFO read signal high while empty signal high", ERROR);
alertif(full = '1' and wr_sig = '1', "Output FIFO write signal high while full signal high", ERROR);
end if;
end process;
input_prc : process(all)
begin
data_in <= stimulus.data(cnt_stim);
last_word_in <= stimulus.last(cnt_stim);
if rising_edge(clk) then
if (reset = '1') then
cnt_stim <= 0;
stim_stage <= IDLE;
packet_sent <= '1';
else
case (stim_stage) is
when IDLE =>
if (start = '1' and stimulus.length /= 0) then
stim_stage <= BUSY;
cnt_stim <= 0;
packet_sent <= '0';
end if;
when BUSY =>
if (rd_sig = '1') then
if (cnt_stim = stimulus.length-1) then
stim_stage <= IDLE;
packet_sent <= '1';
else
cnt_stim <= cnt_stim + 1;
end if;
end if;
end case;
end if;
end if;
end process;
output_check_prc : process(all)
begin
check_done <= '0';
if rising_edge(clk) then
if (wr_sig = '1') then
SB_out.Check(data_out);
end if;
if (stim_done = '1' and SB_out.empty) then
check_done <= '1';
end if;
end if;
end process;
watchdog : process
begin
wait for 1 ms;
Alert("Test timeout", FAILURE);
std.env.stop;
end process;
end architecture;

View File

@ -64,16 +64,16 @@ package user_config is
constant DURATION_DELTA : DURATION_TYPE := gen_duration(0, 100*(10**6)); -- 100 ms constant DURATION_DELTA : DURATION_TYPE := gen_duration(0, 100*(10**6)); -- 100 ms
-- Timing Characteristics for built-in Endpoints -- Timing Characteristics for built-in Endpoints
constant PARTICIPANT_HEARTBEAT_PERIOD : DURATION_TYPE := gen_duration(1,0); -- 1 s 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_RESPONSE_DELAY : DURATION_TYPE := gen_duration(0,100*(10**6)); -- 100 ms
constant PARTICIPANT_HEARTBEAT_SUPPRESSION_DELAY : DURATION_TYPE := gen_duration(0,0); constant PARTICIPANT_HEARTBEAT_SUPPRESSION_DELAY : DURATION_TYPE := gen_duration(0,200*(10**6)); -- 200 ms
constant PARTICIPANT_ACKNACK_RESPONSE_DELAY : DURATION_TYPE := gen_duration(3,200*(10**6)); -- 200 ms constant PARTICIPANT_ACKNACK_RESPONSE_DELAY : DURATION_TYPE := gen_duration(0,200*(10**6)); -- 200 ms
constant PARTICIPANT_ACKNACK_SUPPRESSION_DELAY : DURATION_TYPE := gen_duration(0,0); constant PARTICIPANT_ACKNACK_SUPPRESSION_DELAY : DURATION_TYPE := gen_duration(0,200*(10**6)); -- 200 ms
-- Array mapping Timing Characteristics to Endpoints -- 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_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_RESPONSE_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => gen_duration(0,100*(10**6))); -- 100 ms
constant ENDPOINT_HEARTBEAT_SUPPRESSION_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => gen_duration(0,0)); constant ENDPOINT_HEARTBEAT_SUPPRESSION_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => gen_duration(0,200*(10**6))); -- 200 ms
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_RESPONSE_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => gen_duration(0,200*(10**6))); -- 200 ms
constant ENDPOINT_ACKNACK_SUPPRESSION_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => gen_duration(0,0)); constant ENDPOINT_ACKNACK_SUPPRESSION_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => gen_duration(0,200*(10**6))); -- 200 ms
--***ENDPOINT DDS QOS*** --***ENDPOINT DDS QOS***

View File

@ -11,6 +11,7 @@ analyze ../rtps_test_package.vhd
analyze ../rtps_handler.vhd analyze ../rtps_handler.vhd
analyze ../rtps_builtin_endpoint.vhd analyze ../rtps_builtin_endpoint.vhd
analyze ../rtps_out.vhd analyze ../rtps_out.vhd
analyze ../FWFT_FIFO.vhd
analyze Level_0/rtps_handler_test1.vhd analyze Level_0/rtps_handler_test1.vhd
analyze Level_0/rtps_handler_test2.vhd analyze Level_0/rtps_handler_test2.vhd
analyze test_ram.vhd analyze test_ram.vhd
@ -23,6 +24,7 @@ analyze Level_0/rtps_builtin_endpoint_test4.vhd
analyze Level_0/rtps_builtin_endpoint_test5.vhd analyze Level_0/rtps_builtin_endpoint_test5.vhd
analyze Level_0/rtps_builtin_endpoint_test6.vhd analyze Level_0/rtps_builtin_endpoint_test6.vhd
analyze Level_0/rtps_out_test1.vhd analyze Level_0/rtps_out_test1.vhd
analyze Level_1/rtps_builtin_endpoint_test7.vhd
#simulate rtps_handler_test1 #simulate rtps_handler_test1
#simulate rtps_handler_test2 #simulate rtps_handler_test2
@ -31,5 +33,6 @@ analyze Level_0/rtps_out_test1.vhd
#simulate rtps_builtin_endpoint_test3 #simulate rtps_builtin_endpoint_test3
#simulate rtps_builtin_endpoint_test4 #simulate rtps_builtin_endpoint_test4
#simulate rtps_builtin_endpoint_test5 #simulate rtps_builtin_endpoint_test5
simulate rtps_builtin_endpoint_test6 #simulate rtps_builtin_endpoint_test6
#simulate rtps_out_test1 #simulate rtps_out_test1
simulate rtps_builtin_endpoint_test7

View File

@ -274,8 +274,6 @@ architecture arch of rtps_builtin_endpoint is
signal mem_rd, mem_wr : std_logic := '0'; signal mem_rd, mem_wr : std_logic := '0';
-- General Purpose Counter (Memory FSM) -- General Purpose Counter (Memory FSM)
signal mem_cnt, mem_cnt_next : natural range 0 to 22 := 0; signal mem_cnt, mem_cnt_next : natural range 0 to 22 := 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 : SEQUENCENUMBER_TYPE := (others => (others => '0'));
-- Signifies the next expected Sequence Number of the current relevant Message Type (Participant/Publisher/Subscriber/Message Data) -- 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 : SEQUENCENUMBER_TYPE := (others => (others => '0')); signal next_seq_nr, next_seq_nr_next : SEQUENCENUMBER_TYPE := (others => (others => '0'));
-- Latch used to store the first Sequence Number in ACKNACK/HEARTBEAT/GAP Messages -- Latch used to store the first Sequence Number in ACKNACK/HEARTBEAT/GAP Messages
@ -298,8 +296,6 @@ architecture arch of rtps_builtin_endpoint is
signal mem_participant_data, mem_participant_data_next : PARTICIPANT_DATA_TYPE := ZERO_PARTICIPANT_DATA; signal mem_participant_data, mem_participant_data_next : PARTICIPANT_DATA_TYPE := ZERO_PARTICIPANT_DATA;
-- Signifies if the marked Stale Participant had a Hertbeat Response/Suppression Delay Timeout -- Signifies if the marked Stale Participant had a Hertbeat Response/Suppression Delay Timeout
signal is_heartbeat_res, is_heartbeat_res_next : std_logic := '0'; signal is_heartbeat_res, is_heartbeat_res_next : std_logic := '0';
-- 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 containing the HEARTBEAT/ACKNACK count of all built-in Endpoints
signal count, count_next : unsigned(COUNT_WIDTH-1 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 -- Toggle set when at least one Endpoint has asserted the "alive" signal, until reset
@ -339,6 +335,8 @@ architecture arch of rtps_builtin_endpoint is
signal extra_flags, extra_flags_next : std_logic_vector(EXTRA_FLAGS_WIDTH-1 downto 0) := (others => '0'); signal extra_flags, extra_flags_next : std_logic_vector(EXTRA_FLAGS_WIDTH-1 downto 0) := (others => '0');
-- General Purpose Long latch -- General Purpose Long latch
signal long_latch, long_latch_next : std_logic_vector(CDR_LONG_WIDTH-1 downto 0) := (others => '0'); signal long_latch, long_latch_next : std_logic_vector(CDR_LONG_WIDTH-1 downto 0) := (others => '0');
-- General Purpose Long latch (For Memory FSM)
signal mem_long_latch, mem_long_latch_next : std_logic_vector(CDR_LONG_WIDTH-1 downto 0) := (others => '0');
-- Contains flags that signify which PIDs where received. This is done in order to use the default value for -- Contains flags that signify which PIDs where received. This is done in order to use the default value for
-- not received elements. -- not received elements.
signal rcvd, rcvd_next : std_logic_vector(RCVD_WIDTH-1 downto 0) := (others => '0'); signal rcvd, rcvd_next : std_logic_vector(RCVD_WIDTH-1 downto 0) := (others => '0');
@ -402,56 +400,13 @@ begin
if (reset = '1' or reset_endpoint_alive = '1') then if (reset = '1' or reset_endpoint_alive = '1') then
endpoint_alive <= '0'; endpoint_alive <= '0';
-- Set Endpoint Alive Signal, if at least one endpoint asserts liveliness -- Set Endpoint Alive Signal, if at least one endpoint asserts liveliness
elsif (alive /= (alive'range => '0')) then -- NOTE: Only writer endpoints with a Liveliness QoS of MANUAL_BY_PARTICIPANT as taken into account
elsif ((alive and MANUAL_BY_PARTICIPANT_WRITERS) /= (alive'range => '0')) then
endpoint_alive <= '1'; endpoint_alive <= '1';
end if; end if;
end if; end if;
end process; end process;
-- This process is responsible for setting the "mem_seq_nr" and "next_seq_nr" signals
-- The signals are valid as long as "seq_prc_done" is held high.
-- It takes one clock cycle after "mem_op_done" is high to set-up the signals
seq_nr_prc: process(all)
begin
-- DEFAULT
seq_prc_done_next <= seq_prc_done;
mem_seq_nr_next <= mem_seq_nr;
next_seq_nr_next <= next_seq_nr;
-- Memory Operation Finished
if (mem_op_done = '1') then
seq_prc_done_next <= '1';
case (message_type) is
-- Participant Data Sequence Number
when PDP =>
mem_seq_nr_next <= mem_participant_data.spdp_seq_nr;
next_seq_nr_next <= mem_participant_data.spdp_seq_nr + 1;
when EDP =>
-- Subscriber Data Sequence Number
if (is_subscriber = '1') then
mem_seq_nr_next <= mem_participant_data.sub_seq_nr;
next_seq_nr_next <= mem_participant_data.sub_seq_nr + 1;
-- Publisher Data Sequence Number
else
mem_seq_nr_next <= mem_participant_data.pub_seq_nr;
next_seq_nr_next <= mem_participant_data.pub_seq_nr + 1;
end if;
-- Participant Message Data Sequence Number
when MESSAGE =>
mem_seq_nr_next <= mem_participant_data.mes_seq_nr;
next_seq_nr_next <= mem_participant_data.mes_seq_nr + 1;
when others =>
null;
end case;
-- Memory Operation in progress
else
seq_prc_done_next <= '0';
mem_seq_nr_next <= (others => (others => '0'));
next_seq_nr_next <= (others => (others => '0'));
end if;
end process;
-- This process connects the Intermediate Output Signals to the actual output FIFOs -- This process connects the Intermediate Output Signals to the actual output FIFOs
output_prc : process(all) output_prc : process(all)
begin begin
@ -543,6 +498,8 @@ begin
variable tmp_endpoint_mask : std_logic_vector(0 to NUM_ENDPOINTS-1) := (others => '0'); variable tmp_endpoint_mask : std_logic_vector(0 to NUM_ENDPOINTS-1) := (others => '0');
variable rd_guard : std_logic := '0'; variable rd_guard : std_logic := '0';
variable tmp_default_qos_match : DEFAULT_QOS_MATCH_TYPE := READER_DEFAULT_QOS_MATCH; variable tmp_default_qos_match : DEFAULT_QOS_MATCH_TYPE := READER_DEFAULT_QOS_MATCH;
variable tmp_dw : DOUBLE_WORD_ARRAY := (others => (others => '0'));
variable mem_seq_nr : SEQUENCENUMBER_TYPE := SEQUENCENUMBER_UNKNOWN;
begin begin
--DEFAULT Registered --DEFAULT Registered
stage_next <= stage; stage_next <= stage;
@ -587,6 +544,7 @@ begin
publisher_data_cnt_next <= publisher_data_cnt; publisher_data_cnt_next <= publisher_data_cnt;
subscriber_data_cnt_next <= subscriber_data_cnt; subscriber_data_cnt_next <= subscriber_data_cnt;
seq_nr_next <= seq_nr; seq_nr_next <= seq_nr;
next_seq_nr_next <= next_seq_nr;
last_word_in_latch_next <= last_word_in_latch; last_word_in_latch_next <= last_word_in_latch;
count_next <= count; count_next <= count;
long_latch_next <= long_latch; long_latch_next <= long_latch;
@ -607,7 +565,26 @@ begin
last_word_in_latch_next <= '1'; last_word_in_latch_next <= '1';
end if; end if;
-- TODO: Reset Latches -- Set mem_seq_nr to correct sequence number
-- NOTE: The stored Sequence Numbers are the next expected
case (message_type) is
-- Participant Data Sequence Number
when PDP =>
mem_seq_nr := mem_participant_data.spdp_seq_nr;
when EDP =>
-- Subscriber Data Sequence Number
if (is_subscriber = '1') then
mem_seq_nr := mem_participant_data.sub_seq_nr;
-- Publisher Data Sequence Number
else
mem_seq_nr := mem_participant_data.pub_seq_nr;
end if;
-- Participant Message Data Sequence Number
when MESSAGE =>
mem_seq_nr := mem_participant_data.mes_seq_nr;
when others =>
mem_seq_nr := SEQUENCENUMBER_UNKNOWN;
end case;
case(stage) is case(stage) is
-- Initial/Idle State -- Initial/Idle State
@ -744,8 +721,9 @@ begin
if (empty = '0') then if (empty = '0') then
rd_guard := '1'; rd_guard := '1';
-- DEFAULT STAGE -- DEFAULT
stage_next <= SKIP_PACKET; stage_next <= SKIP_PACKET;
is_subscriber_next <= '0';
-- *Check Destination Entity ID* -- *Check Destination Entity ID*
case (data_in) is case (data_in) is
@ -767,6 +745,7 @@ begin
-- Only ACKNACKs are relevant -- Only ACKNACKs are relevant
if (NUM_WRITERS /= 0 and opcode = SID_ACKNACK) then if (NUM_WRITERS /= 0 and opcode = SID_ACKNACK) then
message_type_next <= EDP; message_type_next <= EDP;
is_subscriber_next <= '1';
stage_next <= PROCESS_ACKNACK; --ACKNACK Processing stage_next <= PROCESS_ACKNACK; --ACKNACK Processing
cnt_next <= 0; cnt_next <= 0;
@ -775,7 +754,7 @@ begin
-- SANITY CHECK: Ignore if no Readers -- SANITY CHECK: Ignore if no Readers
if (NUM_READERS /= 0) then if (NUM_READERS /= 0) then
message_type_next <= EDP; message_type_next <= EDP;
is_subscriber_next <= '0';
-- Only HEARTBEATs, GAPs and DATA are relevant -- Only HEARTBEATs, GAPs and DATA are relevant
case (opcode) is case (opcode) is
@ -868,8 +847,9 @@ begin
end case; end case;
end if; end if;
when CHECK_SRC_ENTITYID => when CHECK_SRC_ENTITYID =>
-- DEFAULT STAGE -- DEFAULT
stage_next <= SKIP_PACKET; stage_next <= SKIP_PACKET;
is_subscriber_next <= '0';
-- *Check Dest Entity ID* -- *Check Dest Entity ID*
case (src_entityid) is case (src_entityid) is
@ -887,6 +867,7 @@ begin
-- Only ACKNACKs are relevant -- Only ACKNACKs are relevant
if (NUM_WRITERS /= 0 and opcode = SID_ACKNACK) then if (NUM_WRITERS /= 0 and opcode = SID_ACKNACK) then
message_type_next <= EDP; message_type_next <= EDP;
is_subscriber_next <= '1';
stage_next <= PROCESS_ACKNACK; --ACKNACK Processing stage_next <= PROCESS_ACKNACK; --ACKNACK Processing
cnt_next <= 0; cnt_next <= 0;
@ -895,7 +876,6 @@ begin
-- SANITY CHECK: Ignore if no Readers -- SANITY CHECK: Ignore if no Readers
if (NUM_READERS /= 0) then if (NUM_READERS /= 0) then
message_type_next <= EDP; message_type_next <= EDP;
is_subscriber_next <= '0';
-- Only HEARTBEATs, GAPs and DATA are relevant -- Only HEARTBEATs, GAPs and DATA are relevant
case (opcode) is case (opcode) is
@ -997,6 +977,10 @@ begin
seq_nr_next(0) <= unsigned(data_in_swapped); seq_nr_next(0) <= unsigned(data_in_swapped);
when 1 => when 1 =>
seq_nr_next(1) <= unsigned(data_in_swapped); seq_nr_next(1) <= unsigned(data_in_swapped);
-- Store Next Sequence Number
tmp_dw := (0 => seq_nr(0), 1 => unsigned(data_in_swapped));
next_seq_nr_next <= tmp_dw + 1;
stage_next <= PROCESS_DATA; stage_next <= PROCESS_DATA;
when others => when others =>
null; null;
@ -1162,16 +1146,14 @@ begin
end if; end if;
when PROCESS_GAP_SEQUENCE_NUMBERS => when PROCESS_GAP_SEQUENCE_NUMBERS =>
-- Wait for Sequence Number to be fetched from buffer -- Wait for Sequence Number to be fetched from buffer
if (mem_op_done = '1' and seq_prc_done = '1') then if (mem_op_done = '1') then
-- Sender known -- Sender known
if (addr_res /= MAX_ADDRESS) then if (addr_res /= MAX_ADDRESS) then
-- XXX: This logic relies on the sender marking continuous GAPs with the GAP Start Sequence Number and GAP End Sequence Number Set Base (i.e. the first bit in the bitmask should be 0/not in GAP) -- XXX: This logic relies on the sender marking continuous GAPs with the GAP Start Sequence Number and GAP End Sequence Number Set Base (i.e. the first bit in the bitmask should be 0/not in GAP)
-- It also relies on the sender starting the GAP from the next expected/requested sequence number (Not Begining the GAP from an already ACKed sequence number) -- GAP only relevant if next expected sequence number in GAP
-- TODO: Couldn't we do something like (first_seq_nr <= seq_nr and last_seq_nr >= next_seq_nr) to also handle the case were the GAP is not begining from the next expected? if (first_seq_nr <= mem_seq_nr and last_seq_nr >= mem_seq_nr) then
-- GAP only relevant if GAP start is the next expected sequence number
if (first_seq_nr = next_seq_nr) then
-- Store GAP end as last sequence number -- Store GAP end as last sequence number
seq_nr_next <= last_seq_nr; next_seq_nr_next <= last_seq_nr + 1;
mem_opcode <= UPDATE_PARTICIPANT; mem_opcode <= UPDATE_PARTICIPANT;
update_participant_flags_next <= (EDP_SEQ_NR_FLAG => '1', others => '0'); update_participant_flags_next <= (EDP_SEQ_NR_FLAG => '1', others => '0');
mem_op_start <= '1'; mem_op_start <= '1';
@ -1202,16 +1184,16 @@ begin
end case; end case;
end if; end if;
when PROCESS_HEARTBEAT_SEQUENCE_NUMBERS => when PROCESS_HEARTBEAT_SEQUENCE_NUMBERS =>
-- Wait for Participant Search to finish and Next Sequence Number to be set -- Wait for Participant Search to finish
if (mem_op_done = '1' and seq_prc_done = '1') then if (mem_op_done = '1') then
-- Participant in Buffer -- Participant in Buffer
if (addr_res /= MAX_ADDRESS) then if (addr_res /= MAX_ADDRESS) then
-- No scheduled Heartbeat Response -- No scheduled Heartbeat Response
if (mem_participant_data.heartbeat_res_time /= 0) then if (mem_participant_data.heartbeat_res_time = 0) then
-- If current Sequence Number obsolete (removed from source history cache) -- If current Sequence Number obsolete (removed from source history cache)
if (first_seq_nr > next_seq_nr) then if (first_seq_nr > mem_seq_nr and first_seq_nr <= last_seq_nr) then
-- Store new expected Sequence Number -1 and set Response Dealy -- Store new expected Sequence Number and set Response Dealy
seq_nr_next <= first_seq_nr - 1; next_seq_nr_next <= first_seq_nr;
mem_opcode <= UPDATE_PARTICIPANT; mem_opcode <= UPDATE_PARTICIPANT;
deadline_next <= time + PARTICIPANT_HEARTBEAT_RESPONSE_DELAY; deadline_next <= time + PARTICIPANT_HEARTBEAT_RESPONSE_DELAY;
-- NOTE: Last Bit denotes if this is Response or Suppression Delay -- NOTE: Last Bit denotes if this is Response or Suppression Delay
@ -1219,7 +1201,7 @@ begin
update_participant_flags_next <= (EDP_SEQ_NR_FLAG => '1', HEARTBEAT_RES_TIME_FLAG => '1', others => '0'); update_participant_flags_next <= (EDP_SEQ_NR_FLAG => '1', HEARTBEAT_RES_TIME_FLAG => '1', others => '0');
mem_op_start <= '1'; mem_op_start <= '1';
-- If new Sequence Number is available or Writer expects ACKNACK -- If new Sequence Number is available or Writer expects ACKNACK
elsif (last_seq_nr > mem_seq_nr or final_flag = '0') then elsif (last_seq_nr >= mem_seq_nr or final_flag = '0') then
-- Set Response Delay -- Set Response Delay
mem_opcode <= UPDATE_PARTICIPANT; mem_opcode <= UPDATE_PARTICIPANT;
deadline_next <= time + PARTICIPANT_HEARTBEAT_RESPONSE_DELAY; deadline_next <= time + PARTICIPANT_HEARTBEAT_RESPONSE_DELAY;
@ -1231,9 +1213,9 @@ begin
-- Currently in Heartbeat Response Delay -- Currently in Heartbeat Response Delay
elsif (mem_participant_data.heartbeat_res_time(1)(0) = '0') then elsif (mem_participant_data.heartbeat_res_time(1)(0) = '0') then
-- If current Sequence Number obsolete (removed from source history cache) -- If current Sequence Number obsolete (removed from source history cache)
if (first_seq_nr > next_seq_nr) then if (first_seq_nr > mem_seq_nr and first_seq_nr <= last_seq_nr) then
-- Store new expected Sequence Number -1 -- Store new expected Sequence Number
seq_nr_next <= first_seq_nr - 1; next_seq_nr_next <= first_seq_nr;
mem_opcode <= UPDATE_PARTICIPANT; mem_opcode <= UPDATE_PARTICIPANT;
update_participant_flags_next <= (EDP_SEQ_NR_FLAG => '1', others => '0'); update_participant_flags_next <= (EDP_SEQ_NR_FLAG => '1', others => '0');
mem_op_start <= '1'; mem_op_start <= '1';
@ -1251,9 +1233,9 @@ begin
-- Latch Sequence Number -- Latch Sequence Number
-- NOTE: Because we always sent the entire history cache, we only need to look at the SequenceNumberSetBase to determine if we need to sent data or not -- NOTE: Because we always sent the entire history cache, we only need to look at the SequenceNumberSetBase to determine if we need to sent data or not
case (cnt) is case (cnt) is
when 1 => when 0 =>
first_seq_nr_next(0) <= unsigned(data_in_swapped); first_seq_nr_next(0) <= unsigned(data_in_swapped);
when 2 => when 1 =>
first_seq_nr_next(1) <= unsigned(data_in_swapped); first_seq_nr_next(1) <= unsigned(data_in_swapped);
stage_next <= PROCESS_ACKNACK_SEQUENCE_NUMBERS; stage_next <= PROCESS_ACKNACK_SEQUENCE_NUMBERS;
@ -1267,7 +1249,7 @@ begin
-- Participant in Buffer -- Participant in Buffer
if (addr_res /= MAX_ADDRESS) then if (addr_res /= MAX_ADDRESS) then
-- No scheduled Acknack Response -- No scheduled Acknack Response
if (mem_participant_data.acknack_res_time /= 0) then if (mem_participant_data.acknack_res_time = 0) then
case (message_type) is case (message_type) is
when EDP => when EDP =>
-- Subscriber Acknack -- Subscriber Acknack
@ -2089,18 +2071,13 @@ begin
case (cnt) is case (cnt) is
when 0 => when 0 =>
-- Check QoS Compatibility (Unmark match on incompatibility) long_latch_next <= data_in_swapped;
-- COMPATIBLE (DDS v1.4): offered <= requested
for i in 0 to NUM_ENDPOINTS-1 loop
if (not check_qos_compatibility(is_subscriber, '0', unsigned(data_in_swapped), ENDPOINT_DEADLINE_QOS(i)(0))) then
endpoint_mask_next(i) <= '0';
end if;
end loop;
when 1 => when 1 =>
tmp_dw := (0 => unsigned(long_latch), 1 => unsigned(data_in_swapped));
-- Check QoS Compatibility (Unmark match on incompatibility) -- Check QoS Compatibility (Unmark match on incompatibility)
-- COMPATIBLE (DDS v1.4): offered <= requested -- COMPATIBLE (DDS v1.4): offered <= requested
for i in 0 to NUM_ENDPOINTS-1 loop for i in 0 to NUM_ENDPOINTS-1 loop
if (not check_qos_compatibility(is_subscriber, '0', unsigned(data_in_swapped), ENDPOINT_DEADLINE_QOS(i)(1))) then if (not check_qos_compatibility(is_subscriber, '0', tmp_dw, ENDPOINT_DEADLINE_QOS(i))) then
endpoint_mask_next(i) <= '0'; endpoint_mask_next(i) <= '0';
end if; end if;
end loop; end loop;
@ -2134,18 +2111,14 @@ begin
case (cnt) is case (cnt) is
when 0 => when 0 =>
-- Check QoS Compatibility (Unmark match on incompatibility) -- Temporal Latch
-- COMPATIBLE (DDS v1.4): offered <= requested long_latch_next <= data_in_swapped;
for i in 0 to NUM_ENDPOINTS-1 loop
if (not check_qos_compatibility(is_subscriber, '0', unsigned(data_in_swapped), ENDPOINT_LEASE_DURATION(i)(0))) then
endpoint_mask_next(i) <= '0';
end if;
end loop;
when 1 => when 1 =>
tmp_dw := (0 => unsigned(long_latch), 1 => unsigned(data_in_swapped));
-- Check QoS Compatibility (Unmark match on incompatibility) -- Check QoS Compatibility (Unmark match on incompatibility)
-- COMPATIBLE (DDS v1.4): offered <= requested -- COMPATIBLE (DDS v1.4): offered <= requested
for i in 0 to NUM_ENDPOINTS-1 loop for i in 0 to NUM_ENDPOINTS-1 loop
if (not check_qos_compatibility(is_subscriber, '0', unsigned(data_in_swapped), ENDPOINT_LEASE_DURATION(i)(1))) then if (not check_qos_compatibility(is_subscriber, '0', tmp_dw, ENDPOINT_LEASE_DURATION(i))) then
endpoint_mask_next(i) <= '0'; endpoint_mask_next(i) <= '0';
end if; end if;
end loop; end loop;
@ -2274,18 +2247,13 @@ begin
case (cnt) is case (cnt) is
when 0 => when 0 =>
-- Check QoS Compatibility (Unmark match on incompatibility) long_latch_next <= data_in_swapped;
-- COMPATIBLE (DDS v1.4): offered <= requested
for i in 0 to NUM_ENDPOINTS-1 loop
if (not check_qos_compatibility(is_subscriber, '0', unsigned(data_in_swapped), ENDPOINT_LATENCY_BUDGET_QOS(i)(0))) then
endpoint_mask_next(i) <= '0';
end if;
end loop;
when 1 => when 1 =>
tmp_dw := (0 => unsigned(long_latch), 1 => unsigned(data_in_swapped));
-- Check QoS Compatibility (Unmark match on incompatibility) -- Check QoS Compatibility (Unmark match on incompatibility)
-- COMPATIBLE (DDS v1.4): offered <= requested -- COMPATIBLE (DDS v1.4): offered <= requested
for i in 0 to NUM_ENDPOINTS-1 loop for i in 0 to NUM_ENDPOINTS-1 loop
if (not check_qos_compatibility(is_subscriber, '0', unsigned(data_in_swapped), ENDPOINT_LATENCY_BUDGET_QOS(i)(1))) then if (not check_qos_compatibility(is_subscriber, '0', tmp_dw, ENDPOINT_LATENCY_BUDGET_QOS(i))) then
endpoint_mask_next(i) <= '0'; endpoint_mask_next(i) <= '0';
end if; end if;
end loop; end loop;
@ -2308,8 +2276,8 @@ begin
stage_next <= SKIP_PARAMETER; stage_next <= SKIP_PARAMETER;
end if; end if;
when PARTICIPANT_MATCH_STAGE => when PARTICIPANT_MATCH_STAGE =>
-- Wait for Participant Search to finish and Next Sequence Number to be set -- Wait for Participant Search to finish
if (mem_op_done = '1' and seq_prc_done = '1') then if (mem_op_done = '1') then
-- Participant not in Buffer -- Participant not in Buffer
if (addr_res = MAX_ADDRESS) then if (addr_res = MAX_ADDRESS) then
-- Participant Match -- Participant Match
@ -2329,7 +2297,7 @@ begin
-- Participant Announcement -- Participant Announcement
if (message_type = PDP) then if (message_type = PDP) then
-- Newer Sequence Number -- Newer Sequence Number
if (mem_seq_nr < seq_nr) then if (mem_seq_nr <= seq_nr) then
-- Participant Unmatch -- Participant Unmatch
if (participant_match = '0') then if (participant_match = '0') then
-- Remove participant from buffer -- Remove participant from buffer
@ -2362,7 +2330,7 @@ begin
-- (since all Data messages with a higher sequence number than the next expected will be ignored), -- (since all Data messages with a higher sequence number than the next expected will be ignored),
-- but keeps the logic simple. -- but keeps the logic simple.
-- Endpoint (Next Expected Sequence Number) -- Endpoint (Next Expected Sequence Number)
elsif (message_type = EDP and next_seq_nr = seq_nr) then elsif (message_type = EDP and mem_seq_nr = seq_nr) then
-- Store new Sequence Number -- Store new Sequence Number
mem_opcode <= UPDATE_PARTICIPANT; mem_opcode <= UPDATE_PARTICIPANT;
update_participant_flags_next <= (EDP_SEQ_NR_FLAG => '1', others => '0'); update_participant_flags_next <= (EDP_SEQ_NR_FLAG => '1', others => '0');
@ -2575,10 +2543,10 @@ begin
data_out <= SID_ACKNACK & "00000010" & std_logic_vector(to_unsigned(24, 16)); data_out <= SID_ACKNACK & "00000010" & std_logic_vector(to_unsigned(24, 16));
-- Reader Entity ID -- Reader Entity ID
when 1 => when 1 =>
data_out <= ENTITYID_SEDP_BUILTIN_PUBLICATIONS_DETECTOR; data_out <= ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_DETECTOR;
-- Writer Entity ID -- Writer Entity ID
when 2 => when 2 =>
data_out <= ENTITYID_SEDP_BUILTIN_PUBLICATIONS_ANNOUNCER; data_out <= ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_ANNOUNCER;
-- Sequence Number Set (Bitmap Base 1/2) -- Sequence Number Set (Bitmap Base 1/2)
when 3 => when 3 =>
data_out <= std_logic_vector(mem_participant_data.pub_seq_nr(0)); data_out <= std_logic_vector(mem_participant_data.pub_seq_nr(0));
@ -2597,10 +2565,10 @@ begin
data_out <= SID_ACKNACK & "00000010" & std_logic_vector(to_unsigned(24, 16)); data_out <= SID_ACKNACK & "00000010" & std_logic_vector(to_unsigned(24, 16));
-- Reader Entity ID -- Reader Entity ID
when 8 => when 8 =>
data_out <= ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_DETECTOR; data_out <= ENTITYID_SEDP_BUILTIN_PUBLICATIONS_DETECTOR;
-- Writer Entity ID -- Writer Entity ID
when 9 => when 9 =>
data_out <= ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_ANNOUNCER; data_out <= ENTITYID_SEDP_BUILTIN_PUBLICATIONS_ANNOUNCER;
-- Sequence Number Set (Bitmap Base 1/2) -- Sequence Number Set (Bitmap Base 1/2)
when 10 => when 10 =>
data_out <= std_logic_vector(mem_participant_data.sub_seq_nr(0)); data_out <= std_logic_vector(mem_participant_data.sub_seq_nr(0));
@ -2705,10 +2673,10 @@ begin
data_out <= SID_HEARTBEAT & "00000010" & std_logic_vector(to_unsigned(28, 16)); data_out <= SID_HEARTBEAT & "00000010" & std_logic_vector(to_unsigned(28, 16));
-- Reader Entity ID -- Reader Entity ID
when 17 => when 17 =>
data_out <= ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_DETECTOR; data_out <= ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER;
-- Writer Entity ID -- Writer Entity ID
when 18 => when 18 =>
data_out <= ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_ANNOUNCER; data_out <= ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER;
-- Sequence Number 1/2 -- Sequence Number 1/2
when 19 => when 19 =>
data_out <= std_logic_vector(man_live_seq_nr(0)); data_out <= std_logic_vector(man_live_seq_nr(0));
@ -3040,6 +3008,7 @@ begin
variable tmp : unsigned(mem_addr_base'range) := (others => '0'); variable tmp : unsigned(mem_addr_base'range) := (others => '0');
variable tmp2 : unsigned(mem_addr_base'range) := (others => '0'); variable tmp2 : unsigned(mem_addr_base'range) := (others => '0');
variable tmp3 : unsigned(mem_addr_base'range) := (others => '0'); variable tmp3 : unsigned(mem_addr_base'range) := (others => '0');
variable tmp_dw : DOUBLE_WORD_ARRAY := (others => (others => '0'));
begin begin
-- DEFAULT Registered -- DEFAULT Registered
mem_stage_next <= mem_stage; mem_stage_next <= mem_stage;
@ -3053,6 +3022,7 @@ begin
mem_guidprefix_next <= mem_guidprefix; mem_guidprefix_next <= mem_guidprefix;
max_participant_addr_next <= max_participant_addr; max_participant_addr_next <= max_participant_addr;
reset_max_pointer_next <= reset_max_pointer; reset_max_pointer_next <= reset_max_pointer;
mem_long_latch_next <= mem_long_latch;
-- DEFAULT Unregistered -- DEFAULT Unregistered
mem_write_data <= (others => '0'); mem_write_data <= (others => '0');
mem_op_done <= '0'; mem_op_done <= '0';
@ -3305,10 +3275,10 @@ begin
mem_write_data <= meta_port & def_port; mem_write_data <= meta_port & def_port;
-- SPDP Sequence Number 1/2 -- SPDP Sequence Number 1/2
when 6 => when 6 =>
mem_write_data <= std_logic_vector(seq_nr(0)); mem_write_data <= std_logic_vector(next_seq_nr(0));
-- SPDP Sequence Number 2/2 -- SPDP Sequence Number 2/2
when 7 => when 7 =>
mem_write_data <= std_logic_vector(seq_nr(1)); mem_write_data <= std_logic_vector(next_seq_nr(1));
-- Lease Duration 1/2 -- Lease Duration 1/2
when 8 => when 8 =>
mem_write_data <= std_logic_vector(lease_duration(0)); mem_write_data <= std_logic_vector(lease_duration(0));
@ -3339,22 +3309,22 @@ begin
mem_write_data <= (others => '0'); mem_write_data <= (others => '0');
-- Publication Sequence Number 1/2 -- Publication Sequence Number 1/2
when 17 => when 17 =>
mem_write_data <= (others => '0'); mem_write_data <= std_logic_vector(FIRST_SEQUENCENUMBER(0));
-- Publication Sequence Number 2/2 -- Publication Sequence Number 2/2
when 18 => when 18 =>
mem_write_data <= (others => '0'); mem_write_data <= std_logic_vector(FIRST_SEQUENCENUMBER(1));
-- Subscription Sequence Number 1/2 -- Subscription Sequence Number 1/2
when 19 => when 19 =>
mem_write_data <= (others => '0'); mem_write_data <= std_logic_vector(FIRST_SEQUENCENUMBER(0));
-- Subscription Sequence Number 2/2 -- Subscription Sequence Number 2/2
when 20 => when 20 =>
mem_write_data <= (others => '0'); mem_write_data <= std_logic_vector(FIRST_SEQUENCENUMBER(1));
-- Participant Message Sequence Number 1/2 -- Participant Message Sequence Number 1/2
when 21 => when 21 =>
mem_write_data <= (others => '0'); mem_write_data <= std_logic_vector(FIRST_SEQUENCENUMBER(0));
-- Participant Message Sequence Number 2/2 -- Participant Message Sequence Number 2/2
when 22 => when 22 =>
mem_write_data <= (others => '0'); mem_write_data <= std_logic_vector(FIRST_SEQUENCENUMBER(1));
-- DONE -- DONE
mem_stage_next <= IDLE; mem_stage_next <= IDLE;
when others => when others =>
@ -3385,13 +3355,13 @@ begin
end if; end if;
-- SPDP Sequence Number 1/2 -- SPDP Sequence Number 1/2
when 3 => when 3 =>
mem_write_data <= std_logic_vector(seq_nr(0)); mem_write_data <= std_logic_vector(next_seq_nr(0));
if (update_participant_flags(PARTICIPANT_DATA_FLAG) = '1') then if (update_participant_flags(PARTICIPANT_DATA_FLAG) = '1') then
mem_wr <= '1'; mem_wr <= '1';
end if; end if;
-- SPDP Sequence Number 2/2 -- SPDP Sequence Number 2/2
when 4 => when 4 =>
mem_write_data <= std_logic_vector(seq_nr(1)); mem_write_data <= std_logic_vector(next_seq_nr(1));
if (update_participant_flags(PARTICIPANT_DATA_FLAG) = '1') then if (update_participant_flags(PARTICIPANT_DATA_FLAG) = '1') then
mem_wr <= '1'; mem_wr <= '1';
end if; end if;
@ -3433,7 +3403,7 @@ begin
when 9 => when 9 =>
mem_write_data <= (others => '0'); mem_write_data <= (others => '0');
mem_write_data(EXTRA_FLAGS_WIDTH-1 downto 0) <= extra_flags; mem_write_data(EXTRA_FLAGS_WIDTH-1 downto 0) <= extra_flags;
if (update_participant_flags(PARTICIPANT_DATA_FLAG) = '1') then if (update_participant_flags(EXTRA_FLAGS_FLAG) = '1') then
mem_wr <= '1'; mem_wr <= '1';
end if; end if;
-- If nothing else to update -- If nothing else to update
@ -3477,37 +3447,37 @@ begin
end if; end if;
-- Publication Sequence Number 1/2 -- Publication Sequence Number 1/2
when 14 => when 14 =>
mem_write_data <= std_logic_vector(seq_nr(0)); mem_write_data <= std_logic_vector(next_seq_nr(0));
if (update_participant_flags(EDP_SEQ_NR_FLAG) = '1' and message_type = EDP and is_subscriber = '0') then if (update_participant_flags(EDP_SEQ_NR_FLAG) = '1' and message_type = EDP and is_subscriber = '0') then
mem_wr <= '1'; mem_wr <= '1';
end if; end if;
-- Publication Sequence Number 2/2 -- Publication Sequence Number 2/2
when 15 => when 15 =>
mem_write_data <= std_logic_vector(seq_nr(1)); mem_write_data <= std_logic_vector(next_seq_nr(1));
if (update_participant_flags(EDP_SEQ_NR_FLAG) = '1' and message_type = EDP and is_subscriber = '0') then if (update_participant_flags(EDP_SEQ_NR_FLAG) = '1' and message_type = EDP and is_subscriber = '0') then
mem_wr <= '1'; mem_wr <= '1';
end if; end if;
-- Subscription Sequence Number 1/2 -- Subscription Sequence Number 1/2
when 16 => when 16 =>
mem_write_data <= std_logic_vector(seq_nr(0)); mem_write_data <= std_logic_vector(next_seq_nr(0));
if (update_participant_flags(EDP_SEQ_NR_FLAG) = '1' and message_type = EDP and is_subscriber = '1') then if (update_participant_flags(EDP_SEQ_NR_FLAG) = '1' and message_type = EDP and is_subscriber = '1') then
mem_wr <= '1'; mem_wr <= '1';
end if; end if;
-- Subscription Sequence Number 2/2 -- Subscription Sequence Number 2/2
when 17 => when 17 =>
mem_write_data <= std_logic_vector(seq_nr(1)); mem_write_data <= std_logic_vector(next_seq_nr(1));
if (update_participant_flags(EDP_SEQ_NR_FLAG) = '1' and message_type = EDP and is_subscriber = '1') then if (update_participant_flags(EDP_SEQ_NR_FLAG) = '1' and message_type = EDP and is_subscriber = '1') then
mem_wr <= '1'; mem_wr <= '1';
end if; end if;
-- Participant Message Sequence Number 1/2 -- Participant Message Sequence Number 1/2
when 18 => when 18 =>
mem_write_data <= std_logic_vector(seq_nr(0)); mem_write_data <= std_logic_vector(next_seq_nr(0));
if (update_participant_flags(EDP_SEQ_NR_FLAG) = '1' and message_type = MESSAGE) then if (update_participant_flags(EDP_SEQ_NR_FLAG) = '1' and message_type = MESSAGE) then
mem_wr <= '1'; mem_wr <= '1';
end if; end if;
-- Participant Message Sequence Number 2/2 -- Participant Message Sequence Number 2/2
when 19 => when 19 =>
mem_write_data <= std_logic_vector(seq_nr(1)); mem_write_data <= std_logic_vector(next_seq_nr(1));
if (update_participant_flags(EDP_SEQ_NR_FLAG) = '1' and message_type = MESSAGE) then if (update_participant_flags(EDP_SEQ_NR_FLAG) = '1' and message_type = MESSAGE) then
mem_wr <= '1'; mem_wr <= '1';
end if; end if;
@ -3816,18 +3786,12 @@ begin
null; null;
-- Lease Deadline 1/2 -- Lease Deadline 1/2
when 5 => when 5 =>
-- Lease Deadline passed mem_long_latch_next <= mem_read_data;
if (unsigned(mem_read_data) < time(0)) then
-- Mark Participant as stale
addr_res_next <= mem_addr_base;
mem_participant_data_next <= ZERO_PARTICIPANT_DATA;
-- DONE
mem_stage_next <= IDLE;
end if;
-- Lease Deadline 2/2 -- Lease Deadline 2/2
when 6 => when 6 =>
tmp_dw := (0 => unsigned(mem_long_latch), 1 => unsigned(mem_read_data));
-- Lease Deadline passed -- Lease Deadline passed
if (unsigned(mem_read_data) < time(1)) then if (tmp_dw < time) then
-- Mark Participant as stale -- Mark Participant as stale
addr_res_next <= mem_addr_base; addr_res_next <= mem_addr_base;
mem_participant_data_next <= ZERO_PARTICIPANT_DATA; mem_participant_data_next <= ZERO_PARTICIPANT_DATA;
@ -3839,20 +3803,12 @@ begin
null; null;
-- ACKNACK Response/Suppression Time 1/2 -- ACKNACK Response/Suppression Time 1/2
when 8 => when 8 =>
-- Acknack Response/Suppression Time passed mem_long_latch_next <= mem_read_data;
if (mem_read_data /= (mem_read_data'reverse_range => '0') and unsigned(mem_read_data) < time(0)) then
-- Mark Participant and get Participant Data
addr_res_next <= mem_addr_base;
mem_addr_next <= tmp3;
-- Mark as ACKNACK Trigger
is_heartbeat_res_next <= '0';
mem_stage_next <= GET_PARTICIPANT_DATA;
mem_cnt_next <= 0;
end if;
-- ACKNACK Response/Suppression Time 2/2 -- ACKNACK Response/Suppression Time 2/2
when 9 => when 9 =>
tmp_dw := (0 => unsigned(mem_long_latch), 1 => unsigned(mem_read_data));
-- Acknack Response/Suppression Time passed -- Acknack Response/Suppression Time passed
if (mem_read_data /= (mem_read_data'reverse_range => '0') and unsigned(mem_read_data) < time(1)) then if (tmp_dw /= 0 and tmp_dw < time) then
-- Mark Participant and get Participant Data -- Mark Participant and get Participant Data
addr_res_next <= mem_addr_base; addr_res_next <= mem_addr_base;
mem_addr_next <= tmp3; mem_addr_next <= tmp3;
@ -3863,20 +3819,12 @@ begin
end if; end if;
-- HEARTBEAT Response/Suppression Time 1/2 -- HEARTBEAT Response/Suppression Time 1/2
when 10 => when 10 =>
-- Heartbeat Response/Suppression Time passed mem_long_latch_next <= mem_read_data;
if (mem_read_data /= (mem_read_data'reverse_range => '0') and unsigned(mem_read_data) < time(0)) then
-- Mark Participant and get Participant Data
addr_res_next <= mem_addr_base;
mem_addr_next <= tmp3;
-- Mark as HEARTBEAT Trigger
is_heartbeat_res_next <= '1';
mem_stage_next <= GET_PARTICIPANT_DATA;
mem_cnt_next <= 0;
end if;
-- HEARTBEAT Response/Suppression Time 2/2 -- HEARTBEAT Response/Suppression Time 2/2
when 11 => when 11 =>
tmp_dw := (0 => unsigned(mem_long_latch), 1 => unsigned(mem_read_data));
-- Heartbeat Response/Suppression Time passed -- Heartbeat Response/Suppression Time passed
if (mem_read_data /= (mem_read_data'reverse_range => '0') and unsigned(mem_read_data) < time(1)) then if (tmp_dw /= 0 and tmp_dw < time) then
-- Mark Participant and get Participant Data -- Mark Participant and get Participant Data
addr_res_next <= mem_addr_base; addr_res_next <= mem_addr_base;
mem_addr_next <= tmp3; mem_addr_next <= tmp3;
@ -3952,16 +3900,16 @@ begin
addr_res <= (others => '0'); addr_res <= (others => '0');
last_addr <= (others => '0'); last_addr <= (others => '0');
long_latch <= (others => '0'); long_latch <= (others => '0');
mem_long_latch <= (others => '0');
rcvd <= (others => '0'); rcvd <= (others => '0');
max_participant_addr <= FIRST_PARTICIPANT_ADDRESS; max_participant_addr <= FIRST_PARTICIPANT_ADDRESS;
guid <= (others => (others => '0')); guid <= (others => (others => '0'));
mem_guidprefix <= (others => (others => '0')); mem_guidprefix <= (others => (others => '0'));
lease_duration <= (others => (others => '0')); lease_duration <= (others => (others => '0'));
deadline <= (others => (others => '0')); deadline <= (others => (others => '0'));
announcement_time <= (others => (others => '0')); announcement_time <= time + PARTICIPANT_ANNOUNCEMENT_PERIOD;
heartbeat_time <= (others => (others => '0')); heartbeat_time <= time + HEARTBEAT_PERIOD;
seq_nr <= (others => (others => '0')); seq_nr <= (others => (others => '0'));
mem_seq_nr <= (others => (others => '0'));
next_seq_nr <= (others => (others => '0')); next_seq_nr <= (others => (others => '0'));
first_seq_nr <= (others => (others => '0')); first_seq_nr <= (others => (others => '0'));
last_seq_nr <= (others => (others => '0')); last_seq_nr <= (others => (others => '0'));
@ -3975,7 +3923,6 @@ begin
publisher_data_cnt <= 0; publisher_data_cnt <= 0;
subscriber_data_cnt <= 0; subscriber_data_cnt <= 0;
mem_cnt <= 0; mem_cnt <= 0;
seq_prc_done <= '0';
participant_match <= '0'; participant_match <= '0';
is_subscriber <= '0'; is_subscriber <= '0';
is_meta_addr <= '0'; is_meta_addr <= '0';
@ -4013,16 +3960,16 @@ begin
addr_res <= addr_res_next; addr_res <= addr_res_next;
last_addr <= last_addr_next; last_addr <= last_addr_next;
long_latch <= long_latch_next; long_latch <= long_latch_next;
mem_long_latch <= mem_long_latch_next;
rcvd <= rcvd_next; rcvd <= rcvd_next;
max_participant_addr <= max_participant_addr_next; max_participant_addr <= max_participant_addr_next;
guid <= guid_next; guid <= guid_next;
mem_guidprefix <= mem_guidprefix_next; mem_guidprefix <= mem_guidprefix_next;
lease_duration <= lease_duration_next; lease_duration <= lease_duration_next;
deadline <= deadline_next; deadline <= deadline_next;
announcement_time <= announcement_time_next; announcement_time <= announcement_time_next;
heartbeat_time <= heartbeat_time_next; heartbeat_time <= heartbeat_time_next;
seq_nr <= seq_nr_next; seq_nr <= seq_nr_next;
mem_seq_nr <= mem_seq_nr_next;
next_seq_nr <= next_seq_nr_next; next_seq_nr <= next_seq_nr_next;
first_seq_nr <= first_seq_nr_next; first_seq_nr <= first_seq_nr_next;
last_seq_nr <= last_seq_nr_next; last_seq_nr <= last_seq_nr_next;
@ -4036,7 +3983,6 @@ begin
publisher_data_cnt <= publisher_data_cnt_next; publisher_data_cnt <= publisher_data_cnt_next;
subscriber_data_cnt <= subscriber_data_cnt_next; subscriber_data_cnt <= subscriber_data_cnt_next;
mem_cnt <= mem_cnt_next; mem_cnt <= mem_cnt_next;
seq_prc_done <= seq_prc_done_next;
participant_match <= participant_match_next; participant_match <= participant_match_next;
is_subscriber <= is_subscriber_next; is_subscriber <= is_subscriber_next;
is_meta_addr <= is_meta_addr_next; is_meta_addr <= is_meta_addr_next;

View File

@ -53,6 +53,9 @@ package rtps_config_package is
-- Marks the Reader Endpoint in the Endpoint Array -- 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'); constant ENDPOINT_READERS : std_logic_vector(0 to NUM_ENDPOINTS-1) := (0 to NUM_READERS-1 => '1', others => '0');
-- Marks the writers with MANUAL BY PARTICIPANT Qos
constant MANUAL_BY_PARTICIPANT_WRITERS : std_logic_vector(0 to NUM_ENDPOINTS-1); --Deferred to package body
type WORD_ARRAY_TYPE is array (natural range <>) of std_logic_vector(WORD_WIDTH-1 downto 0); type WORD_ARRAY_TYPE is array (natural range <>) of std_logic_vector(WORD_WIDTH-1 downto 0);
type OUTPUT_DATA_TYPE is record type OUTPUT_DATA_TYPE is record
-- Limit DATA to MAX UDPv4 Payload Size - RTPS Header (65487 Bytes) -- Limit DATA to MAX UDPv4 Payload Size - RTPS Header (65487 Bytes)
@ -99,6 +102,8 @@ package rtps_config_package is
function round_slv(slv : std_logic_vector; width : natural) return std_logic_vector; function round_slv(slv : std_logic_vector; width : natural) return std_logic_vector;
function check_qos_compatibility(src_is_reader : std_logic; direction : std_logic; remote : unsigned(WORD_WIDTH-1 downto 0); local : unsigned(WORD_WIDTH-1 downto 0)) return boolean; function check_qos_compatibility(src_is_reader : std_logic; direction : std_logic; remote : unsigned(WORD_WIDTH-1 downto 0); local : unsigned(WORD_WIDTH-1 downto 0)) return boolean;
function check_qos_compatibility(src_is_reader : std_logic; direction : std_logic; remote : DOUBLE_WORD_ARRAY; local : DOUBLE_WORD_ARRAY) return boolean;
end package; end package;
package body rtps_config_package is package body rtps_config_package is
@ -340,7 +345,7 @@ package body rtps_config_package is
ret.data(ind+len) := GUIDPREFIX(2); ret.data(ind+len) := GUIDPREFIX(2);
len := len + 1; len := len + 1;
ret.data(ind+len) := ENTITYID(i); ret.data(ind+len) := ENTITYID(i);
-- EXPECTS INLINE QOS (Only relevant for Reader endpoints) -- EXPECTS INLINE QOS
len := len + 1; len := len + 1;
ret.data(ind+len) := PID_EXPECTS_INLINE_QOS & std_logic_vector(to_unsigned(4, 16)); ret.data(ind+len) := PID_EXPECTS_INLINE_QOS & std_logic_vector(to_unsigned(4, 16));
len := len + 1; len := len + 1;
@ -372,6 +377,37 @@ package body rtps_config_package is
len := len + 1; len := len + 1;
ret.data(ind+len) := ENDPOINT_DURABILITY_QOS(i); ret.data(ind+len) := ENDPOINT_DURABILITY_QOS(i);
end if; end if;
-- DURABILITY SERVICE
if (ENDPOINT_DURABILITY_SERVICE_CLEANUP_DELAY(i) /= DEFAULT_DURABILITY_SERVICE_CLEANUP_DELAY or ENDPOINT_DURABILITY_SERVICE_HISTORY(i) /= DEFAULT_DURABILITY_SERVICE_HISTORY or
ENDPOINT_DURABILITY_SERVICE_HISTORY_DEPTH(i) /= DEFAULT_DURABILITY_SERVICE_HISTORY_DEPTH or ENDPOINT_DURABILITY_SERVICE_MAX_SAMPLES(i) /= DEFAULT_DURABILITY_SERVICE_MAX_SAMPLES or
ENDPOINT_DURABILITY_SERVICE_MAX_INSTANCES(i) /= DEFAULT_DURABILITY_SERVICE_MAX_INSTANCES or ENDPOINT_DURABILITY_SERVICE_MAX_SAMPLES_PER_INSTANCE(i) /= DEFAULT_DURABILITY_SERVICE_MAX_SAMPLES_PER_INSTANCE
) then
len := len + 1;
ret.data(ind+len) := PID_DURABILITY_SERVICE & std_logic_vector(to_unsigned(28, 16));
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_DURABILITY_SERVICE_CLEANUP_DELAY(i)(0));
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_DURABILITY_SERVICE_CLEANUP_DELAY(i)(1));
len := len + 1;
ret.data(ind+len) := ENDPOINT_DURABILITY_SERVICE_HISTORY(i);
len := len + 1;
ret.data(ind+len) := ENDPOINT_DURABILITY_SERVICE_HISTORY_DEPTH(i);
len := len + 1;
ret.data(ind+len) := ENDPOINT_DURABILITY_SERVICE_MAX_SAMPLES(i);
len := len + 1;
ret.data(ind+len) := ENDPOINT_DURABILITY_SERVICE_MAX_INSTANCES(i);
len := len + 1;
ret.data(ind+len) := ENDPOINT_DURABILITY_SERVICE_MAX_SAMPLES_PER_INSTANCE(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 => boolean_to_std_logic(ENDPOINT_COHERENT_ACCESS(i)), 16 => boolean_to_std_logic(ENDPOINT_ORDERED_ACCESS(i)), others => '0');
end if;
-- DEADLINE -- DEADLINE
if (ENDPOINT_DEADLINE_QOS(i) /= DEFAULT_DEADLINE_QOS) then if (ENDPOINT_DEADLINE_QOS(i) /= DEFAULT_DEADLINE_QOS) then
len := len + 1; len := len + 1;
@ -381,6 +417,22 @@ package body rtps_config_package is
len := len + 1; len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_DEADLINE_QOS(i)(1)); ret.data(ind+len) := std_logic_vector(ENDPOINT_DEADLINE_QOS(i)(1));
end if; end if;
-- LATENCY_BUDGET
if (ENDPOINT_LATENCY_BUDGET_QOS(i) /= DEFAULT_LATENCY_BUDGET_QOS) then
len := len + 1;
ret.data(ind+len) := PID_LATENCY_BUDGET & std_logic_vector(to_unsigned(8, 16));
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_LATENCY_BUDGET_QOS(i)(0));
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_LATENCY_BUDGET_QOS(i)(1));
end if;
-- OWNERSHIP
if (ENDPOINT_OWNERSHIP_QOS(i) /= DEFAULT_OWNERSHIP_QOS) then
len := len + 1;
ret.data(ind+len) := PID_OWNERSHIP & std_logic_vector(to_unsigned(4, 16));
len := len + 1;
ret.data(ind+len) := ENDPOINT_OWNERSHIP_QOS(i);
end if;
-- LIVELINESS -- LIVELINESS
if (ENDPOINT_LIVELINESS_QOS(i) /= DEFAULT_LIVELINESS_QOS or ENDPOINT_LEASE_DURATION(i) /= DEFAULT_LEASE_DURATION) then if (ENDPOINT_LIVELINESS_QOS(i) /= DEFAULT_LIVELINESS_QOS or ENDPOINT_LEASE_DURATION(i) /= DEFAULT_LEASE_DURATION) then
len := len + 1; len := len + 1;
@ -392,6 +444,15 @@ package body rtps_config_package is
len := len + 1; len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_LEASE_DURATION(i)(1)); ret.data(ind+len) := std_logic_vector(ENDPOINT_LEASE_DURATION(i)(1));
end if; end if;
-- TIME BASED FILTER
if (ENDPOINT_TIME_BASED_FILTER_QOS(i) /= DEFAULT_LATENCY_BUDGET_QOS) then
len := len + 1;
ret.data(ind+len) := PID_TIME_BASED_FILTER & std_logic_vector(to_unsigned(8, 16));
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_TIME_BASED_FILTER_QOS(i)(0));
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_TIME_BASED_FILTER_QOS(i)(1));
end if;
-- RELIABILITY -- RELIABILITY
if (ENDPOINT_RELIABILITY_QOS(i) /= DEFAULT_RELIABILTY_QOS or ENDPOINT_MAX_BLOCKING_TIME(i) /= DEFAULT_MAX_BLOCKING_TIME) then if (ENDPOINT_RELIABILITY_QOS(i) /= DEFAULT_RELIABILTY_QOS or ENDPOINT_MAX_BLOCKING_TIME(i) /= DEFAULT_MAX_BLOCKING_TIME) then
len := len + 1; len := len + 1;
@ -410,15 +471,6 @@ package body rtps_config_package is
len := len + 1; len := len + 1;
ret.data(ind+len) := ENDPOINT_DESTINATION_ORDER_QOS(i); ret.data(ind+len) := ENDPOINT_DESTINATION_ORDER_QOS(i);
end if; 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 => boolean_to_std_logic(ENDPOINT_COHERENT_ACCESS(i)), 16 => boolean_to_std_logic(ENDPOINT_ORDERED_ACCESS(i)), others => '0');
end if;
-- SENTINEL -- SENTINEL
len := len + 1; len := len + 1;
ret.data(ind+len) := PID_SENTINEL & std_logic_vector(to_unsigned(0, 16)); ret.data(ind+len) := PID_SENTINEL & std_logic_vector(to_unsigned(0, 16));
@ -512,6 +564,37 @@ package body rtps_config_package is
len := len + 1; len := len + 1;
ret.data(ind+len) := ENDPOINT_DURABILITY_QOS(i); ret.data(ind+len) := ENDPOINT_DURABILITY_QOS(i);
end if; end if;
-- DURABILITY SERVICE
if (ENDPOINT_DURABILITY_SERVICE_CLEANUP_DELAY(i) /= DEFAULT_DURABILITY_SERVICE_CLEANUP_DELAY or ENDPOINT_DURABILITY_SERVICE_HISTORY(i) /= DEFAULT_DURABILITY_SERVICE_HISTORY or
ENDPOINT_DURABILITY_SERVICE_HISTORY_DEPTH(i) /= DEFAULT_DURABILITY_SERVICE_HISTORY_DEPTH or ENDPOINT_DURABILITY_SERVICE_MAX_SAMPLES(i) /= DEFAULT_DURABILITY_SERVICE_MAX_SAMPLES or
ENDPOINT_DURABILITY_SERVICE_MAX_INSTANCES(i) /= DEFAULT_DURABILITY_SERVICE_MAX_INSTANCES or ENDPOINT_DURABILITY_SERVICE_MAX_SAMPLES_PER_INSTANCE(i) /= DEFAULT_DURABILITY_SERVICE_MAX_SAMPLES_PER_INSTANCE
) then
len := len + 1;
ret.data(ind+len) := PID_DURABILITY_SERVICE & std_logic_vector(to_unsigned(28, 16));
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_DURABILITY_SERVICE_CLEANUP_DELAY(i)(0));
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_DURABILITY_SERVICE_CLEANUP_DELAY(i)(1));
len := len + 1;
ret.data(ind+len) := ENDPOINT_DURABILITY_SERVICE_HISTORY(i);
len := len + 1;
ret.data(ind+len) := ENDPOINT_DURABILITY_SERVICE_HISTORY_DEPTH(i);
len := len + 1;
ret.data(ind+len) := ENDPOINT_DURABILITY_SERVICE_MAX_SAMPLES(i);
len := len + 1;
ret.data(ind+len) := ENDPOINT_DURABILITY_SERVICE_MAX_INSTANCES(i);
len := len + 1;
ret.data(ind+len) := ENDPOINT_DURABILITY_SERVICE_MAX_SAMPLES_PER_INSTANCE(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 => boolean_to_std_logic(ENDPOINT_COHERENT_ACCESS(i)), 16 => boolean_to_std_logic(ENDPOINT_ORDERED_ACCESS(i)), others => '0');
end if;
-- DEADLINE -- DEADLINE
if (ENDPOINT_DEADLINE_QOS(i) /= DEFAULT_DEADLINE_QOS) then if (ENDPOINT_DEADLINE_QOS(i) /= DEFAULT_DEADLINE_QOS) then
len := len + 1; len := len + 1;
@ -521,6 +604,29 @@ package body rtps_config_package is
len := len + 1; len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_DEADLINE_QOS(i)(1)); ret.data(ind+len) := std_logic_vector(ENDPOINT_DEADLINE_QOS(i)(1));
end if; end if;
-- LATENCY_BUDGET
if (ENDPOINT_LATENCY_BUDGET_QOS(i) /= DEFAULT_LATENCY_BUDGET_QOS) then
len := len + 1;
ret.data(ind+len) := PID_LATENCY_BUDGET & std_logic_vector(to_unsigned(8, 16));
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_LATENCY_BUDGET_QOS(i)(0));
len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_LATENCY_BUDGET_QOS(i)(1));
end if;
-- OWNERSHIP
if (ENDPOINT_OWNERSHIP_QOS(i) /= DEFAULT_OWNERSHIP_QOS) then
len := len + 1;
ret.data(ind+len) := PID_OWNERSHIP & std_logic_vector(to_unsigned(4, 16));
len := len + 1;
ret.data(ind+len) := ENDPOINT_OWNERSHIP_QOS(i);
end if;
-- OWNERSHIP STRENGTH
if (ENDPOINT_OWNERSHIP_STRENGTH_QOS(i) /= DEFAULT_OWNERSHIP_STRENGTH_QOS) then
len := len + 1;
ret.data(ind+len) := PID_OWNERSHIP_STRENGTH & std_logic_vector(to_unsigned(4, 16));
len := len + 1;
ret.data(ind+len) := ENDPOINT_OWNERSHIP_STRENGTH_QOS(i);
end if;
-- LIVELINESS -- LIVELINESS
if (ENDPOINT_LIVELINESS_QOS(i) /= DEFAULT_LIVELINESS_QOS or ENDPOINT_LEASE_DURATION(i) /= DEFAULT_LEASE_DURATION) then if (ENDPOINT_LIVELINESS_QOS(i) /= DEFAULT_LIVELINESS_QOS or ENDPOINT_LEASE_DURATION(i) /= DEFAULT_LEASE_DURATION) then
len := len + 1; len := len + 1;
@ -543,6 +649,13 @@ package body rtps_config_package is
len := len + 1; len := len + 1;
ret.data(ind+len) := std_logic_vector(ENDPOINT_MAX_BLOCKING_TIME(i)(1)); ret.data(ind+len) := std_logic_vector(ENDPOINT_MAX_BLOCKING_TIME(i)(1));
end if; end if;
-- TRANSPORT PRIORITY
if (ENDPOINT_TRANSPORT_PRIORITY_QOS(i) /= DEFAULT_TRANSPORT_PRIORITY_QOS) then
len := len + 1;
ret.data(ind+len) := PID_TRANSPORT_PRIORITY & std_logic_vector(to_unsigned(4, 16));
len := len + 1;
ret.data(ind+len) := ENDPOINT_TRANSPORT_PRIORITY_QOS(i);
end if;
-- LIFESPAN -- LIFESPAN
if (ENDPOINT_LIFESPAN_QOS(i) /= DEFAULT_LIFESPAN_QOS) then if (ENDPOINT_LIFESPAN_QOS(i) /= DEFAULT_LIFESPAN_QOS) then
len := len + 1; len := len + 1;
@ -559,15 +672,7 @@ package body rtps_config_package is
len := len + 1; len := len + 1;
ret.data(ind+len) := ENDPOINT_DESTINATION_ORDER_QOS(i); ret.data(ind+len) := ENDPOINT_DESTINATION_ORDER_QOS(i);
end if; end if;
-- PRESENTATION -- TODO: MAX_SIZE_SERIALIZED
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 => boolean_to_std_logic(ENDPOINT_COHERENT_ACCESS(i)), 16 => boolean_to_std_logic(ENDPOINT_ORDERED_ACCESS(i)), others => '0');
end if;
-- SENTINEL -- SENTINEL
len := len + 1; len := len + 1;
ret.data(ind+len) := PID_SENTINEL & std_logic_vector(to_unsigned(0, 16)); ret.data(ind+len) := PID_SENTINEL & std_logic_vector(to_unsigned(0, 16));
@ -658,22 +763,6 @@ package body rtps_config_package is
ret.data(ind+len) := (others => '0'); ret.data(ind+len) := (others => '0');
ret.data(ind+len)(31 downto 16) := VENDORID; ret.data(ind+len)(31 downto 16) := VENDORID;
-- TODO: Expects inline QoS of Participant -- 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 -- METATRAFFIC MULTICAST LOCATOR
len := len + 1; len := len + 1;
ret.data(ind+len) := PID_METATRAFFIC_MULTICAST_LOCATOR & std_logic_vector(to_unsigned(24, 16)); ret.data(ind+len) := PID_METATRAFFIC_MULTICAST_LOCATOR & std_logic_vector(to_unsigned(24, 16));
@ -689,15 +778,15 @@ package body rtps_config_package is
len := len + 1; len := len + 1;
ret.data(ind+len) := (others => '0'); ret.data(ind+len) := (others => '0');
len := len + 1; len := len + 1;
ret.data(ind+len) := DEFAULT_IPv4_META_ADDRESS; ret.data(ind+len) := DEFAULT_IPv4_ADDRESS;
-- DEFAULT UNICAST LOCATOR -- METATRAFFIC UNICAST LOCATOR
len := len + 1; len := len + 1;
ret.data(ind+len) := PID_DEFAULT_UNICAST_LOCATOR & std_logic_vector(to_unsigned(24, 16)); ret.data(ind+len) := PID_METATRAFFIC_UNICAST_LOCATOR & std_logic_vector(to_unsigned(24, 16));
len := len + 1; len := len + 1;
ret.data(ind+len) := LOCATOR_KIND_UDPv4; ret.data(ind+len) := LOCATOR_KIND_UDPv4;
len := len + 1; len := len + 1;
ret.data(ind+len) := (others => '0'); ret.data(ind+len) := (others => '0');
ret.data(ind+len)(15 downto 0) := USER_IPv4_UNICAST_PORT; ret.data(ind+len)(15 downto 0) := META_IPv4_UNICAST_PORT;
len := len + 1; len := len + 1;
ret.data(ind+len) := (others => '0'); ret.data(ind+len) := (others => '0');
len := len + 1; len := len + 1;
@ -705,7 +794,7 @@ package body rtps_config_package is
len := len + 1; len := len + 1;
ret.data(ind+len) := (others => '0'); ret.data(ind+len) := (others => '0');
len := len + 1; len := len + 1;
ret.data(ind+len) := DEFAULT_IPv4_META_ADDRESS; ret.data(ind+len) := DEFAULT_IPv4_ADDRESS;
-- DEFAULT MULTICAST LOCATOR -- DEFAULT MULTICAST LOCATOR
len := len + 1; len := len + 1;
ret.data(ind+len) := PID_DEFAULT_MULTICAST_LOCATOR & std_logic_vector(to_unsigned(24, 16)); ret.data(ind+len) := PID_DEFAULT_MULTICAST_LOCATOR & std_logic_vector(to_unsigned(24, 16));
@ -721,7 +810,23 @@ package body rtps_config_package is
len := len + 1; len := len + 1;
ret.data(ind+len) := (others => '0'); ret.data(ind+len) := (others => '0');
len := len + 1; len := len + 1;
ret.data(ind+len) := DEFAULT_IPv4_META_ADDRESS; ret.data(ind+len) := DEFAULT_IPv4_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_ADDRESS;
-- LEASE DURATION -- LEASE DURATION
if (PARTICIPANT_LEASE_DURATION /= DEFAULT_PARTICIPANT_LEASE_DURATION) then if (PARTICIPANT_LEASE_DURATION /= DEFAULT_PARTICIPANT_LEASE_DURATION) then
len := len + 1; len := len + 1;
@ -760,8 +865,9 @@ package body rtps_config_package is
constant PARTICIPANT_DATA : OUTPUT_DATA_TYPE := gen_participant_data; constant PARTICIPANT_DATA : OUTPUT_DATA_TYPE := gen_participant_data;
-- Direction 1 : Offered >= Requested
-- Direction 0 : Offered <= Requested -- Direction 0 : Offered <= Requested
-- Direction 1 : Offered >= Requested
-- src_is_reader 1 : Remote is Subscriber-Requested -- src_is_reader 1 : Remote is Subscriber-Requested
-- src_is_reader 0 : Remote is Publisher-Offered -- src_is_reader 0 : Remote is Publisher-Offered
function check_qos_compatibility(src_is_reader : std_logic; direction : std_logic; remote : unsigned(WORD_WIDTH-1 downto 0); local : unsigned(WORD_WIDTH-1 downto 0)) return boolean is function check_qos_compatibility(src_is_reader : std_logic; direction : std_logic; remote : unsigned(WORD_WIDTH-1 downto 0); local : unsigned(WORD_WIDTH-1 downto 0)) return boolean is
@ -783,6 +889,29 @@ package body rtps_config_package is
return ret; return ret;
end function; end function;
-- Direction 0 : Offered <= Requested
-- Direction 1 : Offered >= Requested
-- src_is_reader 1 : Remote is Subscriber-Requested
-- src_is_reader 0 : Remote is Publisher-Offered
function check_qos_compatibility(src_is_reader : std_logic; direction : std_logic; remote : DOUBLE_WORD_ARRAY; local : DOUBLE_WORD_ARRAY) return boolean is
variable ret : boolean;
begin
-- Default Match
ret := TRUE;
if ((src_is_reader xor direction) = '1') then
if (remote < local) then
ret := FALSE;
end if;
else
if (remote > local) then
ret := FALSE;
end if;
end if;
return ret;
end function;
function gen_default_qos_match(is_reader : boolean) return DEFAULT_QOS_MATCH_TYPE is function gen_default_qos_match(is_reader : boolean) return DEFAULT_QOS_MATCH_TYPE is
variable ret : DEFAULT_QOS_MATCH_TYPE; variable ret : DEFAULT_QOS_MATCH_TYPE;
begin begin
@ -856,6 +985,20 @@ package body rtps_config_package is
constant READER_DEFAULT_QOS_MATCH : DEFAULT_QOS_MATCH_TYPE := gen_default_qos_match(TRUE); constant READER_DEFAULT_QOS_MATCH : DEFAULT_QOS_MATCH_TYPE := gen_default_qos_match(TRUE);
constant WRITER_DEFAULT_QOS_MATCH : DEFAULT_QOS_MATCH_TYPE := gen_default_qos_match(FALSE); constant WRITER_DEFAULT_QOS_MATCH : DEFAULT_QOS_MATCH_TYPE := gen_default_qos_match(FALSE);
function gen_manual_by_participant_writers return std_logic_vector is
variable ret : std_logic_vector(0 to NUM_ENDPOINTS-1) := (others => '0');
begin
for i in 0 to NUM_ENDPOINTS-1 loop
if (ENDPOINT_LIVELINESS_QOS(i) = MANUAL_BY_PARTICIPANT_LIVELINESS_QOS) then
ret(i) := '1';
end if;
end loop;
ret := ret and (not ENDPOINT_READERS);
return ret;
end function;
constant MANUAL_BY_PARTICIPANT_WRITERS : std_logic_vector(0 to NUM_ENDPOINTS-1) := gen_manual_by_participant_writers;
-- Returns the 'data' argument either as is, or with reversed Byte order, depending on the -- Returns the 'data' argument either as is, or with reversed Byte order, depending on the
-- 'swap' argument. -- 'swap' argument.
function endian_swap(swap : std_logic; data : std_logic_vector) return std_logic_vector is function endian_swap(swap : std_logic; data : std_logic_vector) return std_logic_vector is

View File

@ -377,8 +377,8 @@ package body rtps_package is
-- If Fraction Bit is >= 500 ms it cannot be represented as a natural (because naturals/integers are signed). -- If Fraction Bit is >= 500 ms it cannot be represented as a natural (because naturals/integers are signed).
-- So we handle that manualy -- So we handle that manualy
if (ns >= half_sec) then if (ns >= half_sec) then
ret(1) := to_unsigned(natural(CEIL(real(ns-half_sec)*unit)),WORD_WIDTH);
ret(1)(31) := '1'; ret(1)(31) := '1';
ret(1) := to_unsigned(natural(CEIL(real(ns/2)*unit)),WORD_WIDTH);
else else
ret(1) := to_unsigned(natural(CEIL(real(ns)*unit)),WORD_WIDTH); ret(1) := to_unsigned(natural(CEIL(real(ns)*unit)),WORD_WIDTH);
end if; end if;

View File

@ -90,7 +90,7 @@ package rtps_test_package is
dest : LOCATOR_TYPE; dest : LOCATOR_TYPE;
end record; end record;
constant DEFAULT_UDP_HEADER : OUTPUT_HEADER_TYPE; -- Deferred to Package Body constant DEFAULT_OUTPUT_HEADER : OUTPUT_HEADER_TYPE; -- Deferred to Package Body
-- *RTPS HEADER* -- *RTPS HEADER*
type RTPS_HEADER_TYPE is record type RTPS_HEADER_TYPE is record
@ -160,6 +160,7 @@ package rtps_test_package is
end record; end record;
constant DEFAULT_PARTICIPANT_DATA : PARTICIPANT_DATA_TYPE; -- Deferred to Pckage Body constant DEFAULT_PARTICIPANT_DATA : PARTICIPANT_DATA_TYPE; -- Deferred to Pckage Body
constant THIS_PARTICIPANT_DATA : PARTICIPANT_DATA_TYPE; -- Deferred to Pckage Body
type ENDPOINT_DATA_TYPE is record type ENDPOINT_DATA_TYPE is record
littleEndian : std_logic; littleEndian : std_logic;
@ -226,6 +227,9 @@ package rtps_test_package is
procedure gen_participant_match_frame( ref : in PARTICIPANT_DATA_TYPE; output : inout TEST_PACKET_TYPE); procedure gen_participant_match_frame( ref : in PARTICIPANT_DATA_TYPE; output : inout TEST_PACKET_TYPE);
function gen_endpoint_array(readers : boolean) return ENDPOINT_DATA_ARRAY_TYPE; function gen_endpoint_array(readers : boolean) return ENDPOINT_DATA_ARRAY_TYPE;
procedure gen_liveliness_assertion(participant : in PARTICIPANT_DATA_TYPE; manual : in boolean; extra_data : in TEST_PACKET_TYPE; output : inout TEST_PACKET_TYPE);
procedure gen_liveliness_assertion(participant : in PARTICIPANT_DATA_TYPE; manual : in boolean; output : inout TEST_PACKET_TYPE);
procedure gen_sentinel(output : inout TEST_PACKET_TYPE); procedure gen_sentinel(output : inout TEST_PACKET_TYPE);
procedure gen_parameter(pid : in std_logic_vector(PARAMETER_ID_WIDTH-1 downto 0); data : in TEST_PACKET_TYPE; output : inout TEST_PACKET_TYPE); procedure gen_parameter(pid : in std_logic_vector(PARAMETER_ID_WIDTH-1 downto 0); data : in TEST_PACKET_TYPE; output : inout TEST_PACKET_TYPE);
@ -234,6 +238,10 @@ package rtps_test_package is
function int(n : integer; width : natural) return std_logic_vector; function int(n : integer; width : natural) return std_logic_vector;
function to_string1 (input : std_logic_vector) return string; function to_string1 (input : std_logic_vector) return string;
-- NOTE: This assume a specific sending order (Multicast before Unicast)!
function get_loc (ref : PARTICIPANT_DATA_TYPE; meta : boolean) return LOCATOR_TYPE;
function get_loc (ref : ENDPOINT_DATA_TYPE) return LOCATOR_TYPE;
end package; end package;
package body rtps_test_package is package body rtps_test_package is
@ -339,7 +347,7 @@ package body rtps_test_package is
) )
); );
constant DEFAULT_UDP_HEADER : OUTPUT_HEADER_TYPE := ( constant DEFAULT_OUTPUT_HEADER : OUTPUT_HEADER_TYPE := (
src => EMPTY_LOCATOR, src => EMPTY_LOCATOR,
dest => EMPTY_LOCATOR dest => EMPTY_LOCATOR
); );
@ -405,6 +413,27 @@ package body rtps_test_package is
nr => 0 nr => 0
); );
constant THIS_PARTICIPANT_DATA : PARTICIPANT_DATA_TYPE := (
littleEndian => '0',
domainId => DOMAIN_ID,
domainTag => DOMAIN_TAG,
protocolVersion => PROTOCOLVERSION_2_4,
vendorId => VENDORID_UNKNOWN,
guidPrefix => GUIDPREFIX,
entityId => ENTITYID_PARTICIPANT,
expectsInlineQoS => (others => '0'),
metatrafficUnicastLocatorList => (numLocators => int(1,CDR_LONG_WIDTH), locator => (0 => DEST_LOC.meta.locator(3), others => EMPTY_LOCATOR)),
metatrafficMulticastLocatorList => (numLocators => int(1,CDR_LONG_WIDTH), locator => (0 => DEST_LOC.meta.locator(2), others => EMPTY_LOCATOR)),
defaultUnicastLocatorList => (numLocators => int(1,CDR_LONG_WIDTH), locator => (0 => DEST_LOC.user.locator(1), others => EMPTY_LOCATOR)),
defaultMulticastLocatorList => (numLocators => int(1,CDR_LONG_WIDTH), locator => (0 => DEST_LOC.user.locator(0), others => EMPTY_LOCATOR)),
leaseDuration => PARTICIPANT_LEASE_DURATION,
manualLivelinessCount => (others => '0'),
builtinEndpointQoS => (others => '0'),
availableBuiltinEndpoints => (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', DISC_BUILTIN_ENDPOINT_PUBLICATIONS_ANNOUNCER => '1', DISC_BUILTIN_ENDPOINT_PUBLICATIONS_DETECTOR => '1', DISC_BUILTIN_ENDPOINT_SUBSCRIPTIONS_ANNOUNCER => '1', DISC_BUILTIN_ENDPOINT_SUBSCRIPTIONS_DETECTOR => '1', others => '0'),
match => MATCH,
nr => 0
);
constant DEFAULT_ENDPOINT_DATA : ENDPOINT_DATA_TYPE := ( constant DEFAULT_ENDPOINT_DATA : ENDPOINT_DATA_TYPE := (
littleEndian => '0', littleEndian => '0',
participant => DEFAULT_PARTICIPANT_DATA, participant => DEFAULT_PARTICIPANT_DATA,
@ -917,6 +946,39 @@ package body rtps_test_package is
gen_rtps_handler_out(ref, get_loc(endpoint.participant, TRUE), TRUE, TIME_INVALID, endpoint.participant.guidPrefix, output); gen_rtps_handler_out(ref, get_loc(endpoint.participant, TRUE), TRUE, TIME_INVALID, endpoint.participant.guidPrefix, output);
end procedure; end procedure;
procedure gen_liveliness_assertion(participant : in PARTICIPANT_DATA_TYPE; manual : in boolean; extra_data : in TEST_PACKET_TYPE; output : inout TEST_PACKET_TYPE) is
begin
-- Representation Identifier & Representation Options
output.data(output.length) := CDR_BE & x"0000";
output.length := output.length + 1;
-- GUID Prefix
output.data(output.length) := participant.guidPrefix(0);
output.length := output.length + 1;
output.data(output.length) := participant.guidPrefix(1);
output.length := output.length + 1;
output.data(output.length) := participant.guidPrefix(2);
output.length := output.length + 1;
-- Participant Message Kind
if (manual) then
output.data(output.length) := PARTICIPANT_MESSAGE_DATA_KIND_MANUAL_LIVELINESS_UPDATE;
else
output.data(output.length) := PARTICIPANT_MESSAGE_DATA_KIND_AUTOMATIC_LIVELINESS_UPDATE;
end if;
output.length := output.length + 1;
-- DATA Length
output.data(output.length) := int(extra_data.length, WORD_WIDTH);
output.length := output.length + 1;
for i in 0 to extra_data.length-1 loop
output.data(output.length) := extra_data.data(i);
output.length := output.length + 1;
end loop;
end procedure;
procedure gen_liveliness_assertion(participant : in PARTICIPANT_DATA_TYPE; manual : in boolean; output : inout TEST_PACKET_TYPE) is
begin
gen_liveliness_assertion(participant, manual, EMPTY_TEST_PACKET, output);
end procedure;
procedure gen_participant_data( ref : in PARTICIPANT_DATA_TYPE; output : inout TEST_PACKET_TYPE; pid : in std_logic_vector(PARAMETER_ID_WIDTH-1 downto 0); offset : in integer) is procedure gen_participant_data( ref : in PARTICIPANT_DATA_TYPE; output : inout TEST_PACKET_TYPE; pid : in std_logic_vector(PARAMETER_ID_WIDTH-1 downto 0); offset : in integer) is
variable tmp : natural := 0; variable tmp : natural := 0;
begin begin
@ -1507,7 +1569,7 @@ package body rtps_test_package is
end if; end if;
end if; end if;
-- OWNERSHIP STRENGTH -- OWNERSHIP STRENGTH
if (ref.ownership /= DEFAULT_OWNERSHIP_STRENGTH_QOS or pid = PID_OWNERSHIP_STRENGTH) then if (ref.ownership_strength /= DEFAULT_OWNERSHIP_STRENGTH_QOS or pid = PID_OWNERSHIP_STRENGTH) then
if (pid = PID_OWNERSHIP_STRENGTH) then if (pid = PID_OWNERSHIP_STRENGTH) then
assert (4+(offset*4) >= 0) report "Parameter Length < 0" severity FAILURE; assert (4+(offset*4) >= 0) report "Parameter Length < 0" severity FAILURE;
output.data(output.length) := PID_OWNERSHIP_STRENGTH & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_OWNERSHIP_STRENGTH & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH));
@ -1623,34 +1685,6 @@ package body rtps_test_package is
output.length := output.length + offset; output.length := output.length + offset;
end if; end if;
end if; end if;
-- UNICAST LOCATORS
if (unsigned(ref.unicastLocatorList.numLocators) > 0) then
tmp := to_integer(unsigned(ref.unicastLocatorList.numLocators));
for i in 0 to tmp-1 loop
if (pid = PID_UNICAST_LOCATOR) then
assert (24+(offset*4) >= 0) report "Parameter Length < 0" severity FAILURE;
output.data(output.length) := PID_UNICAST_LOCATOR & endian_swap(ref.littleEndian, int(24+(offset*4),PARAMETER_LENGTH_WIDTH));
else
output.data(output.length) := PID_UNICAST_LOCATOR & endian_swap(ref.littleEndian, int(24,PARAMETER_LENGTH_WIDTH));
end if;
output.length := output.length + 1;
output.data(output.length) := endian_swap(ref.littleEndian, ref.unicastLocatorList.locator(i).kind);
output.length := output.length + 1;
output.data(output.length) := endian_swap(ref.littleEndian, ref.unicastLocatorList.locator(i).portn);
output.length := output.length + 1;
output.data(output.length) := ref.unicastLocatorList.locator(i).addr(127 downto 96);
output.length := output.length + 1;
output.data(output.length) := ref.unicastLocatorList.locator(i).addr(95 downto 64);
output.length := output.length + 1;
output.data(output.length) := ref.unicastLocatorList.locator(i).addr(63 downto 32);
output.length := output.length + 1;
output.data(output.length) := ref.unicastLocatorList.locator(i).addr(31 downto 0);
output.length := output.length + 1;
if (pid = PID_UNICAST_LOCATOR) then
output.length := output.length + offset;
end if;
end loop;
end if;
-- MULTICAST LOCATORS -- MULTICAST LOCATORS
if (unsigned(ref.multicastLocatorList.numLocators) > 0) then if (unsigned(ref.multicastLocatorList.numLocators) > 0) then
tmp := to_integer(unsigned(ref.multicastLocatorList.numLocators)); tmp := to_integer(unsigned(ref.multicastLocatorList.numLocators));
@ -1679,6 +1713,34 @@ package body rtps_test_package is
end if; end if;
end loop; end loop;
end if; end if;
-- UNICAST LOCATORS
if (unsigned(ref.unicastLocatorList.numLocators) > 0) then
tmp := to_integer(unsigned(ref.unicastLocatorList.numLocators));
for i in 0 to tmp-1 loop
if (pid = PID_UNICAST_LOCATOR) then
assert (24+(offset*4) >= 0) report "Parameter Length < 0" severity FAILURE;
output.data(output.length) := PID_UNICAST_LOCATOR & endian_swap(ref.littleEndian, int(24+(offset*4),PARAMETER_LENGTH_WIDTH));
else
output.data(output.length) := PID_UNICAST_LOCATOR & endian_swap(ref.littleEndian, int(24,PARAMETER_LENGTH_WIDTH));
end if;
output.length := output.length + 1;
output.data(output.length) := endian_swap(ref.littleEndian, ref.unicastLocatorList.locator(i).kind);
output.length := output.length + 1;
output.data(output.length) := endian_swap(ref.littleEndian, ref.unicastLocatorList.locator(i).portn);
output.length := output.length + 1;
output.data(output.length) := ref.unicastLocatorList.locator(i).addr(127 downto 96);
output.length := output.length + 1;
output.data(output.length) := ref.unicastLocatorList.locator(i).addr(95 downto 64);
output.length := output.length + 1;
output.data(output.length) := ref.unicastLocatorList.locator(i).addr(63 downto 32);
output.length := output.length + 1;
output.data(output.length) := ref.unicastLocatorList.locator(i).addr(31 downto 0);
output.length := output.length + 1;
if (pid = PID_UNICAST_LOCATOR) then
output.length := output.length + offset;
end if;
end loop;
end if;
-- USER DATA -- USER DATA
tmp := string_len(ref.user_data); tmp := string_len(ref.user_data);
if (tmp > 1) then if (tmp > 1) then
@ -1842,6 +1904,9 @@ package body rtps_test_package is
ret_readers(i).transportnpriority := ENDPOINT_TRANSPORT_PRIORITY_QOS(i); ret_readers(i).transportnpriority := ENDPOINT_TRANSPORT_PRIORITY_QOS(i);
ret_readers(i).lifespan := ENDPOINT_LIFESPAN_QOS(i); ret_readers(i).lifespan := ENDPOINT_LIFESPAN_QOS(i);
ret_readers(i).destination_order := ENDPOINT_DESTINATION_ORDER_QOS(i); ret_readers(i).destination_order := ENDPOINT_DESTINATION_ORDER_QOS(i);
ret_readers(i).expectsInlineQoS(0) := '1';
ret_readers(i).participant := THIS_PARTICIPANT_DATA;
ret_readers(i).entityId := ENTITYID(i);
end loop; end loop;
return ret_readers; return ret_readers;
else else
@ -1870,6 +1935,8 @@ package body rtps_test_package is
ret_writers(i-NUM_READERS).transportnpriority := ENDPOINT_TRANSPORT_PRIORITY_QOS(i); ret_writers(i-NUM_READERS).transportnpriority := ENDPOINT_TRANSPORT_PRIORITY_QOS(i);
ret_writers(i-NUM_READERS).lifespan := ENDPOINT_LIFESPAN_QOS(i); ret_writers(i-NUM_READERS).lifespan := ENDPOINT_LIFESPAN_QOS(i);
ret_writers(i-NUM_READERS).destination_order := ENDPOINT_DESTINATION_ORDER_QOS(i); ret_writers(i-NUM_READERS).destination_order := ENDPOINT_DESTINATION_ORDER_QOS(i);
ret_writers(i-NUM_READERS).participant := THIS_PARTICIPANT_DATA;
ret_writers(i-NUM_READERS).entityId := ENTITYID(i);
end loop; end loop;
return ret_writers; return ret_writers;
end if; end if;

View File

@ -56,13 +56,13 @@ package user_config is
constant PARTICIPANT_HEARTBEAT_PERIOD : DURATION_TYPE := gen_duration(1,0); -- 1 s 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_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_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_RESPONSE_DELAY : DURATION_TYPE := gen_duration(0,200*(10**6)); -- 200 ms
constant PARTICIPANT_ACKNACK_SUPPRESSION_DELAY : DURATION_TYPE := gen_duration(0,0); constant PARTICIPANT_ACKNACK_SUPPRESSION_DELAY : DURATION_TYPE := gen_duration(0,0);
-- Array mapping Timing Characteristics to Endpoints -- 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_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_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_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_RESPONSE_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => gen_duration(0,200*(10**6))); -- 200 ms
constant ENDPOINT_ACKNACK_SUPPRESSION_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => gen_duration(0,0)); constant ENDPOINT_ACKNACK_SUPPRESSION_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => gen_duration(0,0));