CIRCT 23.0.0git
Loading...
Searching...
No Matches
__init__.py
Go to the documentation of this file.
1# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2# See https://llvm.org/LICENSE.txt for license information.
3# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4import sys
5import os
6from .accelerator import AcceleratorConnection, Context, LogLevel
7
8from .esiCppAccel import (AppID, Type, BundleType, ChannelType, ArrayType,
9 StructType, BitsType, UIntType, SIntType, ListType,
10 WindowType)
11
12__all__ = [
13 "AcceleratorConnection", "AppID", "Context", "LogLevel", "Type",
14 "BundleType", "ChannelType", "ArrayType", "StructType", "BitsType",
15 "UIntType", "SIntType", "ListType", "WindowType"
16]
17
18if sys.platform == "win32":
19 """Ensure that ESI libraries are in the dll path on Windows. Necessary to
20 call when users build against the esiaccel-provided prebuilt CMake/prebuilt
21 libraries, before they are loaded via. python.
22 """
23 from .utils import get_dll_dir
24 os.add_dll_directory(str(get_dll_dir()))
25
26
27def connect(platform: str, connection_str: str) -> "AcceleratorConnection":
28 """Connect to an accelerator using the specified platform and connection
29 string."""
30 ctxt = Context.default()
31 return AcceleratorConnection(ctxt,
32 ctxt.cpp_ctxt.connect(platform, connection_str))
"AcceleratorConnection" connect(str platform, str connection_str)
Definition __init__.py:27