code refactoring

This commit is contained in:
John Ring 2022-04-03 20:02:31 +02:00
parent 5e7ea79887
commit ddacbb6d2b
2 changed files with 39 additions and 41 deletions

View File

@ -607,14 +607,14 @@ begin
AffirmIf(status_id,(status and SAMPLE_REJECTED_STATUS) = SAMPLE_REJECTED_STATUS, "Expected: 1", "Received: 0");
Log("DDS Operation GET_SAMPLE_REJECTED_STATUS (Expected: Count 6, Change 1, Instance 1, REJECTED_BY_SAMPLES_LIMIT)", INFO);
Log("DDS Operation GET_SAMPLE_REJECTED_STATUS (Expected: Count 6, Change 1, Instance 1, REJECTED_BY_INSTANCES_LIMIT)", INFO);
dds := DEFAULT_DDS_READER_TEST;
dds.opcode := GET_SAMPLE_REJECTED_STATUS;
dds.ret_code := RETCODE_OK;
dds.count := 6;
dds.change := 1;
dds.inst := kh4;
dds.last_reason:= REJECTED_BY_SAMPLES_LIMIT;
dds.last_reason:= REJECTED_BY_INSTANCES_LIMIT;
start_dds;
wait_on_dds;
wait_on_idle;

View File

@ -1754,34 +1754,34 @@ begin
ret_rtps <= OK;
-- DONE
stage_next <= IDLE;
-- RESOURCE_LIMITS_QOS (MAX_SAMPLES)
elsif (empty_sample_list_head = empty_sample_list_tail) then
if (HISTORY_QOS = KEEP_ALL_HISTORY_QOS and RELIABILITY_QOS = RELIABLE_RELIABILITY_QOS) then
-- RESOURCE_LIMITS_QOS (MAX_INSTANCES) (Instance Memory Full)
elsif (inst_empty_head = INSTANCE_MEMORY_MAX_ADDRESS) then
-- No Stale Instances available
if (stale_inst_cnt = 0) then
-- Reject Change
done_rtps <= '1';
ret_rtps <= REJECTED;
-- DONE
stage_next <= IDLE;
-- Update Sample Reject Status
status_sig_next <= status_sig or SAMPLE_REJECTED_STATUS;
sample_rej_cnt_next <= sample_rej_cnt + 1;
sample_rej_cnt_change_next <= sample_rej_cnt_change + 1;
sample_rej_last_reason_next <= REJECTED_BY_SAMPLES_LIMIT;
sample_rej_last_reason_next <= REJECTED_BY_INSTANCES_LIMIT;
sample_rej_last_inst_next <= key_hash;
else
-- RESOURCE_LIMITS_QOS (MAX_INSTANCES) (Instance Memory Full)
if (inst_empty_head = INSTANCE_MEMORY_MAX_ADDRESS) then
-- No Stale Instances available
if (stale_inst_cnt = 0) then
-- RESOURCE_LIMITS_QOS (MAX_SAMPLES)
if (empty_sample_list_head = empty_sample_list_tail) then
if (HISTORY_QOS = KEEP_ALL_HISTORY_QOS and RELIABILITY_QOS = RELIABLE_RELIABILITY_QOS) then
-- Reject Change
done_rtps <= '1';
ret_rtps <= REJECTED;
-- DONE
stage_next <= IDLE;
-- Update Sample Reject Status
status_sig_next <= status_sig or SAMPLE_REJECTED_STATUS;
sample_rej_cnt_next <= sample_rej_cnt + 1;
sample_rej_cnt_change_next <= sample_rej_cnt_change + 1;
sample_rej_last_reason_next <= REJECTED_BY_INSTANCES_LIMIT;
sample_rej_last_reason_next <= REJECTED_BY_SAMPLES_LIMIT;
sample_rej_last_inst_next <= key_hash;
else
-- Accept Change (Remove Oldest Sample)
@ -1797,6 +1797,33 @@ begin
stage_next <= REMOVE_STALE_INSTANCE;
cnt_next <= 0;
end if;
else
done_rtps <= '1';
ret_rtps <= OK;
-- Remove Stale Instance and Insert Instance
inst_op_start <= '1';
inst_opcode <= GET_INSTANCE;
inst_r.addr <= inst_occupied_head;
inst_r.field_flags <= IMF_SAMPLE_CNT_FLAG or IMF_WRITER_BITMAP_FLAG;
stage_next <= REMOVE_STALE_INSTANCE;
cnt_next <= 0;
end if;
end if;
else
-- RESOURCE_LIMITS_QOS (MAX_SAMPLES)
if (empty_sample_list_head = empty_sample_list_tail) then
if (HISTORY_QOS = KEEP_ALL_HISTORY_QOS and RELIABILITY_QOS = RELIABLE_RELIABILITY_QOS) then
-- Reject Change
done_rtps <= '1';
ret_rtps <= REJECTED;
stage_next <= IDLE;
-- Update Sample Reject Status
status_sig_next <= status_sig or SAMPLE_REJECTED_STATUS;
sample_rej_cnt_next <= sample_rej_cnt + 1;
sample_rej_cnt_change_next <= sample_rej_cnt_change + 1;
sample_rej_last_reason_next <= REJECTED_BY_SAMPLES_LIMIT;
sample_rej_last_inst_next <= key_hash;
else
-- Accept Change (Remove Oldest Sample)
remove_oldest_sample_next <= '1';
@ -1834,35 +1861,6 @@ begin
end if;
end if;
end if;
end if;
else
-- RESOURCE_LIMITS_QOS (MAX_INSTANCES) (Instance Memory Full)
if (inst_empty_head = INSTANCE_MEMORY_MAX_ADDRESS) then
-- No Stale Instances available
if (stale_inst_cnt = 0) then
-- Reject Change
done_rtps <= '1';
ret_rtps <= REJECTED;
-- DONE
stage_next <= IDLE;
-- Update Sample Reject Status
status_sig_next <= status_sig or SAMPLE_REJECTED_STATUS;
sample_rej_cnt_next <= sample_rej_cnt + 1;
sample_rej_cnt_change_next <= sample_rej_cnt_change + 1;
sample_rej_last_reason_next <= REJECTED_BY_INSTANCES_LIMIT;
sample_rej_last_inst_next <= key_hash;
else
done_rtps <= '1';
ret_rtps <= OK;
-- Remove Stale Instance and Insert Instance
inst_op_start <= '1';
inst_opcode <= GET_INSTANCE;
inst_r.addr <= inst_occupied_head;
inst_r.field_flags <= IMF_SAMPLE_CNT_FLAG or IMF_WRITER_BITMAP_FLAG;
stage_next <= REMOVE_STALE_INSTANCE;
cnt_next <= 0;
end if;
else
-- Accept Change
done_rtps <= '1';