* Added rtps_builtin_endpoint_test3
- Compiling and Passing
This commit is contained in:
parent
02be7bb0a3
commit
472af656b3
72
sim/rtps_builtin_endpoint_test3.do
Normal file
72
sim/rtps_builtin_endpoint_test3.do
Normal 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}
|
||||
@ -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?)
|
||||
* 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?
|
||||
* 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
|
||||
- Open Github Issue
|
||||
|
||||
@ -189,6 +189,7 @@ begin
|
||||
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 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
|
||||
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));
|
||||
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);
|
||||
stim_done <= '0';
|
||||
start <= '0';
|
||||
@ -589,16 +597,13 @@ begin
|
||||
sub_p.data := EMPTY_TEST_PACKET;
|
||||
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;
|
||||
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);
|
||||
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));
|
||||
gen_endpoint_data(endpoint, sub_p.data);
|
||||
gen_sentinel(sub_p.data);
|
||||
@ -610,6 +615,24 @@ begin
|
||||
sub_p.data := EMPTY_TEST_PACKET;
|
||||
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
|
||||
|
||||
Log("Ignore Participant 2 Reader [Durability Persistent]", INFO);
|
||||
@ -691,6 +714,24 @@ begin
|
||||
sub_s.data := EMPTY_TEST_PACKET;
|
||||
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
|
||||
|
||||
Log("Match Participant 2 Writer [Default]", INFO);
|
||||
|
||||
1189
src/Tests/Level_0/rtps_builtin_endpoint_test3.vhd
Normal file
1189
src/Tests/Level_0/rtps_builtin_endpoint_test3.vhd
Normal file
File diff suppressed because it is too large
Load Diff
@ -17,8 +17,10 @@ analyze ScoreBoard_test_memory.vhd
|
||||
analyze Level_0/rtps_builtin_endpoint_test1.vhd
|
||||
analyze ScoreBoard_builtin_endpoint.vhd
|
||||
analyze Level_0/rtps_builtin_endpoint_test2.vhd
|
||||
analyze Level_0/rtps_builtin_endpoint_test3.vhd
|
||||
|
||||
#simulate rtps_handler_test1
|
||||
#simulate rtps_handler_test2
|
||||
#simulate rtps_builtin_endpoint_test1
|
||||
simulate rtps_builtin_endpoint_test2
|
||||
#simulate rtps_builtin_endpoint_test2
|
||||
simulate rtps_builtin_endpoint_test3
|
||||
@ -374,7 +374,7 @@ architecture arch of rtps_builtin_endpoint is
|
||||
-- RTPS PARAMETER LIST HEADER
|
||||
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 must_undersand : std_logic is parameter_id(14);
|
||||
alias must_understand : std_logic is parameter_id(14);
|
||||
-- RTPS DATA PAYLOAD HEADER
|
||||
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);
|
||||
@ -1710,7 +1710,8 @@ begin
|
||||
-- Ignore in-line QoS
|
||||
-- Only relevant for Endpoint Discovery Protocol
|
||||
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';
|
||||
end if;
|
||||
when PID_DESTINATION_ORDER =>
|
||||
@ -1886,7 +1887,7 @@ begin
|
||||
null;
|
||||
when others =>
|
||||
-- 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;
|
||||
-- Else skip Uknown Parameter
|
||||
else
|
||||
@ -2243,18 +2244,26 @@ begin
|
||||
-- Input FIFO Guard
|
||||
if (empty = '0') then
|
||||
rd_guard := '1';
|
||||
cnt_next <= cnt + 1;
|
||||
|
||||
-- Check QoS Compatibility (Unmark match on incompatibility)
|
||||
-- COMPATIBLE (DDS v1.4): offered >= requested, with BEST_EFFORT < RELIABLE
|
||||
for i in 0 to NUM_ENDPOINTS-1 loop
|
||||
if (not check_qos_compatibility(is_subscriber, '1', unsigned(data_in_swapped), unsigned(ENDPOINT_RELIABILITY_QOS(i)))) then
|
||||
endpoint_mask_next(i) <= '0';
|
||||
end if;
|
||||
end loop;
|
||||
|
||||
-- NOTE: The max_blocking_time value is ignored
|
||||
-- DONE
|
||||
stage_next <= SKIP_PARAMETER;
|
||||
case (cnt) is
|
||||
when 0 =>
|
||||
-- Check QoS Compatibility (Unmark match on incompatibility)
|
||||
-- COMPATIBLE (DDS v1.4): offered >= requested, with BEST_EFFORT < RELIABLE
|
||||
for i in 0 to NUM_ENDPOINTS-1 loop
|
||||
if (not check_qos_compatibility(is_subscriber, '1', unsigned(data_in_swapped), unsigned(ENDPOINT_RELIABILITY_QOS(i)))) then
|
||||
endpoint_mask_next(i) <= '0';
|
||||
end if;
|
||||
end loop;
|
||||
when 1 =>
|
||||
-- NOTE: The max_blocking_time value is ignored
|
||||
null;
|
||||
when 2 =>
|
||||
-- DONE
|
||||
stage_next <= SKIP_PARAMETER;
|
||||
when others =>
|
||||
null;
|
||||
end case;
|
||||
end if;
|
||||
when RXO_DESTINATION_ORDER =>
|
||||
-- Input FIFO Guard
|
||||
|
||||
@ -227,7 +227,7 @@ package rtps_test_package is
|
||||
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_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_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;
|
||||
-- GUID
|
||||
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));
|
||||
else
|
||||
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;
|
||||
-- DOMAIN ID
|
||||
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));
|
||||
else
|
||||
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;
|
||||
end if;
|
||||
-- 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);
|
||||
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));
|
||||
else
|
||||
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;
|
||||
-- PROTOCOL VERSION
|
||||
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));
|
||||
else
|
||||
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;
|
||||
-- VENDORID
|
||||
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));
|
||||
else
|
||||
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;
|
||||
end if;
|
||||
-- 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
|
||||
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));
|
||||
else
|
||||
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));
|
||||
for i in 0 to tmp-1 loop
|
||||
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));
|
||||
else
|
||||
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));
|
||||
for i in 0 to tmp-1 loop
|
||||
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));
|
||||
else
|
||||
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));
|
||||
for i in 0 to tmp-1 loop
|
||||
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));
|
||||
else
|
||||
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));
|
||||
for i in 0 to tmp-1 loop
|
||||
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));
|
||||
else
|
||||
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 if;
|
||||
-- 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
|
||||
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));
|
||||
else
|
||||
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;
|
||||
-- AVAILABLE ENDPOINTS
|
||||
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));
|
||||
else
|
||||
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
|
||||
output.length := output.length + offset;
|
||||
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
|
||||
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));
|
||||
else
|
||||
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;
|
||||
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
|
||||
variable tmp : natural := 0;
|
||||
begin
|
||||
@ -1293,7 +1308,7 @@ package body rtps_test_package is
|
||||
output.length := output.length + 1;
|
||||
-- GUID
|
||||
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));
|
||||
else
|
||||
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;
|
||||
end if;
|
||||
-- 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
|
||||
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));
|
||||
else
|
||||
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;
|
||||
-- TOPIC NAME
|
||||
tmp := string_len(ref.topic_name);
|
||||
tmp := string_len(ref.topic_name);
|
||||
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));
|
||||
else
|
||||
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;
|
||||
end if;
|
||||
-- TYPE NAME
|
||||
tmp := string_len(ref.type_name);
|
||||
tmp := string_len(ref.type_name);
|
||||
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));
|
||||
else
|
||||
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;
|
||||
end if;
|
||||
-- DURABILITY
|
||||
if (ref.durability /= DEFAULT_DURABILITY_QOS) then
|
||||
if (ref.durability /= DEFAULT_DURABILITY_QOS or 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));
|
||||
else
|
||||
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
|
||||
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
|
||||
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
|
||||
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));
|
||||
else
|
||||
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;
|
||||
-- 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
|
||||
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));
|
||||
else
|
||||
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;
|
||||
-- DEADLINE
|
||||
if (ref.deadline /= DEFAULT_DEADLINE_QOS) then
|
||||
if (ref.deadline /= DEFAULT_DEADLINE_QOS or 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));
|
||||
else
|
||||
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;
|
||||
-- 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
|
||||
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));
|
||||
else
|
||||
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;
|
||||
-- OWNERSHIP
|
||||
if (ref.ownership /= DEFAULT_OWNERSHIP_QOS) then
|
||||
if (ref.ownership /= DEFAULT_OWNERSHIP_QOS or 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));
|
||||
else
|
||||
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;
|
||||
-- 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
|
||||
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));
|
||||
else
|
||||
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;
|
||||
-- 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
|
||||
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));
|
||||
else
|
||||
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;
|
||||
-- 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
|
||||
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));
|
||||
else
|
||||
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;
|
||||
-- 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
|
||||
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));
|
||||
else
|
||||
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;
|
||||
-- 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
|
||||
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));
|
||||
else
|
||||
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;
|
||||
-- LIFESPAN
|
||||
if (ref.lifespan /= DEFAULT_LIFESPAN_QOS) then
|
||||
if (ref.lifespan /= DEFAULT_LIFESPAN_QOS or 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));
|
||||
else
|
||||
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;
|
||||
-- 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
|
||||
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));
|
||||
else
|
||||
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));
|
||||
for i in 0 to tmp-1 loop
|
||||
if (pid = PID_UNICAST_LOCATOR) then
|
||||
assert (24+(offset*4) > 0) report "Parameter Length < 0" severity FAILURE;
|
||||
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));
|
||||
@ -1622,7 +1637,7 @@ package body rtps_test_package is
|
||||
tmp := to_integer(unsigned(ref.multicastLocatorList.numLocators));
|
||||
for i in 0 to tmp-1 loop
|
||||
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));
|
||||
else
|
||||
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 if;
|
||||
-- USER DATA
|
||||
tmp := string_len(ref.user_data);
|
||||
tmp := string_len(ref.user_data);
|
||||
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.length := output.length + 1;
|
||||
@ -1658,7 +1673,7 @@ package body rtps_test_package is
|
||||
end loop;
|
||||
end if;
|
||||
-- TOPIC DATA
|
||||
tmp := string_len(ref.topic_data);
|
||||
tmp := string_len(ref.topic_data);
|
||||
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.length := output.length + 1;
|
||||
@ -1670,7 +1685,7 @@ package body rtps_test_package is
|
||||
end loop;
|
||||
end if;
|
||||
-- GROUP DATA
|
||||
tmp := string_len(ref.group_data);
|
||||
tmp := string_len(ref.group_data);
|
||||
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.length := output.length + 1;
|
||||
@ -1682,9 +1697,10 @@ package body rtps_test_package is
|
||||
end loop;
|
||||
end if;
|
||||
-- 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 (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));
|
||||
else
|
||||
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;
|
||||
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
|
||||
-- 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;
|
||||
-- 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.length := output.length + 1;
|
||||
end loop;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user