Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f7ba61b47b09
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 16fdebad8e1d
Choose a head ref
  • 3 commits
  • 6 files changed
  • 1 contributor

Commits on May 3, 2016

  1. style

    sbourdeauducq committed May 3, 2016
    Copy the full SHA
    9e14419 View commit details
  2. Copy the full SHA
    adeb886 View commit details
  3. Copy the full SHA
    16fdeba View commit details
7 changes: 7 additions & 0 deletions RELEASE_NOTES.rst
Original file line number Diff line number Diff line change
@@ -3,6 +3,13 @@
Release notes
=============


1.0rc4 (unreleased)
-------------------

* setattr_argument and setattr_device add their key to kernel_invariants.


1.0rc3
------

2 changes: 1 addition & 1 deletion artiq/gateware/nist_qc2.py
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ def FPins(s):
Subsignal("wr_n", FPins("FMC:LA24_P")),
Subsignal("rd_n", FPins("FMC:LA25_N")),
Subsignal("rst", FPins("FMC:LA25_P")),
IOStandard("LVTTL")),
IOStandard("LVTTL"), Misc("DRIVE=24")),

("i2c_fmc", next(i2c_fmc),
Subsignal("scl", FPins("FMC:IIC_SCL")),
12 changes: 10 additions & 2 deletions artiq/language/environment.py
Original file line number Diff line number Diff line change
@@ -227,8 +227,12 @@ def get_argument(self, key, processor=None, group=None):

def setattr_argument(self, key, processor=None, group=None):
"""Sets an argument as attribute. The names of the argument and of the
attribute are the same."""
attribute are the same.
The key is added to the instance's kernel invariants."""
setattr(self, key, self.get_argument(key, processor, group))
kernel_invariants = getattr(self, "kernel_invariants", set())
self.kernel_invariants = kernel_invariants | {key}

def get_device_db(self):
"""Returns the full contents of the device database."""
@@ -248,8 +252,12 @@ def get_device(self, key):

def setattr_device(self, key):
"""Sets a device driver as attribute. The names of the device driver
and of the attribute are the same."""
and of the attribute are the same.
The key is added to the instance's kernel invariants."""
setattr(self, key, self.get_device(key))
kernel_invariants = getattr(self, "kernel_invariants", set())
self.kernel_invariants = kernel_invariants | {key}

def set_dataset(self, key, value,
broadcast=False, persist=False, save=True):
4 changes: 0 additions & 4 deletions artiq/test/coredevice/test_rtio.py
Original file line number Diff line number Diff line change
@@ -83,8 +83,6 @@ def run(self):


class PulseRate(EnvExperiment):
kernel_invariants = {"core", "ttl_out"}

def build(self):
self.setattr_device("core")
self.setattr_device("ttl_out")
@@ -107,8 +105,6 @@ def run(self):


class PulseRateDDS(EnvExperiment):
kernel_invariants = {"core", "core_dds", "dds0", "dds1"}

def build(self):
self.setattr_device("core")
self.setattr_device("core_dds")
2 changes: 1 addition & 1 deletion artiq/test/lit/embedding/error_attr_constant.py
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
from artiq.language.types import *

class c:
kernel_invariants = {'a'}
kernel_invariants = {"a"}

def __init__(self):
self.a = 1
4 changes: 2 additions & 2 deletions artiq/test/lit/embedding/warning_invariant_2.py
Original file line number Diff line number Diff line change
@@ -12,8 +12,8 @@ def __init__(self, invariants):
def __repr__(self):
return "<testbench.c object>"

i1 = c({'a', 'b'})
i2 = c({'a'})
i1 = c({"a", "b"})
i2 = c({"a"})

@kernel
def entrypoint():