Skip to content

Commit

Permalink
fix Delay3PatchFSM: init issue (JIRA ESSURF-24)
Browse files Browse the repository at this point in the history
  • Loading branch information
jumdz committed Jun 23, 2023
1 parent b40b1e3 commit f4ccc95
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions xilinx/UltraScale/general/rtl/Delaye3PatchFsm.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ architecture rtl of Delaye3PatchFsm is

type StateType is (
IDLE_S,
CHECK_CNT_S,
LOAD_S,
WAIT_S);

Expand Down Expand Up @@ -84,15 +85,17 @@ begin
v.Load := '0';

-- Check for load request
if (LOAD = '1') then
-- Update the target delay value
v.dlyTarget := CNTVALUEIN;
end if;

-- Main state machine
case r.state is
----------------------------------------------------------------------
when IDLE_S =>
if (LOAD = '1') then
-- Update the target delay value on load request
v.dlyTarget := CNTVALUEIN;
v.state := CHECK_CNT_S;
end if;

when CHECK_CNT_S =>
-- Check if load target different from current output
if (v.dlyTarget /= CNTVALUEOUT) then
-- Check if we should increment the value
Expand All @@ -104,6 +107,10 @@ begin
end if;
-- Next state
v.state := LOAD_S;

else
v.state := IDLE_S;

end if;
----------------------------------------------------------------------
when LOAD_S =>
Expand All @@ -121,7 +128,7 @@ begin
-- Reset the counter
v.waitCnt := (others => '0');
-- Next state
v.state := IDLE_S;
v.state := CHECK_CNT_S;
end if;
----------------------------------------------------------------------
end case;
Expand Down

0 comments on commit f4ccc95

Please sign in to comment.