* Added rtps_builtin_endpoint_test3

- Compiling and Passing
This commit is contained in:
Greek 2020-11-28 10:12:35 +01:00
parent 02be7bb0a3
commit 472af656b3
7 changed files with 1408 additions and 78 deletions

View File

@ -0,0 +1,72 @@
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate -divider SYSTEM
add wave -noupdate /rtps_builtin_endpoint_test3/uut/clk
add wave -noupdate /rtps_builtin_endpoint_test3/uut/reset
add wave -noupdate -divider INPUT
add wave -noupdate /rtps_builtin_endpoint_test3/uut/empty
add wave -noupdate /rtps_builtin_endpoint_test3/uut/rd
add wave -noupdate -radix hexadecimal /rtps_builtin_endpoint_test3/uut/data_in
add wave -noupdate /rtps_builtin_endpoint_test3/uut/last_word_in
add wave -noupdate /rtps_builtin_endpoint_test3/uut/last_word_in_latch
add wave -noupdate -divider OUTPUT
add wave -noupdate -radix hexadecimal /rtps_builtin_endpoint_test3/uut/data_out
add wave -noupdate /rtps_builtin_endpoint_test3/uut/endpoint_wr
add wave -noupdate /rtps_builtin_endpoint_test3/uut/last_word_out
add wave -noupdate -divider TESTBENCH
add wave -noupdate /rtps_builtin_endpoint_test3/start
add wave -noupdate /rtps_builtin_endpoint_test3/stim_stage
add wave -noupdate /rtps_builtin_endpoint_test3/stimulus.length
add wave -noupdate /rtps_builtin_endpoint_test3/cnt_stim
add wave -noupdate /rtps_builtin_endpoint_test3/packet_sent
add wave -noupdate /rtps_builtin_endpoint_test3/SB.ItemNumberVar
add wave -noupdate -divider {MAIN FSM}
add wave -noupdate /rtps_builtin_endpoint_test3/uut/stage
add wave -noupdate /rtps_builtin_endpoint_test3/uut/stage_next
add wave -noupdate /rtps_builtin_endpoint_test3/uut/cnt
add wave -noupdate /rtps_builtin_endpoint_test3/uut/endpoint_mask
add wave -noupdate /rtps_builtin_endpoint_test3/uut/participant_match
add wave -noupdate -divider {MEM FSM}
add wave -noupdate -group MEM_FSM /rtps_builtin_endpoint_test3/uut/mem_opcode
add wave -noupdate -group MEM_FSM /rtps_builtin_endpoint_test3/uut/mem_op_start
add wave -noupdate -group MEM_FSM /rtps_builtin_endpoint_test3/uut/mem_op_done
add wave -noupdate -group MEM_FSM /rtps_builtin_endpoint_test3/uut/mem_stage
add wave -noupdate -group MEM_FSM /rtps_builtin_endpoint_test3/uut/mem_stage_next
add wave -noupdate -group MEM_FSM /rtps_builtin_endpoint_test3/uut/mem_cnt
add wave -noupdate -group MEM_FSM -radix unsigned /rtps_builtin_endpoint_test3/uut/mem_addr_base
add wave -noupdate -group MEM_FSM -radix unsigned /rtps_builtin_endpoint_test3/uut/addr_res
add wave -noupdate -group MEM_FSM -radix unsigned /rtps_builtin_endpoint_test3/uut/last_addr
add wave -noupdate -group MEM_FSM -radix unsigned /rtps_builtin_endpoint_test3/uut/max_participant_addr
add wave -noupdate -group MEM_FSM -radix unsigned /rtps_builtin_endpoint_test3/uut/max_endpoint_addr
add wave -noupdate -divider GUARD
add wave -noupdate -radix unsigned /rtps_builtin_endpoint_test3/uut/read_cnt
add wave -noupdate -radix unsigned /rtps_builtin_endpoint_test3/uut/parameter_end
add wave -noupdate /rtps_builtin_endpoint_test3/uut/parse_prc/rd_guard
add wave -noupdate -divider MEMORY
add wave -noupdate -group MEMORY -radix unsigned /rtps_builtin_endpoint_test3/uut/ram_inst/addr
add wave -noupdate -group MEMORY /rtps_builtin_endpoint_test3/uut/ram_inst/wen
add wave -noupdate -group MEMORY /rtps_builtin_endpoint_test3/uut/ram_inst/ren
add wave -noupdate -group MEMORY -radix hexadecimal /rtps_builtin_endpoint_test3/uut/ram_inst/wr_data
add wave -noupdate -group MEMORY -radix hexadecimal /rtps_builtin_endpoint_test3/uut/ram_inst/rd_data
add wave -noupdate -divider MISC
add wave -noupdate /rtps_builtin_endpoint_test3/uut/update_participant_flags
add wave -noupdate -radix unsigned /rtps_builtin_endpoint_test3/uut/mem_seq_nr
add wave -noupdate -radix unsigned /rtps_builtin_endpoint_test3/uut/seq_nr
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {Begin {32125000 ps} 1} {Error {35025000 ps} 1} {Cursor {33675000 ps} 0}
quietly wave cursor active 3
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 {33245026 ps} {34393368 ps}

View File

@ -53,6 +53,7 @@
* We can determine if a Endpoint is a Reader or Writer via the Entity ID. Is it illegal to get a SEDP with incompatible source (Reader Entity ID from Publications Announcer?) * We can determine if a Endpoint is a Reader or Writer via the Entity ID. Is it illegal to get a SEDP with incompatible source (Reader Entity ID from Publications Announcer?)
* Can we make an array of records of uncontrained strings? That we we could make an array of variable sized strings... * Can we make an array of records of uncontrained strings? That we we could make an array of variable sized strings...
* Should I also check for Minor_Version >= 4? * Should I also check for Minor_Version >= 4?
* 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.
* Fast-RTPS doen not follow DDSI-RTPS Specification * Fast-RTPS doen not follow DDSI-RTPS Specification
- Open Github Issue - Open Github Issue

View File

@ -189,6 +189,7 @@ begin
variable p2_sn, p2_snp, p2_sns : SEQUENCENUMBER_TYPE := FIRST_SEQUENCENUMBER; variable p2_sn, p2_snp, p2_sns : SEQUENCENUMBER_TYPE := FIRST_SEQUENCENUMBER;
variable wr_sig : std_logic_vector(0 to NUM_ENDPOINTS-1) := (others => '0'); variable wr_sig : std_logic_vector(0 to NUM_ENDPOINTS-1) := (others => '0');
variable user_data, topic_data, group_data : STRING_WORD_ARRAY_TYPE := EMPTY_STRING; variable user_data, topic_data, group_data : STRING_WORD_ARRAY_TYPE := EMPTY_STRING;
variable partition : TEST_PACKET_TYPE := EMPTY_TEST_PACKET;
-- Wrapper to use procedure as function -- Wrapper to use procedure as function
impure function gen_rand_loc_2 return LOCATOR_TYPE is impure function gen_rand_loc_2 return LOCATOR_TYPE is
@ -320,6 +321,13 @@ begin
group_data := convert_string("GROUP_DATA" & (11 to 256 => NUL)); group_data := convert_string("GROUP_DATA" & (11 to 256 => NUL));
topic_data := convert_string("TOPIC_DATA" & (11 to 256 => NUL)); topic_data := convert_string("TOPIC_DATA" & (11 to 256 => NUL));
-- Partition
partition.data(0) := int(10, CDR_LONG_WIDTH);
partition.data(1) := x"50415254";
partition.data(2) := x"4954494f";
partition.data(3) := x"4e000000";
partition.length := 4;
Log("Initiating Test", INFO); Log("Initiating Test", INFO);
stim_done <= '0'; stim_done <= '0';
start <= '0'; start <= '0';
@ -589,16 +597,13 @@ begin
sub_p.data := EMPTY_TEST_PACKET; sub_p.data := EMPTY_TEST_PACKET;
p2_snp := p2_snp + 1; p2_snp := p2_snp + 1;
Log("ignore Participant 2 Writer [incompatible MAX_SERIALIZED_PAYLOAD]", INFO); Log("Ignore Participant 2 Writer [Incompatible MAX_SERIALIZED_PAYLOAD]", INFO);
sub_p.writerSN := p2_snp; sub_p.writerSN := p2_snp;
endpoint := DEFAULT_ENDPOINT_DATA; endpoint := DEFAULT_ENDPOINT_DATA;
endpoint.entityId := gen_rand_entityid_2(FALSE); endpoint.entityId := gen_rand_entityid_2(FALSE);
endpoint.participant := p2; endpoint.participant := p2;
endpoint.topic_name := ENDPOINT_TOPIC(0); endpoint.topic_name := ENDPOINT_TOPIC(0);
endpoint.type_name := ENDPOINT_TYPE(0); endpoint.type_name := ENDPOINT_TYPE(0);
endpoint.user_data := user_data;
endpoint.topic_data := topic_data;
endpoint.group_data := group_data;
endpoint.max_size_serialized:= std_logic_vector(to_unsigned(66000, CDR_LONG_WIDTH)); endpoint.max_size_serialized:= std_logic_vector(to_unsigned(66000, CDR_LONG_WIDTH));
gen_endpoint_data(endpoint, sub_p.data); gen_endpoint_data(endpoint, sub_p.data);
gen_sentinel(sub_p.data); gen_sentinel(sub_p.data);
@ -610,6 +615,24 @@ begin
sub_p.data := EMPTY_TEST_PACKET; sub_p.data := EMPTY_TEST_PACKET;
p2_snp := p2_snp + 1; p2_snp := p2_snp + 1;
Log("Ignore Participant 2 Writer [Non-Default Partition]", INFO);
sub_p.writerSN := p2_snp;
endpoint := DEFAULT_ENDPOINT_DATA;
endpoint.entityId := gen_rand_entityid_2(FALSE);
endpoint.participant := p2;
endpoint.topic_name := ENDPOINT_TOPIC(0);
endpoint.type_name := ENDPOINT_TYPE(0);
gen_endpoint_data(endpoint, sub_p.data);
gen_parameter(PID_PARTITION, partition, sub_p.data);
gen_sentinel(sub_p.data);
gen_rtps_handler_out(sub_p, endpoint, stimulus);
start_test;
wait_on_complete;
stimulus := EMPTY_TEST_PACKET;
reference := EMPTY_TEST_PACKET;
sub_p.data := EMPTY_TEST_PACKET;
p2_snp := p2_snp + 1;
-- Readers -- Readers
Log("Ignore Participant 2 Reader [Durability Persistent]", INFO); Log("Ignore Participant 2 Reader [Durability Persistent]", INFO);
@ -691,6 +714,24 @@ begin
sub_s.data := EMPTY_TEST_PACKET; sub_s.data := EMPTY_TEST_PACKET;
p2_sns := p2_sns + 1; p2_sns := p2_sns + 1;
Log("Ignore Participant 2 Reader [Non-Default Partition]", INFO);
sub_s.writerSN := p2_sns;
endpoint := DEFAULT_ENDPOINT_DATA;
endpoint.entityId := gen_rand_entityid_2(TRUE);
endpoint.participant := p2;
endpoint.topic_name := ENDPOINT_TOPIC(0);
endpoint.type_name := ENDPOINT_TYPE(0);
gen_endpoint_data(endpoint, sub_s.data);
gen_parameter(PID_PARTITION, partition, sub_s.data);
gen_sentinel(sub_s.data);
gen_rtps_handler_out(sub_s, endpoint, stimulus);
start_test;
wait_on_complete;
stimulus := EMPTY_TEST_PACKET;
reference := EMPTY_TEST_PACKET;
sub_s.data := EMPTY_TEST_PACKET;
p2_sns := p2_sns + 1;
-- Reader/Writer Match/Unmatch -- Reader/Writer Match/Unmatch
Log("Match Participant 2 Writer [Default]", INFO); Log("Match Participant 2 Writer [Default]", INFO);

File diff suppressed because it is too large Load Diff

View File

@ -17,8 +17,10 @@ analyze ScoreBoard_test_memory.vhd
analyze Level_0/rtps_builtin_endpoint_test1.vhd analyze Level_0/rtps_builtin_endpoint_test1.vhd
analyze ScoreBoard_builtin_endpoint.vhd analyze ScoreBoard_builtin_endpoint.vhd
analyze Level_0/rtps_builtin_endpoint_test2.vhd analyze Level_0/rtps_builtin_endpoint_test2.vhd
analyze Level_0/rtps_builtin_endpoint_test3.vhd
#simulate rtps_handler_test1 #simulate rtps_handler_test1
#simulate rtps_handler_test2 #simulate rtps_handler_test2
#simulate rtps_builtin_endpoint_test1 #simulate rtps_builtin_endpoint_test1
simulate rtps_builtin_endpoint_test2 #simulate rtps_builtin_endpoint_test2
simulate rtps_builtin_endpoint_test3

View File

@ -374,7 +374,7 @@ architecture arch of rtps_builtin_endpoint is
-- RTPS PARAMETER LIST HEADER -- RTPS PARAMETER LIST HEADER
alias parameter_id : std_logic_vector(15 downto 0) is data_in(31 downto 16); alias parameter_id : std_logic_vector(15 downto 0) is data_in(31 downto 16);
alias parameter_length : std_logic_vector(15 downto 0) is data_in(15 downto 0); alias parameter_length : std_logic_vector(15 downto 0) is data_in(15 downto 0);
alias must_undersand : std_logic is parameter_id(14); alias must_understand : std_logic is parameter_id(14);
-- RTPS DATA PAYLOAD HEADER -- RTPS DATA PAYLOAD HEADER
alias representation_id : std_logic_vector(15 downto 0) is data_in(31 downto 16); alias representation_id : std_logic_vector(15 downto 0) is data_in(31 downto 16);
alias representation_options : std_logic_vector(15 downto 0) is data_in(15 downto 0); alias representation_options : std_logic_vector(15 downto 0) is data_in(15 downto 0);
@ -1710,7 +1710,8 @@ begin
-- Ignore in-line QoS -- Ignore in-line QoS
-- Only relevant for Endpoint Discovery Protocol -- Only relevant for Endpoint Discovery Protocol
if(qos_flag = '0' and message_type = EDP) then if(qos_flag = '0' and message_type = EDP) then
stage_next <= RXO_RELIABILITY; stage_next <= RXO_RELIABILITY;
cnt_next <= 0;
rcvd_next(RELIABILITY_QOS_RCVD_FLAG) <= '1'; rcvd_next(RELIABILITY_QOS_RCVD_FLAG) <= '1';
end if; end if;
when PID_DESTINATION_ORDER => when PID_DESTINATION_ORDER =>
@ -1886,7 +1887,7 @@ begin
null; null;
when others => when others =>
-- If MUST_UNDERSTAND Flag is set, we have incompatible communication. Drop Packet -- If MUST_UNDERSTAND Flag is set, we have incompatible communication. Drop Packet
if (must_undersand = '1') then if (must_understand = '1') then
stage_next <= SKIP_PACKET; stage_next <= SKIP_PACKET;
-- Else skip Uknown Parameter -- Else skip Uknown Parameter
else else
@ -2243,18 +2244,26 @@ begin
-- Input FIFO Guard -- Input FIFO Guard
if (empty = '0') then if (empty = '0') then
rd_guard := '1'; rd_guard := '1';
cnt_next <= cnt + 1;
-- Check QoS Compatibility (Unmark match on incompatibility) case (cnt) is
-- COMPATIBLE (DDS v1.4): offered >= requested, with BEST_EFFORT < RELIABLE when 0 =>
for i in 0 to NUM_ENDPOINTS-1 loop -- Check QoS Compatibility (Unmark match on incompatibility)
if (not check_qos_compatibility(is_subscriber, '1', unsigned(data_in_swapped), unsigned(ENDPOINT_RELIABILITY_QOS(i)))) then -- COMPATIBLE (DDS v1.4): offered >= requested, with BEST_EFFORT < RELIABLE
endpoint_mask_next(i) <= '0'; for i in 0 to NUM_ENDPOINTS-1 loop
end if; if (not check_qos_compatibility(is_subscriber, '1', unsigned(data_in_swapped), unsigned(ENDPOINT_RELIABILITY_QOS(i)))) then
end loop; endpoint_mask_next(i) <= '0';
end if;
-- NOTE: The max_blocking_time value is ignored end loop;
-- DONE when 1 =>
stage_next <= SKIP_PARAMETER; -- NOTE: The max_blocking_time value is ignored
null;
when 2 =>
-- DONE
stage_next <= SKIP_PARAMETER;
when others =>
null;
end case;
end if; end if;
when RXO_DESTINATION_ORDER => when RXO_DESTINATION_ORDER =>
-- Input FIFO Guard -- Input FIFO Guard

View File

@ -227,7 +227,7 @@ package rtps_test_package is
function gen_endpoint_array(readers : boolean) return ENDPOINT_DATA_ARRAY_TYPE; function gen_endpoint_array(readers : boolean) return ENDPOINT_DATA_ARRAY_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); length : in natural; 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);
procedure gen_rand_loc(RV : inout RandomPType; ret : out LOCATOR_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)); procedure gen_rand_entityid(RV : inout RandomPType; reader : boolean; ret : out std_logic_vector(ENTITYID_WIDTH-1 downto 0));
@ -935,7 +935,7 @@ package body rtps_test_package is
output.length := output.length + 1; output.length := output.length + 1;
-- GUID -- GUID
if (pid = PID_PARTICIPANT_GUID) then if (pid = PID_PARTICIPANT_GUID) then
assert (16+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; 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)); output.data(output.length) := PID_PARTICIPANT_GUID & endian_swap(ref.littleEndian, int(16+(offset*4), PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_PARTICIPANT_GUID & endian_swap(ref.littleEndian, int(16, PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_PARTICIPANT_GUID & endian_swap(ref.littleEndian, int(16, PARAMETER_LENGTH_WIDTH));
@ -954,7 +954,7 @@ package body rtps_test_package is
end if; end if;
-- DOMAIN ID -- DOMAIN ID
if (pid = PID_DOMAIN_ID) then if (pid = PID_DOMAIN_ID) 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_DOMAIN_ID & endian_swap(ref.littleEndian, int(4+(offset*4), PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_DOMAIN_ID & endian_swap(ref.littleEndian, int(4+(offset*4), PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_DOMAIN_ID & endian_swap(ref.littleEndian, int(4, PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_DOMAIN_ID & endian_swap(ref.littleEndian, int(4, PARAMETER_LENGTH_WIDTH));
@ -966,10 +966,10 @@ package body rtps_test_package is
output.length := output.length + offset; output.length := output.length + offset;
end if; end if;
-- DOMAIN TAG -- DOMAIN TAG
if (ref.domainTag /= DEFAULT_DOMAIN_TAG) then if (ref.domainTag /= DEFAULT_DOMAIN_TAG or pid = PID_DOMAIN_TAG) then
tmp := string_len(ref.domainTag); tmp := string_len(ref.domainTag);
if (pid = PID_DOMAIN_TAG) then if (pid = PID_DOMAIN_TAG) then
assert (((round_div(tmp,4)+1)*4)+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; 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)); output.data(output.length) := PID_DOMAIN_TAG & endian_swap(ref.littleEndian, int(((round_div(tmp,4)+1)*4)+(offset*4), PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_DOMAIN_TAG & endian_swap(ref.littleEndian, int((round_div(tmp,4)+1)*4, PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_DOMAIN_TAG & endian_swap(ref.littleEndian, int((round_div(tmp,4)+1)*4, PARAMETER_LENGTH_WIDTH));
@ -987,7 +987,7 @@ package body rtps_test_package is
end if; end if;
-- PROTOCOL VERSION -- PROTOCOL VERSION
if (pid = PID_PROTOCOL_VERSION) then if (pid = PID_PROTOCOL_VERSION) 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_PROTOCOL_VERSION & endian_swap(ref.littleEndian, int(4+(offset*4), PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_PROTOCOL_VERSION & endian_swap(ref.littleEndian, int(4+(offset*4), PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_PROTOCOL_VERSION & endian_swap(ref.littleEndian, int(4, PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_PROTOCOL_VERSION & endian_swap(ref.littleEndian, int(4, PARAMETER_LENGTH_WIDTH));
@ -1001,7 +1001,7 @@ package body rtps_test_package is
end if; end if;
-- VENDORID -- VENDORID
if (pid = PID_VENDORID) then if (pid = PID_VENDORID) 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_VENDORID & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_VENDORID & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_VENDORID & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_VENDORID & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH));
@ -1014,9 +1014,9 @@ package body rtps_test_package is
output.length := output.length + offset; output.length := output.length + offset;
end if; end if;
-- EXPECTS IN-LINE QOS -- EXPECTS IN-LINE QOS
if (ref.expectsInlineQoS(0) /= DEFAULT_EXPECTS_INLINE_QOS) then if (ref.expectsInlineQoS(0) /= DEFAULT_EXPECTS_INLINE_QOS or pid = PID_EXPECTS_INLINE_QOS) then
if (pid = PID_EXPECTS_INLINE_QOS) then if (pid = PID_EXPECTS_INLINE_QOS) 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_EXPECTS_INLINE_QOS & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_EXPECTS_INLINE_QOS & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_EXPECTS_INLINE_QOS & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_EXPECTS_INLINE_QOS & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH));
@ -1034,7 +1034,7 @@ package body rtps_test_package is
tmp := to_integer(unsigned(ref.metatrafficMulticastLocatorList.numLocators)); tmp := to_integer(unsigned(ref.metatrafficMulticastLocatorList.numLocators));
for i in 0 to tmp-1 loop for i in 0 to tmp-1 loop
if (pid = PID_METATRAFFIC_MULTICAST_LOCATOR) then if (pid = PID_METATRAFFIC_MULTICAST_LOCATOR) then
assert (24+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; 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)); output.data(output.length) := PID_METATRAFFIC_MULTICAST_LOCATOR & endian_swap(ref.littleEndian, int(24+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_METATRAFFIC_MULTICAST_LOCATOR & endian_swap(ref.littleEndian, int(24,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_METATRAFFIC_MULTICAST_LOCATOR & endian_swap(ref.littleEndian, int(24,PARAMETER_LENGTH_WIDTH));
@ -1062,7 +1062,7 @@ package body rtps_test_package is
tmp := to_integer(unsigned(ref.metatrafficUnicastLocatorList.numLocators)); tmp := to_integer(unsigned(ref.metatrafficUnicastLocatorList.numLocators));
for i in 0 to tmp-1 loop for i in 0 to tmp-1 loop
if (pid = PID_METATRAFFIC_UNICAST_LOCATOR) then if (pid = PID_METATRAFFIC_UNICAST_LOCATOR) then
assert (24+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; 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)); output.data(output.length) := PID_METATRAFFIC_UNICAST_LOCATOR & endian_swap(ref.littleEndian, int(24+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_METATRAFFIC_UNICAST_LOCATOR & endian_swap(ref.littleEndian, int(24,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_METATRAFFIC_UNICAST_LOCATOR & endian_swap(ref.littleEndian, int(24,PARAMETER_LENGTH_WIDTH));
@ -1090,7 +1090,7 @@ package body rtps_test_package is
tmp := to_integer(unsigned(ref.defaultMulticastLocatorList.numLocators)); tmp := to_integer(unsigned(ref.defaultMulticastLocatorList.numLocators));
for i in 0 to tmp-1 loop for i in 0 to tmp-1 loop
if (pid = PID_DEFAULT_MULTICAST_LOCATOR) then if (pid = PID_DEFAULT_MULTICAST_LOCATOR) then
assert (24+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; 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)); output.data(output.length) := PID_DEFAULT_MULTICAST_LOCATOR & endian_swap(ref.littleEndian, int(24+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_DEFAULT_MULTICAST_LOCATOR & endian_swap(ref.littleEndian, int(24,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_DEFAULT_MULTICAST_LOCATOR & endian_swap(ref.littleEndian, int(24,PARAMETER_LENGTH_WIDTH));
@ -1119,7 +1119,7 @@ package body rtps_test_package is
tmp := to_integer(unsigned(ref.defaultUnicastLocatorList.numLocators)); tmp := to_integer(unsigned(ref.defaultUnicastLocatorList.numLocators));
for i in 0 to tmp-1 loop for i in 0 to tmp-1 loop
if (pid = PID_DEFAULT_UNICAST_LOCATOR) then if (pid = PID_DEFAULT_UNICAST_LOCATOR) then
assert (24+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; 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)); output.data(output.length) := PID_DEFAULT_UNICAST_LOCATOR & endian_swap(ref.littleEndian, int(24+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_DEFAULT_UNICAST_LOCATOR & endian_swap(ref.littleEndian, int(24,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_DEFAULT_UNICAST_LOCATOR & endian_swap(ref.littleEndian, int(24,PARAMETER_LENGTH_WIDTH));
@ -1143,9 +1143,9 @@ package body rtps_test_package is
end loop; end loop;
end if; end if;
-- LEASE DURATION -- LEASE DURATION
if (ref.leaseDuration /= DEFAULT_PARTICIPANT_LEASE_DURATION) then if (ref.leaseDuration /= DEFAULT_PARTICIPANT_LEASE_DURATION or pid = PID_PARTICIPANT_LEASE_DURATION) then
if (pid = PID_PARTICIPANT_LEASE_DURATION) then if (pid = PID_PARTICIPANT_LEASE_DURATION) then
assert (8+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; 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)); output.data(output.length) := PID_PARTICIPANT_LEASE_DURATION & endian_swap(ref.littleEndian, int(8+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_PARTICIPANT_LEASE_DURATION & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_PARTICIPANT_LEASE_DURATION & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH));
@ -1161,7 +1161,7 @@ package body rtps_test_package is
end if; end if;
-- AVAILABLE ENDPOINTS -- AVAILABLE ENDPOINTS
if (pid = PID_BUILTIN_ENDPOINT_SET) then if (pid = PID_BUILTIN_ENDPOINT_SET) 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_BUILTIN_ENDPOINT_SET & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_BUILTIN_ENDPOINT_SET & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_BUILTIN_ENDPOINT_SET & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_BUILTIN_ENDPOINT_SET & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH));
@ -1172,9 +1172,22 @@ package body rtps_test_package is
if (pid = PID_BUILTIN_ENDPOINT_SET) then if (pid = PID_BUILTIN_ENDPOINT_SET) then
output.length := output.length + offset; output.length := output.length + offset;
end if; end if;
-- BUILTIN ENDPOINT QOS
if (pid = PID_BUILTIN_ENDPOINT_QOS) then
assert (4+(offset*4) >= 0) report "Parameter Length < 0" severity FAILURE;
output.data(output.length) := PID_BUILTIN_ENDPOINT_QOS & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH));
else
output.data(output.length) := PID_BUILTIN_ENDPOINT_QOS & 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.builtinEndpointQoS);
output.length := output.length + 1;
if (pid = PID_BUILTIN_ENDPOINT_QOS) then
output.length := output.length + offset;
end if;
-- MANUAL LIVELINESS COUNT -- MANUAL LIVELINESS COUNT
if (pid = PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT) then if (pid = PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT) 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_PARTICIPANT_MANUAL_LIVELINESS_COUNT & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH));
@ -1281,6 +1294,8 @@ package body rtps_test_package is
return ret; return ret;
end function; end function;
-- The Arguments "pid" and "offset" can be used to modify the parameter generation. More specifically, the length of the parameter denoted by "pid" is modified by "offset" 4-Byte words.
-- Also setting "pid" forces the respective parameter to be writen out even if it is equal to the default value.
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 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; variable tmp : natural := 0;
begin begin
@ -1293,7 +1308,7 @@ package body rtps_test_package is
output.length := output.length + 1; output.length := output.length + 1;
-- GUID -- GUID
if (pid = PID_ENDPOINT_GUID) then if (pid = PID_ENDPOINT_GUID) then
assert (16+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; 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)); output.data(output.length) := PID_ENDPOINT_GUID & endian_swap(ref.littleEndian, int(16+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_ENDPOINT_GUID & endian_swap(ref.littleEndian, int(16,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_ENDPOINT_GUID & endian_swap(ref.littleEndian, int(16,PARAMETER_LENGTH_WIDTH));
@ -1311,9 +1326,9 @@ package body rtps_test_package is
output.length := output.length + offset; output.length := output.length + offset;
end if; end if;
-- EXPECTS IN-LINE QOS -- EXPECTS IN-LINE QOS
if (ref.expectsInlineQoS(0) /= '0') then if (ref.expectsInlineQoS(0) /= DEFAULT_EXPECTS_INLINE_QOS or pid = PID_EXPECTS_INLINE_QOS) then
if (pid = PID_EXPECTS_INLINE_QOS) then if (pid = PID_EXPECTS_INLINE_QOS) 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_EXPECTS_INLINE_QOS & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_EXPECTS_INLINE_QOS & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_EXPECTS_INLINE_QOS & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_EXPECTS_INLINE_QOS & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH));
@ -1327,9 +1342,9 @@ package body rtps_test_package is
end if; end if;
end if; end if;
-- TOPIC NAME -- TOPIC NAME
tmp := string_len(ref.topic_name); tmp := string_len(ref.topic_name);
if (pid = PID_TOPIC_NAME) then if (pid = PID_TOPIC_NAME) then
assert (((round_div(tmp,4)+1)*4)+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; 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)); output.data(output.length) := PID_TOPIC_NAME & endian_swap(ref.littleEndian, int(((round_div(tmp,4)+1)*4)+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_TOPIC_NAME & endian_swap(ref.littleEndian, int((round_div(tmp,4)+1)*4,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_TOPIC_NAME & endian_swap(ref.littleEndian, int((round_div(tmp,4)+1)*4,PARAMETER_LENGTH_WIDTH));
@ -1345,9 +1360,9 @@ package body rtps_test_package is
output.length := output.length + offset; output.length := output.length + offset;
end if; end if;
-- TYPE NAME -- TYPE NAME
tmp := string_len(ref.type_name); tmp := string_len(ref.type_name);
if (pid = PID_TYPE_NAME) then if (pid = PID_TYPE_NAME) then
assert (((round_div(tmp,4)+1)*4)+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; 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)); output.data(output.length) := PID_TYPE_NAME & endian_swap(ref.littleEndian, int(((round_div(tmp,4)+1)*4)+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_TYPE_NAME & endian_swap(ref.littleEndian, int((round_div(tmp,4)+1)*4,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_TYPE_NAME & endian_swap(ref.littleEndian, int((round_div(tmp,4)+1)*4,PARAMETER_LENGTH_WIDTH));
@ -1363,9 +1378,9 @@ package body rtps_test_package is
output.length := output.length + offset; output.length := output.length + offset;
end if; end if;
-- DURABILITY -- DURABILITY
if (ref.durability /= DEFAULT_DURABILITY_QOS) then if (ref.durability /= DEFAULT_DURABILITY_QOS or pid = PID_DURABILITY) then
if (pid = PID_DURABILITY) then if (pid = PID_DURABILITY) 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_DURABILITY & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_DURABILITY & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_DURABILITY & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_DURABILITY & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH));
@ -1380,9 +1395,9 @@ package body rtps_test_package is
-- DURABILITY SERVICE -- DURABILITY SERVICE
if (ref.durability_service_cleanup_delay /= DEFAULT_DURABILITY_SERVICE_CLEANUP_DELAY or ref.durability_service_history /= DEFAULT_DURABILITY_SERVICE_HISTORY or 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_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 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 or pid = PID_DURABILITY_SERVICE) then
if (pid = PID_DURABILITY_SERVICE) then if (pid = PID_DURABILITY_SERVICE) then
assert (28+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; 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)); output.data(output.length) := PID_DURABILITY_SERVICE & endian_swap(ref.littleEndian, int(28+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_DURABILITY_SERVICE & endian_swap(ref.littleEndian, int(28,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_DURABILITY_SERVICE & endian_swap(ref.littleEndian, int(28,PARAMETER_LENGTH_WIDTH));
@ -1407,9 +1422,9 @@ package body rtps_test_package is
end if; end if;
end if; end if;
-- PRESENTATION -- 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 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) or pid = PID_PRESENTATION) then
if (pid = PID_PRESENTATION) then if (pid = PID_PRESENTATION) then
assert (8+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; 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)); output.data(output.length) := PID_PRESENTATION & endian_swap(ref.littleEndian, int(8+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_PRESENTATION & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_PRESENTATION & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH));
@ -1424,9 +1439,9 @@ package body rtps_test_package is
end if; end if;
end if; end if;
-- DEADLINE -- DEADLINE
if (ref.deadline /= DEFAULT_DEADLINE_QOS) then if (ref.deadline /= DEFAULT_DEADLINE_QOS or pid = PID_DEADLINE) then
if (pid = PID_DEADLINE) then if (pid = PID_DEADLINE) then
assert (8+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; 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)); output.data(output.length) := PID_DEADLINE & endian_swap(ref.littleEndian, int(8+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_DEADLINE & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_DEADLINE & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH));
@ -1441,9 +1456,9 @@ package body rtps_test_package is
end if; end if;
end if; end if;
-- LATENCY BUDGET -- LATENCY BUDGET
if (ref.latency_budget /= DEFAULT_LATENCY_BUDGET_QOS) then if (ref.latency_budget /= DEFAULT_LATENCY_BUDGET_QOS or pid = PID_LATENCY_BUDGET) then
if (pid = PID_LATENCY_BUDGET) then if (pid = PID_LATENCY_BUDGET) then
assert (8+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; 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)); output.data(output.length) := PID_LATENCY_BUDGET & endian_swap(ref.littleEndian, int(8+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_LATENCY_BUDGET & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_LATENCY_BUDGET & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH));
@ -1458,9 +1473,9 @@ package body rtps_test_package is
end if; end if;
end if; end if;
-- OWNERSHIP -- OWNERSHIP
if (ref.ownership /= DEFAULT_OWNERSHIP_QOS) then if (ref.ownership /= DEFAULT_OWNERSHIP_QOS or pid = PID_OWNERSHIP) then
if (pid = PID_OWNERSHIP) then if (pid = PID_OWNERSHIP) 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 & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_OWNERSHIP & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_OWNERSHIP & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_OWNERSHIP & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH));
@ -1473,9 +1488,9 @@ 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) then if (ref.ownership /= 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));
else else
output.data(output.length) := PID_OWNERSHIP_STRENGTH & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_OWNERSHIP_STRENGTH & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH));
@ -1488,9 +1503,9 @@ package body rtps_test_package is
end if; end if;
end if; end if;
-- LIVELINESS -- LIVELINESS
if (ref.liveliness /= DEFAULT_LIVELINESS_QOS or ref.leaseDuration /= DEFAULT_LEASE_DURATION) then if (ref.liveliness /= DEFAULT_LIVELINESS_QOS or ref.leaseDuration /= DEFAULT_LEASE_DURATION or pid = PID_LIVELINESS) then
if (pid = PID_LIVELINESS) then if (pid = PID_LIVELINESS) then
assert (12+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; 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)); output.data(output.length) := PID_LIVELINESS & endian_swap(ref.littleEndian, int(12+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_LIVELINESS & endian_swap(ref.littleEndian, int(12,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_LIVELINESS & endian_swap(ref.littleEndian, int(12,PARAMETER_LENGTH_WIDTH));
@ -1507,9 +1522,9 @@ package body rtps_test_package is
end if; end if;
end if; end if;
-- TIME BASED FILTER -- TIME BASED FILTER
if (ref.time_based_filter /= DEFAULT_TIME_BASED_FILTER_QOS) then if (ref.time_based_filter /= DEFAULT_TIME_BASED_FILTER_QOS or pid = PID_TIME_BASED_FILTER) then
if (pid = PID_TIME_BASED_FILTER) then if (pid = PID_TIME_BASED_FILTER) then
assert (8+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; 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)); output.data(output.length) := PID_TIME_BASED_FILTER & endian_swap(ref.littleEndian, int(8+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_TIME_BASED_FILTER & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_TIME_BASED_FILTER & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH));
@ -1524,9 +1539,9 @@ package body rtps_test_package is
end if; end if;
end if; end if;
-- RELIABILITY -- RELIABILITY
if (ref.reliability /= DEFAULT_RELIABILTY_QOS or ref.max_blocking_time /= DEFAULT_MAX_BLOCKING_TIME) then if (ref.reliability /= DEFAULT_RELIABILTY_QOS or ref.max_blocking_time /= DEFAULT_MAX_BLOCKING_TIME or pid = PID_RELIABILITY) then
if (pid = PID_RELIABILITY) then if (pid = PID_RELIABILITY) then
assert (12+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; 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)); output.data(output.length) := PID_RELIABILITY & endian_swap(ref.littleEndian, int(12+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_RELIABILITY & endian_swap(ref.littleEndian, int(12,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_RELIABILITY & endian_swap(ref.littleEndian, int(12,PARAMETER_LENGTH_WIDTH));
@ -1543,9 +1558,9 @@ package body rtps_test_package is
end if; end if;
end if; end if;
-- TRANSPORT PRIORITY -- TRANSPORT PRIORITY
if (ref.transportnpriority /= DEFAULT_TRANSPORT_PRIORITY_QOS) then if (ref.transportnpriority /= DEFAULT_TRANSPORT_PRIORITY_QOS or pid = PID_TRANSPORT_PRIORITY) then
if (pid = PID_TRANSPORT_PRIORITY) then if (pid = PID_TRANSPORT_PRIORITY) 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_TRANSPORT_PRIORITY & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_TRANSPORT_PRIORITY & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_TRANSPORT_PRIORITY & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_TRANSPORT_PRIORITY & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH));
@ -1558,9 +1573,9 @@ package body rtps_test_package is
end if; end if;
end if; end if;
-- LIFESPAN -- LIFESPAN
if (ref.lifespan /= DEFAULT_LIFESPAN_QOS) then if (ref.lifespan /= DEFAULT_LIFESPAN_QOS or pid = PID_LIFESPAN) then
if (pid = PID_LIFESPAN) then if (pid = PID_LIFESPAN) then
assert (8+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; 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)); output.data(output.length) := PID_LIFESPAN & endian_swap(ref.littleEndian, int(8+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_LIFESPAN & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_LIFESPAN & endian_swap(ref.littleEndian, int(8,PARAMETER_LENGTH_WIDTH));
@ -1575,9 +1590,9 @@ package body rtps_test_package is
end if; end if;
end if; end if;
-- DESTINATION ORDER -- DESTINATION ORDER
if (ref.destination_order /= DEFAULT_DESTINATION_ORDER_QOS) then if (ref.destination_order /= DEFAULT_DESTINATION_ORDER_QOS or pid = PID_DESTINATION_ORDER) then
if (pid = PID_DESTINATION_ORDER) then if (pid = PID_DESTINATION_ORDER) 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_DESTINATION_ORDER & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_DESTINATION_ORDER & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_DESTINATION_ORDER & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_DESTINATION_ORDER & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH));
@ -1594,7 +1609,7 @@ package body rtps_test_package is
tmp := to_integer(unsigned(ref.unicastLocatorList.numLocators)); tmp := to_integer(unsigned(ref.unicastLocatorList.numLocators));
for i in 0 to tmp-1 loop for i in 0 to tmp-1 loop
if (pid = PID_UNICAST_LOCATOR) then if (pid = PID_UNICAST_LOCATOR) then
assert (24+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; 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)); output.data(output.length) := PID_UNICAST_LOCATOR & endian_swap(ref.littleEndian, int(24+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_UNICAST_LOCATOR & endian_swap(ref.littleEndian, int(24,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_UNICAST_LOCATOR & endian_swap(ref.littleEndian, int(24,PARAMETER_LENGTH_WIDTH));
@ -1622,7 +1637,7 @@ package body rtps_test_package is
tmp := to_integer(unsigned(ref.multicastLocatorList.numLocators)); tmp := to_integer(unsigned(ref.multicastLocatorList.numLocators));
for i in 0 to tmp-1 loop for i in 0 to tmp-1 loop
if (pid = PID_MULTICAST_LOCATOR) then if (pid = PID_MULTICAST_LOCATOR) then
assert (24+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE; 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)); output.data(output.length) := PID_MULTICAST_LOCATOR & endian_swap(ref.littleEndian, int(24+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_MULTICAST_LOCATOR & endian_swap(ref.littleEndian, int(24,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_MULTICAST_LOCATOR & endian_swap(ref.littleEndian, int(24,PARAMETER_LENGTH_WIDTH));
@ -1646,7 +1661,7 @@ package body rtps_test_package is
end loop; end loop;
end if; 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
output.data(output.length) := PID_USER_DATA & endian_swap(ref.littleEndian, int((round_div(tmp,4)+1)*4,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_USER_DATA & endian_swap(ref.littleEndian, int((round_div(tmp,4)+1)*4,PARAMETER_LENGTH_WIDTH));
output.length := output.length + 1; output.length := output.length + 1;
@ -1658,7 +1673,7 @@ package body rtps_test_package is
end loop; end loop;
end if; end if;
-- TOPIC DATA -- TOPIC DATA
tmp := string_len(ref.topic_data); tmp := string_len(ref.topic_data);
if (tmp > 1) then if (tmp > 1) then
output.data(output.length) := PID_TOPIC_DATA & endian_swap(ref.littleEndian, int((round_div(tmp,4)+1)*4,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_TOPIC_DATA & endian_swap(ref.littleEndian, int((round_div(tmp,4)+1)*4,PARAMETER_LENGTH_WIDTH));
output.length := output.length + 1; output.length := output.length + 1;
@ -1670,7 +1685,7 @@ package body rtps_test_package is
end loop; end loop;
end if; end if;
-- GROUP DATA -- GROUP DATA
tmp := string_len(ref.group_data); tmp := string_len(ref.group_data);
if (tmp > 1) then if (tmp > 1) then
output.data(output.length) := PID_GROUP_DATA & endian_swap(ref.littleEndian, int((round_div(tmp,4)+1)*4,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_GROUP_DATA & endian_swap(ref.littleEndian, int((round_div(tmp,4)+1)*4,PARAMETER_LENGTH_WIDTH));
output.length := output.length + 1; output.length := output.length + 1;
@ -1682,9 +1697,10 @@ package body rtps_test_package is
end loop; end loop;
end if; end if;
-- MAX SIZE SERIALIZED -- MAX SIZE SERIALIZED
-- NOTE: PID_DATA_MAX_SIZE_SERIALIZED has no default value, but we use the value zero as default for not sending the parameter
if (unsigned(ref.max_size_serialized) /= 0) then if (unsigned(ref.max_size_serialized) /= 0) then
if (pid = PID_DATA_MAX_SIZE_SERIALIZED) then if (pid = PID_DATA_MAX_SIZE_SERIALIZED) 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_DATA_MAX_SIZE_SERIALIZED & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_DATA_MAX_SIZE_SERIALIZED & endian_swap(ref.littleEndian, int(4+(offset*4),PARAMETER_LENGTH_WIDTH));
else else
output.data(output.length) := PID_DATA_MAX_SIZE_SERIALIZED & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH)); output.data(output.length) := PID_DATA_MAX_SIZE_SERIALIZED & endian_swap(ref.littleEndian, int(4,PARAMETER_LENGTH_WIDTH));
@ -1751,13 +1767,13 @@ package body rtps_test_package is
output.length := output.length + 1; output.length := output.length + 1;
end procedure; 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 procedure gen_parameter(pid : in std_logic_vector(PARAMETER_ID_WIDTH-1 downto 0); data : in TEST_PACKET_TYPE; output : inout TEST_PACKET_TYPE) is
begin begin
-- PARAMETER HEADER -- PARAMETER HEADER
output.data(output.length) := pid & int(length*4,PARAMETER_LENGTH_WIDTH); output.data(output.length) := pid & int(data.length*4,PARAMETER_LENGTH_WIDTH);
output.length := output.length + 1; output.length := output.length + 1;
-- DATA -- DATA
for i in 0 to length-1 loop for i in 0 to data.length-1 loop
output.data(output.length) := data.data(i); output.data(output.length) := data.data(i);
output.length := output.length + 1; output.length := output.length + 1;
end loop; end loop;