From d51493fb5d1d4dfc015552ada65ab7f138ad595f Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 25 Feb 2015 21:15:46 -0700 Subject: [PATCH] language/core: fix interpreter implementations of time/cycle conversions --- artiq/language/core.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/artiq/language/core.py b/artiq/language/core.py index 974ee886b..64e8e42aa 100644 --- a/artiq/language/core.py +++ b/artiq/language/core.py @@ -6,8 +6,6 @@ Core ARTIQ extensions to the Python language. from collections import namedtuple as _namedtuple from functools import wraps as _wraps -from artiq.language import units as _units - class int64(int): """64-bit integers for static compilation. @@ -236,7 +234,7 @@ def time_to_cycles(time, core=None): """ if core is None: raise ValueError("Core device must be specified for time conversion") - return round64(time.amount//core.runtime_env.ref_period) + return round64(time.amount//core.ref_period) def cycles_to_time(cycles, core=None): @@ -249,7 +247,7 @@ def cycles_to_time(cycles, core=None): """ if core is None: raise ValueError("Core device must be specified for time conversion") - return cycles*core.runtime_env.ref_period*_units.s + return cycles*core.ref_period def syscall(*args):