|
1 | 1 | #!/bin/bash |
2 | 2 | set -e |
3 | 3 |
|
4 | | -# ORFS install script |
5 | | -# Single user-facing entry point: bazelisk run //:install |
| 4 | +# ORFS developer install script |
| 5 | +# Builds and installs OpenROAD, Yosys, and yosys-slang to tools/install/ |
| 6 | +# where flow/Makefile expects them. |
6 | 7 | # |
7 | | -# Builds and installs tools to tools/install/ where flow/Makefile expects them. |
8 | 8 | # Uses stamp files for fast no-op re-runs (seconds when nothing changed). |
9 | 9 |
|
10 | 10 | WORKSPACE="${BUILD_WORKSPACE_DIRECTORY:-.}" |
11 | 11 | INSTALL_DIR="${WORKSPACE}/tools/install" |
12 | 12 | NUM_THREADS=$(nproc) |
13 | 13 |
|
| 14 | +BUILD_OPENROAD=1 |
| 15 | + |
14 | 16 | usage() { |
15 | 17 | cat <<'EOF' |
16 | 18 | Usage: bazelisk run //:install [-- OPTIONS] |
17 | 19 |
|
18 | | -Installs tools required for the ORFS flow/Makefile. |
19 | | -
|
20 | | -Installed: |
21 | | - openroad OpenROAD with GUI support |
22 | | - yosys Yosys synthesis tool |
23 | | - yosys-slang Yosys SystemVerilog plugin |
24 | | -
|
25 | | -Not yet supported (use sudo ./setup.sh): |
26 | | - klayout KLayout layout viewer |
27 | | - kepler Kepler formal verification |
28 | | -
|
29 | | -Nix users: nix develop already provides all tools. See flake.nix. |
30 | | -
|
31 | 20 | Options: |
32 | 21 | --help, -h Show this help |
33 | 22 | --skip-openroad Skip OpenROAD build |
|
36 | 25 | exit 0 |
37 | 26 | } |
38 | 27 |
|
39 | | -# Check for required system dependencies before expensive builds. |
40 | | -# ORFS checks deps for what it builds (yosys/slang). OpenROAD checks |
41 | | -# its own deps in tools/OpenROAD/bazel/install.sh (separation of concerns). |
42 | | -# |
43 | | -# Currently only Ubuntu/Debian is checked. Dependency checking for |
44 | | -# other platforms (macOS, RHEL, Fedora, etc.) is not implemented |
45 | | -# because we cannot test them. Contributions welcome. |
46 | | -check_ubuntu_deps() { |
47 | | - local missing_cmds=() |
48 | | - local missing_pkgs=() |
49 | | - |
50 | | - # Commands needed for yosys build |
51 | | - command -v bison &>/dev/null || { missing_cmds+=(bison); missing_pkgs+=(bison); } |
52 | | - command -v flex &>/dev/null || { missing_cmds+=(flex); missing_pkgs+=(flex); } |
53 | | - command -v gawk &>/dev/null || { missing_cmds+=(gawk); missing_pkgs+=(gawk); } |
54 | | - command -v g++ &>/dev/null || { missing_cmds+=(g++); missing_pkgs+=(g++); } |
55 | | - command -v pkg-config &>/dev/null || { missing_cmds+=(pkg-config); missing_pkgs+=(pkg-config); } |
56 | | - command -v tclsh &>/dev/null || { missing_cmds+=(tclsh); missing_pkgs+=(tcl); } |
57 | | - command -v git &>/dev/null || { missing_cmds+=(git); missing_pkgs+=(git); } |
58 | | - command -v cmake &>/dev/null || { missing_cmds+=(cmake); missing_pkgs+=(cmake); } |
59 | | - |
60 | | - # Dev libraries needed for yosys/slang compilation (check via dpkg) |
61 | | - for pkg in tcl-dev libffi-dev libreadline-dev zlib1g-dev; do |
62 | | - if ! dpkg -s "$pkg" &>/dev/null 2>&1; then |
63 | | - missing_pkgs+=("$pkg") |
64 | | - fi |
65 | | - done |
66 | | - |
67 | | - if [[ ${#missing_pkgs[@]} -gt 0 ]]; then |
68 | | - echo "ERROR: Missing dependencies for Yosys build." |
69 | | - if [[ ${#missing_cmds[@]} -gt 0 ]]; then |
70 | | - echo " Missing commands: ${missing_cmds[*]}" |
71 | | - fi |
72 | | - echo "" |
73 | | - echo "On Ubuntu this would be:" |
74 | | - echo " sudo apt install ${missing_pkgs[*]}" |
75 | | - exit 1 |
76 | | - fi |
77 | | -} |
78 | | - |
79 | | -if command -v dpkg &>/dev/null; then |
80 | | - check_ubuntu_deps |
81 | | -fi |
82 | | - |
83 | | -BUILD_OPENROAD=1 |
84 | | - |
85 | 28 | while [[ $# -gt 0 ]]; do |
86 | 29 | case "$1" in |
87 | 30 | --help|-h) |
|
0 commit comments