@@ -14,6 +14,7 @@ function usage() {
14
14
echo " --or_branch BRANCH build using the head of branch BRANCH for OpenROAD"
15
15
echo " --or_repo REPO-URL build using a fork at REPO-URL(https/ssh) for OpenROAD"
16
16
echo " -n, --nice build using all cpus but nice the jobs"
17
+ echo " --no_init Skip initializing submodules"
17
18
echo " -c, --copy-platforms" copy platforms to inside docker image
18
19
19
20
echo " This script builds the openroad tools (OpenROAD, yosys)"
@@ -64,16 +65,16 @@ while (( "$#" )); do
64
65
UPDATE_PLATFORM=1
65
66
shift
66
67
;;
67
- -n|- -no_init)
68
- NO_INIT =1
68
+ --no_init)
69
+ OPENROAD_FLOW_NO_INIT =1
69
70
shift
70
71
;;
71
72
-c|--copy-platforms)
72
73
COPY_PLATFORMS=" YES"
73
74
shift
74
75
;;
75
76
-* |--* =) # unsupported flags
76
- echo " [ERROR][FLOW-1000 ] Unsupported flag $1 " >&2
77
+ echo " [ERROR][FLOW-0004 ] Unsupported flag $1 " >&2
77
78
exit 1
78
79
;;
79
80
* ) # preserve positional arguments
85
86
86
87
# Choose install method
87
88
if [ -z ${BUILD_METHOD+x} ] && which docker & > /dev/null; then
88
- echo " [INFO][ FLOW-0000] using docker build method. This will create a docker image tagged '${DOCKER_TAG} '"
89
+ echo " [INFO FLOW-0000] Using docker build method. This will create a docker image tagged '${DOCKER_TAG} '"
89
90
build_method=" DOCKER"
90
91
else
91
- echo " [INFO][ FLOW-0000] using local build method. This will create binaries at tools/build /"
92
+ echo " [INFO FLOW-0000] Using local build method. This will create binaries at tools/install /"
92
93
build_method=" LOCAL"
93
94
fi
94
95
113
114
114
115
115
116
if [ ! -z ${UPDATE_OR+x} ]; then
116
- echo " updating OpenROAD tool to the latest"
117
+ echo " [INFO FLOW-0005] Updating OpenROAD tool to the latest"
117
118
(cd tools/OpenROAD && git fetch $CURRENT_REMOTE $OR_BRANCH \
118
119
&& git checkout $CURRENT_REMOTE /$OR_BRANCH \
119
120
&& git pull $CURRENT_REMOTE $OR_BRANCH \
124
125
if [ ! -z ${UPDATE_PLATFORM+x} ]; then
125
126
for dir in flow/platforms/* / ; do
126
127
if [ -d $dir /.git ]; then
127
- echo " [INFO][ FLOW-0001] updating git repository '$dir '"
128
+ echo " [INFO FLOW-0001] Updating git repository '$dir '"
128
129
(cd $dir && git pull)
129
130
else
130
- echo " [INFO][ FLOW-0002] directory '$dir ' is not a git repository. Skipping update."
131
+ echo " [INFO FLOW-0002] Directory '$dir ' is not a git repository. Skipping update."
131
132
fi
132
133
done
133
134
fi
134
135
135
136
# Update developer repos
136
137
if [ ! -z ${UPDATE_PRIVATE+x} ]; then
137
138
if [ -d flow/private ]; then
138
- echo " [INFO][ FLOW-0001] updating git repository 'private'"
139
+ echo " [INFO FLOW-0001] Updating git repository 'private'"
139
140
(cd flow/private && git pull)
140
141
else
141
- echo " [INFO][ FLOW-0002] directory 'flow/private' is not a git repository. Skipping update."
142
+ echo " [INFO FLOW-0002] Directory 'flow/private' is not a git repository. Skipping update."
142
143
fi
143
144
fi
144
145
@@ -158,20 +159,19 @@ if [ "$build_method" == "DOCKER" ]; then
158
159
159
160
# Local build
160
161
elif [ " $build_method " == " LOCAL" ]; then
161
- mkdir -p tools/build/yosys
162
- (cd tools/yosys && $NICE make install -j$PROC PREFIX=../build/yosys CONFIG=gcc)
162
+ $NICE make install -C tools/yosys -j$PROC PREFIX=$( pwd) /tools/install/yosys CONFIG=gcc
163
163
164
- mkdir -p tools/build/OpenROAD
165
- (cd tools/build/OpenROAD && cmake ../../ OpenROAD && $NICE make -j$PROC )
164
+ cmake -B tools/OpenROAD/ build tools/OpenROAD -DCMAKE_INSTALL_PREFIX=tools/install /OpenROAD
165
+ $NICE cmake --build tools/ OpenROAD/build --target install -j$PROC
166
166
167
167
cmake -B tools/LSOracle/build tools/LSOracle \
168
168
-D CMAKE_BUILD_TYPE=RELEASE \
169
169
-D YOSYS_INCLUDE_DIR=$( pwd) /tools/yosys \
170
170
-D YOSYS_PLUGIN=ON \
171
- -D YOSYS_SHARE_DIR=$( pwd) /tools/build /yosys/share/yosys \
172
- -D CMAKE_INSTALL_PREFIX=$( pwd) /tools/build /LSOracle
171
+ -D YOSYS_SHARE_DIR=$( pwd) /tools/install /yosys/share/yosys \
172
+ -D CMAKE_INSTALL_PREFIX=$( pwd) /tools/install /LSOracle
173
173
$NICE cmake --build tools/LSOracle/build -j$PROC --target install
174
174
else
175
- echo " ERROR: No valid build method found"
175
+ echo " [ ERROR FLOW-0003] No valid build method found"
176
176
exit 1
177
177
fi
0 commit comments