Skip to content

Commit

Permalink
add (provisional) sw-controlled self-rst feature to aligner
Browse files Browse the repository at this point in the history
  • Loading branch information
cbakalis-slac committed Feb 14, 2024
1 parent f904bed commit 4de8008
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
9 changes: 9 additions & 0 deletions python/surf/xilinx/_GtRxAlignCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,12 @@ def __init__( self,
linkedGet = lambda: self.RefClkFreqRaw.value() * 1.0e-6,
disp = '{:0.3f}',
))

self.add(pr.RemoteCommand(
name = "SelfRst",
description = 'Self-Reset the aligner',
offset = 0x124,
bitSize = 1,
bitOffset = 0,
function = pr.RemoteCommand.touchOne
))
10 changes: 7 additions & 3 deletions xilinx/general/rtl/GtRxAlignCheck.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ architecture rtl of GtRxAlignCheck is
rst : sl;
rstRetryCnt : sl;
override : sl;
selfRst : sl;
rstlen : slv(3 downto 0);
rstcnt : slv(3 downto 0);
retryCnt : slv(15 downto 0);
Expand All @@ -96,6 +97,7 @@ architecture rtl of GtRxAlignCheck is
rst => '1',
rstRetryCnt => '0',
override => '0',
selfRst => '0',
rstlen => toSlv(3, 4),
rstcnt => toSlv(0, 4),
retryCnt => toSlv(0, 16),
Expand Down Expand Up @@ -181,6 +183,7 @@ begin
v.rst := '0';
-- Reset the strobes
v.rstRetryCnt := '0';
v.selfRst := '0';

------------------------
-- AXI-Lite Transactions
Expand All @@ -198,11 +201,12 @@ begin
axiSlaveRegister (axilEp, x"104", 0, v.last);
axiSlaveRegisterR(axilEp, x"108", 0, txClkFreq);
axiSlaveRegisterR(axilEp, x"10C", 0, rxClkFreq);
axiSlaveRegisterR(axilEp, x"110", 0, v.locked);
axiSlaveRegisterR(axilEp, x"110", 0, r.locked);
axiSlaveRegister (axilEp, x"114", 0, v.override);
axiSlaveRegister (axilEp, x"118", 0, v.rstRetryCnt);
axiSlaveRegisterR(axilEp, x"11C", 0, v.retryCnt);
axiSlaveRegisterR(axilEp, x"11C", 0, r.retryCnt);
axiSlaveRegisterR(axilEp, x"120", 0, refClkFreq);
axiSlaveRegister (axilEp, x"124", 0, v.selfRst);


-- Close out the transaction
Expand Down Expand Up @@ -278,7 +282,7 @@ begin
end if;

-- Check for user reset
if (resetIn = '1') or (resetErr = '1') then
if (resetIn = '1') or (resetErr = '1') or (r.selfRst = '1') then
-- Setup flags for reset state
v.rst := '1';
v.req.request := '0';
Expand Down

0 comments on commit 4de8008

Please sign in to comment.