{"action":"created","issue":{"url":"https://api.github.com/repos/m-labs/artiq/issues/178","labels_url":"https://api.github.com/repos/m-labs/artiq/issues/178/labels{/name}","comments_url":"https://api.github.com/repos/m-labs/artiq/issues/178/comments","events_url":"https://api.github.com/repos/m-labs/artiq/issues/178/events","html_url":"https://github.com/m-labs/artiq/issues/178","id":118507446,"number":178,"title":"PDQ2/wavesynth","user":{"login":"kgilmo","id":15162088,"avatar_url":"https://avatars.githubusercontent.com/u/15162088?v=3","gravatar_id":"","url":"https://api.github.com/users/kgilmo","html_url":"https://github.com/kgilmo","followers_url":"https://api.github.com/users/kgilmo/followers","following_url":"https://api.github.com/users/kgilmo/following{/other_user}","gists_url":"https://api.github.com/users/kgilmo/gists{/gist_id}","starred_url":"https://api.github.com/users/kgilmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgilmo/subscriptions","organizations_url":"https://api.github.com/users/kgilmo/orgs","repos_url":"https://api.github.com/users/kgilmo/repos","events_url":"https://api.github.com/users/kgilmo/events{/privacy}","received_events_url":"https://api.github.com/users/kgilmo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/m-labs/artiq/labels/area:controllers","name":"area:controllers","color":"207de5"},{"url":"https://api.github.com/repos/m-labs/artiq/labels/prio:3-serious","name":"prio:3-serious","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"jordens","id":1338946,"avatar_url":"https://avatars.githubusercontent.com/u/1338946?v=3","gravatar_id":"","url":"https://api.github.com/users/jordens","html_url":"https://github.com/jordens","followers_url":"https://api.github.com/users/jordens/followers","following_url":"https://api.github.com/users/jordens/following{/other_user}","gists_url":"https://api.github.com/users/jordens/gists{/gist_id}","starred_url":"https://api.github.com/users/jordens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordens/subscriptions","organizations_url":"https://api.github.com/users/jordens/orgs","repos_url":"https://api.github.com/users/jordens/repos","events_url":"https://api.github.com/users/jordens/events{/privacy}","received_events_url":"https://api.github.com/users/jordens/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-11-24T00:47:37Z","updated_at":"2015-12-17T16:10:07Z","closed_at":null,"body":"The versions of the PDQ2 driver in Artiq and in the ions gitweb are different. In the gitweb history, commit 3d93519b33f81b2be79934019f0cf15447374bfd shows a merge with the artiq version, though they are no longer the same. The issue is with the program_frame definition, which seems buggy in the artiq version. Here's the difference:\r\n\r\n```python\r\n\r\n--- a/qc/hardware/pdq2.py\r\n+++ b/qc/hardware/pdq2.py\r\n@@ -104,7 +104,6 @@ class Channel:\r\n         del self.segments[:]\r\n \r\n     def new_segment(self):\r\n-        # assert len(self.segments) < self.num_frames\r\n         segment = Segment()\r\n         self.segments.append(segment)\r\n         return segment\r\n@@ -200,24 +199,24 @@ class Pdq2:\r\n         for i, line in enumerate(frame_data):  # segments are concatenated\r\n             dac_divider = line.get(\"dac_divider\", 1)\r\n             shift = int(log(dac_divider, 2))\r\n-            assert 2**shift == dac_divider\r\n+            if 2**shift != dac_divider:\r\n+                raise ValueError(\"only power-of-two dac_dividers supported\")\r\n             duration = line[\"duration\"]\r\n             trigger = line.get(\"trigger\", False)\r\n-            if i == 0:\r\n-                assert trigger\r\n-                #trigger = False  # use wait on the last line\r\n-                # jumping through frame table takes 3-4 cycles\r\n-                # just ensure that time betweeen triggers is always longer than this\r\n-                # and that the first trigger covers both, the end on the last and the\r\n-                # trigger on the first\r\n-            eof = i == len(frame_data) - 1\r\n             for segment, data in zip(segments, line[\"channel_data\"]):\r\n-                assert len(data) == 1\r\n+                if len(data) != 1:\r\n+                    raise ValueError(\"only one target per channel and line \"\r\n+                                     \"supported\")\r\n                 for target, target_data in data.items():\r\n                     getattr(segment, target)(\r\n-                        shift=shift, duration=duration,\r\n-                        trigger=trigger, wait=eof, jump=eof,\r\n+                        shift=shift, duration=duration, trigger=trigger,\r\n                         **target_data)\r\n+        # append an empty line to stall the memory reader before jumping\r\n+        # through the frame table (`wait` does not prevent reading\r\n+        # the next line)\r\n+        for segment in segments:\r\n+            segment.line(typ=3, data=b\"\", trigger=True, duration=10,\r\n+                         jump=True)\r\n         return segments\r\n \r\n     def program(self, program):\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/m-labs/artiq/issues/comments/165496372","html_url":"https://github.com/m-labs/artiq/issues/178#issuecomment-165496372","issue_url":"https://api.github.com/repos/m-labs/artiq/issues/178","id":165496372,"user":{"login":"dhslichter","id":9222487,"avatar_url":"https://avatars.githubusercontent.com/u/9222487?v=3","gravatar_id":"","url":"https://api.github.com/users/dhslichter","html_url":"https://github.com/dhslichter","followers_url":"https://api.github.com/users/dhslichter/followers","following_url":"https://api.github.com/users/dhslichter/following{/other_user}","gists_url":"https://api.github.com/users/dhslichter/gists{/gist_id}","starred_url":"https://api.github.com/users/dhslichter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhslichter/subscriptions","organizations_url":"https://api.github.com/users/dhslichter/orgs","repos_url":"https://api.github.com/users/dhslichter/repos","events_url":"https://api.github.com/users/dhslichter/events{/privacy}","received_events_url":"https://api.github.com/users/dhslichter/received_events","type":"User","site_admin":false},"created_at":"2015-12-17T16:10:07Z","updated_at":"2015-12-17T16:10:07Z","body":"Would the notion be to replace the USB communications with SPI communications, or to have them be supplementary?  In other words, will the SPI be used just to communicate frame selection information or would it be more generally for waveform data upload/modification?  If the latter, we need to ensure that the core device is not unduly bogged down by communicating waveform data to the PDQs.  In addition, it seems it would make sense to implement the SPI in such a manner that multiple PDQs can share the same serial bus, lest we run out of TTL lines.  I assume this would be a 3-wire SPI, leaving one remaining input on the PDQ cards to provide a TTL trigger.  "}}