CIRCT  20.0.0git
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 
5 from . import codegen
6 
7 from pathlib import Path
8 import subprocess
9 import 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 
31 def run_cppgen():
32  return codegen.run()
33 
34 
36  return _thisdir / "cmake"
def run_esi_cosim()
Definition: utils.py:20
def get_cmake_dir()
Definition: utils.py:35
def run_cppgen()
Definition: utils.py:31
def run_esiquery()
Definition: utils.py:14