mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-18 16:06:30 +08:00
compiler.iodelay: fold and eval SToMU to an int, not float.
This commit is contained in:
parent
178ff74da2
commit
abb36b42be
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user