minor cleanups

This commit is contained in:
Sebastien Bourdeauducq 2014-09-26 17:21:51 +08:00
parent e0cd45b1ba
commit dd6de244fe
4 changed files with 6 additions and 9 deletions

View File

@ -330,8 +330,6 @@ def syscall(*args):
_encoded_exceptions = dict()
first_user_eid = 1024
def EncodedException(eid):
"""Represents exceptions on the core device, which are identified
@ -346,3 +344,6 @@ def EncodedException(eid):
Exception.__init__(self, eid)
_encoded_exceptions[eid] = EncodedException
return EncodedException
first_user_eid = 1024

View File

@ -1,7 +1,6 @@
import ast
from artiq.transforms.tools import value_to_ast
from artiq.language import units
# TODO:
@ -41,7 +40,4 @@ class _UnitsLowerer(ast.NodeTransformer):
def lower_units(func_def, ref_period):
if (not isinstance(ref_period, units.Quantity)
or ref_period.unit is not units.s_unit):
raise units.DimensionError("Reference period not expressed in seconds")
_UnitsLowerer(ref_period.amount).visit(func_def)

View File

@ -105,7 +105,7 @@ class _RTIOUnderflow(AutoContext):
@kernel
def run(self):
for i in range(10000):
while True:
delay(25*ns)
self.o.pulse(25*ns)

View File

@ -205,8 +205,8 @@ def _test_range():
class CodeGenCase(unittest.TestCase):
def _test_float_arith(self, op):
arith_c = CompiledFunction(arith, {
"op": base_types.VInt(),
"a": base_types.VFloat(), "b": base_types.VFloat()})
"op": base_types.VInt(),
"a": base_types.VFloat(), "b": base_types.VFloat()})
for a in _test_range():
for b in _test_range():
self.assertEqual(arith_c(op, a/2, b/2), arith(op, a/2, b/2))