Skip to content

Commit

Permalink
Add software support for RowFpgaBoard
Browse files Browse the repository at this point in the history
  • Loading branch information
bengineerd committed Nov 1, 2024
1 parent 1ddf696 commit 61501f4
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 19 deletions.
40 changes: 40 additions & 0 deletions firmware/python/warm_tdm/_FrontEnds.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,43 @@ def __init__(self, **kwargs):
for i in range(8):
self.add(warm_tdm.FpgaBoardColumnFebChannel(
name = f'Channel[{i}]'))





class RowBoardC01StandardFrontEnd(FrontEndDevice):
def __init__(self, **kwargs):
super().__init__(**kwargs)

# Channels 0 and 1 use differential amplifier configuration
for i in range(2):
self.add(warm_tdm.FastDacAmplifierDiff(
name = f'Amp[{i}]',
guiGroup = 'Amp_',
hidden = False))

for i in range(2, 32):
self.add(warm_tdm.FastDacAmplifierSE(
name = f'Amp[{i}]',
guiGroup = 'Amp_',
hidden = False))

class FpgaBoardRowFeb(FrontEndDevice):
def __init__(self, **kwargs):
super().__init__(**kwargs)

# Channels 0 and 1 use differential amplifier configuration
for i in range(32):
self.add(warm_tdm.FastDacAmplifierDiff(
name = f'Amp[{i}]',
guiGroup = 'Amp_',
hidden = False,
defaults = {
'Invert': False,
'InputR': 100.0,
'FbR': 402.0,
'ShuntR': 1.000e3
}))


1 change: 1 addition & 0 deletions firmware/python/warm_tdm/_HardwareGroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def __init__(
# Instantiate the board Device tree and link it to the SRP
self.add(rowBoardClass(
name=f'RowBoard[{rowIndex}]',
frontEndClass=rowFeClass,
memBase=srp,
expand=True,
enabled=True))
Expand Down
17 changes: 3 additions & 14 deletions firmware/python/warm_tdm/_RowDacDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
class RowDacDriver(pr.Device):
def __init__(
self,
frontEnd,
num_row_selects=32,
num_chip_selects=0,
**kwargs):
Expand All @@ -22,21 +23,9 @@ def bits(number):

rowBoardIdBits = 8-(self.row_addr_bits + self.chip_addr_bits)

self._frontEnd = frontEnd

# Channels 0 and 1 use differential amplifier configuration
for i in range(2):
self.add(warm_tdm.FastDacAmplifierDiff(
name = f'Amp[{i}]',
guiGroup = 'Amp_',
hidden = False))

for i in range(2, 32):
self.add(warm_tdm.FastDacAmplifierSE(
name = f'Amp[{i}]',
guiGroup = 'Amp_',
hidden = False))

self.amps = [self.Amp[i] for i in range(32)]
self.amps = [self._frontEnd.Amp[i] for i in range(32)]

self.add(pr.RemoteVariable(
name = 'Mode',
Expand Down
42 changes: 42 additions & 0 deletions firmware/python/warm_tdm/_RowFpgaBoard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import pyrogue as pr

import surf
import surf.protocols.ssi

import warm_tdm

class RowFpgaBoard(pr.Device):
def __init__(self, frontEndClass, num_row_selects=32, num_chip_selects=0, **kwargs):
super().__init__(**kwargs)

self.forceCheckEach = True

self.add(frontEndClass(
name='AnalogFrontEnd'))

self.add(warm_tdm.WarmTdmCore2(
offset = 0x00000000,
expand = True,
disable_timing_tx = True,
local_therm_channels = [9, 10, 1, 11, 0, 3],
fe_therm_channels = [2, 8]))

self.add(surf.protocols.ssi.SsiPrbsRx(
enabled = False,
hidden = True,
offset = 0xC0200000))

self.add(surf.protocols.ssi.SsiPrbsTx(
enabled = False,
hidden = True,
offset = 0xC0201000))

self.add(warm_tdm.RowDacDriver(
offset = 0xC100_0000,
frontEnd = self.AnalogFrontEnd,
num_row_selects = num_row_selects,
num_chip_selects = num_chip_selects,
expand = True))



5 changes: 4 additions & 1 deletion firmware/python/warm_tdm/_RowModule.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
import warm_tdm

class RowModule(pr.Device):
def __init__(self, num_row_selects=32, num_chip_selects=0, **kwargs):
def __init__(self, frontEndClass, num_row_selects=32, num_chip_selects=0, **kwargs):
super().__init__(**kwargs)

self.forceCheckEach = True

self.add(frontEndClass(
name='AnalogFrontEnd'))

self.add(warm_tdm.WarmTdmCore(
offset = 0x00000000,
expand = True,
Expand Down
1 change: 1 addition & 0 deletions firmware/python/warm_tdm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from ._BoardTemp import *
from ._BoardTemp2 import *
from ._ColumnFpgaBoard import *
from ._RowFpgaBoard import *
from ._WarmTdmCommon2 import *
from ._WarmTdmCore2 import *
from ._SaBiasOffset2 import *
Expand Down
8 changes: 5 additions & 3 deletions software/python/warm_tdm_api/_ArgParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(self):

self.add_argument(
"--rowFrontEnd",
choices= ['Legacy'],
choices= ['Legacy', 'FpgaRowFeb'],
default= 'Legacy')


Expand All @@ -96,10 +96,12 @@ def __init__(self):
}

rowBoardDict = {
'Legacy': warm_tdm.RowModule}
'Legacy': warm_tdm.RowModule,
'FPGA': warm_tdm.RowFpgaBoard}

rowFeDict = {
'Legacy': None}
'Legacy': warm_tdm.RowBoardC01StandardFrontEnd,
'FpgaRowFeb': warm_tdm.FpgaBoardRowFeb}


def arg_dict(args):
Expand Down
2 changes: 1 addition & 1 deletion software/python/warm_tdm_api/_GroupRoot.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(self, colBoardClass, colFeClass, rowBoardClass, rowFeClass, numRows
colBoardClass=colBoardClass,
colFeClass=colFeClass,
rowBoardClass=rowBoardClass,
rowFeClass=None,
rowFeClass=rowFeClass,
groupConfig=groupConfig,
groupId=0,
rows=numRows,
Expand Down

0 comments on commit 61501f4

Please sign in to comment.