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: e53f26dba002
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: d3f0059cab5f
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Nov 23, 2015

  1. transforms.iodelay_estimator: correctly handle functions with empty b…

    …ody.
    whitequark committed Nov 23, 2015
    Copy the full SHA
    9bc62fa View commit details
  2. compiler.iodelay: correctly fold max(0, [0, ]...).

    whitequark committed Nov 23, 2015
    Copy the full SHA
    d3f0059 View commit details
Showing with 4 additions and 2 deletions.
  1. +2 −1 artiq/compiler/iodelay.py
  2. +2 −1 artiq/compiler/transforms/iodelay_estimator.py
3 changes: 2 additions & 1 deletion artiq/compiler/iodelay.py
Original file line number Diff line number Diff line change
@@ -208,6 +208,7 @@ class Max(Expr):
def __init__(self, operands):
assert isinstance(operands, list)
assert all([isinstance(operand, Expr) for operand in operands])
assert operands != []
self.operands = operands

def __str__(self):
@@ -230,7 +231,7 @@ def fold(self, vars=None):
consts.append(operand.value)
elif operand not in exprs:
exprs.append(operand)
if any(consts):
if len(consts) > 0:
exprs.append(Const(max(consts)))
if len(exprs) == 1:
return exprs[0]
3 changes: 2 additions & 1 deletion artiq/compiler/transforms/iodelay_estimator.py
Original file line number Diff line number Diff line change
@@ -220,7 +220,8 @@ def visit_With(self, node):
delays.append(self.current_delay)
self.current_delay = old_delay

self.current_delay += iodelay.Max(delays)
if any(delays):
self.current_delay += iodelay.Max(delays)
except _IndeterminateDelay as error:
# Interleave failures inside `with` statements are hard failures,
# since there's no chance that the code will never actually execute