CIRCT 20.0.0git
Loading...
Searching...
No Matches
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
7from pathlib import Path
8import subprocess
9import sys
10
11_thisdir = Path(__file__).absolute().resolve().parent
12
13
15 """Run the esiquery executable with the same arguments as this script."""
16 esiquery = _thisdir / "bin" / "esiquery"
17 return subprocess.call([esiquery] + sys.argv[1:])
18
19
21 """Run the esi-cosim.py script with the same arguments as this script."""
22 import importlib.util
23 esi_cosim = _thisdir / "bin" / "esi-cosim.py"
24 spec = importlib.util.spec_from_file_location("esi_cosim", esi_cosim)
25 assert spec is not None
26 cosim_import = importlib.util.module_from_spec(spec)
27 spec.loader.exec_module(cosim_import)
28 return cosim_import.__main__(sys.argv)
29
30
32 return codegen.run()
33
34
36 return _thisdir / "cmake"
get_cmake_dir()
Definition utils.py:35
run_esi_cosim()
Definition utils.py:20