-
Notifications
You must be signed in to change notification settings - Fork 23
/
ubuntu.sh
executable file
·77 lines (66 loc) · 1.67 KB
/
ubuntu.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env bash
# Author : James Nock
# Year : 2022
set -euo pipefail
echo () {
printf "\n%b\n" "[iac] $1"
}
echo "Updating apt packages... you may have to enter your password here"
sudo apt update
echo "Installing dependencies.."
sudo apt install -y git \
perl \
python3 \
python3-pip \
gperf \
autoconf \
bc \
bison \
gcc \
clang \
make
sudo apt install -y \
flex \
build-essential \
ca-certificates \
ccache \
libgoogle-perftools-dev \
numactl \
perl-doc \
libfl2 \
libfl-dev \
zlib1g \
zlib1g-dev \
qemu qemu-user \
gtkwave \
jq
# Install Verilator
echo "Installing Verilator"
cd /tmp
rm -rf verilator
git clone https://github.com/verilator/verilator verilator
cd verilator
git checkout v4.226
autoconf
./configure
make -j "$(nproc)"
sudo make install
cd ..
rm -rf verilator
verilator --version
echo "Installing riscv-gnu-toolchain... this may require your password..."
# shellcheck disable=SC1091
ubuntu_version=$( . /etc/os-release ; printf "%s" "$VERSION_ID" )
echo "Got Ubuntu version: ${ubuntu_version}"
tools_download_link="https://github.com/EIE2-IAC-Labs/Lab0-devtools/releases/download/v1.0.0/riscv-gnu-toolchain-2022-09-21-Ubuntu-${ubuntu_version}.tar.gz"
cd /tmp
rm -rf riscv-gnu-toolchain.tar.gz
curl --output riscv-gnu-toolchain.tar.gz -L "${tools_download_link}"
sudo rm -rf /opt/riscv
sudo tar -xzf riscv-gnu-toolchain.tar.gz --directory /opt
export PATH="/opt/riscv/bin:$PATH"
if ! grep "/opt/riscv/bin" ~/.bashrc > /dev/null; then
# shellcheck disable=SC2016
printf '\n%s' 'export PATH="/opt/riscv/bin:$PATH"' >> ~/.bashrc
fi
rm -rf riscv-gnu-toolchain.tar.gz