forked from M-Labs/artiq
MPO: implicit core
This commit is contained in:
parent
d76182a3ee
commit
5f01b061f7
|
@ -4,9 +4,12 @@ from collections import namedtuple
|
||||||
class MPO:
|
class MPO:
|
||||||
channels = ""
|
channels = ""
|
||||||
parameters = ""
|
parameters = ""
|
||||||
|
implicit_core = True
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
argnames = self.channels.split() + self.parameters.split()
|
argnames = self.channels.split() + self.parameters.split()
|
||||||
|
if self.implicit_core:
|
||||||
|
argnames.insert(0, "core")
|
||||||
undef_args = list(argnames)
|
undef_args = list(argnames)
|
||||||
|
|
||||||
if len(argnames) < len(args):
|
if len(argnames) < len(args):
|
||||||
|
|
|
@ -2,7 +2,7 @@ from artiq.language.units import *
|
||||||
from artiq.language.experiment import *
|
from artiq.language.experiment import *
|
||||||
|
|
||||||
class AluminumSpectroscopy(MPO):
|
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"
|
parameters = "spectroscopy_freq photon_limit_low photon_limit_high"
|
||||||
|
|
||||||
@kernel
|
@kernel
|
||||||
|
|
|
@ -4,7 +4,7 @@ from artiq.language.experiment import *
|
||||||
my_range = range
|
my_range = range
|
||||||
|
|
||||||
class CompilerTest(MPO):
|
class CompilerTest(MPO):
|
||||||
channels = "core a b A B"
|
channels = "a b A B"
|
||||||
|
|
||||||
def print_done(self):
|
def print_done(self):
|
||||||
print("Done!")
|
print("Done!")
|
||||||
|
|
|
@ -2,7 +2,7 @@ from artiq.language.experiment import MPO, kernel
|
||||||
from artiq.devices import corecom_serial, runtime, core, gpio_core
|
from artiq.devices import corecom_serial, runtime, core, gpio_core
|
||||||
|
|
||||||
class CompilerTest(MPO):
|
class CompilerTest(MPO):
|
||||||
channels = "core led"
|
channels = "led"
|
||||||
|
|
||||||
def output(self, n):
|
def output(self, n):
|
||||||
print("Received: "+str(n))
|
print("Received: "+str(n))
|
||||||
|
|
|
@ -2,7 +2,7 @@ from artiq.language.units import *
|
||||||
from artiq.language.experiment import *
|
from artiq.language.experiment import *
|
||||||
|
|
||||||
class SimpleSimulation(MPO):
|
class SimpleSimulation(MPO):
|
||||||
channels = "core a b c d"
|
channels = "a b c d"
|
||||||
|
|
||||||
@kernel
|
@kernel
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
Loading…
Reference in New Issue