2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-28 20:53:35 +08:00

language/core: fix interpreter implementations of time/cycle conversions

This commit is contained in:
Sebastien Bourdeauducq 2015-02-25 21:15:46 -07:00
parent 1b5944257e
commit d51493fb5d

View File

@ -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):