From 6509f1fd0491c431aae194467dc66781d0035b13 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 10 Jul 2014 18:13:37 +0200 Subject: [PATCH] artiq.language.experiment -> artiq.language.core --- artiq/compiler/inline.py | 8 +++++--- artiq/compiler/tools.py | 7 ++++--- artiq/devices/dds_core.py | 2 +- artiq/devices/gpio_core.py | 2 +- artiq/language/{experiment.py => core.py} | 0 artiq/sim/time.py | 4 ++-- examples/al_spectroscopy.py | 2 +- examples/compiler_test.py | 2 +- examples/coredev_test.py | 2 +- examples/simple_simulation.py | 2 +- 10 files changed, 17 insertions(+), 14 deletions(-) rename artiq/language/{experiment.py => core.py} (100%) diff --git a/artiq/compiler/inline.py b/artiq/compiler/inline.py index 593e3b8a4..ce69d9db5 100644 --- a/artiq/compiler/inline.py +++ b/artiq/compiler/inline.py @@ -2,7 +2,8 @@ from collections import namedtuple, defaultdict import inspect, textwrap, ast from artiq.compiler.tools import eval_ast, value_to_ast -from artiq.language import experiment, units +from artiq.language import core as core_language +from artiq.language import units def _replace_global(obj, ref): try: @@ -32,7 +33,7 @@ class _ReferenceManager: self.use_count["Quantity"] = 1 self.use_count["base_s_unit"] = 1 self.use_count["base_Hz_unit"] = 1 - for kg in experiment.kernel_globals: + for kg in core_language.kernel_globals: self.use_count[kg] = 1 self.use_count["range"] = 1 @@ -123,7 +124,8 @@ class _ReferenceManager: _embeddable_calls = { units.Quantity, - experiment.delay, experiment.at, experiment.now, experiment.syscall, + core_language.delay, core_language.at, core_language.now, + core_language.syscall, range } diff --git a/artiq/compiler/tools.py b/artiq/compiler/tools.py index 8eca52e74..7b1d0d7cf 100644 --- a/artiq/compiler/tools.py +++ b/artiq/compiler/tools.py @@ -1,6 +1,7 @@ import ast -from artiq.language import experiment, units +from artiq.language import core as core_language +from artiq.language import units def eval_ast(expr, symdict=dict()): if not isinstance(expr, ast.Expression): @@ -15,8 +16,8 @@ def value_to_ast(value): elif isinstance(value, str): return ast.Str(value) else: - for kg in experiment.kernel_globals: - if value is getattr(experiment, kg): + for kg in core_language.kernel_globals: + if value is getattr(core_language, kg): return ast.Name(kg, ast.Load()) if isinstance(value, units.Quantity): return ast.Call( diff --git a/artiq/devices/dds_core.py b/artiq/devices/dds_core.py index 229ef992c..c630940f7 100644 --- a/artiq/devices/dds_core.py +++ b/artiq/devices/dds_core.py @@ -1,4 +1,4 @@ -from artiq.language.experiment import * +from artiq.language.core import * from artiq.language.units import * class DDS: diff --git a/artiq/devices/gpio_core.py b/artiq/devices/gpio_core.py index e457ec0a2..31884b60f 100644 --- a/artiq/devices/gpio_core.py +++ b/artiq/devices/gpio_core.py @@ -1,4 +1,4 @@ -from artiq.language.experiment import * +from artiq.language.core import * class GPIOOut: def __init__(self, core, channel=0): diff --git a/artiq/language/experiment.py b/artiq/language/core.py similarity index 100% rename from artiq/language/experiment.py rename to artiq/language/core.py diff --git a/artiq/sim/time.py b/artiq/sim/time.py index dfcb4cdc8..f677a561e 100644 --- a/artiq/sim/time.py +++ b/artiq/sim/time.py @@ -1,7 +1,7 @@ from operator import itemgetter from artiq.language.units import * -from artiq.language import experiment +from artiq.language import core as core_language class SequentialTimeContext: def __init__(self, current_time): @@ -65,4 +65,4 @@ class Manager: return r manager = Manager() -experiment.set_time_manager(manager) +core_language.set_time_manager(manager) diff --git a/examples/al_spectroscopy.py b/examples/al_spectroscopy.py index 299f7f421..90db51ca6 100644 --- a/examples/al_spectroscopy.py +++ b/examples/al_spectroscopy.py @@ -1,5 +1,5 @@ from artiq.language.units import * -from artiq.language.experiment import * +from artiq.language.core import * class AluminumSpectroscopy(MPO): channels = "mains_sync laser_cooling spectroscopy spectroscopy_b state_detection pmt" diff --git a/examples/compiler_test.py b/examples/compiler_test.py index 5e796e073..5e2393115 100644 --- a/examples/compiler_test.py +++ b/examples/compiler_test.py @@ -1,5 +1,5 @@ from artiq.language.units import * -from artiq.language.experiment import * +from artiq.language.core import * my_range = range diff --git a/examples/coredev_test.py b/examples/coredev_test.py index 9b2265545..e3f9b8d46 100644 --- a/examples/coredev_test.py +++ b/examples/coredev_test.py @@ -1,4 +1,4 @@ -from artiq.language.experiment import MPO, kernel +from artiq.language.core import MPO, kernel from artiq.devices import corecom_serial, runtime, core, gpio_core class CompilerTest(MPO): diff --git a/examples/simple_simulation.py b/examples/simple_simulation.py index 749fb8ce4..cf8716827 100644 --- a/examples/simple_simulation.py +++ b/examples/simple_simulation.py @@ -1,5 +1,5 @@ from artiq.language.units import * -from artiq.language.experiment import * +from artiq.language.core import * class SimpleSimulation(MPO): channels = "a b c d"