mirror of https://github.com/m-labs/artiq.git
Merge branch 'master' into nac3
This commit is contained in:
commit
25b1bbd10e
|
@ -1 +0,0 @@
|
||||||
8
|
|
|
@ -1,13 +1,4 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
def get_version():
|
def get_version():
|
||||||
override = os.getenv("VERSIONEER_OVERRIDE")
|
return os.getenv("VERSIONEER_OVERRIDE", default="8.0.beta")
|
||||||
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
|
|
||||||
|
|
|
@ -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()
|
|
@ -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<u8, &'static str> {
|
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::I2cPca954xSelectRequest {
|
let reply = drtio::aux_transact(io, aux_mutex, linkno, &drtioaux::Packet::I2cSwitchSelectRequest {
|
||||||
destination: destination,
|
destination: destination,
|
||||||
busno: busno,
|
busno: busno,
|
||||||
address: address,
|
address: address,
|
||||||
|
|
|
@ -3,7 +3,7 @@ import os, unittest
|
||||||
from artiq.experiment import *
|
from artiq.experiment import *
|
||||||
from artiq.test.hardware_testbench import ExperimentCase
|
from artiq.test.hardware_testbench import ExperimentCase
|
||||||
from artiq.coredevice.exceptions import I2CError
|
from artiq.coredevice.exceptions import I2CError
|
||||||
from artiq.coredevice.i2c import I2CSwitch
|
from artiq.coredevice.i2c import I2CSwitch, i2c_read_byte
|
||||||
|
|
||||||
|
|
||||||
class I2CSwitchTest(EnvExperiment):
|
class I2CSwitchTest(EnvExperiment):
|
||||||
|
@ -16,7 +16,9 @@ class I2CSwitchTest(EnvExperiment):
|
||||||
passed = True
|
passed = True
|
||||||
for i in range(8):
|
for i in range(8):
|
||||||
self.i2c_switch.set(i)
|
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
|
passed = False
|
||||||
self.set_dataset("passed", passed)
|
self.set_dataset("passed", passed)
|
||||||
|
|
||||||
|
|
|
@ -11,16 +11,7 @@ def get_rev():
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def get_version():
|
def get_version():
|
||||||
override = os.getenv("VERSIONEER_OVERRIDE")
|
return os.getenv("VERSIONEER_OVERRIDE", default="8.0.beta")
|
||||||
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
|
|
||||||
|
|
||||||
def get_rev():
|
def get_rev():
|
||||||
return os.getenv("VERSIONEER_REV", default="unknown")
|
return os.getenv("VERSIONEER_REV", default="unknown")
|
||||||
|
|
Loading…
Reference in New Issue