diff --git a/pycqed/instrument_drivers/library/DIO.py b/pycqed/instrument_drivers/library/DIO.py index 410c939cec..7b0f8be3de 100644 --- a/pycqed/instrument_drivers/library/DIO.py +++ b/pycqed/instrument_drivers/library/DIO.py @@ -138,6 +138,13 @@ def calibrate(sender: CalInterface = None, [27, 26, 25] ], "trigger_bits": [31,15] + }, + "calibration":{ + "control_bits":[ + [30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16], + [32] + ], + "trigger_bits": [16] } } diff --git a/pycqed/instrument_drivers/physical_instruments/QuTech/CC.py b/pycqed/instrument_drivers/physical_instruments/QuTech/CC.py index f5c3efb57c..1b1af608a5 100644 --- a/pycqed/instrument_drivers/physical_instruments/QuTech/CC.py +++ b/pycqed/instrument_drivers/physical_instruments/QuTech/CC.py @@ -304,6 +304,20 @@ def output_dio_calibration_data(self, dio_mode: str, port: int=0) -> Tuple[int, (3, list(staircase_sequence+ (staircase_sequence << 3)))] dio_mask = 0x8FFF8FFF + elif dio_mode == "hdawg": + cc_prog = inspect.cleandoc(""" + mainLoop: seq_out 0xFFFF0000,1 + seq_out 0x00000000,1 + jmp @mainLoop + """) + + dio_mask = 0xbfff0000 + + expected_sequence = [(0, [1023]), + (1, [1023]), + (2, [1]), + (3, [1])] + elif dio_mode == "uhfqa": # FIXME: no official mode yet cc_prog = inspect.cleandoc(""" diff --git a/pycqed/instrument_drivers/physical_instruments/ZurichInstruments/ZI_HDAWG8.py b/pycqed/instrument_drivers/physical_instruments/ZurichInstruments/ZI_HDAWG8.py index f162a2c696..52e2fe13a7 100644 --- a/pycqed/instrument_drivers/physical_instruments/ZurichInstruments/ZI_HDAWG8.py +++ b/pycqed/instrument_drivers/physical_instruments/ZurichInstruments/ZI_HDAWG8.py @@ -218,7 +218,7 @@ def _add_extra_parameters(self): self.add_parameter( 'cfg_codeword_protocol', initial_value='identical', - vals=validators.Enum('identical', 'microwave', 'novsm_microwave', 'flux'), docstring=( + vals=validators.Enum('identical', 'microwave', 'novsm_microwave', 'flux', "calibration"), docstring=( 'Used in the configure codeword method to determine what DIO' ' pins are used in for which AWG numbers.'), parameter_class=ManualParameter) @@ -567,7 +567,7 @@ def _ensure_activity(self, awg_nr, mask_value=None, timeout=5): return False - def _find_valid_delays(self, awgs_and_sequences): + def _find_valid_delays(self, awgs_and_sequences, dio_mask): """Finds valid DIO delay settings for a given AWG by testing all allowed delay settings for timing violations on the configured bits. In addition, it compares the recorded DIO codewords to an expected sequence to make sure that no codewords are sampled incorrectly.""" @@ -575,11 +575,13 @@ def _find_valid_delays(self, awgs_and_sequences): valid_delays= [] for delay in range(16): log.debug(f' Testing delay {delay}') - self.setd('raw/dios/0/delays/*/value', delay) - time.sleep(1) + for index in range(32): + self.setd(f'raw/dios/*/delays/{index}/value', delay) + self.seti('raw/dios/*/error/timingclear', 1) + time.sleep(3) valid_sequence = True for awg, sequence in awgs_and_sequences: - if self.geti('awgs/' + str(awg) + '/dio/error/timing') == 0: + if self.geti('raw/dios/0/error/timingsticky') == 0: ts, cws = self._get_awg_dio_data(awg) index = None last_index = None @@ -605,7 +607,6 @@ def _find_valid_delays(self, awgs_and_sequences): if valid_sequence: valid_delays.append(delay) - return set(valid_delays) ########################################################################## @@ -640,14 +641,17 @@ def output_dio_calibration_data(self, dio_mode: str, port: int=0) -> Tuple[int, def calibrate_dio_protocol(self, dio_mask: int, expected_sequence: List, port: int=0): # FIXME: UHF driver does not use expected_sequence, why the difference + self.assure_ext_clock() self.upload_codeword_program() for awg, sequence in expected_sequence: if not self._ensure_activity(awg, mask_value=dio_mask): raise ziDIOActivityError('No or insufficient activity found on the DIO bits associated with AWG {}'.format(awg)) - - valid_delays = self._find_valid_delays(expected_sequence) + # self.setd('awgs/*/dio/mask/shift', 0) + # self.setd('awgs/0/dio/mask/value', 0) + valid_delays = self._find_valid_delays(expected_sequence, dio_mask) + print(valid_delays) if len(valid_delays) == 0: raise ziDIOCalibrationError('DIO calibration failed! No valid delays found') diff --git a/pycqed/measurement/qcodes_QtPlot_monkey_patching.py b/pycqed/measurement/qcodes_QtPlot_monkey_patching.py index 18dca3e2a0..d243669111 100644 --- a/pycqed/measurement/qcodes_QtPlot_monkey_patching.py +++ b/pycqed/measurement/qcodes_QtPlot_monkey_patching.py @@ -75,8 +75,8 @@ # Below: patch the QtPlot method to allow for setting a fixed color scale range -import qcodes -from qcodes.plots.pyqtgraph import QtPlot +import qcodes_loop +from qcodes_loop.plots.pyqtgraph import QtPlot def dummy_func(hist, **kwargs): @@ -124,7 +124,7 @@ def dummy_func(hist, **kwargs): # Compile and execute the code in the namespace of the "pyqtgraph" module # such that on next import of QtPlot the patched version will be used co = compile(parsedQtPlotSource, "", "exec") -exec(co, qcodes.plots.pyqtgraph.__dict__) +exec(co, qcodes_loop.plots.pyqtgraph.__dict__) # Patch the color scales @@ -141,15 +141,15 @@ def dummy_func(hist, **kwargs): parsed_colorscales_raw = ast.parse(str_colorscales_raw) co = compile(parsed_colorscales, "", "exec") -exec(co, qcodes.plots.colors.__dict__) +exec(co, qcodes_loop.plots.colors.__dict__) co = compile(parsed_colorscales_raw, "", "exec") -exec(co, qcodes.plots.colors.__dict__) +exec(co, qcodes_loop.plots.colors.__dict__) # On some systems this is also required probably because the colors get imported # there as well and, depending on the python version, the reference doesn't # change everywhere co = compile(parsed_colorscales, "", "exec") -exec(co, qcodes.plots.pyqtgraph.__dict__) +exec(co, qcodes_loop.plots.pyqtgraph.__dict__) co = compile(parsed_colorscales_raw, "", "exec") -exec(co, qcodes.plots.pyqtgraph.__dict__) \ No newline at end of file +exec(co, qcodes_loop.plots.pyqtgraph.__dict__) \ No newline at end of file