From 7e61f66493a934800a5609ebe7d08533bc50d93e Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 22 Mar 2015 00:24:42 +0100 Subject: [PATCH] pdq2/mediator: get pdq devices from pdb --- artiq/devices/pdq2/mediator.py | 15 ++++++++++----- examples/master/ddb.pyon | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 6 deletions(-) diff --git a/artiq/devices/pdq2/mediator.py b/artiq/devices/pdq2/mediator.py index bc811247d..ad05b3eb7 100644 --- a/artiq/devices/pdq2/mediator.py +++ b/artiq/devices/pdq2/mediator.py @@ -114,15 +114,20 @@ class _Frame: class CompoundPDQ2(AutoDB): class DBKeys: core = Device() - ids = Argument() + pdq2_devices = Argument() rtio_trigger = Argument() rtio_frame = Argument() def build(self): - self.trigger = rtio.LLRTIOOut(core=self.core, channel=self.rtio_trigger) - self.frame0 = rtio.LLRTIOOut(core=self.core, channel=self.rtio_frame[0]) - self.frame1 = rtio.LLRTIOOut(core=self.core, channel=self.rtio_frame[1]) - self.frame2 = rtio.LLRTIOOut(core=self.core, channel=self.rtio_frame[2]) + self.pdq2s = [self.dbh.get_device(d) for d in self.pdq2_devices] + self.trigger = rtio.LLRTIOOut( + core=self.core, channel=self.rtio_trigger) + self.frame0 = rtio.LLRTIOOut( + core=self.core, channel=self.rtio_frame[0]) + self.frame1 = rtio.LLRTIOOut( + core=self.core, channel=self.rtio_frame[1]) + self.frame2 = rtio.LLRTIOOut( + core=self.core, channel=self.rtio_frame[2]) self.frames = [] self.current_frame = -1 diff --git a/examples/master/ddb.pyon b/examples/master/ddb.pyon index b30796954..ed1a4dff0 100644 --- a/examples/master/ddb.pyon +++ b/examples/master/ddb.pyon @@ -70,12 +70,44 @@ "arguments": {"reg_channel": 2, "rtio_switch": 7} }, + "qc_q1_0": { + "type": "controller", + "best_effort": false, + "host": "::1", + "port": 4000, + "target_name": "pdq2", + "command": "pdq2_controller -p {port} --bind {bind} --dump qc_q1_0.bin" + }, + "qc_q1_1": { + "type": "controller", + "best_effort": false, + "host": "::1", + "port": 4001, + "target_name": "pdq2", + "command": "pdq2_controller -p {port} --bind {bind} --dump qc_q1_1.bin" + }, + "qc_q1_2": { + "type": "controller", + "best_effort": false, + "host": "::1", + "port": 4002, + "target_name": "pdq2", + "command": "pdq2_controller -p {port} --bind {bind} --dump qc_q1_2.bin" + }, + "qc_q1_3": { + "type": "controller", + "best_effort": false, + "host": "::1", + "port": 4003, + "target_name": "pdq2", + "command": "pdq2_controller -p {port} --bind {bind} --dump qc_q1_3.bin" + }, "electrodes": { "type": "local", "module": "artiq.devices.pdq2", "class": "CompoundPDQ2", "arguments": { - "ids": ["qc_q1_0", "qc_q1_1", "qc_q1_2", "qc_q1_3"], + "pdq2_devices": ["qc_q1_0", "qc_q1_1", "qc_q1_2", "qc_q1_3"], "rtio_trigger": 7, "rtio_frame": (2, 3, 4) },