From 0e76cbc4147e61f4405a64768428be6d136786af Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 10 Nov 2016 01:04:36 +0000 Subject: [PATCH] artiq_compile: actually disable attribute writeback. I wrote both halves of this condition but forgot to hook them together. Fixes #586. --- artiq/compiler/module.py | 6 ++++-- artiq/coredevice/core.py | 6 ++++-- artiq/frontend/artiq_compile.py | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/artiq/compiler/module.py b/artiq/compiler/module.py index 0e07a5b60..e169a656e 100644 --- a/artiq/compiler/module.py +++ b/artiq/compiler/module.py @@ -40,7 +40,8 @@ class Source: 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,7 +80,8 @@ class Module: 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) + return llvm_ir_generator.process(self.artiq_ir, + attribute_writeback=self.attribute_writeback) def __repr__(self): printer = types.TypePrinter() diff --git a/artiq/coredevice/core.py b/artiq/coredevice/core.py index 1b1b7b3a4..58c2ca7a9 100644 --- a/artiq/coredevice/core.py +++ b/artiq/coredevice/core.py @@ -81,7 +81,7 @@ class Core: self.core = self self.comm.core = self - def compile(self, function, args, kwargs, set_result=None, with_attr_writeback=True): + def compile(self, function, args, kwargs, set_result=None, attribute_writeback=True): try: engine = _DiagnosticEngine(all_errors_are_fatal=True) @@ -89,7 +89,9 @@ class Core: stitcher.stitch_call(function, args, kwargs, set_result) stitcher.finalize() - module = Module(stitcher, ref_period=self.ref_period) + module = Module(stitcher, + ref_period=self.ref_period, + attribute_writeback=attribute_writeback) target = OR1KTarget() library = target.compile_and_link([module]) diff --git a/artiq/frontend/artiq_compile.py b/artiq/frontend/artiq_compile.py index 16d211399..ef801516c 100755 --- a/artiq/frontend/artiq_compile.py +++ b/artiq/frontend/artiq_compile.py @@ -55,7 +55,7 @@ def main(): object_map, kernel_library, _, _ = \ core.compile(exp.run, [exp_inst], {}, - with_attr_writeback=False) + attribute_writeback=False) except CompileError as error: return finally: