Loading [MathJax]/extensions/tex2jax.js
CIRCT 22.0.0git
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
utils.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
4
5from . import codegen
6
7import platform
8from pathlib import Path
9import subprocess
10import sys
11
12_thisdir = Path(__file__).absolute().resolve().parent
13
14
16 """Run the esiquery executable with the same arguments as this script."""
17 if platform.system() == "Windows":
18 esiquery = _thisdir / "esiquery.exe"
19 else:
20 esiquery = _thisdir / "bin" / "esiquery"
21 return subprocess.call([esiquery] + sys.argv[1:])
22
23
25 """Run the esi-cosim.py script with the same arguments as this script."""
26 import importlib.util
27 if platform.system() == "Windows":
28 esi_cosim = _thisdir / "esi-cosim.py"
29 else:
30 esi_cosim = _thisdir / "bin" / "esi-cosim.py"
31 spec = importlib.util.spec_from_file_location("esi_cosim", esi_cosim)
32 assert spec is not None
33 assert spec.loader is not None
34 cosim_import = importlib.util.module_from_spec(spec)
35 spec.loader.exec_module(cosim_import)
36 return cosim_import.__main__(sys.argv)
37
38
40 return codegen.run()
41
42
44 return _thisdir / "cmake"
get_cmake_dir()
Definition utils.py:43
run_esi_cosim()
Definition utils.py:24