From f2acf95f98170ffec73b4e9fdac367fb19c7156d Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Wed, 24 Feb 2016 15:48:35 +0100 Subject: [PATCH] pdq2.mediator: err on short segments --- artiq/devices/pdq2/mediator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/artiq/devices/pdq2/mediator.py b/artiq/devices/pdq2/mediator.py index c73edf392..570030d1e 100644 --- a/artiq/devices/pdq2/mediator.py +++ b/artiq/devices/pdq2/mediator.py @@ -5,6 +5,7 @@ frame_setup = 20*ns trigger_duration = 50*ns sample_period = 10*ns delay_margin_factor = 1 + 1e-4 +minimum_duration = 100*ns class FrameActiveError(Exception): @@ -103,6 +104,9 @@ class _Frame: def _get_program(self): r = [] for segment in self.segments: + if segment.duration < minimum_duration: + raise ValueError(("Segment too short ({:g} s), trigger might " + "overlap").format(segment.duration)) segment_program = [ { "dac_divider": dac_divider,