3.1.2. qupulse._program.seqc

This module contains the ZI HDAWG compatible description of programs. There is no code in here that interacts with hardware directly.

The public interface to all functionality is given by HDAWGProgramManager. This class can create seqc source code which contains multiple programs and allows switching between these with the user registers of a device,

Furthermore: - SEQCNode: AST of a subset of sequencing C - loop_to_seqc: conversion of Loop objects to this subset in a clever way - BinaryWaveform: Bundles functionality of handling segments in a native way. - WaveformMemory: Functionality to sync waveforms to the device (via the LabOne user folder) - ProgramWaveformManager and HDAWGProgramEntry: Program wise handling of waveforms and seqc-code classes that convert Loop objects

class qupulse._program.seqc.HDAWGProgramManager[source]

Bases: object

This class contains everything that is needed to create the final seqc program and provides an interface to write the required waveforms to the file system. It does not talk to the device.

GLOBAL_CONSTS = {'IDLE_WAIT_CYCLES': 300, 'NO_RESET_MASK': '0b1000000000000000', 'PROG_SEL_MASK': '0b111111111111111', 'PROG_SEL_NONE': 0, 'PROG_SEL_REGISTER': UserRegister(zero_based_value=0), 'TRIGGER_REGISTER': UserRegister(zero_based_value=1), 'TRIGGER_RESET_MASK': '0b1000000000000000'}
INIT_PROGRAM_SWITCH = '// INIT program switch.\nvar prog_sel = 0;'
PROGRAM_FUNCTION_NAME_TEMPLATE = '{program_name}_function'
SOFTWARE_WAIT_FOR_TRIGGER_FUNCTION_DEFINITION = 'void waitForSoftwareTrigger() {\n while (true) {\n var trigger_register = getUserReg(TRIGGER_REGISTER);\n if (trigger_register & TRIGGER_RESET_MASK) setUserReg(TRIGGER_REGISTER, 0);\n if (trigger_register) return;\n }\n}\n'
WAIT_FOR_SOFTWARE_TRIGGER = 'waitForSoftwareTrigger();'
add_program(name, loop, channels, markers, amplitudes, offsets, voltage_transformations, sample_rate)[source]

Register the given program and translate it to seqc.

TODO: Add an interface to change the trigger mode

Parameters
clear()[source]
Return type

None

get_register_values(name)[source]
Return type

Mapping[UserRegister, int]

get_register_values_to_update_volatile_parameters(name, parameters)[source]
Parameters
  • name (str) – Program name

  • parameters (Mapping[str, Number]) – new values for volatile parameters

Return type

Mapping[UserRegister, int]

Returns

A dict user_register->value that reflects the new parameter values

name_to_index(name)[source]
Return type

int

property programs
Return type

Mapping[str, HDAWGProgramEntry]

remove(name)[source]
Return type

None

to_seqc_program()[source]
Return type

str

property waveform_memory