From 9cc9e8b276bc45c0bcb918653c2b34f6f58c6c00 Mon Sep 17 00:00:00 2001 From: whitequark Date: Wed, 6 Apr 2016 22:38:31 +0000 Subject: [PATCH] embedding: s/kernel_constant_attributes/kernel_invariants/g Requested in #359. --- artiq/compiler/embedding.py | 6 +++--- artiq/coredevice/core.py | 2 +- artiq/coredevice/dds.py | 6 +++--- artiq/coredevice/ttl.py | 6 +++--- artiq/test/coredevice/test_rtio.py | 4 ++-- artiq/test/lit/embedding/error_attr_constant.py | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/artiq/compiler/embedding.py b/artiq/compiler/embedding.py index ffe9f3426..006d274ad 100644 --- a/artiq/compiler/embedding.py +++ b/artiq/compiler/embedding.py @@ -137,9 +137,9 @@ class ASTSynthesizer: instance_type = types.TInstance("{}.{}".format(typ.__module__, typ.__qualname__), OrderedDict()) instance_type.attributes['__objectid__'] = builtins.TInt32() - if hasattr(typ, 'kernel_constant_attributes'): - assert isinstance(typ.kernel_constant_attributes, set) - instance_type.constant_attributes = typ.kernel_constant_attributes + if hasattr(typ, 'kernel_invariants'): + assert isinstance(typ.kernel_invariants, set) + instance_type.constant_attributes = typ.kernel_invariants constructor_type = types.TConstructor(instance_type) constructor_type.attributes['__objectid__'] = builtins.TInt32() diff --git a/artiq/coredevice/core.py b/artiq/coredevice/core.py index f500cfa6b..9ac755b34 100644 --- a/artiq/coredevice/core.py +++ b/artiq/coredevice/core.py @@ -59,7 +59,7 @@ class Core: :param comm_device: name of the device used for communications. """ - kernel_constant_attributes = { + kernel_invariants = { "core", "ref_period", "coarse_ref_period", "ref_multiplier", "external_clock", } diff --git a/artiq/coredevice/dds.py b/artiq/coredevice/dds.py index 7c81efcaa..dbe749e08 100644 --- a/artiq/coredevice/dds.py +++ b/artiq/coredevice/dds.py @@ -29,7 +29,7 @@ def dds_batch_exit() -> TNone: class _BatchContextManager: - kernel_constant_attributes = {"core", "core_dds"} + kernel_invariants = {"core", "core_dds"} def __init__(self, core_dds): self.core_dds = core_dds @@ -53,7 +53,7 @@ class CoreDDS: phase-locked multiple of the RTIO clock. """ - kernel_constant_attributes = {"core", "sysclk", "batch"} + kernel_invariants = {"core", "sysclk", "batch"} def __init__(self, dmgr, sysclk, core_device="core"): self.core = dmgr.get(core_device) @@ -88,7 +88,7 @@ class _DDSGeneric: :param channel: channel number of the DDS device to control. """ - kernel_constant_attributes = { + kernel_invariants = { "core", "core_dds", "bus_channel", "channel", "pow_width" } diff --git a/artiq/coredevice/ttl.py b/artiq/coredevice/ttl.py index bd917c1de..34c7d1edf 100644 --- a/artiq/coredevice/ttl.py +++ b/artiq/coredevice/ttl.py @@ -10,7 +10,7 @@ class TTLOut: :param channel: channel number """ - kernel_constant_attributes = {"core", "channel"} + kernel_invariants = {"core", "channel"} def __init__(self, dmgr, channel, core_device="core"): self.core = dmgr.get(core_device) @@ -84,7 +84,7 @@ class TTLInOut: :param channel: channel number """ - kernel_constant_attributes = {"core", "channel"} + kernel_invariants = {"core", "channel"} def __init__(self, dmgr, channel, core_device="core"): self.core = dmgr.get(core_device) @@ -236,7 +236,7 @@ class TTLClockGen: :param channel: channel number """ - kernel_constant_attributes = {"core", "channel", "acc_width"} + kernel_invariants = {"core", "channel", "acc_width"} def __init__(self, dmgr, channel, core_device="core"): self.core = dmgr.get(core_device) diff --git a/artiq/test/coredevice/test_rtio.py b/artiq/test/coredevice/test_rtio.py index d0a578579..60bfda526 100644 --- a/artiq/test/coredevice/test_rtio.py +++ b/artiq/test/coredevice/test_rtio.py @@ -83,7 +83,7 @@ class ClockGeneratorLoopback(EnvExperiment): class PulseRate(EnvExperiment): - kernel_constant_attributes = {"core", "ttl_out"} + kernel_invariants = {"core", "ttl_out"} def build(self): self.setattr_device("core") @@ -107,7 +107,7 @@ class PulseRate(EnvExperiment): class PulseRateDDS(EnvExperiment): - kernel_constant_attributes = {"core", "core_dds", "dds0", "dds1"} + kernel_invariants = {"core", "core_dds", "dds0", "dds1"} def build(self): self.setattr_device("core") diff --git a/artiq/test/lit/embedding/error_attr_constant.py b/artiq/test/lit/embedding/error_attr_constant.py index 22e8fe977..1adda638c 100644 --- a/artiq/test/lit/embedding/error_attr_constant.py +++ b/artiq/test/lit/embedding/error_attr_constant.py @@ -5,7 +5,7 @@ from artiq.language.core import * from artiq.language.types import * class c: - kernel_constant_attributes = {'a'} + kernel_invariants = {'a'} def __init__(self): self.a = 1