forked from M-Labs/artiq
test: add test for RTIO counter (#883)
This commit is contained in:
parent
e0e795f11c
commit
ed0fbd5662
|
@ -18,6 +18,17 @@ artiq_low_latency = os.getenv("ARTIQ_LOW_LATENCY")
|
||||||
artiq_in_devel = os.getenv("ARTIQ_IN_DEVEL")
|
artiq_in_devel = os.getenv("ARTIQ_IN_DEVEL")
|
||||||
|
|
||||||
|
|
||||||
|
class RTIOCounter(EnvExperiment):
|
||||||
|
def build(self):
|
||||||
|
self.setattr_device("core")
|
||||||
|
|
||||||
|
@kernel
|
||||||
|
def run(self):
|
||||||
|
t0 = self.core.get_rtio_counter_mu()
|
||||||
|
t1 = self.core.get_rtio_counter_mu()
|
||||||
|
self.set_dataset("dt", self.core.mu_to_seconds(t1 - t0))
|
||||||
|
|
||||||
|
|
||||||
class PulseNotReceived(Exception):
|
class PulseNotReceived(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -357,6 +368,12 @@ class HandoverException(EnvExperiment):
|
||||||
|
|
||||||
|
|
||||||
class CoredeviceTest(ExperimentCase):
|
class CoredeviceTest(ExperimentCase):
|
||||||
|
def test_rtio_counter(self):
|
||||||
|
self.execute(RTIOCounter)
|
||||||
|
dt = self.dataset_mgr.get("dt")
|
||||||
|
self.assertGreater(dt, 50*ns)
|
||||||
|
self.assertLess(dt, 200*ns)
|
||||||
|
|
||||||
def test_loopback(self):
|
def test_loopback(self):
|
||||||
self.execute(Loopback)
|
self.execute(Loopback)
|
||||||
rtt = self.dataset_mgr.get("rtt")
|
rtt = self.dataset_mgr.get("rtt")
|
||||||
|
|
Loading…
Reference in New Issue