From 7f009031b0955ae2066777218907511e9d52bc42 Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Wed, 2 Oct 2024 23:00:56 -0700 Subject: [PATCH] Fix histogram variables --- python/surf/xilinx/_GtRxAlignCheck.py | 47 ++++++++++++--------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/python/surf/xilinx/_GtRxAlignCheck.py b/python/surf/xilinx/_GtRxAlignCheck.py index 2c491c2de6..e835f98679 100644 --- a/python/surf/xilinx/_GtRxAlignCheck.py +++ b/python/surf/xilinx/_GtRxAlignCheck.py @@ -26,32 +26,6 @@ def __init__( self, # Variables ############################## - # self.addRemoteVariables( - # name = "PhaseCount", - # description = "Timing frame phase", - # offset = 0x00, - # bitSize = 16, - # bitOffset = 0, - # mode = "RO", - # pollInterval = 1, - # number = 128, - # stride = 2, - # hidden = True, - # ) - - self.addRemoteVariables( - name = "PhaseCount", - description = "Timing frame phase", - offset = 0x00, - bitSize = 32, - bitOffset = 0, - mode = "RO", - pollInterval = 1, - number = 64, - stride = 4, - hidden = True, - ) - self.add(pr.RemoteVariable( name = "PhaseTarget", description = "Timing frame phase lock target", @@ -184,3 +158,24 @@ def __init__( self, linkedGet = lambda read: self.RefClkFreqRaw.get(read=read) * 1.0e-6, disp = '{:0.3f}', )) + + self.add(pr.RemoteVariable( + name = "PhaseCount", + description = "Timing frame phase", + offset = 0x00, + valueBits = 8, + valueStride = 8, + numValues = 40, + mode = "RO", + pollInterval = 1, + hidden = False, + )) + + for i in range(40): + self.add(pr.LinkVariable( + name = f'PhaseHist[{i}]', + guiGroup='Hist', + disp = '{:d}', + mode = 'RO', + dependencies = [self.PhaseCount], + linkedGet = lambda read, x=i: self.PhaseCount.get(read=read, index=x)))