Skip to content
Open
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
23 changes: 20 additions & 3 deletions ghz_fpga_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,10 @@ def run(self, runners, reps, setupPkts, setupState, sync, getTimingData,
# sequence.
results = yield readAll # wait for read to complete

# List the DACs that support the data readback.
timingDataDACs = [runner.dev.devName for runner in runners
if isinstance(runner, dac.DacRunner_Build8)]

if getTimingData:
answers = []
# Cache of already-parsed data from a particular board.
Expand All @@ -770,7 +774,14 @@ def run(self, runners, reps, setupPkts, setupState, sync, getTimingData,
boardName, channel = dataChannelName.split('::')
channel = int(channel)
elif 'DAC' in dataChannelName:
raise RuntimeError('DAC data readback not supported')
# Ensure that dataChannelName is among the DACs
# that support the data readback.
if dataChannelName in timingDataDACs:
boardName = dataChannelName
channel = None
else:
raise RuntimeError('DAC data readback ' +
' supported only for DAC build 8')
elif 'ADC' in dataChannelName:
# ADC average mode
boardName = dataChannelName
Expand All @@ -791,6 +802,10 @@ def run(self, runners, reps, setupPkts, setupState, sync, getTimingData,
results[idx]['read']]
# Array of all timing results (DAC)
extracted = runner.extract(result)
# Wrap the DAC timing results in a tuple for
# the data format consistency.
if isinstance(runner, dac.DacRunner_Build8):
extracted = (extracted,)
extractedData[boardName] = extracted
# Add extracted data to list of data to be returned
if channel != None:
Expand Down Expand Up @@ -1390,7 +1405,7 @@ def adc_mixer_table(self, c, channel, data):
getTimingData='b',
setupPkts='?{(((ww), s, ((s?)(s?)(s?)...))...)}',
setupState='*s',
returns=['*4i', '*3i', ''])
returns=['*4i', '*3i', '*i', ''])
def run_sequence(self, c, reps=30, getTimingData=True, setupPkts=[],
setupState=[]):
"""Executes a sequence on one or more boards.
Expand Down Expand Up @@ -1424,7 +1439,9 @@ def run_sequence(self, c, reps=30, getTimingData=True, setupPkts=[],
(demod channel, stat, retrigger, I/Q).
retrigger indexes multiple triggers in a sequence.

If only DACs present, we return no data.
If only DACs present, we return no data unless the build
number for at least some of the DAC boards is 8.
In the later case, the data is returned as *i.

ADC boards must be either all in average mode or all in demodulate
mode.
Expand Down