CIRCT  19.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 pathlib import Path
6 import subprocess
7 import sys
8 
9 _thisdir = Path(__file__).absolute().resolve().parent
10 
11 
13  """Run the esiquery executable with the same arguments as this script."""
14  esiquery = _thisdir / "bin" / "esiquery"
15  return subprocess.call([esiquery] + sys.argv[1:])
16 
17 
19  """Run the esi-cosim.py script with the same arguments as this script."""
20  import importlib.util
21  esi_cosim = _thisdir / "bin" / "esi-cosim.py"
22  spec = importlib.util.spec_from_file_location("esi_cosim", esi_cosim)
23  assert spec is not None
24  cosim_import = importlib.util.module_from_spec(spec)
25  spec.loader.exec_module(cosim_import)
26  return cosim_import.__main__(sys.argv)
def run_esi_cosim()
Definition: utils.py:18
def run_esiquery()
Definition: utils.py:12