-
Notifications
You must be signed in to change notification settings - Fork 2
/
deprecated_update_orflow.py
executable file
·59 lines (46 loc) · 1.58 KB
/
deprecated_update_orflow.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env python3
import sys
import subprocess
import array as arr
import argparse
import os
import shlex
import argparse
def which(pgm):
path=os.getenv('PATH')
for p in path.split(os.path.pathsep):
p=os.path.join(p,pgm)
if os.path.exists(p) and os.access(p,os.X_OK):
return p
def check_exists(pgm):
if which(pgm) == None:
print(pgm, "not on path")
def run_command_locally(command):
print("command=",command)
subprocess.run(shlex.split(command), check=True)
parser = argparse.ArgumentParser(description='Update OR Flow')
parser.add_argument('--clean', action='store_true')
args = parser.parse_args()
starting_dir = os.getcwd()
print("path to script=",os.path.dirname(os.path.realpath(__file__)))
print("starting_dir =",starting_dir)
starting_dir = os.getcwd()
print("path to script=",os.path.dirname(os.path.realpath(__file__)))
print("starting_dir =",starting_dir)
os.environ['OPENROAD_FLOW_NO_GIT_INIT'] = 'Y'
os.chdir("OpenROAD-flow-private")
run_command_locally("git pull")
os.chdir(os.path.join(starting_dir, "gf12"))
run_command_locally("git pull")
os.chdir(os.path.join(starting_dir, "tsmc65lp"))
run_command_locally("git pull")
os.chdir(os.path.join(starting_dir, "private_tool_scripts"))
run_command_locally("git pull")
os.chdir(os.path.join(starting_dir, "OpenROAD-flow-private"))
if args.clean:
run_command_locally("rm -rf tools/build")
run_command_locally("./build_openroad.sh --latest --local --nice")
run_command_locally("bash -c 'source ./setup_env.sh'")
check_exists("openroad")
check_exists("yosys")
check_exists("TritonRoute")