Skip to content

Commit b85ab71

Browse files
author
whitequark
committedNov 10, 2016
artiq_compile: actually disable attribute writeback.
I wrote both halves of this condition but forgot to hook them together. Fixes #586.
1 parent f368e1b commit b85ab71

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed
 

Diff for: ‎artiq/compiler/module.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ def from_filename(cls, filename, engine=None):
4040
return cls(source.Buffer(f.read(), filename, 1), engine=engine)
4141

4242
class Module:
43-
def __init__(self, src, ref_period=1e-6):
43+
def __init__(self, src, ref_period=1e-6, attribute_writeback=True):
44+
self.attribute_writeback = attribute_writeback
4445
self.engine = src.engine
4546
self.embedding_map = src.embedding_map
4647
self.name = src.name
@@ -79,7 +80,8 @@ def build_llvm_ir(self, target):
7980
llvm_ir_generator = transforms.LLVMIRGenerator(
8081
engine=self.engine, module_name=self.name, target=target,
8182
embedding_map=self.embedding_map)
82-
return llvm_ir_generator.process(self.artiq_ir, attribute_writeback=True)
83+
return llvm_ir_generator.process(self.artiq_ir,
84+
attribute_writeback=self.attribute_writeback)
8385

8486
def entry_point(self):
8587
"""Return the name of the function that is the entry point of this module."""

Diff for: ‎artiq/coredevice/core.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,17 @@ def __init__(self, dmgr, ref_period, external_clock=False,
8181
self.core = self
8282
self.comm.core = self
8383

84-
def compile(self, function, args, kwargs, set_result=None, with_attr_writeback=True):
84+
def compile(self, function, args, kwargs, set_result=None, attribute_writeback=True):
8585
try:
8686
engine = _DiagnosticEngine(all_errors_are_fatal=True)
8787

8888
stitcher = Stitcher(engine=engine, core=self, dmgr=self.dmgr)
8989
stitcher.stitch_call(function, args, kwargs, set_result)
9090
stitcher.finalize()
9191

92-
module = Module(stitcher, ref_period=self.ref_period)
92+
module = Module(stitcher,
93+
ref_period=self.ref_period,
94+
attribute_writeback=attribute_writeback)
9395
target = OR1KTarget()
9496

9597
library = target.compile_and_link([module])

Diff for: ‎artiq/frontend/artiq_compile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def main():
5555

5656
object_map, kernel_library, _, _ = \
5757
core.compile(exp.run, [exp_inst], {},
58-
with_attr_writeback=False)
58+
attribute_writeback=False)
5959
except CompileError as error:
6060
return
6161
finally:

0 commit comments

Comments
 (0)
Please sign in to comment.