|
82 | 82 |
|
83 | 83 | STOP_REQ_CHAN : out std_logic_vector(log2(CHANNELS)-1 downto 0);
|
84 | 84 | 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 |
86 | 86 |
|
87 | 87 | -- general vector of all channels with their activity
|
88 | 88 | ENABLED_CHAN : out std_logic_vector(CHANNELS-1 downto 0);
|
@@ -594,7 +594,7 @@ architecture FULL of TX_DMA_SW_MANAGER is
|
594 | 594 | -- =====================================================================
|
595 | 595 | -- Stop request logic
|
596 | 596 | -- =====================================================================
|
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); |
598 | 598 | signal stop_fsm_pst : stop_fsm_type;
|
599 | 599 | signal stop_fsm_nst : stop_fsm_type;
|
600 | 600 |
|
@@ -1115,23 +1115,37 @@ begin
|
1115 | 1115 | when IDLE =>
|
1116 | 1116 |
|
1117 | 1117 | 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; |
1119 | 1119 | 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; |
1121 | 1135 | STOP_REQ_VLD <= '1';
|
1122 | 1136 | end if;
|
1123 | 1137 |
|
1124 | 1138 | -- wait till Channel core acknowledges the stopping of the channel
|
1125 | 1139 | when WAIT_FOR_REQ_ACK =>
|
1126 | 1140 |
|
1127 | 1141 | if (STOP_REQ_ACK = '1') then
|
1128 |
| - stop_fsm_nst <= WAIT_FOR_POINTERS; |
| 1142 | + stop_fsm_nst <= WAIT_FOR_STATUS_UPDATE; |
1129 | 1143 | end if;
|
1130 | 1144 |
|
1131 |
| - when WAIT_FOR_POINTERS => |
| 1145 | + when WAIT_FOR_STATUS_UPDATE => |
1132 | 1146 |
|
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; |
1135 | 1149 | stop_acked <= '1';
|
1136 | 1150 | enabled_chan_rst(to_integer(unsigned(stop_fsm_channel_reg))) <= '1';
|
1137 | 1151 | end if;
|
|
0 commit comments