Skip to content

Commit

Permalink
test: bring back test_loopback_count (fixes #295).
Browse files Browse the repository at this point in the history
whitequark committed Feb 25, 2016
1 parent 51e831c commit 8e77e56
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions artiq/test/coredevice/test_rtio.py
Original file line number Diff line number Diff line change
@@ -101,6 +101,28 @@ def run(self):
pass


class LoopbackCount(EnvExperiment):
def build(self):
self.setattr_device("core")
self.setattr_device("ttl_inout")

This comment has been minimized.

Copy link
@sbourdeauducq

sbourdeauducq Feb 26, 2016

Member

That won't work. I'll bring the FMC adapter into the office so that you can properly run those tests (alternatively, use Pipistrello).

self.setattr_argument("npulses")

def set_count(self, count):
self.set_dataset("count", count)

@kernel
def run(self):
self.loop_out.output()
delay(5*us)
with parallel:
self.loop_in.gate_rising(10*us)
with sequential:
for i in range(self.npulses):
delay(25*ns)
self.loop_out.pulse(25*ns)
self.set_dataset("count", self.loop_in.count())


class Underflow(EnvExperiment):
def build(self):
self.setattr_device("core")
@@ -182,6 +204,12 @@ def test_pulse_rate(self):
self.assertGreater(rate, 100*ns)
self.assertLess(rate, 2500*ns)

def test_loopback_count(self):
npulses = 2
self.execute(LoopbackCount, npulses=npulses)
count = self.dataset_mgr.get("count")
self.assertEqual(count, npulses)

def test_underflow(self):
with self.assertRaises(RTIOUnderflow):
self.execute(Underflow)

0 comments on commit 8e77e56

Please sign in to comment.