From 315338fca93f73727702fe4724fed577df1b5feb Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Mon, 12 Jun 2017 20:35:47 +0200 Subject: [PATCH] test/sawg: test HBF overshoot, fix sim patching --- artiq/gateware/test/dsp/test_sawg_fe.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/artiq/gateware/test/dsp/test_sawg_fe.py b/artiq/gateware/test/dsp/test_sawg_fe.py index 4031ca1f9..c6725656a 100644 --- a/artiq/gateware/test/dsp/test_sawg_fe.py +++ b/artiq/gateware/test/dsp/test_sawg_fe.py @@ -37,6 +37,7 @@ class SAWGTest(unittest.TestCase): core_language.set_time_manager(sim_time.Manager()) self.rtio_manager = RTIOManager() self.rtio_manager.patch(spline) + self.rtio_manager.patch(sawg) self.core = sim_devices.Core({}) self.core.coarse_ref_period = 6.66666 self.t = self.core.coarse_ref_period @@ -47,6 +48,7 @@ class SAWGTest(unittest.TestCase): def tearDown(self): self.rtio_manager.unpatch(spline) + self.rtio_manager.unpatch(sawg) def test_instantiate(self): pass @@ -223,3 +225,24 @@ class SAWGTest(unittest.TestCase): import matplotlib.pyplot as plt plt.plot(out) plt.show() + + def test_fir_overflow(self): + MHz = 1e-3 + ns = 1. + f1 = self.driver.frequency1 + a1 = self.driver.amplitude1 + p1 = self.driver.phase1 + cfg = self.driver.config + f1.set(1*MHz) + a1.set(.99) + delay(100*ns) + p1.set(.5) + delay(100*ns) + a1.set(0) + + out = self.run_channel(self.rtio_manager.outputs) + out = sum(out, []) + if False: + import matplotlib.pyplot as plt + plt.plot(out) + plt.show()