Our lab just recently bought a pre-assembled system composed of a few Sinara hardware modules and I'm running through the initial examples from the ARTIQ manual, but I'm having trouble using Direct Memory Access to increase the frequency of a ttl signal beyond the limit set by the CPU.

I'm running the following script:

`
from artiq.experiment import *

class Tutorial(EnvExperiment):
def build(self):
self.setattr_device("core")
self.setattr_device("core_dma")
self.setattr_device("ttl4")

@kernel
def record(self):
	with self.core_dma.record("test_sequence"):
		for i in range(2):
			self.ttl4.pulse(100*ns)
			delay(100*ns)

@kernel
def run(self):
	self.core.reset()
	self.record()
	test_sequence_handle = self.core_dma.get_handle("test_sequence")
	self.core.break_realtime()
	while True:
		self.core_dma.playback_handle(test_sequence_handle)

`

and getting the following error/warnings

C:/msys64/mingw64/lib/python3.10/site-packages/numpy/core/getlimits.py:493: UserWarning: Signature b'\x00\xd0\xcc\xcc\xcc\xcc\xcc\xcc\xfb\xbf\xde\xc9n\x00\x00\x00' for <class 'numpy.float128'> does not match any known type: falling back to type probe function.
This warnings indicates broken support for the dtype!
machar = _get_machar(dtype)
====== LLVM IR (BROKEN) DUMP ======
LLVM IR (broken) dumped as C:/Users/JEAN-L~1/AppData/Local/Temp/tmppbq6vg_t.ll
Traceback (most recent call last):
File "C:\msys64\mingw64\bin\artiq_run-script.py", line 33, in <module>
sys.exit(load_entry_point('artiq===8.8254.8dc6902.beta', 'console_scripts', 'artiq_run')())
File "C:/msys64/mingw64/lib/python3.10/site-packages/artiq/frontend/artiq_run.py", line 226, in main
return run(with_file=True)
File "C:/msys64/mingw64/lib/python3.10/site-packages/artiq/frontend/artiq_run.py", line 212, in run
raise exn
File "C:/msys64/mingw64/lib/python3.10/site-packages/artiq/frontend/artiq_run.py", line 205, in run
exp_inst.run()
File "C:/msys64/mingw64/lib/python3.10/site-packages/artiq/language/core.py", line 54, in run_on_core
return getattr(self, arg).run(run_on_core, ((self,) + k_args), k_kwargs)
File "C:/msys64/mingw64/lib/python3.10/site-packages/artiq/coredevice/core.py", line 139, in run
self.compile(function, args, kwargs, set_result)
File "C:/msys64/mingw64/lib/python3.10/site-packages/artiq/coredevice/core.py", line 115, in compile
library = target.compile_and_link([module])
File "C:/msys64/mingw64/lib/python3.10/site-packages/artiq/compiler/targets.py", line 203, in compile_and_link
return self.link([self.assemble(self.compile(module)) for module in modules])
File "C:/msys64/mingw64/lib/python3.10/site-packages/artiq/compiler/targets.py", line 203, in <listcomp>
return self.link([self.assemble(self.compile(module)) for module in modules])
File "C:/msys64/mingw64/lib/python3.10/site-packages/artiq/compiler/targets.py", line 157, in compile
llparsedmod = llvm.parse_assembly(str(llmod))
File "C:/msys64/mingw64/lib/python3.10/site-packages/llvmlite/binding/module.py", line 25, in parse_assembly
raise RuntimeError("LLVM IR parsing error\n{0}".format(errmsg))
RuntimeError: LLVM IR parsing error
<string>:354:124: error: expected '('
define private void @"_Z39artiq.coredevice.dma.CoreDMA.get_handleI28artiq.coredevice.dma.CoreDMAEzz"({i32, i64, i32}* s
ret %".1", i8* %"ARG.ENV", %"I.artiq.coredevice.dma.CoreDMA"* %"ARG.self", {i8*, i32} %"ARG.name") uwtable personality
i32 (...)* @"__artiq_personality"!dbg !46

The warnings before the ====== LLVM IR (BROKEN) DUMP ====== message were printed when running the previous examples, but I was still able to turn the two leds on the front panel of the Kasli EEM controller ( Sinara 1124 Processor) on and off, and output TTL signals from the Sinara 2118 BNC TTL card. The parsing error has only occured when running this particular DMA example.

I'm using a PC running Windows 10. I installed ARTIQ via MSYS2 following the instructions on the beta manual since I was getting "InvalidArchiveError"s I couldn't resolve when installing via Conda.

What can I do to resolve this parsing error? Is there any additional information I can provide?

Thank you for your help.

Please fix the formatting of your post.

The issue is not reproducible on Nix, I suspect an issue with the llvmlite package in msys2.

Can you provide that C:/Users/JEAN-L~1/AppData/Local/Temp/tmppbq6vg_t.ll file?

Also, is there a particular reason why you're using the beta version instead of release-7? Is the conda archive error bug present on release-7?

  • jdg replied to this.

    sb10q

    Thanks for your reply.

    I don't see a way to edit the original post to improve the formatting -- it looks like I can only reply to it an 'like' it. Are there permissions you can grant me to do that or am just not finding the 'edit' button? I can edit this reply, but not the original post.

    When I try attaching the tmppbq6vg_t.ll file to this post I get the error "Uploading files of this type is not allowed". When I try copy and pasting the text of that file to a .txt file and upload it I get the same error. Copying the text of that file to this post maxes out the character limit. Is there another way I can get you that file?

    I didn't consciously choose the beta version instead of release-7, I just followed the instructions in section 2.2 "Installing via MSYS2 (Windows)" in the beta manual, which instructs copying Server = https://msys2.m-labs.hk/artiq-beta to the pacman.conf file. Is it possible to install release-7 via MSYS2?

    The InvalidArchiveError I was getting with conda was when following the stable version of the artiq manual (section 2.2 - "Installing via Conda (Windows, Linux)"). After running the conda create -n artiq artiq this is the error I got:

    InvalidArchiveError("Error with archive C:\\Users\\Riker\\anaconda3\\pkgs\\lld-14.0.6-h3d09cdc_0\\.cph_tmpx5bb_zs5\\pkg-lld-14.0.6-h3d09cdc_0.tar.zst. You probably need to delete and re-download or re-create this file. Message from libarchive was:\n\nCan't create '\\\\?\\C:\\Users\\Riker\\anaconda3\\pkgs\\lld-14.0.6-h3d09cdc_0\\Library\\bin\\lld-link.exe'")
    InvalidArchiveError("Error with archive C:\\Users\\Riker\\anaconda3\\pkgs\\llvm-tools-14.0.6-hbc40eef_1\\.cph_tmpmkxdpwla\\pkg-llvm-tools-14.0.6-hbc40eef_1.tar.zst. You probably need to delete and re-download or re-create this file. Message from libarchive was:\n\nCan't create '\\\\?\\C:\\Users\\Riker\\anaconda3\\pkgs\\llvm-tools-14.0.6-hbc40eef_1\\Library\\bin\\llvm-addr2line.exe'")

    but when I tried deleting those files and running 'conda create -n artiq artiq' again, I'd get the same error. The beta manual says installing ARTIQ via Conda isn't recommended, so I installed via MSYS2 following the beta manual instead.

    If the parsing issue I'm experiencing is a problem with the llvmlite package in MSYS2, would it be worth trying to use an older version of the llvmlite package? What's the best way for me to proceed?

    Thank you again for your help.

    Strictly speaking, the best way to proceed is to install an operating system, for example Linux or FreeBSD.

    Otherwise you can:

    1. Install release-7 and figure out what is going on with conda. Those \\\\?\\ characters at the beginning of the path look suspicious. Are you trying to install using shared network filesystems or similar? Try a more standard situation. It appears the issue is when writing the target file, not with the download.
    2. Figure out the problem in the LLVM IR file, and why it occurs. It looks like it's a simple syntax error. Edit the code in your llvmlite installation so it stops generating incorrect IR (and once it works for you, send a patch upstream MSYS2). llvmlite is only designed for LLVM 11, but MSYS2 runs it on LLVM 15 with a local patch. I suspect there is a small mistake in that patch.
    5 days later
    7 months later

    I encounter the exact same issue.
    For this reason, I updated Artiq to the newest version but the problem still persists.
    Did you find a solution in the end that worked?

    (artiq) C:\Users\lac\anaconda3\envs\artiq\Artiq_tutorial>artiq_run rtio2.py
    ====== LLVM IR (BROKEN) DUMP ======
    LLVM IR (broken) dumped as C:\Users\lac\AppData\Local\Temp\tmpgqteic8w.ll
    Traceback (most recent call last):
    File "C:\Users\lac\anaconda3\envs\artiq\Scripts\artiq_run-script.py", line 9, in <module>
    sys.exit(main())
    ^^^^^^
    File "C:\Users\lac\anaconda3\envs\artiq\Lib\site-packages\artiq\frontend\artiq_run.py", line 224, in main
    return run(with_file=True)
    ^^^^^^^^^^^^^^^^^^^
    File "C:\Users\lac\anaconda3\envs\artiq\Lib\site-packages\artiq\frontend\artiq_run.py", line 210, in run
    raise exn
    File "C:\Users\lac\anaconda3\envs\artiq\Lib\site-packages\artiq\frontend\artiq_run.py", line 203, in run
    exp_inst.run()
    File "C:\Users\lac\anaconda3\envs\artiq\Lib\site-packages\artiq\language\core.py", line 54, in run_on_core
    return getattr(self, arg).run(run_on_core, ((self,) + k_args), k_kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\lac\anaconda3\envs\artiq\Lib\site-packages\artiq\coredevice\core.py", line 139, in run
    self.compile(function, args, kwargs, set_result)
    File "C:\Users\lac\anaconda3\envs\artiq\Lib\site-packages\artiq\coredevice\core.py", line 115, in compile
    library = target.compile_and_link([module])
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\lac\anaconda3\envs\artiq\Lib\site-packages\artiq\compiler\targets.py", line 203, in compile_and_link
    return self.link([self.assemble(self.compile(module)) for module in modules])
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\lac\anaconda3\envs\artiq\Lib\site-packages\artiq\compiler\targets.py", line 203, in <listcomp>
    return self.link([self.assemble(self.compile(module)) for module in modules])
    ^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\lac\anaconda3\envs\artiq\Lib\site-packages\artiq\compiler\targets.py", line 157, in compile
    llparsedmod = llvm.parse_assembly(str(llmod))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\lac\anaconda3\envs\artiq\Lib\site-packages\llvmlite\binding\module.py", line 25, in parse_assembly
    raise RuntimeError("LLVM IR parsing error\n{0}".format(errmsg))
    RuntimeError: LLVM IR parsing error
    <string>:354:124: error: expected '('
    define private void @"_Z39artiq.coredevice.dma.CoreDMA.get_handleI28artiq.coredevice.dma.CoreDMAEzz"({i32, i64, i32}* sret %".1", i8* %"ARG.ENV", %"I.artiq.coredevice.dma.CoreDMA"* %"ARG.self", {i8*, i32} %"ARG.name") uwtable personality i32 (...)* @"__artiq_personality" !dbg !46

    I'm using Windows
    My LLVM-ttols version is 14.0.6 and LVMlite is 0.40.0
    Artiq is 7.1866

    Ok the problem is solved now. I needed to completely reinstall artiq.
    It seems llvmlite version 0.40 was the issue. Now its 0.39