From 58e0e670fc7d61cdaa6fea9d6434d2d047e441a7 Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Wed, 9 Mar 2016 15:39:16 +0100 Subject: [PATCH] tests: test spi business --- artiq/test/coredevice/test_spi.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 artiq/test/coredevice/test_spi.py diff --git a/artiq/test/coredevice/test_spi.py b/artiq/test/coredevice/test_spi.py new file mode 100644 index 000000000..ac1838d5d --- /dev/null +++ b/artiq/test/coredevice/test_spi.py @@ -0,0 +1,24 @@ +from artiq.experiment import * +from artiq.test.hardware_testbench import ExperimentCase + + +class Busy(EnvExperiment): + def build(self): + self.setattr_device("core") + self.setattr_device("spi0") + self.setattr_device("led") + + @kernel + def run(self): + self.spi0.set_config_mu() + delay(-8*ns) + self.spi0.set_config_mu() # causes the error + self.led.on() + self.led.sync() # registers the error + self.core.break_realtime() + self.spi0.set_config_mu() # raises the error + + +class SPITest(ExperimentCase): + def test_busy(self): + self.execute(Busy)