revert 06ed44c code refactor

Revert changes made in commit 06ed44c to the memory FSMs.
NOTE: This commit only reverts the changes in rtps_builtin_endpoint. The rest of the reverted changes are merged with following commits.
This commit is contained in:
Greek 2021-01-16 18:14:40 +01:00
parent 9ff39c6fea
commit d2f466d588

View File

@ -3133,19 +3133,33 @@ begin
when 2 => when 2 =>
-- No Match -- No Match
if (mem_read_data /= guid(1)) then if (mem_read_data /= guid(1)) then
-- Reached End of Memory, No Match
if (mem_addr_base = max_participant_addr) then
addr_res_next <= MAX_ADDRESS; --No match
-- DONE
mem_stage_next <= IDLE;
else
-- Continue Search -- Continue Search
mem_addr_next <= tmp; mem_addr_next <= tmp;
mem_addr_base_next <= tmp; mem_addr_base_next <= tmp;
mem_cnt_next <= 0; mem_cnt_next <= 0;
end if; end if;
end if;
-- GUID Prefix 3/3 -- GUID Prefix 3/3
when 3 => when 3 =>
-- No Match -- No Match
if (mem_read_data /= guid(2)) then if (mem_read_data /= guid(2)) then
-- Reached End of Memory, No Match
if (mem_addr_base = max_participant_addr) then
addr_res_next <= MAX_ADDRESS; --No match
-- DONE
mem_stage_next <= IDLE;
else
-- Continue Search -- Continue Search
mem_addr_next <= tmp; mem_addr_next <= tmp;
mem_addr_base_next <= tmp; mem_addr_base_next <= tmp;
mem_cnt_next <= 0; mem_cnt_next <= 0;
end if;
-- Match -- Match
else else
-- Fetch Participant Data -- Fetch Participant Data
@ -3562,6 +3576,28 @@ begin
when 2 => when 2 =>
-- Slot Occupied -- Slot Occupied
if (mem_read_data /= GUIDPREFIX_UNKNOWN(1)) then if (mem_read_data /= GUIDPREFIX_UNKNOWN(1)) then
if (mem_addr_base = max_participant_addr) then
-- We are in the middle of resetting the MAX Participant Pointer
if (reset_max_pointer = '1') then
-- No Change
mem_stage_next <= IDLE;
-- MEMORY FULL
elsif (max_participant_addr = MAX_PARTICIPANT_ADDRESS) then
report "Memory Full, Ignoring Participant Data" severity NOTE;
-- Ignore Insertion
mem_stage_next <= IDLE;
addr_res_next <= MAX_ADDRESS;
else
-- Extend Participant Memory Area
-- NOTE: "max_participant_addr" points to the first address of last participant frame
max_participant_addr_next <= tmp;
-- Populate Participant Slot
mem_stage_next <= INSERT_PARTICIPANT;
mem_addr_next <= tmp;
addr_res_next <= tmp;
mem_cnt_next <= 0;
end if;
else
-- Latch last occupied Participant Slot -- Latch last occupied Participant Slot
last_addr_next <= mem_addr_base; last_addr_next <= mem_addr_base;
-- Continue Search -- Continue Search
@ -3569,16 +3605,40 @@ begin
mem_addr_base_next <= tmp; mem_addr_base_next <= tmp;
mem_cnt_next <= 0; mem_cnt_next <= 0;
end if; end if;
end if;
-- GUID Prefix 3/3 -- GUID Prefix 3/3
when 3 => when 3 =>
-- Slot Occupied -- Slot Occupied
if (mem_read_data /= GUIDPREFIX_UNKNOWN(2)) then if (mem_read_data /= GUIDPREFIX_UNKNOWN(2)) then
if (mem_addr_base = max_participant_addr) then
-- We are in the middle of resetting the MAX Participant Pointer
if (reset_max_pointer = '1') then
-- No Change
mem_stage_next <= IDLE;
-- MEMORY FULL
elsif (max_participant_addr = MAX_PARTICIPANT_ADDRESS) then
report "Memory Full, Ignoring Participant Data" severity NOTE;
-- Ignore Insertion
mem_stage_next <= IDLE;
addr_res_next <= MAX_ADDRESS;
else
-- Extend Participant Memory Area
-- NOTE: "max_participant_addr" points to the first address of last participant frame
max_participant_addr_next <= tmp;
-- Populate Participant Slot
mem_stage_next <= INSERT_PARTICIPANT;
mem_addr_next <= tmp;
addr_res_next <= tmp;
mem_cnt_next <= 0;
end if;
else
-- Latch last occupied Participant Slot -- Latch last occupied Participant Slot
last_addr_next <= mem_addr_base; last_addr_next <= mem_addr_base;
-- Continue Search -- Continue Search
mem_addr_next <= tmp; mem_addr_next <= tmp;
mem_addr_base_next <= tmp; mem_addr_base_next <= tmp;
mem_cnt_next <= 0; mem_cnt_next <= 0;
end if;
-- Slot Empty -- Slot Empty
else else
if (reset_max_pointer = '1') then if (reset_max_pointer = '1') then