From 79e1fb663d78d18b63a14f864ef2ae36f2d01741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Rist=C3=A8?= Date: Thu, 11 Apr 2019 16:07:08 -0400 Subject: [PATCH] Add TDM channels --- QGL/ChannelLibraries.py | 2 ++ QGL/Channels.py | 1 + QGL/drivers/APS2Pattern.py | 6 ++++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/QGL/ChannelLibraries.py b/QGL/ChannelLibraries.py index 6afb03b2..32e4daf4 100644 --- a/QGL/ChannelLibraries.py +++ b/QGL/ChannelLibraries.py @@ -339,6 +339,8 @@ def load_from_library(self, return_only=False): params["phys_chan"] = meas_instr + "-" + meas_chan params["meas_type"] = "autodyne" params["receiver_chan"] = "RecvChan-" + qubit["measure"]["receiver"] + if "tdm_chan" in qubit["measure"].keys(): + params['tdm_chan'] = qubit["measure"]["tdm_chan"] params["__module__"] = "QGL.Channels" params["__class__"] = "Measurement" channel_dict[params["label"]] = params diff --git a/QGL/Channels.py b/QGL/Channels.py index c0c85163..57661aaf 100644 --- a/QGL/Channels.py +++ b/QGL/Channels.py @@ -170,6 +170,7 @@ class Measurement(LogicalChannel): gate_chan = Instance((str, LogicalMarkerChannel)) trig_chan = Instance((str, LogicalMarkerChannel)) receiver_chan = Instance((str, ReceiverChannel)) + tdm_chan = Int(0).tag(desc='tdm input for this digitized measurement result') def __init__(self, **kwargs): super(Measurement, self).__init__(**kwargs) diff --git a/QGL/drivers/APS2Pattern.py b/QGL/drivers/APS2Pattern.py index 224690e3..ea5c09b9 100644 --- a/QGL/drivers/APS2Pattern.py +++ b/QGL/drivers/APS2Pattern.py @@ -1395,7 +1395,8 @@ def tdm_instructions(seqs): elif isinstance(s, PulseSequencer.Pulse): if s.label == 'MEAS' and s.maddr != (-1, 0): - instructions.append(CrossBar(2**s.maddr[1], 0x1, label=label)) + tdm_chan = m.channel.tdm_chan if getattr(m.channel, 'tdm_chan') else 1 + instructions.append(CrossBar(2**s.maddr[1], 2**(tdm_chan-1), label=label)) instructions.append(LoadCmp(label=label)) instructions.append(StoreMeas(s.maddr[0], 1 << 16, label=label)) @@ -1409,7 +1410,8 @@ def tdm_instructions(seqs): if len(set(maddr))>1: raise Exception('Storing simultaneous measurements on different addresses not supported.') for n,m in enumerate(sim_meas): - instructions.append(CrossBar(2**m.maddr[1], 2**n)) + tdm_chan = m.channel.tdm_chan if getattr(m.channel, 'tdm_chan') else n+1 #default 0 + instructions.append(CrossBar(2**m.maddr[1], 2**(tdm_chan-1))) instructions.append(LoadCmp(label=label)) instructions.append(StoreMeas(maddr[0], 1 << 16))