Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e981b235486f
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 51f23feeacc2
Choose a head ref

Commits on Sep 27, 2016

  1. Rust: liblwip: call tcp_recved where appropriate.

    whitequark committed Sep 27, 2016
    Copy the full SHA
    9562d8d View commit details
  2. Rust: fix prelude.

    whitequark committed Sep 27, 2016
    Copy the full SHA
    b813710 View commit details
  3. Rust: fix TcpStream::read.

    whitequark committed Sep 27, 2016
    Copy the full SHA
    89d4621 View commit details
  4. Rust: add skeleton session protocol implementation.

    Only ident requests are supported right now.
    whitequark committed Sep 27, 2016
    Copy the full SHA
    b14c19a View commit details

Commits on Sep 28, 2016

  1. Rust: add support for artiq_corelog.

    whitequark committed Sep 28, 2016
    Copy the full SHA
    fdcb27c View commit details

Commits on Sep 29, 2016

  1. Rust: use generated CSR functions.

    whitequark committed Sep 29, 2016
    Copy the full SHA
    3263def View commit details
  2. runtime: remove "test mode" functionality.

    whitequark committed Sep 29, 2016
    Copy the full SHA
    1e392cc View commit details
  3. Rust: add support for artiq_coreconfig.

    whitequark committed Sep 29, 2016
    Copy the full SHA
    83940ae View commit details
  4. Rust: port clock, rtio_crg routines.

    whitequark committed Sep 29, 2016
    Copy the full SHA
    9c18f1b View commit details
  5. Rust: move a few things around (NFC).

    whitequark committed Sep 29, 2016
    Copy the full SHA
    9d00023 View commit details
  6. Rust: print git commit during startup.

    whitequark committed Sep 29, 2016
    Copy the full SHA
    55b2535 View commit details

Commits on Sep 30, 2016

  1. Rust: port mailbox routines.

    whitequark committed Sep 30, 2016
    Copy the full SHA
    c6a57d2 View commit details
  2. Copy the full SHA
    7cfa667 View commit details
  3. runtime: eliminate va_list from kernel interface.

    whitequark committed Sep 30, 2016
    Copy the full SHA
    1cbb187 View commit details

Commits on Oct 1, 2016

  1. Rust: implement basic communication with kernel CPU.

    whitequark committed Oct 1, 2016
    Copy the full SHA
    b3b1ea7 View commit details
  2. runtime: remove useless copy of flush_cpu_dcache().

    ksupport used to not link to libbase, I think.
    whitequark committed Oct 1, 2016
    Copy the full SHA
    d3dcb4b View commit details
  3. runtime: link ksupport with libm, not runtime.

    We need libm for the %g format specifier.
    whitequark committed Oct 1, 2016
    Copy the full SHA
    999290f View commit details
  4. Rust: style (NFC).

    whitequark committed Oct 1, 2016
    Copy the full SHA
    ab3bd67 View commit details
  5. Copy the full SHA
    5701b20 View commit details
  6. Rust: implement watchdogs.

    whitequark committed Oct 1, 2016
    Copy the full SHA
    d825393 View commit details
  7. Rust: implement cache.

    whitequark committed Oct 1, 2016
    Copy the full SHA
    8bced9d View commit details

Commits on Oct 2, 2016

  1. Rust: implement idle kernels and session takeover.

    whitequark committed Oct 2, 2016
    Copy the full SHA
    30e997f View commit details

Commits on Oct 4, 2016

  1. Rust: use try_borrow where applicable.

    whitequark committed Oct 4, 2016
    Copy the full SHA
    398b709 View commit details
  2. Rust: implement idle kernels.

    whitequark committed Oct 4, 2016
    Copy the full SHA
    6bbaff8 View commit details
  3. Copy the full SHA
    0cd87af View commit details
  4. Rust: implement startup kernels.

    whitequark committed Oct 4, 2016
    Copy the full SHA
    2b3bc30 View commit details
  5. Rust: set the SOF_KEEPALIVE flag on session sockets.

    whitequark committed Oct 4, 2016
    Copy the full SHA
    0e2cd38 View commit details
  6. Rust: import --cfg flags generated by misoc.

    whitequark committed Oct 4, 2016
    Copy the full SHA
    b590c6c View commit details
  7. Copy the full SHA
    2e4d19a View commit details
  8. Rust: implement moninj.

    whitequark committed Oct 4, 2016
    Copy the full SHA
    2fefd0a View commit details

Commits on Oct 5, 2016

  1. Rust: implement analyzer.

    whitequark committed Oct 5, 2016
    Copy the full SHA
    0a29c00 View commit details
  2. Rust: add basic RPC support.

    whitequark committed Oct 5, 2016
    Copy the full SHA
    4cfc4e8 View commit details

Commits on Oct 6, 2016

  1. Rust: implement sending for all RPC types.

    whitequark committed Oct 6, 2016
    Copy the full SHA
    5a63006 View commit details
  2. language: export TTuple.

    whitequark committed Oct 6, 2016
    Copy the full SHA
    516c6fd View commit details
  3. Rust: implement receiving for all RPC types.

    whitequark committed Oct 6, 2016
    Copy the full SHA
    3362887 View commit details
  4. Copy the full SHA
    2ae30b5 View commit details
  5. test: add more RPC tests.

    whitequark committed Oct 6, 2016
    Copy the full SHA
    6b2789e View commit details
  6. Copy the full SHA
    84214ab View commit details
  7. Rust: implement exceptional kernel termination.

    This also adjusts the way backtraces are serialized by kloader.
    whitequark committed Oct 6, 2016
    Copy the full SHA
    226fa72 View commit details
  8. Rust: implement exceptional RPC replies.

    whitequark committed Oct 6, 2016
    Copy the full SHA
    e92f205 View commit details
  9. Rust: unborrow cache after kernel stops.

    whitequark committed Oct 6, 2016
    Copy the full SHA
    3e829d0 View commit details
  10. runtime: the Rust runtime is now just the runtime.

    whitequark committed Oct 6, 2016
    Copy the full SHA
    5428a86 View commit details
  11. Copy the full SHA
    bcdbd00 View commit details
  12. Copy the full SHA
    d619336 View commit details
  13. test: fix d619336.

    whitequark committed Oct 6, 2016
    Copy the full SHA
    edafb08 View commit details
  14. runtime: remove unnecessary buffering.

    whitequark committed Oct 6, 2016
    Copy the full SHA
    557bc4b View commit details
  15. runtime: buffer writes of RPC data.

    This improves upload speed ~166×.
    whitequark committed Oct 6, 2016
    Copy the full SHA
    b4bbf44 View commit details
  16. runtime: make memory map saner.

    whitequark committed Oct 6, 2016
    Copy the full SHA
    b52ecda View commit details

Commits on Oct 7, 2016

  1. runtime: remove useless handshaking in analyzer.

    whitequark committed Oct 7, 2016
    Copy the full SHA
    4f11b07 View commit details
  2. Copy the full SHA
    8be60cc View commit details
Showing with 5,031 additions and 5,219 deletions.
  1. +1 −0 MANIFEST.in
  2. +3 −0 RELEASE_NOTES.rst
  3. +9 −1 artiq/browser/files.py
  4. +22 −2 artiq/compiler/embedding.py
  5. +4 −9 artiq/compiler/module.py
  6. +1 −0 artiq/compiler/prelude.py
  7. +4 −8 artiq/compiler/targets.py
  8. +2 −2 artiq/compiler/testbench/perf_embedding.py
  9. +42 −42 artiq/compiler/transforms/artiq_ir_generator.py
  10. +1 −1 artiq/compiler/transforms/asttyped_rewriter.py
  11. +53 −36 artiq/compiler/transforms/llvm_ir_generator.py
  12. +10 −5 artiq/compiler/types.py
  13. +43 −72 artiq/coredevice/comm_generic.py
  14. +1 −1 artiq/coredevice/comm_tcp.py
  15. +5 −2 artiq/coredevice/core.py
  16. +5 −4 artiq/dashboard/datasets.py
  17. +37 −31 artiq/dashboard/moninj.py
  18. +181 −21 artiq/devices/pdq2/driver.py
  19. +4 −4 artiq/examples/master/repository/flopping_f_simulation.py
  20. +1 −1 artiq/frontend/artiq_compile.py
  21. +154 −0 artiq/frontend/artiq_devtool.py
  22. +3 −5 artiq/frontend/artiq_run.py
  23. +1 −1 artiq/gateware/amp/kernel_cpu.py
  24. +4 −4 artiq/gateware/amp/mailbox.py
  25. +156 −48 artiq/gateware/dsp/sawg.py
  26. +2 −47 artiq/gateware/dsp/tools.py
  27. +6 −3 artiq/gateware/phaser.py
  28. +2 −4 artiq/gateware/rtio/core.py
  29. +8 −6 artiq/gateware/rtio/phy/sawg.py
  30. +1 −1 artiq/gateware/soc.py
  31. +81 −47 artiq/gateware/targets/kc705.py
  32. +2 −1 artiq/gateware/targets/pipistrello.py
  33. +22 −6 artiq/language/core.py
  34. +13 −4 artiq/language/environment.py
  35. +2 −1 artiq/language/types.py
  36. +1 −0 artiq/language/units.py
  37. +9 −2 artiq/master/scheduler.py
  38. +25 −3 artiq/master/worker_db.py
  39. +22 −15 artiq/master/worker_impl.py
  40. +54 −0 artiq/runtime.rs/Cargo.lock
  41. +10 −3 artiq/runtime.rs/Cargo.toml
  42. +42 −0 artiq/runtime.rs/build.rs
  43. +26 −0 artiq/runtime.rs/libksupport/Cargo.lock
  44. +17 −0 artiq/runtime.rs/libksupport/Cargo.toml
  45. +138 −0 artiq/runtime.rs/libksupport/api.rs
  46. +56 −0 artiq/runtime.rs/libksupport/dyld.rs
  47. +308 −0 artiq/runtime.rs/libksupport/lib.rs
  48. +15 −9 artiq/runtime.rs/liblwip-sys/lib.rs
  49. +5 −1 artiq/runtime.rs/liblwip/Cargo.toml
  50. +139 −34 artiq/runtime.rs/liblwip/lib.rs
  51. +3 −0 artiq/runtime.rs/libstd_artiq/Cargo.toml
  52. +2 −0 artiq/runtime.rs/libstd_artiq/io/buffered.rs
  53. +2 −0 artiq/runtime.rs/libstd_artiq/io/cursor.rs
  54. +42 −3 artiq/runtime.rs/libstd_artiq/io/error.rs
  55. +0 −3 artiq/runtime.rs/libstd_artiq/io/prelude.rs
  56. +14 −52 artiq/runtime.rs/libstd_artiq/lib.rs
  57. +0 −117 artiq/runtime.rs/libstd_artiq/time/duration.rs
  58. +0 −81 artiq/runtime.rs/libstd_artiq/time/instant.rs
  59. +0 −5 artiq/runtime.rs/libstd_artiq/time/mod.rs
  60. +92 −0 artiq/runtime.rs/src/analyzer.rs
  61. +22 −0 artiq/runtime.rs/src/analyzer_proto.rs
  62. +145 −0 artiq/runtime.rs/src/board.rs
  63. +53 −0 artiq/runtime.rs/src/cache.rs
  64. +83 −0 artiq/runtime.rs/src/clock.rs
  65. +63 −0 artiq/runtime.rs/src/config.rs
  66. +31 −0 artiq/runtime.rs/src/kernel.rs
  67. +62 −0 artiq/runtime.rs/src/kernel_proto.rs
  68. +123 −26 artiq/runtime.rs/src/lib.rs
  69. +70 −0 artiq/runtime.rs/src/logger.rs
  70. +35 −0 artiq/runtime.rs/src/mailbox.rs
  71. +124 −0 artiq/runtime.rs/src/moninj.rs
  72. +65 −0 artiq/runtime.rs/src/moninj_proto.rs
  73. +76 −0 artiq/runtime.rs/src/proto.rs
  74. +369 −0 artiq/runtime.rs/src/rpc_proto.rs
  75. +61 −0 artiq/runtime.rs/src/rpc_queue.rs
  76. +65 −0 artiq/runtime.rs/src/rtio_crg.rs
  77. +197 −39 artiq/runtime.rs/src/{io.rs → sched.rs}
  78. +641 −0 artiq/runtime.rs/src/session.rs
  79. +198 −0 artiq/runtime.rs/src/session_proto.rs
  80. +31 −0 artiq/runtime.rs/src/urc.rs
  81. +53 −47 artiq/runtime/Makefile
  82. +0 −158 artiq/runtime/analyzer.c
  83. +0 −14 artiq/runtime/analyzer.h
  84. +2 −3 artiq/runtime/artiq_personality.c
  85. +1 −6 artiq/runtime/artiq_personality.h
  86. +0 −131 artiq/runtime/bridge.c
  87. +0 −6 artiq/runtime/bridge.h
  88. +0 −106 artiq/runtime/bridge_ctl.c
  89. +0 −15 artiq/runtime/bridge_ctl.h
  90. +0 −89 artiq/runtime/clock.c
  91. +0 −15 artiq/runtime/clock.h
  92. +0 −1 artiq/runtime/dds.c
  93. +11 −12 artiq/runtime/flash_storage.c
  94. +0 −14 artiq/runtime/isr.c
  95. +0 −206 artiq/runtime/kloader.c
  96. +0 −25 artiq/runtime/kloader.h
  97. +0 −624 artiq/runtime/ksupport.c
  98. +0 −17 artiq/runtime/ksupport.h
  99. +27 −11 artiq/runtime/ksupport.ld
  100. +121 −0 artiq/runtime/ksupport_glue.c
  101. +0 −51 artiq/runtime/log.c
  102. +0 −13 artiq/runtime/log.h
  103. +0 −78 artiq/runtime/mailbox.c
  104. +0 −12 artiq/runtime/mailbox.h
  105. +11 −112 artiq/runtime/main.c
  106. +0 −179 artiq/runtime/messages.h
  107. +0 −166 artiq/runtime/moninj.c
  108. +0 −6 artiq/runtime/moninj.h
  109. +0 −227 artiq/runtime/net_server.c
  110. +0 −26 artiq/runtime/net_server.h
  111. +2 −0 artiq/runtime/rtio.c
  112. +0 −71 artiq/runtime/rtiocrg.c
  113. +0 −8 artiq/runtime/rtiocrg.h
  114. +65 −60 artiq/runtime/runtime.ld
  115. +0 −1,135 artiq/runtime/session.c
  116. +0 −13 artiq/runtime/session.h
  117. +0 −700 artiq/runtime/test_mode.c
  118. +0 −6 artiq/runtime/test_mode.h
  119. +0 −8 artiq/runtime/ttl.h
  120. +90 −3 artiq/test/coredevice/test_embedding.py
  121. +5 −3 artiq/test/coredevice/test_rtio.py
  122. +1 −1 artiq/test/gateware/test_accu.py
  123. +1 −1 artiq/test/gateware/test_sawg.py
  124. +1 −1 artiq/test/gateware/test_sawg_phy.py
  125. +1 −1 artiq/test/gateware/test_spline.py
  126. +43 −0 artiq/test/gateware/tools.py
  127. +2 −7 artiq/test/libartiq_support/artiq_terminate.c
  128. +2 −2 artiq/test/libartiq_support/artiq_time.c
  129. +15 −0 artiq/test/lit/embedding/async_rpc.py
  130. +15 −0 artiq/test/lit/embedding/error_rpc_async_return.py
  131. +26 −0 artiq/test/lit/embedding/invariant_propagation.py
  132. +24 −0 artiq/test/lit/integration/for.py
  133. +24 −0 artiq/test/lit/integration/while.py
  134. +1 −1 conda/artiq-kc705-nist_clock/meta.yaml
  135. +1 −1 conda/artiq-kc705-nist_qc1/meta.yaml
  136. +1 −1 conda/artiq-kc705-nist_qc2/meta.yaml
  137. +1 −1 conda/artiq-pipistrello-nist_qc1/meta.yaml
  138. +2 −2 conda/artiq/meta.yaml
  139. +43 −2 doc/manual/compiler.rst
  140. +13 −7 doc/manual/installing_from_source.rst
  141. +3 −1 doc/manual/management_system.rst
  142. +1 −0 setup.py
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
graft artiq/runtime
graft artiq/runtime.rs
graft artiq/examples
include artiq/gui/logo*.svg
include versioneer.py
3 changes: 3 additions & 0 deletions RELEASE_NOTES.rst
Original file line number Diff line number Diff line change
@@ -13,6 +13,9 @@ Release notes
* Dynamic __getattr__'s returning RPC target methods are not supported anymore.
Controller driver classes must define all their methods intended for RPC as
members.
* Datasets requested by experiments are by default archived into their HDF5
output. If this behavior is undesirable, turn it off by passing
``archive=False`` to ``get_dataset``.


2.0
10 changes: 9 additions & 1 deletion artiq/browser/files.py
Original file line number Diff line number Diff line change
@@ -187,8 +187,16 @@ def list_current_changed(self, current, previous):
except:
logger.warning("unable to read metadata from %s",
info.filePath(), exc_info=True)
rd = dict()
if "archive" in f:
rd = {k: (True, v.value) for k, v in f["archive"].items()}
if "datasets" in f:
rd = {k: (True, v.value) for k, v in f["datasets"].items()}
for k, v in f["datasets"].items():
if k in rd:
logger.warning("dataset '%s' is both in archive and "
"outputs", k)
rd[k] = (True, v.value)
if rd:
self.datasets.init(rd)
self.dataset_changed.emit(info.filePath())

24 changes: 22 additions & 2 deletions artiq/compiler/embedding.py
Original file line number Diff line number Diff line change
@@ -994,8 +994,24 @@ def _quote_rpc(self, function, loc):
else:
assert False

is_async = False
if hasattr(host_function, "artiq_embedded") and \
"async" in host_function.artiq_embedded.flags:
is_async = True

if not builtins.is_none(ret_type) and is_async:
note = diagnostic.Diagnostic("note",
"function called here", {},
loc)
diag = diagnostic.Diagnostic("fatal",
"functions that return a value cannot be defined as async RPCs", {},
self._function_loc(host_function.artiq_embedded.function),
notes=[note])
self.engine.process(diag)

function_type = types.TRPC(ret_type,
service=self.embedding_map.store_object(host_function))
service=self.embedding_map.store_object(host_function),
async=is_async)
self.functions[function] = function_type
return function_type

@@ -1007,7 +1023,11 @@ def _quote_function(self, function, loc):

if function in self.functions:
pass
elif not hasattr(host_function, "artiq_embedded"):
elif not hasattr(host_function, "artiq_embedded") or \
(host_function.artiq_embedded.core_name is None and
host_function.artiq_embedded.portable is False and
host_function.artiq_embedded.syscall is None and
host_function.artiq_embedded.forbidden is False):
self._quote_rpc(function, loc)
elif host_function.artiq_embedded.function is not None:
if host_function.__name__ == "<lambda>":
13 changes: 4 additions & 9 deletions artiq/compiler/module.py
Original file line number Diff line number Diff line change
@@ -40,7 +40,8 @@ def from_filename(cls, filename, engine=None):
return cls(source.Buffer(f.read(), filename, 1), engine=engine)

class Module:
def __init__(self, src, ref_period=1e-6):
def __init__(self, src, ref_period=1e-6, attribute_writeback=True):
self.attribute_writeback = attribute_writeback
self.engine = src.engine
self.embedding_map = src.embedding_map
self.name = src.name
@@ -79,14 +80,8 @@ def build_llvm_ir(self, target):
llvm_ir_generator = transforms.LLVMIRGenerator(
engine=self.engine, module_name=self.name, target=target,
embedding_map=self.embedding_map)
return llvm_ir_generator.process(self.artiq_ir, attribute_writeback=True)

def entry_point(self):
"""Return the name of the function that is the entry point of this module."""
if self.name != "":
return self.name + ".__modinit__"
else:
return "__modinit__"
return llvm_ir_generator.process(self.artiq_ir,
attribute_writeback=self.attribute_writeback)

def __repr__(self):
printer = types.TypePrinter()
1 change: 1 addition & 0 deletions artiq/compiler/prelude.py
Original file line number Diff line number Diff line change
@@ -31,6 +31,7 @@ def globals():
# ARTIQ decorators
"kernel": builtins.fn_kernel(),
"portable": builtins.fn_kernel(),
"rpc": builtins.fn_kernel(),

# ARTIQ context managers
"parallel": builtins.obj_parallel(),
12 changes: 4 additions & 8 deletions artiq/compiler/targets.py
Original file line number Diff line number Diff line change
@@ -86,14 +86,11 @@ def target_machine(self):
llmachine = lltarget.create_target_machine(
features=",".join(["+{}".format(f) for f in self.features]),
reloc="pic", codemodel="default")
llmachine.set_verbose(True)
llmachine.set_asm_verbosity(True)
return llmachine

def optimize(self, llmodule):
llmachine = self.target_machine()
llpassmgr = llvm.create_module_pass_manager()
llmachine.target_data.add_pass(llpassmgr)
llmachine.add_analysis_passes(llpassmgr)

# Register our alias analysis passes.
llpassmgr.add_basic_alias_analysis_pass()
@@ -161,9 +158,9 @@ def assemble(self, llmodule):

return llmachine.emit_object(llmodule)

def link(self, objects, init_fn):
def link(self, objects):
"""Link the relocatable objects into a shared library for this target."""
with RunTool([self.triple + "-ld", "-shared", "--eh-frame-hdr", "-init", init_fn] +
with RunTool([self.triple + "-ld", "-shared", "--eh-frame-hdr"] +
["{{obj{}}}".format(index) for index in range(len(objects))] +
["-o", "{output}"],
output=b"",
@@ -177,8 +174,7 @@ def link(self, objects, init_fn):
return library

def compile_and_link(self, modules):
return self.link([self.assemble(self.compile(module)) for module in modules],
init_fn=modules[0].entry_point())
return self.link([self.assemble(self.compile(module)) for module in modules])

def strip(self, library):
with RunTool([self.triple + "-strip", "--strip-debug", "{library}", "-o", "{output}"],
4 changes: 2 additions & 2 deletions artiq/compiler/testbench/perf_embedding.py
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ def embed():
target = OR1KTarget()
llvm_ir = target.compile(module)
elf_obj = target.assemble(llvm_ir)
elf_shlib = target.link([elf_obj], init_fn=module.entry_point())
elf_shlib = target.link([elf_obj])

benchmark(lambda: embed(),
"ARTIQ embedding")
@@ -61,7 +61,7 @@ def embed():
benchmark(lambda: target.assemble(llvm_ir),
"LLVM machine code emission")

benchmark(lambda: target.link([elf_obj], init_fn=module.entry_point()),
benchmark(lambda: target.link([elf_obj]),
"Linking")

benchmark(lambda: target.strip(elf_shlib),
84 changes: 42 additions & 42 deletions artiq/compiler/transforms/artiq_ir_generator.py
Original file line number Diff line number Diff line change
@@ -452,29 +452,29 @@ def visit_While(self, node):
self.current_block = body
self.visit(node.body)
post_body = self.current_block
finally:
self.break_target = old_break
self.continue_target = old_continue

if any(node.orelse):
else_tail = self.add_block("while.else")
self.current_block = else_tail
self.visit(node.orelse)
post_else_tail = self.current_block
if any(node.orelse):
else_tail = self.add_block("while.else")
self.current_block = else_tail
self.visit(node.orelse)
post_else_tail = self.current_block

tail = self.add_block("while.tail")
self.current_block = tail
tail = self.add_block("while.tail")
self.current_block = tail

if any(node.orelse):
if not post_else_tail.is_terminated():
post_else_tail.append(ir.Branch(tail))
else:
else_tail = tail
if any(node.orelse):
if not post_else_tail.is_terminated():
post_else_tail.append(ir.Branch(tail))
else:
else_tail = tail

post_head.append(ir.BranchIf(cond, body, else_tail))
if not post_body.is_terminated():
post_body.append(ir.Branch(head))
break_block.append(ir.Branch(tail))
finally:
self.break_target = old_break
self.continue_target = old_continue
post_head.append(ir.BranchIf(cond, body, else_tail))
if not post_body.is_terminated():
post_body.append(ir.Branch(head))
break_block.append(ir.Branch(tail))

def iterable_len(self, value, typ=_size_type):
if builtins.is_listish(value.type):
@@ -541,32 +541,32 @@ def visit_ForT(self, node):
self.current_assign = None
self.visit(node.body)
post_body = self.current_block
finally:
self.break_target = old_break
self.continue_target = old_continue

if any(node.orelse):
else_tail = self.add_block("for.else")
self.current_block = else_tail
self.visit(node.orelse)
post_else_tail = self.current_block
if any(node.orelse):
else_tail = self.add_block("for.else")
self.current_block = else_tail
self.visit(node.orelse)
post_else_tail = self.current_block

tail = self.add_block("for.tail")
self.current_block = tail
tail = self.add_block("for.tail")
self.current_block = tail

if any(node.orelse):
if not post_else_tail.is_terminated():
post_else_tail.append(ir.Branch(tail))
else:
else_tail = tail
if any(node.orelse):
if not post_else_tail.is_terminated():
post_else_tail.append(ir.Branch(tail))
else:
else_tail = tail

if node.trip_count is not None:
head.append(ir.Loop(node.trip_count, phi, cond, body, else_tail))
else:
head.append(ir.BranchIf(cond, body, else_tail))
if not post_body.is_terminated():
post_body.append(ir.Branch(continue_block))
break_block.append(ir.Branch(tail))
finally:
self.break_target = old_break
self.continue_target = old_continue
if node.trip_count is not None:
head.append(ir.Loop(node.trip_count, phi, cond, body, else_tail))
else:
head.append(ir.BranchIf(cond, body, else_tail))
if not post_body.is_terminated():
post_body.append(ir.Branch(continue_block))
break_block.append(ir.Branch(tail))

def visit_Break(self, node):
self.append(ir.Branch(self.break_target))
@@ -821,7 +821,7 @@ def visit_With(self, node):
timeout = self.visit(context_expr_node.args[0])
timeout_ms = self.append(ir.Arith(ast.Mult(loc=None), timeout,
ir.Constant(1000, builtins.TFloat())))
timeout_ms_int = self.append(ir.Coerce(timeout_ms, builtins.TInt32()))
timeout_ms_int = self.append(ir.Coerce(timeout_ms, builtins.TInt64()))

watchdog_id = self.append(ir.Builtin("watchdog_set", [timeout_ms_int],
builtins.TInt32()))
2 changes: 1 addition & 1 deletion artiq/compiler/transforms/asttyped_rewriter.py
Original file line number Diff line number Diff line change
@@ -509,7 +509,7 @@ def visit_unsupported(self, node):
visit_DictComp = visit_unsupported
visit_Ellipsis = visit_unsupported
visit_GeneratorExp = visit_unsupported
visit_Set = visit_unsupported
# visit_Set = visit_unsupported
visit_SetComp = visit_unsupported
visit_Starred = visit_unsupported
visit_Yield = visit_unsupported
Loading