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
name (
str
) – Human readable name of the program (used f.i. for the function name)loop (
Loop
) – The program to uploadchannels (
Tuple
[Union
[str
,int
,None
],Union
[str
,int
,None
]]) – see AWG.uploadmarkers (
Tuple
[Union
[str
,int
,None
],Union
[str
,int
,None
],Union
[str
,int
,None
],Union
[str
,int
,None
]]) – see AWG.uploadamplitudes (
Tuple
[float
,float
]) – Used to sample the waveformsoffsets (
Tuple
[float
,float
]) – Used to sample the waveformsvoltage_transformations (
Tuple
[Optional
[Callable
],Optional
[Callable
]]) – see AWG.uploadsample_rate (
TimeType
) – Used to sample the waveforms
-
property
waveform_memory
¶
-