Skip to content

Commit 84b67fe

Browse files
committed
fix(dma-calypte): send stop request after pointers have same values
If stop request is send before comparing pointers then components stop accepting data from PC and pointers never reach same values.
1 parent 9b8f35e commit 84b67fe

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

comp/dma/dma_calypte/comp/tx/comp/software_manager/tx_dma_sw_manager.vhd

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ port (
8282

8383
STOP_REQ_CHAN : out std_logic_vector(log2(CHANNELS)-1 downto 0);
8484
STOP_REQ_VLD : out std_logic;
85-
STOP_REQ_ACK : in std_logic;
85+
STOP_REQ_ACK : in std_logic; --logic request one CLK delay between VLD request and ACK reponse
8686

8787
-- general vector of all channels with their activity
8888
ENABLED_CHAN : out std_logic_vector(CHANNELS-1 downto 0);
@@ -594,7 +594,7 @@ architecture FULL of TX_DMA_SW_MANAGER is
594594
-- =====================================================================
595595
-- Stop request logic
596596
-- =====================================================================
597-
type stop_fsm_type is (IDLE, WAIT_FOR_REQ_ACK, WAIT_FOR_POINTERS);
597+
type stop_fsm_type is (IDLE, WAIT_FOR_REQ_ACK, DELAY_FOR_DSP_1, DELAY_FOR_DSP_2, WAIT_FOR_POINTERS, WAIT_FOR_STATUS_UPDATE);
598598
signal stop_fsm_pst : stop_fsm_type;
599599
signal stop_fsm_nst : stop_fsm_type;
600600

@@ -1115,23 +1115,37 @@ begin
11151115
when IDLE =>
11161116

11171117
if (reg_dob_opt(R_CONTROL)(1)(0) = '0' and reg_dob_opt(R_STATUS)(1)(0) = '1') then
1118-
stop_fsm_nst <= WAIT_FOR_REQ_ACK;
1118+
stop_fsm_nst <= DELAY_FOR_DSP_1;
11191119
stop_fsm_channel <= active_chan_reg;
1120-
STOP_REQ_CHAN <= active_chan_reg;
1120+
end if;
1121+
1122+
1123+
when DELAY_FOR_DSP_1 =>
1124+
1125+
stop_fsm_nst <= DELAY_FOR_DSP_2;
1126+
1127+
when DELAY_FOR_DSP_2 =>
1128+
1129+
stop_fsm_nst <= WAIT_FOR_POINTERS;
1130+
1131+
when WAIT_FOR_POINTERS =>
1132+
1133+
if (stop_chan_ok = '1' and stop_ptr_ok = '1') then
1134+
stop_fsm_nst <= WAIT_FOR_REQ_ACK;
11211135
STOP_REQ_VLD <= '1';
11221136
end if;
11231137

11241138
-- wait till Channel core acknowledges the stopping of the channel
11251139
when WAIT_FOR_REQ_ACK =>
11261140

11271141
if (STOP_REQ_ACK = '1') then
1128-
stop_fsm_nst <= WAIT_FOR_POINTERS;
1142+
stop_fsm_nst <= WAIT_FOR_STATUS_UPDATE;
11291143
end if;
11301144

1131-
when WAIT_FOR_POINTERS =>
1145+
when WAIT_FOR_STATUS_UPDATE =>
11321146

1133-
if (stop_chan_ok = '1' and stop_ptr_ok = '1') then
1134-
stop_fsm_nst <= IDLE;
1147+
if (stop_chan_ok = '1') then
1148+
stop_fsm_nst <= IDLE;
11351149
stop_acked <= '1';
11361150
enabled_chan_rst(to_integer(unsigned(stop_fsm_channel_reg))) <= '1';
11371151
end if;

0 commit comments

Comments
 (0)