diff --git a/BETA b/BETA deleted file mode 100644 index e69de29bb..000000000 diff --git a/MAJOR_VERSION b/MAJOR_VERSION deleted file mode 100644 index 45a4fb75d..000000000 --- a/MAJOR_VERSION +++ /dev/null @@ -1 +0,0 @@ -8 diff --git a/artiq/_version.py b/artiq/_version.py index b3c3d5be4..e308ce8c2 100644 --- a/artiq/_version.py +++ b/artiq/_version.py @@ -1,13 +1,4 @@ import os def get_version(): - override = os.getenv("VERSIONEER_OVERRIDE") - if override: - return override - srcroot = os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir) - with open(os.path.join(srcroot, "MAJOR_VERSION"), "r") as f: - version = f.read().strip() - version += ".unknown" - if os.path.exists(os.path.join(srcroot, "BETA")): - version += ".beta" - return version + return os.getenv("VERSIONEER_OVERRIDE", default="8.0.beta") diff --git a/artiq/examples/kc705_nist_clock/repository/precompile.py b/artiq/examples/kc705_nist_clock/repository/precompile.py new file mode 100644 index 000000000..6bfaaf057 --- /dev/null +++ b/artiq/examples/kc705_nist_clock/repository/precompile.py @@ -0,0 +1,20 @@ +from artiq.experiment import * + + +class Precompile(EnvExperiment): + def build(self): + self.setattr_device("core") + self.hello_str = "hello ARTIQ" + + def prepare(self): + self.precompiled = self.core.precompile(self.hello, "world") + + @kernel + def hello(self, arg): + print(self.hello_str, arg) + self.hello_str = "nowriteback" + + def run(self): + self.precompiled() + self.hello_str = "noupdate" + self.precompiled() diff --git a/artiq/firmware/runtime/kern_hwreq.rs b/artiq/firmware/runtime/kern_hwreq.rs index a80a7b71a..952a18439 100644 --- a/artiq/firmware/runtime/kern_hwreq.rs +++ b/artiq/firmware/runtime/kern_hwreq.rs @@ -116,8 +116,8 @@ mod remote_i2c { } } - pub fn switch_select(io: &Io, aux_mutex: &Mutex, linkno: u8, destination: u8, busno: u8, address: u8, mask: u8) -> Result { - let reply = drtio::aux_transact(io, aux_mutex, linkno, &drtioaux::Packet::I2cPca954xSelectRequest { + pub fn switch_select(io: &Io, aux_mutex: &Mutex, linkno: u8, destination: u8, busno: u8, address: u8, mask: u8) -> Result<(), &'static str> { + let reply = drtio::aux_transact(io, aux_mutex, linkno, &drtioaux::Packet::I2cSwitchSelectRequest { destination: destination, busno: busno, address: address, diff --git a/artiq/test/coredevice/test_i2c.py b/artiq/test/coredevice/test_i2c.py index 7b589cb4e..e8293db9d 100644 --- a/artiq/test/coredevice/test_i2c.py +++ b/artiq/test/coredevice/test_i2c.py @@ -3,7 +3,7 @@ import os, unittest from artiq.experiment import * from artiq.test.hardware_testbench import ExperimentCase from artiq.coredevice.exceptions import I2CError -from artiq.coredevice.i2c import I2CSwitch +from artiq.coredevice.i2c import I2CSwitch, i2c_read_byte class I2CSwitchTest(EnvExperiment): @@ -16,7 +16,9 @@ class I2CSwitchTest(EnvExperiment): passed = True for i in range(8): self.i2c_switch.set(i) - if self.i2c_switch.readback() != 1 << i: + # this will work only with pca9548 (like on kc705) + # otherwise we cannot guarantee exact readback values + if i2c_read_byte(self.i2c_switch.busno, self.i2c_switch.address) != 1 << i: passed = False self.set_dataset("passed", passed) diff --git a/versioneer.py b/versioneer.py index 20794abc9..f6393d21e 100644 --- a/versioneer.py +++ b/versioneer.py @@ -11,16 +11,7 @@ def get_rev(): """ def get_version(): - override = os.getenv("VERSIONEER_OVERRIDE") - if override: - return override - srcroot = os.path.dirname(os.path.abspath(__file__)) - with open(os.path.join(srcroot, "MAJOR_VERSION"), "r") as f: - version = f.read().strip() - version += ".0" - if os.path.exists(os.path.join(srcroot, "BETA")): - version += ".beta" - return version + return os.getenv("VERSIONEER_OVERRIDE", default="8.0.beta") def get_rev(): return os.getenv("VERSIONEER_REV", default="unknown")