test/sawg: check 48 bit frequency

This commit is contained in:
Robert Jördens 2016-11-30 11:21:25 +01:00
parent ea04fb2704
commit 01057dfb6d

View File

@ -1,6 +1,7 @@
import unittest import unittest
import migen as mg import migen as mg
from numpy import int32
from artiq.coredevice import sawg from artiq.coredevice import sawg
from artiq.language import (at_mu, now_mu, delay_mu, delay, from artiq.language import (at_mu, now_mu, delay_mu, delay,
@ -54,17 +55,20 @@ class SAWGTest(unittest.TestCase):
d.offset.set(.9) d.offset.set(.9)
delay_mu(2) delay_mu(2)
d.frequency0.set64(.1) d.frequency0.set64(.1)
d.frequency1.set64(.1)
delay_mu(2) delay_mu(2)
d.offset.set(0) d.offset.set(0)
v = int(round((1 << 48) * .1))
self.assertEqual( self.assertEqual(
self.rtio_manager.outputs, [ self.rtio_manager.outputs, [
(0, 1, 0, int(round( (0., 1, 0, int(round(
(1 << self.driver.offset.width - 1)*.9))), (1 << self.driver.offset.width - 1)*.9))),
(2, 8, 0, [int(round( (2., 8, 0, [int(round(
(1 << self.driver.frequency0.width) / (1 << self.driver.frequency0.width) /
self.channel.parallelism*.1)), self.channel.parallelism*.1)),
0]), 0]),
(4, 1, 0, 0), (2., 3, 0, [int32(v), int32(v >> 32)]),
(4., 1, 0, 0),
]) ])
def run_channel(self, events): def run_channel(self, events):