forked from M-Labs/artiq
1
0
Fork 0

kasli_test: add RF switch control

This commit is contained in:
Sebastien Bourdeauducq 2018-05-18 23:48:29 +08:00
parent f457b59985
commit f953bee79e
1 changed files with 17 additions and 0 deletions

View File

@ -156,14 +156,28 @@ class KasliTester(EnvExperiment):
channel.sw.on() channel.sw.on()
channel.set_att(6.) channel.set_att(6.)
@kernel
def rf_switch_wave(self, channels):
while not is_enter_pressed():
self.core.break_realtime()
# do not fill the FIFOs too much to avoid long response times
t = now_mu() - self.core.seconds_to_mu(0.2)
while self.core.get_rtio_counter_mu() < t:
pass
for channel in channels:
channel.sw.pulse(100*ms)
delay(100*ms)
# We assume that RTIO channels for switches are grouped by card. # We assume that RTIO channels for switches are grouped by card.
def test_urukuls(self): def test_urukuls(self):
print("*** Testing Urukul DDSes.") print("*** Testing Urukul DDSes.")
print("Initializing CPLDs...") print("Initializing CPLDs...")
for name, cpld in sorted(self.urukul_cplds.items(), key=lambda x: x[0]): for name, cpld in sorted(self.urukul_cplds.items(), key=lambda x: x[0]):
print(name + "...") print(name + "...")
self.init_urukul(cpld) self.init_urukul(cpld)
print("...done") print("...done")
print("Frequencies:") print("Frequencies:")
for card_n, channels in enumerate(chunker(self.urukuls, 4)): for card_n, channels in enumerate(chunker(self.urukuls, 4)):
for channel_n, (channel_name, channel_dev) in enumerate(channels): for channel_n, (channel_name, channel_dev) in enumerate(channels):
@ -173,6 +187,9 @@ class KasliTester(EnvExperiment):
print("Press ENTER when done.") print("Press ENTER when done.")
input() input()
print("Testing RF switch control. Press ENTER when done.")
self.rf_switch_wave([channel_dev for channel_name, channel_dev in self.urukuls])
def run(self): def run(self):
print("****** Kasli system tester ******") print("****** Kasli system tester ******")
print("") print("")