diff --git a/artiq/firmware/ksupport/lib.rs b/artiq/firmware/ksupport/lib.rs index ea782f21b..69d6846df 100644 --- a/artiq/firmware/ksupport/lib.rs +++ b/artiq/firmware/ksupport/lib.rs @@ -398,19 +398,21 @@ extern fn dma_playback(timestamp: i64, ptr: i32) { csr::cri_con::selected_write(0); let status = csr::rtio_dma::error_status_read(); - let timestamp = csr::rtio_dma::error_timestamp_read(); - let channel = csr::rtio_dma::error_channel_read(); - if status & rtio::RTIO_O_STATUS_UNDERFLOW != 0 { - csr::rtio_dma::error_underflow_reset_write(1); - raise!("RTIOUnderflow", - "RTIO underflow at {0} mu, channel {1}", - timestamp as i64, channel as i64, 0) - } - if status & rtio::RTIO_O_STATUS_SEQUENCE_ERROR != 0 { - csr::rtio_dma::error_sequence_error_reset_write(1); - raise!("RTIOSequenceError", - "RTIO sequence error at {0} mu, channel {1}", - timestamp as i64, channel as i64, 0) + if status != 0 { + let timestamp = csr::rtio_dma::error_timestamp_read(); + let channel = csr::rtio_dma::error_channel_read(); + if status & rtio::RTIO_O_STATUS_UNDERFLOW != 0 { + csr::rtio_dma::error_underflow_reset_write(1); + raise!("RTIOUnderflow", + "RTIO underflow at {0} mu, channel {1}", + timestamp as i64, channel as i64, 0) + } + if status & rtio::RTIO_O_STATUS_SEQUENCE_ERROR != 0 { + csr::rtio_dma::error_sequence_error_reset_write(1); + raise!("RTIOSequenceError", + "RTIO sequence error at {0} mu, channel {1}", + timestamp as i64, channel as i64, 0) + } } } } diff --git a/artiq/test/coredevice/test_rtio.py b/artiq/test/coredevice/test_rtio.py index 0aff9b979..d0ee3cec5 100644 --- a/artiq/test/coredevice/test_rtio.py +++ b/artiq/test/coredevice/test_rtio.py @@ -605,7 +605,7 @@ class DMATest(ExperimentCase): exp.playback_many(count) dt = self.dataset_mgr.get("dma_playback_time") print("dt={}, dt/count={}".format(dt, dt/count)) - self.assertLess(dt/count, 7*us) + self.assertLess(dt/count, 3*us) def test_handle_invalidation(self): exp = self.create(_DMA)