From 16ff190731bd6c1e6aa62f8c57388a5b8a3263d7 Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Tue, 31 Mar 2015 02:21:19 -0600 Subject: [PATCH] pdq2: cleanup unittest --- artiq/test/pdq2.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/artiq/test/pdq2.py b/artiq/test/pdq2.py index 5c40d6aeb..0b9c0d716 100644 --- a/artiq/test/pdq2.py +++ b/artiq/test/pdq2.py @@ -5,10 +5,7 @@ import io from artiq.devices.pdq2.driver import Pdq2 -no_hardware = bool(os.getenv("ARTIQ_NO_HARDWARE")) \ - or bool(os.getenv("ARTIQ_NO_PERIPHERALS")) - -pdq2_source = os.getenv("ARTIQ_PDQ2_SOURCE") +pdq3_source = os.getenv("ARTIQ_PDQ2_SOURCE") class TestPdq2(unittest.TestCase): @@ -21,6 +18,7 @@ class TestPdq2(unittest.TestCase): self.assertEqual(buf, b"\xa5\x00") def test_program(self): + # about 0.14 ms self.dev.program(_test_program) @unittest.skipUnless(pdq2_source, "no pdq2 source and gateware") @@ -40,9 +38,9 @@ class TestPdq2(unittest.TestCase): import numpy as np tb = Pdq2Sim(buf) tb.ctrl_pads.trigger.reset = 0 - run_simulation(tb, vcd_name="pdq2.vcd", ncycles=700) + run_simulation(tb, vcd_name="pdq2.vcd", ncycles=len(buf) + 250) out = np.array(tb.outputs, np.uint16).view(np.int16) - for outi in out[len(buf):].T: + for outi in out[len(buf) + 100:].T: plt.step(np.arange(len(outi)), outi) plt.show()