generated from TinyTapeout/tt09-verilog-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_oss_cad.sh
executable file
·42 lines (34 loc) · 1.08 KB
/
install_oss_cad.sh
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
#!/bin/bash
set -eax
OSS_CAD_RELEASE_DATE=2024-10-02
OSS_CAD_RELEASE_VERSION=20241002
LINUX_ARCH=
case $(uname -i) in
"aarch64")
LINUX_ARCH="arm64";;
"x86_64")
LINUX_ARCH="x64";;
default)
LINUX_ARCH="x64";;
esac
# Don't install oss-cad-suite over old install to avoid future mysteries.
if [ -d "oss-cad-suite" ] ; then
echo "'oss-cad-suite' directory already exists, you must remove it before reinstalling. Try: rm -rf oss-cad-suite"
exit -1
fi
# Check if .gitignore knows about oss-cad-suite or else add it.
if [[ $(cat .gitignore) =~ "oss-cad-suite" ]]; then
echo "oss-cad-suite already in .gitignore"
else
cat >> .gitignore << EOF
oss-cad-suite
EOF
fi
# Download and extract oss-cad-suite
RELEASE_FILENAME="oss-cad-suite-linux-$LINUX_ARCH-$OSS_CAD_RELEASE_VERSION.tgz"
curl -L -O "https://github.com/YosysHQ/oss-cad-suite-build/releases/download/$OSS_CAD_RELEASE_DATE/$RELEASE_FILENAME"
tar zxvf $RELEASE_FILENAME
# Set the environment variables. TODO: make this permanent to the devcontainer.
if [ -f oss-cad-suite/environment ] ; then
source oss-cad-suite/environment
fi