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

Commits on Nov 16, 2015

  1. compiler.iodelay: add forgotten Conv.__eq__.

    whitequark committed Nov 16, 2015
    Copy the full SHA
    629aace View commit details
  2. compiler.iodelay: fix typo in BinOp.__eq__.

    whitequark committed Nov 16, 2015
    Copy the full SHA
    e67705d View commit details
  3. compiler.types: dump type variable iodelay explicitly.

    whitequark committed Nov 16, 2015
    Copy the full SHA
    a2d73c8 View commit details
Showing with 9 additions and 3 deletions.
  1. +6 −1 artiq/compiler/iodelay.py
  2. +3 −2 artiq/compiler/types.py
7 changes: 6 additions & 1 deletion artiq/compiler/iodelay.py
Original file line number Diff line number Diff line change
@@ -85,6 +85,11 @@ def __init__(self, operand, ref_period):
assert isinstance(ref_period, float)
self.operand, self.ref_period = operand, ref_period

def __eq__(lhs, rhs):
return rhs.__class__ == lhs.__class__ and \
lhs.ref_period == rhs.ref_period and \
lhs.operand == rhs.operand

def free_vars(self):
return self.operand.free_vars()

@@ -116,7 +121,7 @@ def __str__(self):
return "{} {} {}".format(lhs, self._symbol, rhs)

def __eq__(lhs, rhs):
return rhs.__class__ == lhs.__class__ and lhs.lhs == rhs.lhs and rhs.lhs == rhs.rhs
return rhs.__class__ == lhs.__class__ and lhs.lhs == rhs.lhs and lhs.rhs == rhs.rhs

def eval(self, env):
return self.__class__._op(self.lhs.eval(env), self.rhs.eval(env))
5 changes: 3 additions & 2 deletions artiq/compiler/types.py
Original file line number Diff line number Diff line change
@@ -623,8 +623,9 @@ def name(self, typ):
signature = "(%s)->%s" % (", ".join(args), self.name(typ.ret))

delay = typ.delay.find()
if not (isinstance(delay, TVar) or
delay.is_fixed() and iodelay.is_zero(delay.duration)):
if isinstance(delay, TVar):
signature += " delay({})".format(self.name(delay))
elif not (delay.is_fixed() and iodelay.is_zero(delay.duration)):
signature += " " + self.name(delay)

if isinstance(typ, TRPCFunction):