Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancements to XADC Rogue Device #1122

Merged
merged 2 commits into from
Nov 30, 2023
Merged
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
17 changes: 12 additions & 5 deletions python/surf/xilinx/_Xadc.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ def __init__(self,
description = "AXI-Lite XADC for Xilinx 7 Series (Refer to PG091 & PG019)",
auxChannels = 0,
zynq = False,
simpleViewList = ["Temperature", "VccInt", "VccAux", "VccBram"],
pollInterval = 5,
**kwargs):
super().__init__(description=description, **kwargs)

if isinstance(auxChannels, int):
auxChannels = list(range(auxChannels))

self.simpleViewList = simpleViewList
self.simpleViewList.append('enable')

def addPair(name, offset, bitSize, units, bitOffset, description, function, pollInterval=0):
self.add(pr.RemoteVariable(
name = ("Raw"+name),
Expand Down Expand Up @@ -56,7 +61,7 @@ def addPair(name, offset, bitSize, units, bitOffset, description, function, poll
bitOffset = 4,
units = "degC",
function = self.convTemp,
pollInterval = 5,
pollInterval = pollInterval,
description = """
The result of the on-chip temperature sensor measurement is
stored in this location. The data is MSB justified in the
Expand Down Expand Up @@ -116,7 +121,7 @@ def addPair(name, offset, bitSize, units, bitOffset, description, function, poll
bitOffset = 4,
units = "V",
function = self.convCoreVoltage,
pollInterval = 5,
pollInterval = pollInterval,
description = """
The result of the on-chip VccInt supply monitor measurement
is stored at this location. The data is MSB justified in the
Expand Down Expand Up @@ -164,7 +169,7 @@ def addPair(name, offset, bitSize, units, bitOffset, description, function, poll
bitOffset = 4,
units = "V",
function = self.convCoreVoltage,
pollInterval = 5,
pollInterval = pollInterval,
description = """
The result of the on-chip VccAux supply monitor measurement
is stored at this location. The data is MSB justified in the
Expand Down Expand Up @@ -214,7 +219,7 @@ def addPair(name, offset, bitSize, units, bitOffset, description, function, poll
bitOffset = 4,
units = "V",
function = self.convCoreVoltage,
pollInterval = 5,
pollInterval = pollInterval,
description = """
The result of the on-chip VccBram supply monitor measurement
is stored at this location. The data is MSB justified in the
Expand Down Expand Up @@ -331,6 +336,8 @@ def addPair(name, offset, bitSize, units, bitOffset, description, function, poll
variable=self.AuxRaw[ch],
linkedGet=self.convAuxVoltage))

self.simpleViewList.append(f'Aux[{ch}]')

if (zynq):
addPair(
name = 'VccpInt',
Expand Down Expand Up @@ -610,5 +617,5 @@ def simpleView(self):
# Hide all the variable
self.hideVariables(hidden=True)
# Then unhide the most interesting ones
vars = ["enable", "Temperature", "VccInt", "VccAux", "VccBram"]
vars = self.simpleViewList
self.hideVariables(hidden=False, variables=vars)