diff --git a/src/Tests/Level_0/rtps_builtin_endpoint_test1.vhd b/src/Tests/Level_0/rtps_builtin_endpoint_test1.vhd index 5d55a11..48166e7 100644 --- a/src/Tests/Level_0/rtps_builtin_endpoint_test1.vhd +++ b/src/Tests/Level_0/rtps_builtin_endpoint_test1.vhd @@ -147,7 +147,7 @@ begin participant.availableBuiltinEndpoints(DISC_BUILTIN_ENDPOINT_PUBLICATIONS_ANNOUNCER) := '1'; gen_participant_data(participant, rtps_sub.data); gen_sentinel(rtps_sub.data); - gen_rtps_handler_out(rtps_sub, gen_rand_loc_2, TRUE, TIME_INVALID, participant.guidPrefix, stimulus); + gen_rtps_handler_out(rtps_sub, participant, stimulus); SB.Push(gen_participant_mem_frame(participant)); start_test; wait_on_complete; @@ -170,7 +170,7 @@ begin participant.availableBuiltinEndpoints(DISC_BUILTIN_ENDPOINT_PUBLICATIONS_ANNOUNCER) := '1'; gen_participant_data(participant, rtps_sub.data); gen_sentinel(rtps_sub.data); - gen_rtps_handler_out(rtps_sub, gen_rand_loc_2, TRUE, TIME_INVALID, participant.guidPrefix, stimulus); + gen_rtps_handler_out(rtps_sub, participant, stimulus); SB.Push(gen_participant_mem_frame(participant)); start_test; wait_on_complete; @@ -193,7 +193,7 @@ begin participant.availableBuiltinEndpoints(DISC_BUILTIN_ENDPOINT_PUBLICATIONS_ANNOUNCER) := '1'; gen_participant_data(participant, rtps_sub.data); gen_sentinel(rtps_sub.data); - gen_rtps_handler_out(rtps_sub, gen_rand_loc_2, TRUE, TIME_INVALID, participant.guidPrefix, stimulus); + gen_rtps_handler_out(rtps_sub, participant, stimulus); SB.Push(gen_participant_mem_frame(participant)); start_test; wait_on_complete; @@ -216,7 +216,7 @@ begin participant.availableBuiltinEndpoints(DISC_BUILTIN_ENDPOINT_PUBLICATIONS_ANNOUNCER) := '1'; gen_participant_data(participant, rtps_sub.data); gen_sentinel(rtps_sub.data); - gen_rtps_handler_out(rtps_sub, gen_rand_loc_2, TRUE, TIME_INVALID, participant.guidPrefix, stimulus); + gen_rtps_handler_out(rtps_sub, participant, stimulus); SB.Push(gen_participant_mem_frame(participant)); start_test; wait_on_complete; @@ -239,7 +239,7 @@ begin participant.availableBuiltinEndpoints(DISC_BUILTIN_ENDPOINT_PUBLICATIONS_ANNOUNCER) := '1'; gen_participant_data(participant, rtps_sub.data); gen_sentinel(rtps_sub.data); - gen_rtps_handler_out(rtps_sub, gen_rand_loc_2, TRUE, TIME_INVALID, participant.guidPrefix, stimulus); + gen_rtps_handler_out(rtps_sub, participant, stimulus); SB.Push(gen_participant_mem_frame(participant)); start_test; wait_on_complete; @@ -262,7 +262,7 @@ begin participant.availableBuiltinEndpoints(DISC_BUILTIN_ENDPOINT_PUBLICATIONS_ANNOUNCER) := '1'; gen_participant_data(participant, rtps_sub.data); gen_sentinel(rtps_sub.data); - gen_rtps_handler_out(rtps_sub, gen_rand_loc_2, TRUE, TIME_INVALID, participant.guidPrefix, stimulus); + gen_rtps_handler_out(rtps_sub, participant, stimulus); SB.Push(gen_participant_mem_frame(participant)); start_test; wait_on_complete; @@ -285,7 +285,7 @@ begin participant.availableBuiltinEndpoints(DISC_BUILTIN_ENDPOINT_PUBLICATIONS_ANNOUNCER) := '1'; gen_participant_data(participant, rtps_sub.data); gen_sentinel(rtps_sub.data); - gen_rtps_handler_out(rtps_sub, gen_rand_loc_2, TRUE, TIME_INVALID, participant.guidPrefix, stimulus); + gen_rtps_handler_out(rtps_sub, participant, stimulus); SB.Push(gen_participant_mem_frame(participant)); start_test; wait_on_complete; @@ -315,7 +315,7 @@ begin participant.availableBuiltinEndpoints(DISC_BUILTIN_ENDPOINT_PUBLICATIONS_ANNOUNCER) := '1'; gen_participant_data(participant, rtps_sub.data); gen_sentinel(rtps_sub.data); - gen_rtps_handler_out(rtps_sub, gen_rand_loc_2, TRUE, TIME_INVALID, participant.guidPrefix, stimulus); + gen_rtps_handler_out(rtps_sub, participant, stimulus); SB.Push(gen_participant_mem_frame(participant)); start_test; wait_on_complete; @@ -338,7 +338,7 @@ begin participant.availableBuiltinEndpoints(DISC_BUILTIN_ENDPOINT_PUBLICATIONS_ANNOUNCER) := '1'; gen_participant_data(participant, rtps_sub.data); gen_sentinel(rtps_sub.data); - gen_rtps_handler_out(rtps_sub, gen_rand_loc_2, TRUE, TIME_INVALID, participant.guidPrefix, stimulus); + gen_rtps_handler_out(rtps_sub, participant, stimulus); SB.Push(gen_participant_mem_frame(participant)); start_test; wait_on_complete; @@ -361,7 +361,7 @@ begin participant.availableBuiltinEndpoints(DISC_BUILTIN_ENDPOINT_PUBLICATIONS_ANNOUNCER) := '1'; gen_participant_data(participant, rtps_sub.data); gen_sentinel(rtps_sub.data); - gen_rtps_handler_out(rtps_sub, gen_rand_loc_2, TRUE, TIME_INVALID, participant.guidPrefix, stimulus); + gen_rtps_handler_out(rtps_sub, participant, stimulus); SB.Push(gen_participant_mem_frame(participant)); start_test; wait_on_complete; @@ -381,7 +381,7 @@ begin participant.availableBuiltinEndpoints(DISC_BUILTIN_ENDPOINT_PUBLICATIONS_DETECTOR) := '1'; gen_participant_data(participant, rtps_sub.data); gen_sentinel(rtps_sub.data); - gen_rtps_handler_out(rtps_sub, gen_rand_loc_2, TRUE, TIME_INVALID, participant.guidPrefix, stimulus); + gen_rtps_handler_out(rtps_sub, participant, stimulus); SB.Push(gen_participant_mem_frame(participant)); start_test; wait_on_complete; @@ -401,7 +401,7 @@ begin participant.availableBuiltinEndpoints(DISC_BUILTIN_ENDPOINT_SUBSCRIPTIONS_DETECTOR) := '1'; gen_participant_data(participant, rtps_sub.data); gen_sentinel(rtps_sub.data); - gen_rtps_handler_out(rtps_sub, gen_rand_loc_2, TRUE, TIME_INVALID, participant.guidPrefix, stimulus); + gen_rtps_handler_out(rtps_sub, participant, stimulus); SB.Push(gen_participant_mem_frame(participant)); start_test; wait_on_complete; @@ -436,7 +436,7 @@ begin participant.availableBuiltinEndpoints(DISC_BUILTIN_ENDPOINT_SUBSCRIPTIONS_DETECTOR) := '1'; gen_participant_data(participant, rtps_sub.data); gen_sentinel(rtps_sub.data); - gen_rtps_handler_out(rtps_sub, gen_rand_loc_2, TRUE, TIME_INVALID, participant.guidPrefix, stimulus); + gen_rtps_handler_out(rtps_sub, participant, stimulus); SB.Push(gen_participant_mem_frame(participant)); start_test; wait_on_complete; @@ -454,7 +454,7 @@ begin participant.defaultUnicastLocatorList := (numLocators => int(1,CDR_LONG_WIDTH), locator => (0 => gen_rand_loc_2, others => EMPTY_LOCATOR)); gen_participant_data(participant, rtps_sub.data); gen_sentinel(rtps_sub.data); - gen_rtps_handler_out(rtps_sub, gen_rand_loc_2, TRUE, TIME_INVALID, participant.guidPrefix, stimulus); + gen_rtps_handler_out(rtps_sub, participant, stimulus); SB.Push(gen_participant_mem_frame(participant)); start_test; wait_on_complete; @@ -474,7 +474,7 @@ begin participant.availableBuiltinEndpoints(DISC_BUILTIN_ENDPOINT_PUBLICATIONS_DETECTOR) := '1'; gen_participant_data(participant, rtps_sub.data); gen_sentinel(rtps_sub.data); - gen_rtps_handler_out(rtps_sub, gen_rand_loc_2, TRUE, TIME_INVALID, participant.guidPrefix, stimulus); + gen_rtps_handler_out(rtps_sub, participant, stimulus); SB.Push(gen_participant_mem_frame(participant)); start_test; wait_on_complete; @@ -488,7 +488,7 @@ begin -- Mark Packet as non-standard Payload, in order to trigger the packet to be skipped (as early as possible) rtps_sub.data := EMPTY_TEST_PACKET; rtps_sub.flags(SUBMESSAGE_NON_STANDARD_PAYLOAD_FLAG_POS):= '1'; - gen_rtps_handler_out(rtps_sub, gen_rand_loc_2, TRUE, TIME_INVALID, p0, stimulus); + gen_rtps_handler_out(rtps_sub, participant, stimulus); start_test; wait_on_complete; diff --git a/src/Tests/Level_0/rtps_builtin_endpoint_test2.vhd b/src/Tests/Level_0/rtps_builtin_endpoint_test2.vhd index 33ba377..a217c7e 100644 --- a/src/Tests/Level_0/rtps_builtin_endpoint_test2.vhd +++ b/src/Tests/Level_0/rtps_builtin_endpoint_test2.vhd @@ -334,7 +334,7 @@ begin sub.writerSN := p0_sn; gen_participant_data(p0, sub.data); gen_sentinel(sub.data); - gen_rtps_handler_out(sub, gen_rand_loc_2, TRUE, TIME_INVALID, p0.guidPrefix, stimulus); + gen_rtps_handler_out(sub, p0, stimulus); start_test; wait_on_complete; stimulus := EMPTY_TEST_PACKET; @@ -348,7 +348,7 @@ begin sub.writerSN := p1_sn; gen_participant_data(p1, sub.data); gen_sentinel(sub.data); - gen_rtps_handler_out(sub, gen_rand_loc_2, TRUE, TIME_INVALID, p1.guidPrefix, stimulus); + gen_rtps_handler_out(sub, p1, stimulus); start_test; wait_on_complete; stimulus := EMPTY_TEST_PACKET; @@ -362,7 +362,7 @@ begin sub.writerSN := p2_sn; gen_participant_data(p2, sub.data); gen_sentinel(sub.data); - gen_rtps_handler_out(sub, gen_rand_loc_2, TRUE, TIME_INVALID, p2.guidPrefix, stimulus); + gen_rtps_handler_out(sub, p2, stimulus); start_test; wait_on_complete; stimulus := EMPTY_TEST_PACKET; @@ -378,7 +378,7 @@ begin endpoint.participant := p0; gen_endpoint_data(endpoint, sub_p.data); gen_sentinel(sub_p.data); - gen_rtps_handler_out(sub_p, gen_rand_loc_2, TRUE, TIME_INVALID, endpoint.participant.guidPrefix, stimulus); + gen_rtps_handler_out(sub_p, endpoint, stimulus); gen_match_frame(endpoint, reference); wr_sig := gen_wr(i, FALSE); if (or wr_sig = '1') then @@ -401,7 +401,7 @@ begin endpoint.littleEndian:= '1'; gen_endpoint_data(endpoint, sub_p.data); gen_sentinel(sub_p.data); - gen_rtps_handler_out(sub_p, gen_rand_loc_2, TRUE, TIME_INVALID, endpoint.participant.guidPrefix, stimulus); + gen_rtps_handler_out(sub_p, endpoint, stimulus); gen_match_frame(endpoint, reference); wr_sig := gen_wr(i, FALSE); if (or wr_sig = '1') then @@ -423,7 +423,7 @@ begin endpoint.participant := p0; gen_endpoint_data(endpoint, sub_s.data); gen_sentinel(sub_s.data); - gen_rtps_handler_out(sub_s, gen_rand_loc_2, TRUE, TIME_INVALID, endpoint.participant.guidPrefix, stimulus); + gen_rtps_handler_out(sub_s, endpoint, stimulus); gen_match_frame(endpoint, reference); wr_sig := gen_wr(i, TRUE); if (or wr_sig = '1') then @@ -446,7 +446,7 @@ begin endpoint.littleEndian:= '1'; gen_endpoint_data(endpoint, sub_s.data); gen_sentinel(sub_s.data); - gen_rtps_handler_out(sub_s, gen_rand_loc_2, TRUE, TIME_INVALID, endpoint.participant.guidPrefix, stimulus); + gen_rtps_handler_out(sub_s, endpoint, stimulus); gen_match_frame(endpoint, reference); wr_sig := gen_wr(i, TRUE); if (or wr_sig = '1') then @@ -467,7 +467,7 @@ begin p1.match := UNMATCH; gen_participant_data(p1, sub.data); gen_sentinel(sub.data); - gen_rtps_handler_out(sub, gen_rand_loc_2, TRUE, TIME_INVALID, p1.guidPrefix, stimulus); + gen_rtps_handler_out(sub, p1, stimulus); start_test; wait_on_complete; stimulus := EMPTY_TEST_PACKET; @@ -515,7 +515,7 @@ begin endpoint.durability := PERSISTENT_DURABILITY_QOS; gen_endpoint_data(endpoint, sub_p.data); gen_sentinel(sub_p.data); - gen_rtps_handler_out(sub_p, gen_rand_loc_2, TRUE, TIME_INVALID, endpoint.participant.guidPrefix, stimulus); + gen_rtps_handler_out(sub_p, endpoint, stimulus); gen_match_frame(endpoint, reference); wr_sig := (0 => '1', 3 => '1', 9 => '1', 10 => '1', 15 => '1', others => '0'); push_reference; @@ -536,7 +536,7 @@ begin endpoint.presentation := GROUP_PRESENTATION_QOS; gen_endpoint_data(endpoint, sub_p.data); gen_sentinel(sub_p.data); - gen_rtps_handler_out(sub_p, gen_rand_loc_2, TRUE, TIME_INVALID, endpoint.participant.guidPrefix, stimulus); + gen_rtps_handler_out(sub_p, endpoint, stimulus); gen_match_frame(endpoint, reference); wr_sig := (0 => '1', 4 => '1', 9 => '1', 10 => '1', 15 => '1', others => '0'); push_reference; @@ -557,7 +557,7 @@ begin endpoint.ownership := EXCLUSIVE_OWNERSHIP_QOS; gen_endpoint_data(endpoint, sub_p.data); gen_sentinel(sub_p.data); - gen_rtps_handler_out(sub_p, gen_rand_loc_2, TRUE, TIME_INVALID, endpoint.participant.guidPrefix, stimulus); + gen_rtps_handler_out(sub_p, endpoint, stimulus); start_test; wait_on_complete; stimulus := EMPTY_TEST_PACKET; @@ -578,7 +578,7 @@ begin endpoint.max_size_serialized:= std_logic_vector(to_unsigned(65000, CDR_LONG_WIDTH)); gen_endpoint_data(endpoint, sub_p.data); gen_sentinel(sub_p.data); - gen_rtps_handler_out(sub_p, gen_rand_loc_2, TRUE, TIME_INVALID, endpoint.participant.guidPrefix, stimulus); + gen_rtps_handler_out(sub_p, endpoint, stimulus); gen_match_frame(endpoint, reference); wr_sig := (0 => '1', 9 => '1', 10 => '1', 15 => '1', others => '0'); push_reference; @@ -602,7 +602,7 @@ begin endpoint.max_size_serialized:= std_logic_vector(to_unsigned(66000, CDR_LONG_WIDTH)); gen_endpoint_data(endpoint, sub_p.data); gen_sentinel(sub_p.data); - gen_rtps_handler_out(sub_p, gen_rand_loc_2, TRUE, TIME_INVALID, endpoint.participant.guidPrefix, stimulus); + gen_rtps_handler_out(sub_p, endpoint, stimulus); start_test; wait_on_complete; stimulus := EMPTY_TEST_PACKET; @@ -622,7 +622,7 @@ begin endpoint.durability := PERSISTENT_DURABILITY_QOS; gen_endpoint_data(endpoint, sub_s.data); gen_sentinel(sub_s.data); - gen_rtps_handler_out(sub_s, gen_rand_loc_2, TRUE, TIME_INVALID, endpoint.participant.guidPrefix, stimulus); + gen_rtps_handler_out(sub_s, endpoint, stimulus); start_test; wait_on_complete; stimulus := EMPTY_TEST_PACKET; @@ -640,7 +640,7 @@ begin endpoint.presentation := GROUP_PRESENTATION_QOS; gen_endpoint_data(endpoint, sub_s.data); gen_sentinel(sub_s.data); - gen_rtps_handler_out(sub_s, gen_rand_loc_2, TRUE, TIME_INVALID, endpoint.participant.guidPrefix, stimulus); + gen_rtps_handler_out(sub_s, endpoint, stimulus); start_test; wait_on_complete; stimulus := EMPTY_TEST_PACKET; @@ -659,7 +659,7 @@ begin endpoint.ownership := EXCLUSIVE_OWNERSHIP_QOS; gen_endpoint_data(endpoint, sub_s.data); gen_sentinel(sub_s.data); - gen_rtps_handler_out(sub_s, gen_rand_loc_2, TRUE, TIME_INVALID, endpoint.participant.guidPrefix, stimulus); + gen_rtps_handler_out(sub_s, endpoint, stimulus); start_test; wait_on_complete; stimulus := EMPTY_TEST_PACKET; @@ -680,7 +680,7 @@ begin endpoint.expectsInlineQoS(0):= '1'; gen_endpoint_data(endpoint, sub_s.data); gen_sentinel(sub_s.data); - gen_rtps_handler_out(sub_s, gen_rand_loc_2, TRUE, TIME_INVALID, endpoint.participant.guidPrefix, stimulus); + gen_rtps_handler_out(sub_s, endpoint, stimulus); gen_match_frame(endpoint, reference); wr_sig := (NUM_READERS => '1', NUM_READERS+4 => '1', NUM_READERS+5 => '1', NUM_READERS+7 => '1', others => '0'); push_reference; @@ -697,7 +697,7 @@ begin sub_p.writerSN := p2_snp; gen_endpoint_data(e1, sub_p.data); gen_sentinel(sub_p.data); - gen_rtps_handler_out(sub_p, gen_rand_loc_2, TRUE, TIME_INVALID, e1.participant.guidPrefix, stimulus); + gen_rtps_handler_out(sub_p, e1, stimulus); gen_match_frame(e1, reference); wr_sig := (0 => '1', 9 => '1', 10 => '1', 15 => '1', others => '0'); push_reference; @@ -712,7 +712,7 @@ begin sub_s.writerSN := p2_sns; gen_endpoint_data(e2, sub_s.data); gen_sentinel(sub_s.data); - gen_rtps_handler_out(sub_s, gen_rand_loc_2, TRUE, TIME_INVALID, e2.participant.guidPrefix, stimulus); + gen_rtps_handler_out(sub_s, e2, stimulus); gen_match_frame(e2, reference); wr_sig := (NUM_READERS => '1', NUM_READERS+4 => '1', NUM_READERS+5 => '1', NUM_READERS+7 => '1', others => '0'); push_reference; @@ -731,7 +731,7 @@ begin e1.unicastLocatorList.locator(3).portn := (others => '0'); gen_endpoint_data(e1, sub_p.data); gen_sentinel(sub_p.data); - gen_rtps_handler_out(sub_p, gen_rand_loc_2, TRUE, TIME_INVALID, e1.participant.guidPrefix, stimulus); + gen_rtps_handler_out(sub_p, e1, stimulus); gen_match_frame(e1, reference); wr_sig := (0 => '1', 9 => '1', 10 => '1', 15 => '1', others => '0'); push_reference; @@ -750,7 +750,7 @@ begin e2.multicastLocatorList.locator(3).portn := (others => '0'); gen_endpoint_data(e2, sub_s.data); gen_sentinel(sub_s.data); - gen_rtps_handler_out(sub_s, gen_rand_loc_2, TRUE, TIME_INVALID, e2.participant.guidPrefix, stimulus); + gen_rtps_handler_out(sub_s, e2, stimulus); gen_match_frame(e2, reference); wr_sig := (NUM_READERS => '1', NUM_READERS+4 => '1', NUM_READERS+5 => '1', NUM_READERS+7 => '1', others => '0'); push_reference; @@ -766,7 +766,7 @@ begin e1.reliability := BEST_EFFORT_RELIABILITY_QOS; gen_endpoint_data(e1, sub_p.data); gen_sentinel(sub_p.data); - gen_rtps_handler_out(sub_p, gen_rand_loc_2, TRUE, TIME_INVALID, e1.participant.guidPrefix, stimulus); + gen_rtps_handler_out(sub_p, e1, stimulus); -- MATCH gen_match_frame(e1, reference); wr_sig := (15 => '1', others => '0'); @@ -790,7 +790,7 @@ begin e2.type_name := ENDPOINT_TYPE(2); gen_endpoint_data(e2, sub_s.data); gen_sentinel(sub_s.data); - gen_rtps_handler_out(sub_s, gen_rand_loc_2, TRUE, TIME_INVALID, e2.participant.guidPrefix, stimulus); + gen_rtps_handler_out(sub_s, e2, stimulus); -- MATCH gen_match_frame(e2, reference); wr_sig := (NUM_READERS+2 => '1', others => '0'); diff --git a/src/rtps_builtin_endpoint.vhd b/src/rtps_builtin_endpoint.vhd index 62beac1..f4e31ae 100644 --- a/src/rtps_builtin_endpoint.vhd +++ b/src/rtps_builtin_endpoint.vhd @@ -11,6 +11,7 @@ use work.rtps_config_package.all; -- TODO: Skip Packet while we are waiting for memory operation to complete -- TODO: add_res is still valid after removal. So we could continue searching the next orphan endpoint from that address on -- TODO: is it really necessary to process Sequence Numbers in sequence? Could we not just accept any higher Sequence Number? +-- TODO: Remove the Endpoint Bitmask from Memory and just always send MATCH/UNMATCH Frames entity rtps_builtin_endpoint is port ( diff --git a/src/rtps_test_package.vhd b/src/rtps_test_package.vhd index f8532bd..731c338 100644 --- a/src/rtps_test_package.vhd +++ b/src/rtps_test_package.vhd @@ -40,9 +40,6 @@ package rtps_test_package is subtype TEST_PARTICIPANT_MEMORY_FRAME_TYPE is TEST_MEMORY_TYPE(0 to PARTICIPANT_FRAME_SIZE-1); subtype TEST_ENDPOINT_MEMORY_FRAME_TYPE is TEST_MEMORY_TYPE(0 to ENDPOINT_FRAME_SIZE-1); - function test_memory_match (A,B : TEST_MEMORY_TYPE) return boolean; - function to_string (input : TEST_MEMORY_TYPE) return string; - constant LOCATOR_PORT_WIDTH : natural := CDR_LONG_WIDTH; constant LOCATOR_ADDR_WIDTH : natural := 4*CDR_LONG_WIDTH; @@ -96,9 +93,6 @@ package rtps_test_package is constant DEFAULT_UDP_HEADER : UDP_HEADER_TYPE; -- Deferred to Package Body - procedure gen_udp_header(ref : in UDP_HEADER_TYPE; output : inout TEST_PACKET_TYPE); - procedure fix_udp_packet(output : inout TEST_PACKET_TYPE); - -- *RTPS HEADER* type RTPS_HEADER_TYPE is record protocol : std_logic_vector(PROTOCOL_WIDTH-1 downto 0); @@ -109,8 +103,6 @@ package rtps_test_package is constant DEFAULT_RTPS_HEADER : RTPS_HEADER_TYPE; -- Deferred to Package Body - procedure gen_rtps_header( ref : in RTPS_HEADER_TYPE; output : inout TEST_PACKET_TYPE); - -- *GENERIC RTPS SUBMESSAGE HEADER* type RTPS_SUBMESSAGE_TYPE is record submessageID : std_logic_vector(SUBMESSAGE_ID_WIDTH-1 downto 0); @@ -147,9 +139,6 @@ package rtps_test_package is constant DEFAULT_RTPS_SUBMESSAGE : RTPS_SUBMESSAGE_TYPE; -- Deferred to Package Body - procedure gen_rtps_submessage( ref : in RTPS_SUBMESSAGE_TYPE; output : inout TEST_PACKET_TYPE); - procedure gen_rtps_handler_out(ref : in RTPS_SUBMESSAGE_TYPE; loc : in LOCATOR_TYPE; is_meta : in boolean; ts : in TIME_TYPE; src_guid : in GUIDPREFIX_TYPE; output : inout TEST_PACKET_TYPE); - type PARTICIPANT_DATA_TYPE is record littleEndian : std_logic; domainId : std_logic_vector(DOMAIN_ID_WIDTH-1 downto 0); @@ -173,10 +162,6 @@ package rtps_test_package is constant DEFAULT_PARTICIPANT_DATA : PARTICIPANT_DATA_TYPE; -- Deferred to Pckage Body - procedure gen_participant_data( ref : in PARTICIPANT_DATA_TYPE; output : inout TEST_PACKET_TYPE); - --function gen_participant_data2 ( ref : PARTICIPANT_DATA_TYPE) return TEST_PACKET_TYPE; - function gen_participant_mem_frame (ref : PARTICIPANT_DATA_TYPE) return TEST_PARTICIPANT_MEMORY_FRAME_TYPE; - type ENDPOINT_DATA_TYPE is record littleEndian : std_logic; participant : PARTICIPANT_DATA_TYPE; @@ -219,11 +204,30 @@ package rtps_test_package is constant DEFAULT_ENDPOINT_DATA : ENDPOINT_DATA_TYPE; -- Deferred to Package Body type ENDPOINT_DATA_ARRAY_TYPE is array (natural range <>) of ENDPOINT_DATA_TYPE; + function test_memory_match (A,B : TEST_MEMORY_TYPE) return boolean; + function to_string (input : TEST_MEMORY_TYPE) return string; + + procedure gen_udp_header(ref : in UDP_HEADER_TYPE; output : inout TEST_PACKET_TYPE); + procedure fix_udp_packet(output : inout TEST_PACKET_TYPE); + + procedure gen_rtps_header( ref : in RTPS_HEADER_TYPE; output : inout TEST_PACKET_TYPE); + + procedure gen_rtps_submessage( ref : in RTPS_SUBMESSAGE_TYPE; output : inout TEST_PACKET_TYPE); + procedure gen_rtps_handler_out(ref : in RTPS_SUBMESSAGE_TYPE; loc : in LOCATOR_TYPE; is_meta : in boolean; ts : in TIME_TYPE; src_guid : in GUIDPREFIX_TYPE; output : inout TEST_PACKET_TYPE); + procedure gen_rtps_handler_out(ref : in RTPS_SUBMESSAGE_TYPE; participant : PARTICIPANT_DATA_TYPE; output : inout TEST_PACKET_TYPE); + procedure gen_rtps_handler_out(ref : in RTPS_SUBMESSAGE_TYPE; endpoint : ENDPOINT_DATA_TYPE; output : inout TEST_PACKET_TYPE); + + procedure gen_participant_data( ref : in PARTICIPANT_DATA_TYPE; output : inout TEST_PACKET_TYPE); + 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); + function gen_participant_mem_frame (ref : PARTICIPANT_DATA_TYPE) return TEST_PARTICIPANT_MEMORY_FRAME_TYPE; + procedure gen_endpoint_data( ref : in ENDPOINT_DATA_TYPE; output : inout TEST_PACKET_TYPE); + procedure gen_endpoint_data( ref : in ENDPOINT_DATA_TYPE; output : inout TEST_PACKET_TYPE; pid : in std_logic_vector(PARAMETER_ID_WIDTH-1 downto 0); offset : in integer); procedure gen_match_frame( ref : in ENDPOINT_DATA_TYPE; output : inout TEST_PACKET_TYPE); function gen_endpoint_array(readers : boolean) return ENDPOINT_DATA_ARRAY_TYPE; procedure gen_sentinel(output : inout TEST_PACKET_TYPE); + procedure gen_parameter(pid : in std_logic_vector(PARAMETER_ID_WIDTH-1 downto 0); length : in natural; data : in TEST_PACKET_TYPE; output : inout TEST_PACKET_TYPE); procedure gen_rand_loc(RV : inout RandomPType; ret : out LOCATOR_TYPE); procedure gen_rand_entityid(RV : inout RandomPType; reader : boolean; ret : out std_logic_vector(ENTITYID_WIDTH-1 downto 0)); @@ -579,6 +583,43 @@ package body rtps_test_package is return ret; end function; + function get_loc (ref : PARTICIPANT_DATA_TYPE; meta : boolean) return LOCATOR_TYPE is + begin + if (meta) then + if (is_valid_loc(get_loc(ref.metatrafficUnicastLocatorList))) then + return get_loc(ref.metatrafficUnicastLocatorList); + elsif (is_valid_loc(get_loc(ref.metatrafficMulticastLocatorList))) then + return get_loc(ref.metatrafficMulticastLocatorList); + else + return DEST_LOC.meta.locator(0); + end if; + else + if (is_valid_loc(get_loc(ref.defaultUnicastLocatorList))) then + return get_loc(ref.defaultUnicastLocatorList); + elsif (is_valid_loc(get_loc(ref.defaultMulticastLocatorList))) then + return get_loc(ref.defaultMulticastLocatorList); + else + return EMPTY_LOCATOR; + end if; + end if; + end function; + + function get_loc (ref : ENDPOINT_DATA_TYPE) return LOCATOR_TYPE is + begin + if (is_valid_loc(get_loc(ref.unicastLocatorList))) then + return get_loc(ref.unicastLocatorList); + elsif (is_valid_loc(get_loc(ref.multicastLocatorList))) then + return get_loc(ref.multicastLocatorList); + elsif (is_valid_loc(get_loc(ref.participant.defaultUnicastLocatorList))) then + return get_loc(ref.participant.defaultUnicastLocatorList); + elsif (is_valid_loc(get_loc(ref.participant.defaultMulticastLocatorList))) then + return get_loc(ref.participant.defaultMulticastLocatorList); + else + assert(FALSE) report "Endpoint has no valid Locators" severity FAILURE; + return EMPTY_LOCATOR; + end if; + end function; + procedure gen_rtps_submessage( ref : in RTPS_SUBMESSAGE_TYPE; output : inout TEST_PACKET_TYPE) is variable start : natural := 0; variable tmp : natural := 0; @@ -871,8 +912,18 @@ package body rtps_test_package is -- Mark Last Word output.last(output.length-1) := '1'; end procedure; - - procedure gen_participant_data( ref : in PARTICIPANT_DATA_TYPE; output : inout TEST_PACKET_TYPE) is + + procedure gen_rtps_handler_out(ref : in RTPS_SUBMESSAGE_TYPE; participant : PARTICIPANT_DATA_TYPE; output : inout TEST_PACKET_TYPE) is + begin + gen_rtps_handler_out(ref, get_loc(participant, TRUE), TRUE, TIME_INVALID, participant.guidPrefix, output); + end procedure; + + procedure gen_rtps_handler_out(ref : in RTPS_SUBMESSAGE_TYPE; endpoint : ENDPOINT_DATA_TYPE; output : inout TEST_PACKET_TYPE) is + begin + gen_rtps_handler_out(ref, get_loc(endpoint.participant, TRUE), TRUE, TIME_INVALID, endpoint.participant.guidPrefix, 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 variable tmp : natural := 0; begin -- Representation Identifier & Representation Options @@ -883,7 +934,12 @@ package body rtps_test_package is end if; output.length := output.length + 1; -- GUID - output.data(output.length) := PID_PARTICIPANT_GUID & endian_swap(ref.littleEndian, int(16, PARAMETER_LENGTH_WIDTH)); + if (pid = PID_PARTICIPANT_GUID) then + assert (16+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_PARTICIPANT_GUID & endian_swap(ref.littleEndian, int(16+(offset*4), PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_PARTICIPANT_GUID & endian_swap(ref.littleEndian, int(16, PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := ref.guidPrefix(0); output.length := output.length + 1; @@ -893,15 +949,31 @@ package body rtps_test_package is output.length := output.length + 1; output.data(output.length) := ref.entityId; output.length := output.length + 1; + if (pid = PID_PARTICIPANT_GUID) then + output.length := output.length + offset; + end if; -- DOMAIN ID - output.data(output.length) := PID_DOMAIN_ID & endian_swap(ref.littleEndian, int(4, PARAMETER_LENGTH_WIDTH)); + if (pid = PID_DOMAIN_ID) then + assert (4+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_DOMAIN_ID & endian_swap(ref.littleEndian, int(4+(offset*4), PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_DOMAIN_ID & endian_swap(ref.littleEndian, int(4, PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, ref.domainId); output.length := output.length + 1; + if (pid = PID_DOMAIN_ID) then + output.length := output.length + offset; + end if; -- DOMAIN TAG if (ref.domainTag /= DEFAULT_DOMAIN_TAG) then tmp := string_len(ref.domainTag); - output.data(output.length) := PID_DOMAIN_TAG & endian_swap(ref.littleEndian, int((round_div(tmp,4)+1)*4, PARAMETER_LENGTH_WIDTH)); + if (pid = PID_DOMAIN_TAG) then + assert (((round_div(tmp,4)+1)*4)+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_DOMAIN_TAG & endian_swap(ref.littleEndian, int(((round_div(tmp,4)+1)*4)+(offset*4), PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_DOMAIN_TAG & endian_swap(ref.littleEndian, int((round_div(tmp,4)+1)*4, PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, int(tmp, CDR_LONG_WIDTH)); output.length := output.length + 1; @@ -909,32 +981,64 @@ package body rtps_test_package is output.data(output.length) := ref.domainTag(i); output.length := output.length + 1; end loop; + if (pid = PID_DOMAIN_TAG) then + output.length := output.length + offset; + end if; end if; -- PROTOCOL VERSION - output.data(output.length) := PID_PROTOCOL_VERSION & endian_swap(ref.littleEndian, int(4, PARAMETER_LENGTH_WIDTH)); + if (pid = PID_PROTOCOL_VERSION) then + assert (4+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_PROTOCOL_VERSION & endian_swap(ref.littleEndian, int(4+(offset*4), PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_PROTOCOL_VERSION & endian_swap(ref.littleEndian, int(4, PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := (others => '0'); output.data(output.length)(31 downto 16) := ref.protocolVersion; output.length := output.length + 1; + if (pid = PID_PROTOCOL_VERSION) then + output.length := output.length + offset; + end if; -- VENDORID - output.data(output.length) := PID_VENDORID & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_VENDORID) then + assert (4+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_VENDORID & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_VENDORID & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := (others => '0'); output.data(output.length)(31 downto 16) := ref.vendorId; output.length := output.length + 1; + if (pid = PID_VENDORID) then + output.length := output.length + offset; + end if; -- EXPECTS IN-LINE QOS if (ref.expectsInlineQoS(0) /= DEFAULT_EXPECTS_INLINE_QOS) then - output.data(output.length) := PID_EXPECTS_INLINE_QOS & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_EXPECTS_INLINE_QOS) then + assert (4+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_EXPECTS_INLINE_QOS & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_EXPECTS_INLINE_QOS & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := (others => '0'); output.data(output.length)(31 downto 24) := ref.expectsInlineQoS; -- 1 Byte, No endian swap output.length := output.length + 1; + if (pid = PID_EXPECTS_INLINE_QOS) then + output.length := output.length + offset; + end if; end if; -- METATRAFFIC MULTICAST LOCATOR if (ref.metatrafficMulticastLocatorList.numLocators /= (ref.metatrafficMulticastLocatorList.numLocators'range => '0')) then tmp := to_integer(unsigned(ref.metatrafficMulticastLocatorList.numLocators)); for i in 0 to tmp-1 loop - output.data(output.length) := PID_METATRAFFIC_MULTICAST_LOCATOR & endian_swap(ref.littleEndian, int(24,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_METATRAFFIC_MULTICAST_LOCATOR) then + assert (24+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_METATRAFFIC_MULTICAST_LOCATOR & endian_swap(ref.littleEndian, int(24+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_METATRAFFIC_MULTICAST_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.metatrafficMulticastLocatorList.locator(i).kind); output.length := output.length + 1; @@ -948,13 +1052,21 @@ package body rtps_test_package is output.length := output.length + 1; output.data(output.length) := ref.metatrafficMulticastLocatorList.locator(i).addr(31 downto 0); output.length := output.length + 1; + if (pid = PID_METATRAFFIC_MULTICAST_LOCATOR) then + output.length := output.length + offset; + end if; end loop; end if; -- METATRAFFIC UNICAST LOCATOR if (ref.metatrafficUnicastLocatorList.numLocators /= (ref.metatrafficUnicastLocatorList.numLocators'range => '0')) then tmp := to_integer(unsigned(ref.metatrafficUnicastLocatorList.numLocators)); for i in 0 to tmp-1 loop - output.data(output.length) := PID_METATRAFFIC_UNICAST_LOCATOR & endian_swap(ref.littleEndian, int(24,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_METATRAFFIC_UNICAST_LOCATOR) then + assert (24+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_METATRAFFIC_UNICAST_LOCATOR & endian_swap(ref.littleEndian, int(24+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_METATRAFFIC_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.metatrafficUnicastLocatorList.locator(i).kind); output.length := output.length + 1; @@ -968,13 +1080,21 @@ package body rtps_test_package is output.length := output.length + 1; output.data(output.length) := ref.metatrafficUnicastLocatorList.locator(i).addr(31 downto 0); output.length := output.length + 1; + if (pid = PID_METATRAFFIC_UNICAST_LOCATOR) then + output.length := output.length + offset; + end if; end loop; end if; -- DEFAULT MULTICAST LOCATOR if (ref.defaultMulticastLocatorList.numLocators /= (ref.defaultMulticastLocatorList.numLocators'range => '0')) then tmp := to_integer(unsigned(ref.defaultMulticastLocatorList.numLocators)); for i in 0 to tmp-1 loop - output.data(output.length) := PID_DEFAULT_MULTICAST_LOCATOR & endian_swap(ref.littleEndian, int(24,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_DEFAULT_MULTICAST_LOCATOR) then + assert (24+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_DEFAULT_MULTICAST_LOCATOR & endian_swap(ref.littleEndian, int(24+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_DEFAULT_MULTICAST_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.defaultMulticastLocatorList.locator(i).kind); output.length := output.length + 1; @@ -988,6 +1108,9 @@ package body rtps_test_package is output.length := output.length + 1; output.data(output.length) := ref.defaultMulticastLocatorList.locator(i).addr(31 downto 0); output.length := output.length + 1; + if (pid = PID_DEFAULT_MULTICAST_LOCATOR) then + output.length := output.length + offset; + end if; end loop; end if; -- DEFAULT UNICAST LOCATOR @@ -995,7 +1118,12 @@ package body rtps_test_package is if (ref.defaultUnicastLocatorList.numLocators /= (ref.defaultUnicastLocatorList.numLocators'range => '0')) then tmp := to_integer(unsigned(ref.defaultUnicastLocatorList.numLocators)); for i in 0 to tmp-1 loop - output.data(output.length) := PID_DEFAULT_UNICAST_LOCATOR & endian_swap(ref.littleEndian, int(24,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_DEFAULT_UNICAST_LOCATOR) then + assert (24+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_DEFAULT_UNICAST_LOCATOR & endian_swap(ref.littleEndian, int(24+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_DEFAULT_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.defaultUnicastLocatorList.locator(i).kind); output.length := output.length + 1; @@ -1009,35 +1137,60 @@ package body rtps_test_package is output.length := output.length + 1; output.data(output.length) := ref.defaultUnicastLocatorList.locator(i).addr(31 downto 0); output.length := output.length + 1; + if (pid = PID_DEFAULT_UNICAST_LOCATOR) then + output.length := output.length + offset; + end if; end loop; end if; -- LEASE DURATION if (ref.leaseDuration /= DEFAULT_PARTICIPANT_LEASE_DURATION) then - output.data(output.length) := PID_PARTICIPANT_LEASE_DURATION & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_PARTICIPANT_LEASE_DURATION) then + assert (8+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_PARTICIPANT_LEASE_DURATION & endian_swap(ref.littleEndian, int(8+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_PARTICIPANT_LEASE_DURATION & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, std_logic_vector(ref.leaseDuration(0))); output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, std_logic_vector(ref.leaseDuration(1))); output.length := output.length + 1; + if (pid = PID_PARTICIPANT_LEASE_DURATION) then + output.length := output.length + offset; + end if; end if; -- AVAILABLE ENDPOINTS - output.data(output.length) := PID_BUILTIN_ENDPOINT_SET & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_BUILTIN_ENDPOINT_SET) then + assert (4+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_BUILTIN_ENDPOINT_SET & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_BUILTIN_ENDPOINT_SET & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, ref.availableBuiltinEndpoints); output.length := output.length + 1; + if (pid = PID_BUILTIN_ENDPOINT_SET) then + output.length := output.length + offset; + end if; -- MANUAL LIVELINESS COUNT - output.data(output.length) := PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT) then + assert (4+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, ref.manualLivelinessCount); output.length := output.length + 1; + if (pid = PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT) then + output.length := output.length + offset; + end if; end procedure; - --function gen_participant_data2 ( ref : PARTICIPANT_DATA_TYPE) return TEST_PACKET_TYPE is - -- variable ret : TEST_PACKET_TYPE := (length => 0, data => (others => (others => '0')), last => (others => '0')); - --begin - -- gen_participant_data(ref, ret); - -- return ret; - --end function; + procedure gen_participant_data( ref : in PARTICIPANT_DATA_TYPE; output : inout TEST_PACKET_TYPE) is + begin + gen_participant_data(ref, output, PID_PAD, 0); + end procedure; function gen_participant_mem_frame (ref : PARTICIPANT_DATA_TYPE) return TEST_PARTICIPANT_MEMORY_FRAME_TYPE is variable ret : TEST_PARTICIPANT_MEMORY_FRAME_TYPE; @@ -1051,20 +1204,8 @@ package body rtps_test_package is start := PARTICIPANT_FRAME_SIZE * ref.nr; -- Fetch relevant Locators - if (is_valid_loc(get_loc(ref.metatrafficUnicastLocatorList))) then - meta_loc := get_loc(ref.metatrafficUnicastLocatorList); - elsif (is_valid_loc(get_loc(ref.metatrafficMulticastLocatorList))) then - meta_loc := get_loc(ref.metatrafficMulticastLocatorList); - else - meta_loc := DEST_LOC.meta.locator(0); - end if; - if (is_valid_loc(get_loc(ref.defaultUnicastLocatorList))) then - user_loc := get_loc(ref.defaultUnicastLocatorList); - elsif (is_valid_loc(get_loc(ref.defaultMulticastLocatorList))) then - user_loc := get_loc(ref.defaultMulticastLocatorList); - else - user_loc := EMPTY_LOCATOR; - end if; + meta_loc := get_loc (ref, TRUE); + user_loc := get_loc (ref, FALSE); for i in 0 to PARTICIPANT_FRAME_SIZE-1 loop ret(i).addr := start + i; @@ -1140,7 +1281,7 @@ package body rtps_test_package is return ret; end function; - procedure gen_endpoint_data( ref : in ENDPOINT_DATA_TYPE; output : inout TEST_PACKET_TYPE) is + procedure gen_endpoint_data( ref : in ENDPOINT_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; begin -- Representation Identifier & Representation Options @@ -1151,7 +1292,12 @@ package body rtps_test_package is end if; output.length := output.length + 1; -- GUID - output.data(output.length) := PID_ENDPOINT_GUID & endian_swap(ref.littleEndian, int(16,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_ENDPOINT_GUID) then + assert (16+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_ENDPOINT_GUID & endian_swap(ref.littleEndian, int(16+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_ENDPOINT_GUID & endian_swap(ref.littleEndian, int(16,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := ref.participant.guidPrefix(0); output.length := output.length + 1; @@ -1161,17 +1307,33 @@ package body rtps_test_package is output.length := output.length + 1; output.data(output.length) := ref.entityId; output.length := output.length + 1; + if (pid = PID_ENDPOINT_GUID) then + output.length := output.length + offset; + end if; -- EXPECTS IN-LINE QOS if (ref.expectsInlineQoS(0) /= '0') then - output.data(output.length) := PID_EXPECTS_INLINE_QOS & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_EXPECTS_INLINE_QOS) then + assert (4+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_EXPECTS_INLINE_QOS & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_EXPECTS_INLINE_QOS & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := (others => '0'); output.data(output.length)(31 downto 24) := ref.expectsInlineQoS; -- 1 Byte, No endian swap output.length := output.length + 1; + if (pid = PID_EXPECTS_INLINE_QOS) then + output.length := output.length + offset; + end if; end if; -- TOPIC NAME tmp := string_len(ref.topic_name); - output.data(output.length) := PID_TOPIC_NAME & endian_swap(ref.littleEndian, int((round_div(tmp,4)+1)*4,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_TOPIC_NAME) then + assert (((round_div(tmp,4)+1)*4)+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_TOPIC_NAME & endian_swap(ref.littleEndian, int(((round_div(tmp,4)+1)*4)+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_TOPIC_NAME & endian_swap(ref.littleEndian, int((round_div(tmp,4)+1)*4,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, int(tmp, CDR_LONG_WIDTH)); output.length := output.length + 1; @@ -1179,9 +1341,17 @@ package body rtps_test_package is output.data(output.length) := ref.topic_name(i); output.length := output.length + 1; end loop; + if (pid = PID_TOPIC_NAME) then + output.length := output.length + offset; + end if; -- TYPE NAME tmp := string_len(ref.type_name); - output.data(output.length) := PID_TYPE_NAME & endian_swap(ref.littleEndian, int((round_div(tmp,4)+1)*4,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_TYPE_NAME) then + assert (((round_div(tmp,4)+1)*4)+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_TYPE_NAME & endian_swap(ref.littleEndian, int(((round_div(tmp,4)+1)*4)+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_TYPE_NAME & endian_swap(ref.littleEndian, int((round_div(tmp,4)+1)*4,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, int(tmp,CDR_LONG_WIDTH)); output.length := output.length + 1; @@ -1189,19 +1359,34 @@ package body rtps_test_package is output.data(output.length) := ref.type_name(i); output.length := output.length + 1; end loop; + if (pid = PID_TYPE_NAME) then + output.length := output.length + offset; + end if; -- DURABILITY if (ref.durability /= DEFAULT_DURABILITY_QOS) then - output.data(output.length) := PID_DURABILITY & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_DURABILITY) then + assert (4+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_DURABILITY & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_DURABILITY & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, ref.durability); output.length := output.length + 1; + if (pid = PID_DURABILITY) then + output.length := output.length + offset; + end if; end if; -- DURABILITY SERVICE if (ref.durability_service_cleanup_delay /= DEFAULT_DURABILITY_SERVICE_CLEANUP_DELAY or ref.durability_service_history /= DEFAULT_DURABILITY_SERVICE_HISTORY or ref.durability_service_history_depth /= DEFAULT_DURABILITY_SERVICE_HISTORY_DEPTH or ref.durability_service_max_samples /= DEFAULT_DURABILITY_SERVICE_MAX_SAMPLES or ref.durability_service_max_instances /= DEFAULT_DURABILITY_SERVICE_MAX_INSTANCES or ref.durability_service_max_samples_per_instances /= DEFAULT_DURABILITY_SERVICE_MAX_SAMPLES_PER_INSTANCE) then - - output.data(output.length) := PID_DURABILITY_SERVICE & endian_swap(ref.littleEndian, int(28,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_DURABILITY_SERVICE) then + assert (28+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_DURABILITY_SERVICE & endian_swap(ref.littleEndian, int(28+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_DURABILITY_SERVICE & endian_swap(ref.littleEndian, int(28,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, std_logic_vector(ref.durability_service_cleanup_delay(0))); output.length := output.length + 1; @@ -1217,51 +1402,99 @@ package body rtps_test_package is output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, ref.durability_service_max_samples_per_instances); output.length := output.length + 1; + if (pid = PID_DURABILITY_SERVICE) then + output.length := output.length + offset; + end if; end if; -- PRESENTATION if (ref.presentation /= DEFAULT_PRESENTATION_QOS or ref.coherent_access(0) /= boolean_to_std_logic(DEFAULT_COHERENT_ACCESS) or ref.ordered_access(0) /= boolean_to_std_logic(DEFAULT_ORDERED_ACCESS)) then - output.data(output.length) := PID_PRESENTATION & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_PRESENTATION) then + assert (8+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_PRESENTATION & endian_swap(ref.littleEndian, int(8+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_PRESENTATION & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, ref.presentation); output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, ref.coherent_access) & endian_swap(ref.littleEndian, ref.ordered_access) & (0 to 15 => '0'); output.length := output.length + 1; + if (pid = PID_PRESENTATION) then + output.length := output.length + offset; + end if; end if; -- DEADLINE if (ref.deadline /= DEFAULT_DEADLINE_QOS) then - output.data(output.length) := PID_DEADLINE & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_DEADLINE) then + assert (8+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_DEADLINE & endian_swap(ref.littleEndian, int(8+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_DEADLINE & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, std_logic_vector(ref.deadline(0))); output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, std_logic_vector(ref.deadline(1))); output.length := output.length + 1; + if (pid = PID_DEADLINE) then + output.length := output.length + offset; + end if; end if; -- LATENCY BUDGET if (ref.latency_budget /= DEFAULT_LATENCY_BUDGET_QOS) then - output.data(output.length) := PID_LATENCY_BUDGET & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_LATENCY_BUDGET) then + assert (8+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_LATENCY_BUDGET & endian_swap(ref.littleEndian, int(8+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_LATENCY_BUDGET & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, std_logic_vector(ref.latency_budget(0))); output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, std_logic_vector(ref.latency_budget(1))); output.length := output.length + 1; + if (pid = PID_LATENCY_BUDGET) then + output.length := output.length + offset; + end if; end if; -- OWNERSHIP if (ref.ownership /= DEFAULT_OWNERSHIP_QOS) then - output.data(output.length) := PID_OWNERSHIP & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_OWNERSHIP) then + assert (4+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_OWNERSHIP & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_OWNERSHIP & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, ref.ownership); output.length := output.length + 1; + if (pid = PID_OWNERSHIP) then + output.length := output.length + offset; + end if; end if; -- OWNERSHIP STRENGTH if (ref.ownership /= DEFAULT_OWNERSHIP_STRENGTH_QOS) then - output.data(output.length) := PID_OWNERSHIP_STRENGTH & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_OWNERSHIP_STRENGTH) then + 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)); + else + output.data(output.length) := PID_OWNERSHIP_STRENGTH & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, ref.ownership_strength); output.length := output.length + 1; + if (pid = PID_OWNERSHIP_STRENGTH) then + output.length := output.length + offset; + end if; end if; -- LIVELINESS if (ref.liveliness /= DEFAULT_LIVELINESS_QOS or ref.leaseDuration /= DEFAULT_LEASE_DURATION) then - output.data(output.length) := PID_LIVELINESS & endian_swap(ref.littleEndian, int(12,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_LIVELINESS) then + assert (12+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_LIVELINESS & endian_swap(ref.littleEndian, int(12+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_LIVELINESS & endian_swap(ref.littleEndian, int(12,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, ref.liveliness); output.length := output.length + 1; @@ -1269,19 +1502,35 @@ package body rtps_test_package is output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, std_logic_vector(ref.leaseDuration(1))); output.length := output.length + 1; + if (pid = PID_LIVELINESS) then + output.length := output.length + offset; + end if; end if; -- TIME BASED FILTER if (ref.time_based_filter /= DEFAULT_TIME_BASED_FILTER_QOS) then - output.data(output.length) := PID_TIME_BASED_FILTER & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_TIME_BASED_FILTER) then + assert (8+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_TIME_BASED_FILTER & endian_swap(ref.littleEndian, int(8+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_TIME_BASED_FILTER & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, std_logic_vector(ref.time_based_filter(0))); output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, std_logic_vector(ref.time_based_filter(1))); output.length := output.length + 1; + if (pid = PID_TIME_BASED_FILTER) then + output.length := output.length + offset; + end if; end if; -- RELIABILITY if (ref.reliability /= DEFAULT_RELIABILTY_QOS or ref.max_blocking_time /= DEFAULT_MAX_BLOCKING_TIME) then - output.data(output.length) := PID_RELIABILITY & endian_swap(ref.littleEndian, int(12,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_RELIABILITY) then + assert (12+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_RELIABILITY & endian_swap(ref.littleEndian, int(12+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_RELIABILITY & endian_swap(ref.littleEndian, int(12,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, ref.reliability); output.length := output.length + 1; @@ -1289,35 +1538,67 @@ package body rtps_test_package is output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, std_logic_vector(ref.max_blocking_time(1))); output.length := output.length + 1; + if (pid = PID_RELIABILITY) then + output.length := output.length + offset; + end if; end if; -- TRANSPORT PRIORITY if (ref.transportnpriority /= DEFAULT_TRANSPORT_PRIORITY_QOS) then - output.data(output.length) := PID_TRANSPORT_PRIORITY & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_TRANSPORT_PRIORITY) then + assert (4+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_TRANSPORT_PRIORITY & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_TRANSPORT_PRIORITY & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, ref.transportnpriority); output.length := output.length + 1; + if (pid = PID_TRANSPORT_PRIORITY) then + output.length := output.length + offset; + end if; end if; -- LIFESPAN if (ref.lifespan /= DEFAULT_LIFESPAN_QOS) then - output.data(output.length) := PID_LIFESPAN & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_LIFESPAN) then + assert (8+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_LIFESPAN & endian_swap(ref.littleEndian, int(8+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_LIFESPAN & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, std_logic_vector(ref.lifespan(0))); output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, std_logic_vector(ref.lifespan(1))); output.length := output.length + 1; + if (pid = PID_LIFESPAN) then + output.length := output.length + offset; + end if; end if; -- DESTINATION ORDER if (ref.destination_order /= DEFAULT_DESTINATION_ORDER_QOS) then - output.data(output.length) := PID_DESTINATION_ORDER & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_DESTINATION_ORDER) then + assert (4+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_DESTINATION_ORDER & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_DESTINATION_ORDER & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, ref.destination_order); output.length := output.length + 1; + if (pid = PID_DESTINATION_ORDER) then + output.length := output.length + offset; + 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 - output.data(output.length) := PID_UNICAST_LOCATOR & endian_swap(ref.littleEndian, int(24,PARAMETER_LENGTH_WIDTH)); + 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; @@ -1331,13 +1612,21 @@ package body rtps_test_package is 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 if (unsigned(ref.multicastLocatorList.numLocators) > 0) then tmp := to_integer(unsigned(ref.multicastLocatorList.numLocators)); for i in 0 to tmp-1 loop - output.data(output.length) := PID_MULTICAST_LOCATOR & endian_swap(ref.littleEndian, int(24,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_MULTICAST_LOCATOR) then + assert (24+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_MULTICAST_LOCATOR & endian_swap(ref.littleEndian, int(24+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_MULTICAST_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.multicastLocatorList.locator(i).kind); output.length := output.length + 1; @@ -1351,6 +1640,9 @@ package body rtps_test_package is output.length := output.length + 1; output.data(output.length) := ref.multicastLocatorList.locator(i).addr(31 downto 0); output.length := output.length + 1; + if (pid = PID_MULTICAST_LOCATOR) then + output.length := output.length + offset; + end if; end loop; end if; -- USER DATA @@ -1391,29 +1683,31 @@ package body rtps_test_package is end if; -- MAX SIZE SERIALIZED if (unsigned(ref.max_size_serialized) /= 0) then - output.data(output.length) := PID_DATA_MAX_SIZE_SERIALIZED & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + if (pid = PID_DATA_MAX_SIZE_SERIALIZED) then + assert (4+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; + output.data(output.length) := PID_DATA_MAX_SIZE_SERIALIZED & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH)); + else + output.data(output.length) := PID_DATA_MAX_SIZE_SERIALIZED & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); + end if; output.length := output.length + 1; output.data(output.length) := endian_swap(ref.littleEndian, ref.max_size_serialized); output.length := output.length + 1; + if (pid = PID_DATA_MAX_SIZE_SERIALIZED) then + output.length := output.length + offset; + end if; end if; end procedure; + procedure gen_endpoint_data( ref : in ENDPOINT_DATA_TYPE; output : inout TEST_PACKET_TYPE) is + begin + gen_endpoint_data(ref, output, PID_PAD, 0); + end procedure; + procedure gen_match_frame( ref : in ENDPOINT_DATA_TYPE; output : inout TEST_PACKET_TYPE) is variable loc : LOCATOR_TYPE; begin -- Fetch relevant Locator - if (is_valid_loc(get_loc(ref.unicastLocatorList))) then - loc := get_loc(ref.unicastLocatorList); - elsif (is_valid_loc(get_loc(ref.multicastLocatorList))) then - loc := get_loc(ref.multicastLocatorList); - elsif (is_valid_loc(get_loc(ref.participant.defaultUnicastLocatorList))) then - loc := get_loc(ref.participant.defaultUnicastLocatorList); - elsif (is_valid_loc(get_loc(ref.participant.defaultMulticastLocatorList))) then - loc := get_loc(ref.participant.defaultMulticastLocatorList); - else - assert(FALSE) report "Endpoint has no valid Locators" severity FAILURE; - loc := EMPTY_LOCATOR; - end if; + loc := get_loc(ref); -- OPCODE case (ref.match) is @@ -1457,6 +1751,18 @@ package body rtps_test_package is output.length := output.length + 1; end procedure; + procedure gen_parameter(pid : in std_logic_vector(PARAMETER_ID_WIDTH-1 downto 0); length : in natural; data : in TEST_PACKET_TYPE; output : inout TEST_PACKET_TYPE) is + begin + -- PARAMETER HEADER + output.data(output.length) := pid & int(length*4,PARAMETER_LENGTH_WIDTH); + output.length := output.length + 1; + -- DATA + for i in 0 to length-1 loop + output.data(output.length) := data.data(i); + output.length := output.length + 1; + end loop; + end procedure; + function test_memory_match (A,B : TEST_MEMORY_TYPE) return boolean is begin if (A'length /= B'length) then