In the minimal self-contained example below, the functions f_hardcoded
, f_with_self
and f_handover
do the same thing hardware-wise. (I have tested this on my Sinara system.) Do they also function identically software-wise? Or does one have more overhead than the others? Does one of them (or 2 of them) trigger an RPC call?
from artiq.experiment import EnvExperiment, kernel, rpc
from artiq.language.types import TNone, TBool, TInt32, TStr, TList
from artiq.language.units import ns, us, ms, s
@kernel
def f_handover(led_ch_list):
for ch in led_ch_list:
ch.on()
class TestSatellites(EnvExperiment):
def build(self):
self.setattr_device("core")
self.setattr_device("led0")
self.setattr_device("led1")
self.led_ch_list = [self.led0, self.led1]
@kernel
def f_with_self(self):
for ch in self.led_ch_list:
ch.on()
@kernel
def f_hardcoded(self):
self.led0.on()
self.led1.on()
@kernel
def run(self):
self.core.reset()
# self.f_hardcoded()
# self.f_with_self()
f_handover(led_ch_list = self.led_ch_list)
delay(1*s)
self.led0.off()
self.led1.off()