diff --git a/artiq/coredevice/sawg.py b/artiq/coredevice/sawg.py index 4ea97e23f..c781c93de 100644 --- a/artiq/coredevice/sawg.py +++ b/artiq/coredevice/sawg.py @@ -281,18 +281,18 @@ class SAWG: width = 16 time_width = 16 cordic_gain = 1.646760258057163 # Cordic(width=16, guard=None).gain - cordic_gain *= 1.01 # leave a bit of headroom + head_room = 1.001 self.config = Config(channel_base, self.core, cordic_gain) self.offset = Spline(width, time_width, channel_base + 1, - self.core, 2.) + self.core, 2.*head_room) self.amplitude1 = Spline(width, time_width, channel_base + 2, - self.core, 2*cordic_gain**2) + self.core, 2*head_room*cordic_gain**2) self.frequency1 = Spline(3*width, time_width, channel_base + 3, self.core, 1/self.core.coarse_ref_period) self.phase1 = Spline(width, time_width, channel_base + 4, self.core, 1.) self.amplitude2 = Spline(width, time_width, channel_base + 5, - self.core, 2*cordic_gain**2) + self.core, 2*head_room*cordic_gain**2) self.frequency2 = Spline(3*width, time_width, channel_base + 6, self.core, 1/self.core.coarse_ref_period) self.phase2 = Spline(width, time_width, channel_base + 7, diff --git a/artiq/gateware/test/dsp/test_sawg_fe.py b/artiq/gateware/test/dsp/test_sawg_fe.py index b905fea37..5aa3e1241 100644 --- a/artiq/gateware/test/dsp/test_sawg_fe.py +++ b/artiq/gateware/test/dsp/test_sawg_fe.py @@ -68,8 +68,7 @@ class SAWGTest(unittest.TestCase): v = int(round((1 << 48) * .1 * self.t)) self.assertEqual( self.rtio_manager.outputs, [ - (0., 1, 0, int(round( - (1 << self.driver.offset.width - 1)*.9))), + (0., 1, 0, int(round(self.driver.offset.scale*.9))), (2.*self.t, 8, 0, int(round( (1 << self.driver.frequency0.width) * self.t/self.channel.parallelism*.1))),