From 3acd592f3d70f7b893c074acc32973db2daaa630 Mon Sep 17 00:00:00 2001 From: Larry Ruckman Date: Tue, 22 Oct 2024 11:25:13 -0700 Subject: [PATCH] adding ackN/seqN to AXI-Lite for debugging --- protocols/rssi/v1/rtl/RssiAxiLiteRegItf.vhd | 9 +++++ protocols/rssi/v1/rtl/RssiCore.vhd | 4 ++ python/surf/protocols/rssi/_RssiCore.py | 44 +++++++++++++++++++++ 3 files changed, 57 insertions(+) diff --git a/protocols/rssi/v1/rtl/RssiAxiLiteRegItf.vhd b/protocols/rssi/v1/rtl/RssiAxiLiteRegItf.vhd index 70574ec8e7..1c13f435b4 100644 --- a/protocols/rssi/v1/rtl/RssiAxiLiteRegItf.vhd +++ b/protocols/rssi/v1/rtl/RssiAxiLiteRegItf.vhd @@ -123,6 +123,10 @@ entity RssiAxiLiteRegItf is negRssiParam_i : in RssiParamType; -- Status (RO) + txLastAckN_i : in slv(7 downto 0); + rxSeqN_i : in slv(7 downto 0); + rxAckN_i : in slv(7 downto 0); + rxLastSeqN_i : in slv(7 downto 0); txTspState_i : in slv(7 downto 0); txAppState_i : in slv(3 downto 0); txAckState_i : in slv(3 downto 0); @@ -335,6 +339,11 @@ begin v.axilReadSlave.rdata(19 downto 16) := rxTspState_i; v.axilReadSlave.rdata(23 downto 20) := rxAppState_i; v.axilReadSlave.rdata(27 downto 24) := connState_i; + when 16#1C# => + v.axilReadSlave.rdata(7 downto 0) := txLastAckN_i; + v.axilReadSlave.rdata(15 downto 8) := rxSeqN_i; + v.axilReadSlave.rdata(23 downto 16) := rxAckN_i; + v.axilReadSlave.rdata(31 downto 24) := rxLastSeqN_i; when others => axilReadResp := AXI_RESP_DECERR_C; end case; diff --git a/protocols/rssi/v1/rtl/RssiCore.vhd b/protocols/rssi/v1/rtl/RssiCore.vhd index 0354befa18..22bfa13144 100644 --- a/protocols/rssi/v1/rtl/RssiCore.vhd +++ b/protocols/rssi/v1/rtl/RssiCore.vhd @@ -340,6 +340,10 @@ begin injectFault_o => s_injectFaultReg, -- Status (RO) + txLastAckN_i => s_rxLastAckN, + rxSeqN_i => s_rxLastSeqN, + rxAckN_i => s_rxAckN, + rxLastSeqN_i => s_rxLastSeqN, txTspState_i => s_txTspState, txAppState_i => s_txAppState, txAckState_i => s_txAckState, diff --git a/python/surf/protocols/rssi/_RssiCore.py b/python/surf/protocols/rssi/_RssiCore.py index a789aa7c3f..f7c2e30a92 100644 --- a/python/surf/protocols/rssi/_RssiCore.py +++ b/python/surf/protocols/rssi/_RssiCore.py @@ -451,6 +451,50 @@ def __init__(self, **kwargs): }, )) + self.add(pr.RemoteVariable( + name = 'TxLastAckN', + description = 'Last acknowledged Sequence number connected to TX module', + offset = 0x70, + bitSize = 8, + bitOffset = 0, + mode = 'RO', + disp = '{:d}', + pollInterval = 1, + )) + + self.add(pr.RemoteVariable( + name = 'RxSeqN', + description = 'Current received seqN', + offset = 0x70, + bitSize = 8, + bitOffset = 8, + mode = 'RO', + disp = '{:d}', + pollInterval = 1, + )) + + self.add(pr.RemoteVariable( + name = 'RxAckN', + description = 'Current received ackN', + offset = 0x70, + bitSize = 8, + bitOffset = 16, + mode = 'RO', + disp = '{:d}', + pollInterval = 1, + )) + + self.add(pr.RemoteVariable( + name = 'RxLastSeqN', + description = 'Last seqN received and sent to application (this is the ackN transmitted)', + offset = 0x70, + bitSize = 8, + bitOffset = 24, + mode = 'RO', + disp = '{:d}', + pollInterval = 1, + )) + ############################## # Commands ##############################