From abb36b42be2ab84191d0bd2e475f8c65cf7a4096 Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 24 Nov 2015 00:19:33 +0800 Subject: [PATCH] compiler.iodelay: fold and eval SToMU to an int, not float. --- artiq/compiler/iodelay.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artiq/compiler/iodelay.py b/artiq/compiler/iodelay.py index bb5b5186a..bdf96b46a 100644 --- a/artiq/compiler/iodelay.py +++ b/artiq/compiler/iodelay.py @@ -114,12 +114,12 @@ class SToMU(Conv): 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)