We are trying to write an experiment that generates outputs from an SUServo-mode Urukul (Urukul 0) and a non-SUServo-mode Urukul (Urukul 2). However, when we try to initialize both in the same experiment, we get the error below during compilation:
root:While compiling <repository>\depreciated_experiments\urukul_test_orig.py
<synthesized>:1:1-1:62: error: host object has an attribute 'io_update' of type <instance artiq.coredevice.urukul._RegIOUpdate {
__objectid__: numpy.int32
}>, which is different from previously inferred type <instance artiq.coredevice.ttl.TTLOut {
__objectid__: numpy.int32
}> for the same attribute
'<artiq.coredevice.urukul.CPLD object at 0x00000170AF7DB648>'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<repository>\depreciated_experiments\urukul_test_orig.py:50:1: note: expanded from here
def run(self):
^
The minimal code required to reproduce this error is shown below
class UrukulTestMinimal(EnvExperiment):
def build(self):
self.setattr_device("core")
self.setattr_device("urukul0_cpld")
self.setattr_device("suservo0")
self.setattr_device("urukul2_cpld")
@kernel
def run(self):
self.core.reset()
self.urukul2_cpld.init()
self.suservo0.init()
It looks like this is a known issue with using two Urukuls in different configurations (issue #1207 on the ARTIQ GitHub) and one that doesn't have a general solution yet. Has anyone else run into a similar issue in their own experiments, and if so, what kinds of workarounds did you use?
Edit: We got in touch with a group that's worked around this problem, and they let us know that one solution is to run SUServo from a separate experiment class (called SUServoControl in the code below) which inherits from a main class that the standalone Urukul is controlled from (UrukulControl). An attempt at making code like this is shown below, but unfortunately, running SUServoControl produces the same error as above. It's not immediately clear to me what the issue is.
class UrukulControl(EnvExperiment):
def build(self):
self.setattr_device("core")
self.setattr_device("urukul2_cpld")
self.setattr_device("urukul2_ch0")
self.setattr_device("urukul0_cpld")
self.setattr_device("suservo0")
self.setattr_device("suservo0_ch0")
@kernel
def urukul_init(self):
self.urukul2_cpld.init()
self.urukul2_ch0.init()
@kernel
def run(self):
# prepare core
self.core.reset()
# initialize Urukul CPLD and DDS
self.urukul_init()
# initialize suservo
self.suservo_init()
class SUServoControl(UrukulDummy):
@kernel
def suservo_init(self):
self.suservo0.init()
self.suservo0.set_config(enable=1)