From a01e328b4a0c64f66766a845751cfcf62093a887 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sat, 21 Nov 2015 17:24:00 +0800 Subject: [PATCH] transforms.interleaver: don't assume all delay expressions are folded. --- artiq/compiler/transforms/interleaver.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/artiq/compiler/transforms/interleaver.py b/artiq/compiler/transforms/interleaver.py index 1fc8b4e1e..e1348ecd6 100644 --- a/artiq/compiler/transforms/interleaver.py +++ b/artiq/compiler/transforms/interleaver.py @@ -65,8 +65,9 @@ class Interleaver: terminator = block.terminator() if isinstance(terminator, ir.Delay): # We should be able to fold everything without free variables. - assert iodelay.is_const(terminator.expr) - return terminator.expr.value + folded_expr = terminator.expr.fold() + assert iodelay.is_const(folded_expr) + return folded_expr.value else: return 0