Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7d6b93d8eb25
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f684678b91c5
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Jan 29, 2015

  1. Copy the full SHA
    c0c0137 View commit details
  2. Copy the full SHA
    45c0e28 View commit details
  3. Copy the full SHA
    f684678 View commit details
Showing with 11 additions and 6 deletions.
  1. +6 −1 artiq/master/db.py
  2. +3 −0 artiq/transforms/inline.py
  3. +2 −5 examples/rtio_skew.py
7 changes: 6 additions & 1 deletion artiq/master/db.py
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ def __init__(self, realtime_results):
self.realtime_data = Notifier({x: [] for x in realtime_results})
self.data = Notifier(dict())

def request(self, name):
def _request(self, name):
try:
return self.realtime_data[name]
except KeyError:
@@ -19,6 +19,11 @@ def request(self, name):
self.data[name] = []
return self.data[name]

def request(self, name):
r = self._request(name)
r.kernel_attr_init = False
return r

def set(self, name, value):
if name in self.realtime_data.read:
self.realtime_data[name] = value
3 changes: 3 additions & 0 deletions artiq/transforms/inline.py
Original file line number Diff line number Diff line change
@@ -433,6 +433,9 @@ def get_attr_init(attribute_namespace, loc_node):
for (_, attr), attr_info in attribute_namespace.items():
if hasattr(attr_info.obj, attr):
value = getattr(attr_info.obj, attr)
if (hasattr(value, "kernel_attr_init")
and not value.kernel_attr_init):
continue
value = ast.copy_location(value_to_ast(value), loc_node)
target = ast.copy_location(ast.Name(attr_info.mangled_name,
ast.Store()),
7 changes: 2 additions & 5 deletions examples/rtio_skew.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
from artiq import *


def print_skew(p):
print("Input/output skew: {} ns".format(p))


def print_failed():
print("Pulse was not received back")

@@ -13,6 +9,7 @@ class RTIOSkew(AutoDB):
class DBKeys:
pmt0 = Device()
ttl0 = Device()
io_skew = Result()

@kernel
def run(self):
@@ -26,4 +23,4 @@ def run(self):
if in_t < 0*s:
print_failed()
else:
print_skew(int((out_t - in_t)/(1*ns)))
self.io_skew = out_t - in_t