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

Bug fixes _RfBlock.py #1055

Merged
merged 3 commits into from
Mar 28, 2023
Merged
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: 5 additions & 16 deletions python/surf/xilinx/_RfBlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
class RfBlock(pr.Device):
def __init__(
self,
RestartSM = None, # Pointer to the RestartSM remote variable
isAdc = False, # True if this is an ADC tile
description = 'RFSoC data converter block registers',
**kwargs):
super().__init__(description=description, **kwargs)

self.RestartSM = RestartSM

##############################
# Variables
##############################
Expand All @@ -36,7 +39,6 @@ def __init__(
bitOffset = 0,
mode = 'RO',
enum = {0: 'FullBw', 1: 'NA', 2: 'HalfBwImr', 3: 'FullBwByPass'},
overlapEn = True,
))

self.add(pr.RemoteVariable(
Expand All @@ -47,7 +49,6 @@ def __init__(
bitOffset = 0,
mode = 'RO',
enum = {0: 'Real', 1: 'IQ'},
overlapEn = True,
))

if isAdc is True:
Expand All @@ -60,7 +61,6 @@ def __init__(
bitOffset = 0,
mode = 'RO',
enum = {0: 'I Data', 1: 'Q DATA', 2: 'IQ Data', 3: '4GSPS'},
overlapEn = True,
))

self.add(pr.RemoteVariable(
Expand All @@ -71,7 +71,6 @@ def __init__(
bitOffset = 0,
mode = 'RO',
enum = {0: 'NA', 1: 'Even', 2: 'Odd', 3: '4Phase'},
overlapEn = True,
))


Expand All @@ -82,8 +81,6 @@ def __init__(
bitSize = 16,
bitOffset = 0,
mode = 'RW',
overlapEn = True,
hidden = True,
))

self.add(pr.RemoteVariable(
Expand All @@ -93,8 +90,6 @@ def __init__(
bitSize = 16,
bitOffset = 0,
mode = 'RW',
overlapEn = True,
hidden = True,
))

self.add(pr.RemoteVariable(
Expand All @@ -104,8 +99,6 @@ def __init__(
bitSize = 16,
bitOffset = 0,
mode = 'RW',
overlapEn = True,
hidden = True,
))

self.add(pr.RemoteVariable(
Expand All @@ -115,8 +108,6 @@ def __init__(
bitSize = 16,
bitOffset = 0,
mode = 'RO',
overlapEn = True,
hidden = True,
))

self.add(pr.RemoteVariable(
Expand All @@ -126,8 +117,6 @@ def __init__(
bitSize = 16,
bitOffset = 0,
mode = 'RO',
overlapEn = True,
hidden = True,
))

self.add(pr.RemoteVariable(
Expand All @@ -137,8 +126,6 @@ def __init__(
bitSize = 1,
bitOffset = 5,
mode = 'RO',
overlapEn = True,
hidden = True,
))

self.add(pr.LocalVariable(
Expand Down Expand Up @@ -196,6 +183,8 @@ def _ncoFreqSet(self, value, write, verify, check):
self.ncoFqwdMid.set(value=int.from_bytes(ba[2:4], byteorder='little', signed=False), write=write, verify=verify, check=check)
self.ncoFqwdUp.set (value=int.from_bytes(ba[4:6], byteorder='little', signed=False), write=write, verify=verify, check=check)

# Reset the tile after changing the NCO value
self.RestartSM.set(value=0x1, write=write, verify=False, check=False)

def _ncoFreqGet(self, read, check):
samplingRate = self.samplingRate.value()
Expand Down
74 changes: 24 additions & 50 deletions python/surf/xilinx/_RfDataConverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,87 +27,79 @@ def __init__(
# Variables
##############################
self.add(pr.RemoteVariable(
name = "ipVersionMajor",
description = "IP version major",
name = 'ipVersionMajor',
description = 'IP version major',
offset = 0x0000,
bitSize = 8,
bitOffset = 24,
mode = "RO",
overlapEn = True,
mode = 'RO',
))

self.add(pr.RemoteVariable(
name = "ipVersionMinor",
description = "IP version minor",
name = 'ipVersionMinor',
description = 'IP version minor',
offset = 0x0000,
bitSize = 8,
bitOffset = 16,
mode = "RO",
overlapEn = True,
mode = 'RO',
))

self.add(pr.RemoteVariable(
name = "ipVersionRevision",
description = "IP version revision",
name = 'ipVersionRevision',
description = 'IP version revision',
offset = 0x0000,
bitSize = 8,
bitOffset = 8,
mode = "RO",
overlapEn = True,
mode = 'RO',
))

self.add(pr.RemoteVariable(
name = "Reset",
description = "Reset all tiles, autoclear",
name = 'Reset',
description = 'Reset all tiles, autoclear',
offset = 0x0004,
bitSize = 1,
bitOffset = 0,
mode = "WO",
overlapEn = True,
mode = 'WO',
))

self.add(pr.RemoteVariable(
name = "InterruptStatus",
description = "Interrupt status register",
name = 'InterruptStatus',
description = 'Interrupt status register',
offset = 0x0100,
bitSize = 8,
bitOffset = 0,
mode = "RO",
mode = 'RO',
hidden = True,
overlapEn = True,
))

self.add(pr.RemoteVariable(
name = "axiTimeoutInterrupt",
description = "Interrupt status register",
name = 'axiTimeoutInterrupt',
description = 'Interrupt status register',
offset = 0x0100,
bitSize = 1,
bitOffset = 31,
mode = "RO",
mode = 'RO',
hidden = True,
overlapEn = True,
))

self.add(pr.RemoteVariable(
name = "InterruptEnable",
description = "Interrupt enable register",
name = 'InterruptEnable',
description = 'Interrupt enable register',
offset = 0x0104,
bitSize = 8,
bitOffset = 0,
mode = "RW",
mode = 'RW',
hidden = True,
overlapEn = True,
))

self.add(pr.RemoteVariable(
name = "axiTimeoutInterruptEnable",
description = "Interrupt status register",
name = 'axiTimeoutInterruptEnable',
description = 'Interrupt status register',
offset = 0x0104,
bitSize = 1,
bitOffset = 31,
mode = "RW",
mode = 'RW',
hidden = True,
overlapEn = True,
))

for i in range(4):
Expand All @@ -127,21 +119,3 @@ def __init__(
offset = 0x14000 + 0x4000*i,
expand = False,
))

self.add(pr.RemoteVariable(
name = "RawData",
description = "",
offset = 0,
bitSize = 32 * 0x10000,
bitOffset = 0,
numValues = 0x10000,
valueBits = 32,
valueStride = 32,
updateNotify = True,
bulkOpEn = False, # FALSE for large variables
overlapEn = True,
verify = False,
hidden = True,
base = pr.UInt,
mode = "RW",
))
Loading