Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
language.core: implement round(value, width) (fixes #203).
Browse files Browse the repository at this point in the history
whitequark committed Dec 22, 2015
1 parent 25188f0 commit f33ed88
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion artiq/language/core.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
from artiq.coredevice.runtime import source_loader


__all__ = ["host_int", "int",
__all__ = ["host_int", "int", "host_round", "round",
"kernel", "portable", "syscall",
"set_time_manager", "set_watchdog_factory",
"ARTIQException",
@@ -161,6 +161,11 @@ def operator(self, other):
__lt__ = _compareop(host_int.__lt__, "__ge__")
__le__ = _compareop(host_int.__le__, "__gt__")

host_round = round

def round(value, width=32):
return int(host_round(value), width)


_ARTIQEmbeddedInfo = namedtuple("_ARTIQEmbeddedInfo",
"core_name function syscall")

0 comments on commit f33ed88

Please sign in to comment.