Skip to content

Qblox qmi driver - #215

Open
heevasti wants to merge 7 commits into
mainfrom
qblox-qmi-driver
Open

heevasti wants to merge 7 commits into
mainfrom
qblox-qmi-driver

Conversation

@heevasti

@heevasti heevasti commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Add a QMI driver for Qblox Cluster series device.

The driver contains only base functions to control the cluster, and trigger channels, and receive system info and module | function reference objects.

@heevasti
heevasti requested a review from pieterjbotma June 2, 2026 11:45

@bvanommen bvanommen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests look good, maybe bit of overlap between the two cluster modules.

I don't have experience with the device but looks OK. I would like to know why there are two classes. Is it to control either via SCPI commands or "native" control?

EXT_TRIGGERS_IN_CLUSTER = 15
# Module configuration constants:
# AO_IN_MODULE: Analog output channels in modules with value range -1V...+1V.
# AI_IN_MODULE: Analog output channels in modules with value range -1V...+1V.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

input channels presumeably

# Add type handles as callables
for type_handle, value in self.cluster._type_handle.__dict__.items():
if type_handle.startswith("_is"):
# As 'value' gets overridden in memory for the lambda function, do like this:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overwritten

idn = self.cluster._get_idn()
_, model, _, _ = idn.split(",")
self._modules = {"0": _QbloxModule(model, self.cluster_funcs)}
for k, v in self.cluster._mod_handles.items():

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code would be a bit more readable if these keys and values have a bit more descriptive names

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the v's are modules?

if str(module) == module_type:
# Just double check module type before returning
if (
module_type == "QCM"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if these two are on the same line it looks much better

self.cluster._slot_reset()

@rpc_method
def get_module(self, module_type: str, slot_no: int | None = None) -> NativeCluster | _QbloxModule:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it might be fair enough, but if you have multiple of the same module and you specify the module name, it's not clear which one you're gonna get. Maybe ideally you warn the user (or refuse) when you know there are duplicate modules and they didn't specify the slot.

for sequencer in range(SEQUENCERS_IN_MODULE[module_type]):
try:
sequencer_config = module_func_refs["_get_sequencer_config"](sequencer)
if channel_type in [0, 1] and AI_IN_MODULE[module_type] > 0:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

magical constants, ideally we replace

for channel in sequencer_channel_map[1]:
channels[f"adc{channel}_acq_Q{sequencer}"] = sequencer_config["awg"]

if channel_type in [0, 2] and AO_IN_MODULE[module_type] > 0:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

for channel in sequencer_channel_map[1]:
channels[f"dac{channel}_Q{sequencer}"] = sequencer_config["awg"] # TODO: Is this always valid?

if channel_type in [0, 3] and DIGITAL_MARKERS_IN_MODULE[module_type] > 0:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

invert: Any


class Qblox_QcodesCluster(Qblox_ClusterBase):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the difference between this class and Qblox_NativeCluster?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants