I am running into a similiar issue with two ad9910 devices that have different rf_switch configurations (one has dedicated rf switches, the other does not). It is only a warning though. If I understand correctly, this has not been fixed in the current stable release (i.e. ARTIQ 6)? @whitequark said something about a workaround, but is this something, that can be implemented on the user side?
Code:
class Startup(EnvExperiment):
"""Startup kernel.
Resets and initializes devices and establishes default parameters.
This should be used as the persistent startup kernel and can also be used
to re-initialize devices.
"""
def build(self):
self.setattr_device("core")
self.setattr_device("urukul5_cpld")
self.setattr_device("urukul5_ch0")
self.setattr_device("urukul5_ch1")
self.setattr_device("urukul5_ch2")
self.setattr_device("urukul5_ch3")
self.setattr_device("urukul6_cpld")
self.setattr_device("urukul6_ch0")
self.setattr_device("urukul6_ch1")
self.setattr_device("urukul6_ch2")
self.setattr_device("urukul6_ch3")
@kernel
def run(self):
self.core.reset()
while not self.core.get_rtio_destination_status(0):
pass
while not self.core.get_rtio_destination_status(1):
pass
self.core.break_realtime()
self.urukul5_cpld.init()
delay(1*ms)
self.urukul5_ch0.init()
delay(1*ms)
self.urukul5_ch1.init()
delay(1*ms)
self.urukul5_ch2.init()
delay(1*ms)
self.urukul5_ch3.init()
delay(1*ms)
self.urukul6_cpld.init()
delay(1*ms)
self.urukul6_ch0.init()
delay(1*ms)
self.urukul6_ch1.init()
delay(1*ms)
self.urukul6_ch2.init()
delay(1*ms)
self.urukul6_ch3.init()
Warning:
root:While compiling <repository>\startup.py
<synthesized>:1:1-1:64: warning: object <artiq.coredevice.ad9910.AD9910 object at 0x00000171ED013708> of type <instance artiq.coredevice.ad9910.AD9910> does not declare attribute(s) 'sw' as kernel invariant, but other objects of the same type do; the invariant annotation on other objects will be ignored
`<artiq.coredevice.ad9910.AD9910 object at 0x00000171ED013708>`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<repository>\startup.py:79:1: note: expanded from here
def run(self):
^
<repository>\startup.py:160:9-160:25: note: while inferring a type for an attribute 'urukul6_ch0' of a host object
self.urukul6_ch0.init()
^^^^^^^^^^^^^^^^
Section of device_db:
device_db["eeprom_urukul5"]={
"type": "local",
"module": "artiq.coredevice.kasli_i2c",
"class": "KasliEEPROM",
"arguments": {"port": "EEM8"}
}
device_db["spi_urukul5"]={
"type": "local",
"module": "artiq.coredevice.spi2",
"class": "SPIMaster",
"arguments": {"channel": 0x010024}
}
device_db["ttl_urukul5_io_update"] = {
"type": "local",
"module": "artiq.coredevice.ttl",
"class": "TTLOut",
"arguments": {"channel": 0x010025}
}
device_db["ttl_urukul5_sw0"] = {
"type": "local",
"module": "artiq.coredevice.ttl",
"class": "TTLOut",
"arguments": {"channel": 0x010026}
}
device_db["ttl_urukul5_sw1"] = {
"type": "local",
"module": "artiq.coredevice.ttl",
"class": "TTLOut",
"arguments": {"channel": 0x010027}
}
device_db["ttl_urukul5_sw2"] = {
"type": "local",
"module": "artiq.coredevice.ttl",
"class": "TTLOut",
"arguments": {"channel": 0x010028}
}
device_db["ttl_urukul5_sw3"] = {
"type": "local",
"module": "artiq.coredevice.ttl",
"class": "TTLOut",
"arguments": {"channel": 0x010029}
}
device_db["urukul5_cpld"] = {
"type": "local",
"module": "artiq.coredevice.urukul",
"class": "CPLD",
"arguments": {
"spi_device": "spi_urukul5",
"sync_device": None,
"io_update_device": "ttl_urukul5_io_update",
"refclk": 100000000.0,
"clk_sel": 1
}
}
device_db["urukul5_ch0"] = {
"type": "local",
"module": "artiq.coredevice.ad9910",
"class": "AD9910",
"arguments": {
"pll_n": 40,
"chip_select": 4,
"cpld_device": "urukul5_cpld",
"sw_device": "ttl_urukul5_sw0"
}
}
device_db["urukul5_ch1"] = {
"type": "local",
"module": "artiq.coredevice.ad9910",
"class": "AD9910",
"arguments": {
"pll_n": 40,
"chip_select": 5,
"cpld_device": "urukul5_cpld",
"sw_device": "ttl_urukul5_sw1"
}
}
device_db["urukul5_ch2"] = {
"type": "local",
"module": "artiq.coredevice.ad9910",
"class": "AD9910",
"arguments": {
"pll_n": 40,
"chip_select": 6,
"cpld_device": "urukul5_cpld",
"sw_device": "ttl_urukul5_sw2"
}
}
device_db["urukul5_ch3"] = {
"type": "local",
"module": "artiq.coredevice.ad9910",
"class": "AD9910",
"arguments": {
"pll_n": 40,
"chip_select": 7,
"cpld_device": "urukul5_cpld",
"sw_device": "ttl_urukul5_sw3"
}
}
device_db["eeprom_urukul6"]={
"type": "local",
"module": "artiq.coredevice.kasli_i2c",
"class": "KasliEEPROM",
"arguments": {"port": "EEM9"}
}
device_db["spi_urukul6"]={
"type": "local",
"module": "artiq.coredevice.spi2",
"class": "SPIMaster",
"arguments": {"channel": 0x01002a}
}
device_db["ttl_urukul6_io_update"] = {
"type": "local",
"module": "artiq.coredevice.ttl",
"class": "TTLOut",
"arguments": {"channel": 0x01002b}
}
device_db["urukul6_cpld"] = {
"type": "local",
"module": "artiq.coredevice.urukul",
"class": "CPLD",
"arguments": {
"spi_device": "spi_urukul6",
"sync_device": None,
"io_update_device": "ttl_urukul6_io_update",
"refclk": 100000000.0,
"clk_sel": 1
}
}
device_db["urukul6_ch0"] = {
"type": "local",
"module": "artiq.coredevice.ad9910",
"class": "AD9910",
"arguments": {
"pll_n": 40,
"chip_select": 4,
"cpld_device": "urukul6_cpld"
}
}
device_db["urukul6_ch1"] = {
"type": "local",
"module": "artiq.coredevice.ad9910",
"class": "AD9910",
"arguments": {
"pll_n": 40,
"chip_select": 5,
"cpld_device": "urukul6_cpld"
}
}
device_db["urukul6_ch2"] = {
"type": "local",
"module": "artiq.coredevice.ad9910",
"class": "AD9910",
"arguments": {
"pll_n": 40,
"chip_select": 6,
"cpld_device": "urukul6_cpld"
}
}
device_db["urukul6_ch3"] = {
"type": "local",
"module": "artiq.coredevice.ad9910",
"class": "AD9910",
"arguments": {
"pll_n": 40,
"chip_select": 7,
"cpld_device": "urukul6_cpld"
}
}