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: 178ff74da2bf
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: 37b80247f157
Choose a head ref
  • 2 commits
  • 8 files changed
  • 1 contributor

Commits on Nov 23, 2015

  1. Copy the full SHA
    abb36b4 View commit details
  2. lit-test: fix breakage from abb36b4 and 02f2763.

    whitequark committed Nov 23, 2015
    Copy the full SHA
    37b8024 View commit details
4 changes: 2 additions & 2 deletions artiq/compiler/iodelay.py
Original file line number Diff line number Diff line change
@@ -114,12 +114,12 @@ def __str__(self):
return "s->mu({})".format(self.operand)

def eval(self, env):
return self.operand.eval(env) / self.ref_period
return int(self.operand.eval(env) / self.ref_period)

def fold(self, vars=None):
operand = self.operand.fold(vars)
if isinstance(operand, Const):
return Const(operand.value / self.ref_period)
return Const(int(operand.value / self.ref_period))
else:
return SToMU(operand, ref_period=self.ref_period)

4 changes: 2 additions & 2 deletions lit-test/test/iodelay/call.py
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@
# RUN: OutputCheck %s --file-to-check=%t

def f():
delay(1.0)
delay_mu(1)

# CHECK-L: g: ()->NoneType delay(s->mu(2.0) mu)
# CHECK-L: g: ()->NoneType delay(2 mu)
def g():
f()
f()
2 changes: 1 addition & 1 deletion lit-test/test/iodelay/class.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# RUN: %python -m artiq.compiler.testbench.signature %s >%t
# RUN: OutputCheck %s --file-to-check=%t

# CHECK-L: g: (i:<instance c {}>)->NoneType delay(s->mu(1.0) mu)
# CHECK-L: g: (i:<instance c {}>)->NoneType delay(1000000 mu)
def g(i):
i.f(1.0)

8 changes: 4 additions & 4 deletions lit-test/test/iodelay/linear.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# RUN: %python -m artiq.compiler.testbench.signature %s >%t
# RUN: OutputCheck %s --file-to-check=%t

# CHECK-L: f: ()->NoneType delay(s->mu(1.0) + 1000 mu)
# CHECK-L: f: ()->NoneType delay(1001000 mu)
def f():
delay(1.0)
delay_mu(1000)

# CHECK-L: g: ()->NoneType delay(s->mu(5.0) mu)
# CHECK-L: g: ()->NoneType delay(3 mu)
def g():
delay(1.0)
delay(2.0 * 2)
delay_mu(1)
delay_mu(2)
8 changes: 4 additions & 4 deletions lit-test/test/iodelay/loop.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# RUN: %python -m artiq.compiler.testbench.signature %s >%t
# RUN: OutputCheck %s --file-to-check=%t

# CHECK-L: f: ()->NoneType delay(s->mu(1.5) * 10 mu)
# CHECK-L: f: ()->NoneType delay(30 mu)
def f():
for _ in range(10):
delay(1.5)
delay_mu(3)

# CHECK-L: g: ()->NoneType delay(s->mu(1.5) * 2 * 10 mu)
# CHECK-L: g: ()->NoneType delay(60 mu)
def g():
for _ in range(10):
for _ in range(2):
delay(1.5)
delay_mu(3)
4 changes: 2 additions & 2 deletions lit-test/test/iodelay/order_invariance.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# RUN: %python -m artiq.compiler.testbench.signature %s >%t
# RUN: OutputCheck %s --file-to-check=%t

# CHECK-L: g: ()->NoneType delay(s->mu(2.0) mu)
# CHECK-L: g: ()->NoneType delay(2 mu)
def g():
f()
f()

def f():
delay(1.0)
delay_mu(1)
12 changes: 6 additions & 6 deletions lit-test/test/iodelay/range.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# RUN: %python -m artiq.compiler.testbench.signature %s >%t
# RUN: OutputCheck %s --file-to-check=%t

# CHECK-L: f: (a:int(width=32))->NoneType delay(s->mu(1.5) * a mu)
# CHECK-L: f: (a:int(width=32))->NoneType delay(3 * a mu)
def f(a):
for _ in range(a):
delay(1.5)
delay_mu(3)

# CHECK-L: g: (a:int(width=32), b:int(width=32))->NoneType delay(s->mu(1.5) * (b - a) mu)
# CHECK-L: g: (a:int(width=32), b:int(width=32))->NoneType delay(3 * (b - a) mu)
def g(a, b):
for _ in range(a, b):
delay(1.5)
delay_mu(3)

# CHECK-L: h: (a:int(width=32), b:int(width=32), c:int(width=32))->NoneType delay(s->mu(1.5) * (b - a) // c mu)
# CHECK-L: h: (a:int(width=32), b:int(width=32), c:int(width=32))->NoneType delay(3 * (b - a) // c mu)
def h(a, b, c):
for _ in range(a, b, c):
delay(1.5)
delay_mu(3)

f(1)
g(1,2)
4 changes: 2 additions & 2 deletions lit-test/test/iodelay/return.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# RUN: %python -m artiq.compiler.testbench.signature %s >%t
# RUN: OutputCheck %s --file-to-check=%t

# CHECK-L: f: ()->int(width=32) delay(s->mu(1.5) * 10 mu)
# CHECK-L: f: ()->int(width=32) delay(30 mu)
def f():
for _ in range(10):
delay(1.5)
delay_mu(3)
return 10

# CHECK-L: g: (x:float)->int(width=32)