Skip to content

Commit 6db623c

Browse files
committed
Merge branch 'isa_calypte_tx_ver_stop_seq' into 'devel'
fix(RX DMA Calypte-VER): remove copy sw pointer from hw pointer when driver is shuttingdown channel See merge request ndk/ndk-fpga!130
2 parents 201a169 + 903299e commit 6db623c

File tree

2 files changed

+23
-14
lines changed

2 files changed

+23
-14
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;

comp/dma/dma_calypte/comp/tx/uvm/tbench/dma_regs/reg_sequence.sv

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ class stop_channel_seq extends uvm_sequence;
6565
m_regmodel_channel.control_reg.write(status, 32'h0, .parent(this));
6666

6767
do begin
68-
m_regmodel_channel.hw_data_pointer_reg.read (status, data, .parent(this));
69-
m_regmodel_channel.sw_data_pointer_reg.write(status, data, .parent(this));
70-
m_regmodel_channel.hw_hdr_pointer_reg .read (status, data, .parent(this));
71-
m_regmodel_channel.sw_hdr_pointer_reg .write(status, data, .parent(this));
72-
7368
#(500ns);
7469

7570
m_regmodel_channel.sw_data_pointer_reg.read(status, data, .parent(this));
@@ -85,7 +80,7 @@ class stop_channel_seq extends uvm_sequence;
8580
stop_attempts++;
8681

8782
assert (stop_attempts < 500) else
88-
`uvm_warning(this.get_type_name(), "\n\nThe stop of a channel takes suspiciously long time!\n")
83+
`uvm_warning(m_regmodel_channel.get_full_name(), $sformatf("\nThe stop of a channel takes suspiciously long time!\n\tDATA SW(%0d) HW(%0d)\n\tHDR SW(%0d) HW(%0d)\n\tSTATUS %0d\n-----------------------\n", sw_data, hw_data, sw_hdr, hw_hdr, (data & 32'h1)));
8984

9085
end while (sw_data != hw_data || sw_hdr != hw_hdr || (data & 32'h1) != 0);
9186
endtask

0 commit comments

Comments
 (0)