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: a01e328b4a0c
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: 73845279ae52
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Nov 21, 2015

  1. Copy the full SHA
    af43c66 View commit details

Commits on Nov 23, 2015

  1. Copy the full SHA
    7384527 View commit details
Showing with 20 additions and 5 deletions.
  1. +19 −4 artiq/compiler/transforms/interleaver.py
  2. +1 −1 artiq/frontend/artiq_compile.py
23 changes: 19 additions & 4 deletions artiq/compiler/transforms/interleaver.py
Original file line number Diff line number Diff line change
@@ -25,6 +25,9 @@ def delay_free_subgraph(root, limit):

return True

def is_pure_delay(insn):
return isinstance(insn, ir.Builtin) and insn.op in ("delay", "delay_mu")

class Interleaver:
def __init__(self, engine):
self.engine = engine
@@ -98,14 +101,26 @@ def time_after_block(pair):
if target_time_delta > 0:
assert isinstance(source_terminator, ir.Delay)

if isinstance(old_decomp, ir.Builtin) and \
old_decomp.op in ("delay", "delay_mu"):
if is_pure_delay(old_decomp):
new_decomp_expr = ir.Constant(target_time_delta, builtins.TInt64())
new_decomp = ir.Builtin("delay_mu", [new_decomp_expr], builtins.TNone())
new_decomp.loc = old_decomp.loc
source_terminator.basic_block.insert(source_terminator, new_decomp)
else:
old_decomp, new_decomp = None, old_decomp
else: # It's a call.
need_to_inline = False
for other_source_block in filter(lambda block: block != source_block,
source_blocks):
other_source_terminator = other_source_block.terminator()
if not (is_pure_delay(other_source_terminator.decomposition()) and \
iodelay.is_const(other_source_terminator.expr) and \
other_source_terminator.expr.fold().value >= source_block_delay):
need_to_inline = True
break

if need_to_inline:
assert False
else:
old_decomp, new_decomp = None, old_decomp

source_terminator.replace_with(ir.Delay(iodelay.Const(target_time_delta), {},
new_decomp, source_terminator.target()))
2 changes: 1 addition & 1 deletion artiq/frontend/artiq_compile.py
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ def main():
dataset_mgr = DatasetManager(DatasetDB(args.dataset_db))

try:
module = file_import(args.file)
module = file_import(args.file, prefix="artiq_run_")
exp = get_experiment(module, args.experiment)
arguments = parse_arguments(args.arguments)
exp_inst = exp(device_mgr, dataset_mgr, **arguments)