From 5f01b061f794677f756e21fb9da8131830a6de0c Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 10 Jul 2014 15:38:51 +0200 Subject: [PATCH] MPO: implicit core --- artiq/language/experiment.py | 3 +++ examples/al_spectroscopy.py | 2 +- examples/compiler_test.py | 2 +- examples/coredev_test.py | 2 +- examples/simple_simulation.py | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/artiq/language/experiment.py b/artiq/language/experiment.py index ccb604515..98f649d50 100644 --- a/artiq/language/experiment.py +++ b/artiq/language/experiment.py @@ -4,9 +4,12 @@ from collections import namedtuple class MPO: channels = "" parameters = "" + implicit_core = True def __init__(self, *args, **kwargs): argnames = self.channels.split() + self.parameters.split() + if self.implicit_core: + argnames.insert(0, "core") undef_args = list(argnames) if len(argnames) < len(args): diff --git a/examples/al_spectroscopy.py b/examples/al_spectroscopy.py index 7018cfd0c..299f7f421 100644 --- a/examples/al_spectroscopy.py +++ b/examples/al_spectroscopy.py @@ -2,7 +2,7 @@ from artiq.language.units import * from artiq.language.experiment import * class AluminumSpectroscopy(MPO): - channels = "core mains_sync laser_cooling spectroscopy spectroscopy_b state_detection pmt" + channels = "mains_sync laser_cooling spectroscopy spectroscopy_b state_detection pmt" parameters = "spectroscopy_freq photon_limit_low photon_limit_high" @kernel diff --git a/examples/compiler_test.py b/examples/compiler_test.py index 62060dc09..5e796e073 100644 --- a/examples/compiler_test.py +++ b/examples/compiler_test.py @@ -4,7 +4,7 @@ from artiq.language.experiment import * my_range = range class CompilerTest(MPO): - channels = "core a b A B" + channels = "a b A B" def print_done(self): print("Done!") diff --git a/examples/coredev_test.py b/examples/coredev_test.py index 5c4595c9e..9b2265545 100644 --- a/examples/coredev_test.py +++ b/examples/coredev_test.py @@ -2,7 +2,7 @@ from artiq.language.experiment import MPO, kernel from artiq.devices import corecom_serial, runtime, core, gpio_core class CompilerTest(MPO): - channels = "core led" + channels = "led" def output(self, n): print("Received: "+str(n)) diff --git a/examples/simple_simulation.py b/examples/simple_simulation.py index 9ec66abc0..749fb8ce4 100644 --- a/examples/simple_simulation.py +++ b/examples/simple_simulation.py @@ -2,7 +2,7 @@ from artiq.language.units import * from artiq.language.experiment import * class SimpleSimulation(MPO): - channels = "core a b c d" + channels = "a b c d" @kernel def run(self):