-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild_orflow.old.py
executable file
·42 lines (36 loc) · 1.33 KB
/
build_orflow.old.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
#!/usr/bin/env python3
import sys
import subprocess
import array as arr
import argparse
import os
import shlex
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), stdout=subprocess.PIPE).stdout.decode('utf-8')
starting_dir = os.getcwd()
print("path to script=",os.path.dirname(os.path.realpath(__file__)))
print("starting_dir =",starting_dir)
run_command_locally("git clone --recursive --branch openroad https://github.com/The-OpenROAD-Project/OpenROAD-flow.git")
os.chdir("OpenROAD-flow/flow/platforms/")
run_command_locally("git clone /home/tajayi/projects/OpenROAD/alpha-release-platforms/gf14.git")
os.chdir(starting_dir)
os.chdir("OpenROAD-flow/flow/")
run_command_locally("git clone /home/tajayi/projects/OpenROAD/alpha-release-platforms/private.git")
os.chdir(starting_dir)
os.chdir("OpenROAD-flow")
run_command_locally("./build_openroad.sh --latest --local")
run_command_locally("bash -c 'source ./setup_env.sh'")
check_exists("openroad")
check_exists("yosys")
check_exists("TritonRoute")
check_exists("TritonRoute14")