From b85ab712a9c7a009b40a54f8a9b6a4fa25019d7e 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 355e3072d..213d011d1 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 entry_point(self): """Return the name of the function that is the entry point of this module.""" diff --git a/artiq/coredevice/core.py b/artiq/coredevice/core.py index 8f9330287..26dd31c71 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: