Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions protocols/rssi/v1/rtl/RssiMonitor.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ entity RssiMonitor is
STATUS_WIDTH_G : positive := 8;
CNT_WIDTH_G : positive := 32;
RETRANSMIT_ENABLE_G : boolean := true
--
);
--
);
port (
clk_i : in sl;
rst_i : in sl;
Expand Down Expand Up @@ -185,7 +185,9 @@ architecture rtl of RssiMonitor is
signal rin : RegType;
signal s_status : slv(STATUS_WIDTH_G - 1 downto 0);
--

begin

-- Status assignment
s_status(0) <= r.retransMax and r.sndResend and not r.sndResendD1;
s_status(1) <= r.nullTout;
Expand Down Expand Up @@ -312,8 +314,6 @@ begin
if (connActive_i = '0' or
(rxValid_i = '1' and rxFlags_i.data = '1') or
(rxValid_i = '1' and rxFlags_i.nul = '1') or
(rxValid_i = '1' and rxFlags_i.ack = '1') or
(rxValid_i = '1' and rxFlags_i.busy = '1') or
RETRANSMIT_ENABLE_G = false -- Disable null timeout
) then
v.nullToutCnt := (others => '0');
Expand Down Expand Up @@ -356,7 +356,7 @@ begin
dataHeadSt_i = '1' or
rstHeadSt_i = '1' or
nullHeadSt_i = '1' or
(rxLastSeqN_i - r.lastAckSeqN) = 0
((rxLastSeqN_i - r.lastAckSeqN) = 0 and localBusy_i = '0')
) then
v.ackToutCnt := (others => '0');
elsif ((rxLastSeqN_i - r.lastAckSeqN) > 0 and (rxLastSeqN_i - r.lastAckSeqN) <= rxWindowSize_i) or (localBusy_i = '1') then
Expand All @@ -374,8 +374,16 @@ begin
) then
v.sndAck := '0';

-- Periodic BUSY acknowledgment request. The RSSI page recommends
-- Retransmission Timeout/2 so the peer keeps its retransmission timer
-- reset while this receiver remains busy.
elsif (localBusy_i = '1' and (rxLastSeqN_i - r.lastAckSeqN) = 0 and
r.ackToutCnt >= ((conv_integer(rssiParam_i.retransTout)*SAMPLES_PER_TIME_C)/2)) then
v.sndAck := '1';

-- Timeout acknowledgment request
elsif (r.ackToutCnt >= (conv_integer(rssiParam_i.cumulAckTout)* SAMPLES_PER_TIME_C)) then
elsif ((rxLastSeqN_i - r.lastAckSeqN) > 0 and
r.ackToutCnt >= (conv_integer(rssiParam_i.cumulAckTout)* SAMPLES_PER_TIME_C)) then
v.sndAck := '1';

-- Cumulative acknowledgment request
Expand Down Expand Up @@ -460,4 +468,5 @@ begin
resendCnt_o <= r.resendCnt;
reconCnt_o <= r.reconCnt;
---------------------------------------------------------------------

end architecture rtl;
5 changes: 1 addition & 4 deletions tests/protocols/rssi/test_RssiMonitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from cocotb.clock import Clock
from cocotb.triggers import RisingEdge, Timer

from tests.common.regression_utils import env_flag, run_surf_vhdl_test
from tests.common.regression_utils import run_surf_vhdl_test


class TB:
Expand Down Expand Up @@ -222,10 +222,7 @@ async def local_busy_generates_periodic_ack_after_cumulative_timeout_test(dut):

PARAMETER_SWEEP = [pytest.param({}, id="server_monitor")]

KNOWN_ISSUE_REASON = "set RUN_RSSI_KNOWN_ISSUE_TESTS=1 to run RSSI cases that require follow-up RTL fixes"


@pytest.mark.skipif(not env_flag("RUN_RSSI_KNOWN_ISSUE_TESTS", default=False), reason=KNOWN_ISSUE_REASON)
@pytest.mark.parametrize("parameters", PARAMETER_SWEEP)
def test_RssiMonitor(parameters):
run_surf_vhdl_test(
Expand Down