Fix WITH_KEY branching in DDS Entities

This commit is contained in:
Greek 2021-11-19 18:24:32 +01:00
parent 4830645a5a
commit 385257e271
2 changed files with 87 additions and 66 deletions

View File

@ -1663,7 +1663,7 @@ begin
-- Wait for Instance Search to finish -- Wait for Instance Search to finish
if (not WITH_KEY or inst_op_done = '1') then if (not WITH_KEY or inst_op_done = '1') then
assert check_mask(current_imf, IMF_STATUS_FLAG or IMF_IGNORE_DEADLINE_FLAG or IMF_SAMPLE_CNT_FLAG or IMF_DISPOSED_CNT_FLAG or IMF_NO_WRITERS_CNT_FLAG) severity FAILURE; assert (not WITH_KEY or check_mask(current_imf, IMF_STATUS_FLAG or IMF_IGNORE_DEADLINE_FLAG or IMF_SAMPLE_CNT_FLAG or IMF_DISPOSED_CNT_FLAG or IMF_NO_WRITERS_CNT_FLAG)) severity FAILURE;
-- Instance Found -- Instance Found
if (not WITH_KEY or inst_addr_base /= INSTANCE_MEMORY_MAX_ADDRESS) then if (not WITH_KEY or inst_addr_base /= INSTANCE_MEMORY_MAX_ADDRESS) then
@ -1945,17 +1945,24 @@ begin
-- Memory Flow Control Guard -- Memory Flow Control Guard
if (sample_ready_in = '1') then if (sample_ready_in = '1') then
cnt_next <= cnt + 1; if (WITH_KEY) then
cnt_next <= cnt + 1;
else
cnt_next <= cnt + 2; -- Skip next Stage
end if;
end if; end if;
-- GET Instance Pointer -- GET Instance Pointer
when 3 => when 3 =>
sample_valid_in <= '1'; -- Synthesis Guard
sample_addr <= cur_sample + SMF_INSTANCE_ADDR_OFFSET; if (WITH_KEY) then
sample_read <= '1'; sample_valid_in <= '1';
sample_addr <= cur_sample + SMF_INSTANCE_ADDR_OFFSET;
-- Memory Flow Control Guard sample_read <= '1';
if (sample_ready_in = '1') then
cnt_next <= cnt + 1; -- Memory Flow Control Guard
if (sample_ready_in = '1') then
cnt_next <= cnt + 1;
end if;
end if; end if;
-- READ Timestamp 1/2 -- READ Timestamp 1/2
when 4 => when 4 =>
@ -2001,51 +2008,58 @@ begin
-- Memory Flow Control Guard -- Memory Flow Control Guard
if (sample_valid_out = '1') then if (sample_valid_out = '1') then
prev_sample_next <= resize(unsigned(sample_read_data),SAMPLE_MEMORY_ADDR_WIDTH); prev_sample_next <= resize(unsigned(sample_read_data),SAMPLE_MEMORY_ADDR_WIDTH);
cnt_next <= cnt + 1; if (WITH_KEY) then
cnt_next <= cnt + 1;
else
cnt_next <= cnt + 2; -- Skip next stage
end if;
end if; end if;
-- READ Instance Poiner -- READ Instance Poiner
when 7 => when 7 =>
sample_ready_out <= '1'; -- Synthesis Guard
if (WITH_KEY) then
-- Memory Flow Control Guard sample_ready_out <= '1';
if (sample_valid_out = '1') then
-- Sample has Same Instance -- Memory Flow Control Guard
if (resize(unsigned(sample_read_data),INSTANCE_MEMORY_ADDR_WIDTH) = cur_inst) then if (sample_valid_out = '1') then
-- Newer Sample of same Instance found -- Sample has Same Instance
newer_inst_sample_next <= '1'; if (resize(unsigned(sample_read_data),INSTANCE_MEMORY_ADDR_WIDTH) = cur_inst) then
-- NOT_ALIVE Sample -- Newer Sample of same Instance found
if (sample_status_info(SSI_DISPOSED_FLAG) = '1' or sample_status_info(SSI_UNREGISTERED_FLAG) = '1') then newer_inst_sample_next <= '1';
-- NOTE: We drop Dispose and Unregister Samples if a newer Sample of the same Instance exists, because else -- NOT_ALIVE Sample
-- the Instance State and Generation Counters would have to be recalculated (by crawling through all the Instance Samples) if (sample_status_info(SSI_DISPOSED_FLAG) = '1' or sample_status_info(SSI_UNREGISTERED_FLAG) = '1') then
-- Drop Sample -- NOTE: We drop Dispose and Unregister Samples if a newer Sample of the same Instance exists, because else
stage_next <= IDLE; -- the Instance State and Generation Counters would have to be recalculated (by crawling through all the Instance Samples)
else -- Drop Sample
cnt_next <= cnt + 1; stage_next <= IDLE;
end if;
else
-- No previous Slot (Oldest Sample)
if (prev_sample = PAYLOAD_MEMORY_MAX_ADDRESS) then
assert (cur_sample = oldest_sample) severity FAILURE;
-- NOTE: Sample is added to HEAD of List
next_sample_next <= cur_sample;
cur_sample_next <= empty_sample_list_head;
if (new_inst = '1') then
if (has_data = '1') then
stage_next <= FINALIZE_PAYLOAD;
cnt_next <= 0;
else
stage_next <= PRE_SAMPLE_FINALIZE;
cnt_next <= 0;
end if;
else else
stage_next <= UPDATE_INSTANCE; cnt_next <= cnt + 1;
end if; end if;
else else
-- Continue Search -- No previous Slot (Oldest Sample)
cur_sample_next <= prev_sample; if (prev_sample = PAYLOAD_MEMORY_MAX_ADDRESS) then
next_sample_next <= cur_sample; assert (cur_sample = oldest_sample) severity FAILURE;
cnt_next <= 0;
-- NOTE: Sample is added to HEAD of List
next_sample_next <= cur_sample;
cur_sample_next <= empty_sample_list_head;
if (new_inst = '1') then
if (has_data = '1') then
stage_next <= FINALIZE_PAYLOAD;
cnt_next <= 0;
else
stage_next <= PRE_SAMPLE_FINALIZE;
cnt_next <= 0;
end if;
else
stage_next <= UPDATE_INSTANCE;
end if;
else
-- Continue Search
cur_sample_next <= prev_sample;
next_sample_next <= cur_sample;
cnt_next <= 0;
end if;
end if; end if;
end if; end if;
end if; end if;
@ -2106,7 +2120,7 @@ begin
-- Memory Operation Guard -- Memory Operation Guard
if (not WITH_KEY or inst_op_done = '1') then if (not WITH_KEY or inst_op_done = '1') then
assert check_mask(current_imf, IMF_STATUS_FLAG or IMF_WRITER_BITMAP_FLAG or IMF_DISPOSED_CNT_FLAG or IMF_NO_WRITERS_CNT_FLAG or IMF_SAMPLE_CNT_FLAG or IMF_IGNORE_DEADLINE_FLAG) severity FAILURE; assert (not WITH_KEY or check_mask(current_imf, IMF_STATUS_FLAG or IMF_WRITER_BITMAP_FLAG or IMF_DISPOSED_CNT_FLAG or IMF_NO_WRITERS_CNT_FLAG or IMF_SAMPLE_CNT_FLAG or IMF_IGNORE_DEADLINE_FLAG)) severity FAILURE;
-- DEFAULT STATUS INFO (LIVELINESS) -- DEFAULT STATUS INFO (LIVELINESS)
if (WITH_KEY) then if (WITH_KEY) then
@ -2345,7 +2359,7 @@ begin
-- Wait for instance Update to Complete -- Wait for instance Update to Complete
if (not WITH_KEY or inst_op_done = '1') then if (not WITH_KEY or inst_op_done = '1') then
assert check_mask(current_imf, IMF_DISPOSED_CNT_FLAG or IMF_NO_WRITERS_CNT_FLAG) severity FAILURE; assert (not WITH_KEY or check_mask(current_imf, IMF_DISPOSED_CNT_FLAG or IMF_NO_WRITERS_CNT_FLAG)) severity FAILURE;
case (cnt) is case (cnt) is
-- SET Disposed Generation Counter -- SET Disposed Generation Counter
@ -2554,7 +2568,7 @@ begin
-- Wait for Instane Data -- Wait for Instane Data
if (not WITH_KEY or inst_op_done = '1') then if (not WITH_KEY or inst_op_done = '1') then
assert check_mask(current_imf, IMF_DISPOSED_CNT_FLAG or IMF_NO_WRITERS_CNT_FLAG) severity FAILURE; assert (not WITH_KEY or check_mask(current_imf, IMF_DISPOSED_CNT_FLAG or IMF_NO_WRITERS_CNT_FLAG)) severity FAILURE;
case (cnt) is case (cnt) is
-- GET Next Sample (Empty List) -- GET Next Sample (Empty List)
@ -2625,17 +2639,24 @@ begin
-- Memory Flow Control Guard -- Memory Flow Control Guard
if (sample_ready_in = '1') then if (sample_ready_in = '1') then
cnt_next <= cnt + 1; if (WITH_KEY) then
cnt_next <= cnt + 1;
else
cnt_next <= cnt + 2; -- Skip next Stage
end if;
end if; end if;
-- SET Instance Pointer -- SET Instance Pointer
when 7 => when 7 =>
sample_valid_in <= '1'; -- Synthesis Guard
sample_addr <= cur_sample + SMF_INSTANCE_ADDR_OFFSET; if (WITH_KEY) then
sample_write_data <= std_logic_vector(resize(cur_inst,WORD_WIDTH)); sample_valid_in <= '1';
sample_addr <= cur_sample + SMF_INSTANCE_ADDR_OFFSET;
-- Memory Flow Control Guard sample_write_data <= std_logic_vector(resize(cur_inst,WORD_WIDTH));
if (sample_ready_in = '1') then
cnt_next <= cnt + 1; -- Memory Flow Control Guard
if (sample_ready_in = '1') then
cnt_next <= cnt + 1;
end if;
end if; end if;
-- SET Disposed Generation Count -- SET Disposed Generation Count
when 8 => when 8 =>
@ -3036,7 +3057,7 @@ begin
-- Memory Operation Guard -- Memory Operation Guard
if (not WITH_KEY or inst_op_done = '1') then if (not WITH_KEY or inst_op_done = '1') then
assert check_mask(current_imf, IMF_SAMPLE_CNT_FLAG or IMF_WRITER_BITMAP_FLAG or IMF_STATUS_FLAG) severity FAILURE; assert (not WITH_KEY or check_mask(current_imf, IMF_SAMPLE_CNT_FLAG or IMF_WRITER_BITMAP_FLAG or IMF_STATUS_FLAG)) severity FAILURE;
-- Synthesis Guard -- Synthesis Guard
if (WITH_KEY) then if (WITH_KEY) then
@ -3440,8 +3461,8 @@ begin
when 7 => when 7 =>
-- Wait for Instance Data -- Wait for Instance Data
if (not WITH_KEY or inst_op_done = '1') then if (not WITH_KEY or inst_op_done = '1') then
assert check_mask(current_imf, IMF_STATUS_FLAG) severity FAILURE; assert (not WITH_KEY or check_mask(current_imf, IMF_STATUS_FLAG)) severity FAILURE;
assert (next_inst = inst_addr_base) severity FAILURE; assert (not WITH_KEY or next_inst = inst_addr_base) severity FAILURE;
-- DEFAULT -- DEFAULT
tmp_bool := TRUE; tmp_bool := TRUE;
@ -4036,7 +4057,7 @@ begin
when 2 => when 2 =>
-- Memory Operation Guard -- Memory Operation Guard
if (not WITH_KEY or inst_op_done = '1') then if (not WITH_KEY or inst_op_done = '1') then
assert check_mask(current_imf, IMF_STATUS_FLAG) severity FAILURE; assert (not WITH_KEY or check_mask(current_imf, IMF_STATUS_FLAG)) severity FAILURE;
-- NOTE: If we have a presentation of consecutive same instance samples of multiple instances, we have to -- NOTE: If we have a presentation of consecutive same instance samples of multiple instances, we have to
-- mark the instances we have already handled, in order to prevent the GET_NEXT_SAMPLE state to -- mark the instances we have already handled, in order to prevent the GET_NEXT_SAMPLE state to
-- re-process them. -- re-process them.

View File

@ -1625,7 +1625,7 @@ begin
-- Wait for Instance Search to finish -- Wait for Instance Search to finish
if (not WITH_KEY or inst_op_done = '1') then if (not WITH_KEY or inst_op_done = '1') then
assert check_mask(current_imf, IMF_SAMPLE_CNT_FLAG or IMF_ACK_CNT_FLAG) severity FAILURE; assert (not WITH_KEY or check_mask(current_imf, IMF_SAMPLE_CNT_FLAG or IMF_ACK_CNT_FLAG)) severity FAILURE;
-- Instance Found -- Instance Found
if (not WITH_KEY or inst_addr_base /= INSTANCE_MEMORY_MAX_ADDRESS) then if (not WITH_KEY or inst_addr_base /= INSTANCE_MEMORY_MAX_ADDRESS) then
@ -1834,7 +1834,7 @@ begin
-- Memory Operation Guard -- Memory Operation Guard
if (not WITH_KEY or inst_op_done = '1') then if (not WITH_KEY or inst_op_done = '1') then
assert check_mask(current_imf, IMF_STATUS_FLAG or IMF_SAMPLE_CNT_FLAG or IMF_ACK_CNT_FLAG) severity FAILURE; assert (not WITH_KEY or check_mask(current_imf, IMF_STATUS_FLAG or IMF_SAMPLE_CNT_FLAG or IMF_ACK_CNT_FLAG)) severity FAILURE;
-- Synthesis Guard -- Synthesis Guard
if (WITH_KEY) then if (WITH_KEY) then
@ -2536,7 +2536,7 @@ begin
-- Memory Operation Guard -- Memory Operation Guard
if (not WITH_KEY or inst_op_done = '1') then if (not WITH_KEY or inst_op_done = '1') then
assert check_mask(current_imf, IMF_STATUS_FLAG or IMF_SAMPLE_CNT_FLAG or IMF_ACK_CNT_FLAG) severity FAILURE; assert (not WITH_KEY or check_mask(current_imf, IMF_STATUS_FLAG or IMF_SAMPLE_CNT_FLAG or IMF_ACK_CNT_FLAG)) severity FAILURE;
-- Synthesis Guard -- Synthesis Guard
if (WITH_KEY) then if (WITH_KEY) then