In our lab, we have two Artiq chassis: one with the Kasli 2.0 controller and another with Kasli-SoC(which we recently purchased).
When I run the following code on both Artiq systems, I get different results:
from artiq.coredevice.urukul import *
class DDSTest(EnvExperiment):
def build(self):
self.setattr_device("core")
self.setattr_device("urukul0_ch0")
@kernel
def run(self):
self.core.reset()
delay(1 * ms)
self.urukul0_ch0.cpld.init()
self.urukul0_ch0.init()
self.urukul0_ch0.set_att(0.0)
self.urukul0_ch0.set(frequency=100 * MHz, phase=0.5, amplitude=0.24)
delay(10 * ms)
self.urukul0_ch0.sw.on()
delay(3 * s)
self.urukul0_ch0.sw.off()
On the Kasli 2.0 chassis, everything works fine, and I get the expected output. However, on the Kasli-SoC, I encounter an exception:
INFO:dashboard:artiq.dashboard.experiments:Submitted 'repo:test_dds/test2', RID is 34
ERROR:worker(34,test_dds2.py):root:While compiling <repository>\test_dds\test_dds2.py
<synthesized>:1:1-1:64: error: host object does not have an attribute 'sw'
`<artiq.coredevice.ad9910.AD9910 object at 0x000001D6CEFF6070>`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<repository>\test_dds\test_dds2.py:12:1: note: expanded from here
def run(self):
^
<repository>\test_dds\test_dds2.py:20:9-20:28: note: attribute accessed here
self.urukul0_ch0.sw.on()
^^^^^^^^^^^^^^^^^^^
ERROR:master:artiq.master.scheduler:got worker exception in run stage, deleting RID 34
I checked the device_db.py files for both and noticed some differences:
In the Kasli 2.0 device_db.py file, "sw_device" is mapped to "ttl_urukul0_sw0":
device_db["ttl_urukul0_sw0"] = {
"type": "local",
"module": "artiq.coredevice.ttl",
"class": "TTLOut",
"arguments": {"channel": 0x000012}
}
device_db["urukul0_ch0"] = {
"type": "local",
"module": "artiq.coredevice.ad9910",
"class": "AD9910",
"arguments": {
"pll_n": 32,
"chip_select": 4,
"cpld_device": "urukul0_cpld",
"sw_device": "ttl_urukul0_sw0"
}
}
But in the Kasli-SoC file (which I copied from the Intel NUC provided by M-Lab without modification), there is no "ttl_urukul0_sw0" item, and the "urukul0_ch0" entry lacks the "sw_device":
device_db["urukul0_ch0"] = {
"type": "local",
"module": "artiq.coredevice.ad9910",
"class": "AD9910",
"arguments": {
"pll_n": 32,
"chip_select": 4,
"cpld_device": "urukul0_cpld"
}
}
How can I turn on "urukul0_ch0" on the Kasli-SoC chassis?