Skip to content

Commit

Permalink
artiq_compile: actually disable attribute writeback.
Browse files Browse the repository at this point in the history
I wrote both halves of this condition but forgot to hook
them together.

Fixes #586.
whitequark committed Nov 10, 2016
1 parent f368e1b commit b85ab71
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 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,7 +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)
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."""
6 changes: 4 additions & 2 deletions artiq/coredevice/core.py
Original file line number Diff line number Diff line change
@@ -81,15 +81,17 @@ def __init__(self, dmgr, ref_period, external_clock=False,
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)

stitcher = Stitcher(engine=engine, core=self, dmgr=self.dmgr)
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])
2 changes: 1 addition & 1 deletion artiq/frontend/artiq_compile.py
Original file line number Diff line number Diff line change
@@ -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:

0 comments on commit b85ab71

Please sign in to comment.