Modify Lifespan Checktime

Make the time, at which the Lifespan of samples is checked dependant on
the actual Lifespans. This should prevent unnecessary memory bandwidth
waste.
This commit is contained in:
Greek 2021-02-02 23:07:34 +01:00
parent bcaace1b8c
commit 5b8206d539

View File

@ -269,6 +269,8 @@ architecture arch of dds_reader is
signal key_hash, key_hash_next : KEY_HASH_TYPE := (others => (others => '0')); signal key_hash, key_hash_next : KEY_HASH_TYPE := (others => (others => '0'));
-- Source Timestamp Latch -- Source Timestamp Latch
signal ts_latch, ts_latch_next : TIME_TYPE := TIME_INVALID; signal ts_latch, ts_latch_next : TIME_TYPE := TIME_INVALID;
-- Lifespan Latch
signal lifespan, lifespan_next : TIME_TYPE := TIME_INVALID;
-- Sample Status Info Latch -- Sample Status Info Latch
signal sample_status_info, sample_status_info_next : std_logic_vector(CDR_LONG_WIDTH-1 downto 0) := (others => '0'); signal sample_status_info, sample_status_info_next : std_logic_vector(CDR_LONG_WIDTH-1 downto 0) := (others => '0');
-- General Purpose Payload Pointer -- General Purpose Payload Pointer
@ -611,6 +613,7 @@ begin
is_lifespan_check_next <= is_lifespan_check; is_lifespan_check_next <= is_lifespan_check;
status_sig_next <= status_sig; status_sig_next <= status_sig;
cnt2_next <= cnt2; cnt2_next <= cnt2;
lifespan_next <= lifespan;
-- DEFAULT Unregistered -- DEFAULT Unregistered
inst_opcode <= NOP; inst_opcode <= NOP;
res_rtps <= UNDEFINED; res_rtps <= UNDEFINED;
@ -662,7 +665,7 @@ begin
-- LIFESPAN QoS -- LIFESPAN QoS
elsif (lifespan_time <= time) then elsif (lifespan_time <= time) then
-- Reset Timeout -- Reset Timeout
lifespan_time_next <= time + TODO; lifespan_time_next <= TIME_INFINITE;
-- Samples Available -- Samples Available
if (oldest_sample /= SAMPLE_MEMORY_MAX_ADDRESS) then if (oldest_sample /= SAMPLE_MEMORY_MAX_ADDRESS) then
@ -879,11 +882,13 @@ begin
end if; end if;
end if; end if;
end if; end if;
-- Lifespane Deadline 1/2 -- Lifespan Deadline 1/2
when 3 => when 3 =>
sample_valid_in <= '1'; sample_valid_in <= '1';
sample_addr <= cur_sample + SMF_LIFESPAN_DEADLINE_OFFSET; sample_addr <= cur_sample + SMF_LIFESPAN_DEADLINE_OFFSET;
sample_write_data <= data_in_rtps; sample_write_data <= data_in_rtps;
-- Latch Lifespan
lifespan_next(0) <= data_in_rtps;
-- Memory Flow Control Guard -- Memory Flow Control Guard
if (sample_ready_in = '1') then if (sample_ready_in = '1') then
ready_in_rtps <= '1'; ready_in_rtps <= '1';
@ -894,6 +899,8 @@ begin
sample_valid_in <= '1'; sample_valid_in <= '1';
sample_addr <= cur_sample + SMF_LIFESPAN_DEADLINE_OFFSET + 1; sample_addr <= cur_sample + SMF_LIFESPAN_DEADLINE_OFFSET + 1;
sample_write_data <= data_in_rtps; sample_write_data <= data_in_rtps;
-- Latch Lifespan
lifespan_next(1) <= data_in_rtps;
-- Memory Flow Control Guard -- Memory Flow Control Guard
if (sample_ready_in = '1') then if (sample_ready_in = '1') then
ready_in_rtps <= '1'; ready_in_rtps <= '1';
@ -1661,6 +1668,11 @@ begin
-- Signal Data Available -- Signal Data Available
status_sig_next(DATA_AVAILABLE_STATUS) <= '1'; status_sig_next(DATA_AVAILABLE_STATUS) <= '1';
-- Update Lifespan Check Time
if (lifespan /= TIME_INVALID and lifespan < lifespan_time) then
lifespan_next <= lifespan;
end if;
-- NOTE: added_new_instance and remove_oldest_sample are NOT mutual exclusive, but Instance Removal takes precedence. -- NOTE: added_new_instance and remove_oldest_sample are NOT mutual exclusive, but Instance Removal takes precedence.
-- New Instance was added, and Instance Memory is Full -- New Instance was added, and Instance Memory is Full
@ -3236,17 +3248,23 @@ begin
-- Sample Lifespan Expired -- Sample Lifespan Expired
if (tmp_dw /= TIME_INVALID and time >= tmp_dw) then if (tmp_dw /= TIME_INVALID and time >= tmp_dw) then
-- Remove Sample -- Remove Sample
stage_next <= REMOVE_SAMPLE; stage_next <= REMOVE_SAMPLE;
cnt_next <= 0; cnt_next <= 0;
else else
-- Update Check Time
if (tmp_dw /= TIME_INVALID and tmp_dw < lifespan_time) then
lifespan_time_next <= tmp_dw;
end if;
-- Reached End of Samples -- Reached End of Samples
if (next_sample = SAMPLE_MEMORY_MAX_ADDRESS) then if (next_sample = SAMPLE_MEMORY_MAX_ADDRESS) then
-- DONE -- DONE
stage_next <= IDLE; stage_next <= IDLE;
else else
-- Continue Search -- Continue Search
cur_sample_next <= next_sample; cur_sample_next <= next_sample;
cnt_next <= 0; cnt_next <= 0;
end if; end if;
end if; end if;
end if; end if;