forked from Github_Repos/cvw
wally installation improvements: latest main branch of riscv-arch-test, updated install script
This commit is contained in:
parent
4b0b7f0aaf
commit
d4d9fa1ff6
@ -1 +1 @@
|
|||||||
Subproject commit a3b7f0c2cf89652b8a0cba3146890c512ff8ba44
|
Subproject commit 873d16e748ad60023dcdda3926144957c096e31d
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
# Use /opt/riscv for installation - may require running script with sudo
|
# Use /opt/riscv for installation - may require running script with sudo
|
||||||
export RISCV="${1:-/opt/riscv}"
|
export RISCV="${1:-/opt/riscv}"
|
||||||
export PATH=$PATH:$RISCV/bin
|
export PATH=$PATH:$RISCV/bin:/usr/bin
|
||||||
|
|
||||||
set -e # break on error
|
set -e # break on error
|
||||||
|
|
||||||
@ -40,19 +40,20 @@ NUM_THREADS=8 # for >= 32GiB
|
|||||||
#NUM_THREADS=16 # for >= 64GiB
|
#NUM_THREADS=16 # for >= 64GiB
|
||||||
|
|
||||||
sudo mkdir -p $RISCV
|
sudo mkdir -p $RISCV
|
||||||
|
# *** need to update permissions to local user
|
||||||
|
|
||||||
# Update and Upgrade tools (see https://itsfoss.com/apt-update-vs-upgrade/)
|
# Update and Upgrade tools (see https://itsfoss.com/apt-update-vs-upgrade/)
|
||||||
apt update -y
|
sudo apt update -y
|
||||||
apt upgrade -y
|
sudo apt upgrade -y
|
||||||
apt install -y git gawk make texinfo bison flex build-essential python3 libz-dev libexpat-dev autoconf device-tree-compiler ninja-build libpixman-1-dev ncurses-base ncurses-bin libncurses5-dev dialog curl wget ftp libgmp-dev libglib2.0-dev python3-pip pkg-config opam z3 zlib1g-dev verilator automake autotools-dev libmpc-dev libmpfr-dev gperf libtool patchutils bc
|
sudo apt install -y git gawk make texinfo bison flex build-essential python3 libz-dev libexpat-dev autoconf device-tree-compiler ninja-build libpixman-1-dev ncurses-base ncurses-bin libncurses5-dev dialog curl wget ftp libgmp-dev libglib2.0-dev python3-pip pkg-config opam z3 zlib1g-dev verilator automake autotools-dev libmpc-dev libmpfr-dev gperf libtool patchutils bc
|
||||||
# Other python libraries used through the book.
|
# Other python libraries used through the book.
|
||||||
pip3 install matplotlib scipy scikit-learn adjustText lief
|
sudo pip3 install matplotlib scipy scikit-learn adjustText lief
|
||||||
|
|
||||||
# needed for Ubuntu 22.04, gcc cross compiler expects python not python2 or python3.
|
# needed for Ubuntu 22.04, gcc cross compiler expects python not python2 or python3.
|
||||||
if ! command -v python &> /dev/null
|
if ! command -v python &> /dev/null
|
||||||
then
|
then
|
||||||
echo "WARNING: python3 was installed as python3 rather than python. Creating symlink."
|
echo "WARNING: python3 was installed as python3 rather than python. Creating symlink."
|
||||||
ln -sf /usr/bin/python3 /usr/bin/python
|
sudo ln -sf /usr/bin/python3 /usr/bin/python
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# gcc cross-compiler (https://github.com/riscv-collab/riscv-gnu-toolchain)
|
# gcc cross-compiler (https://github.com/riscv-collab/riscv-gnu-toolchain)
|
||||||
@ -67,11 +68,12 @@ fi
|
|||||||
cd $RISCV
|
cd $RISCV
|
||||||
git clone https://github.com/riscv/riscv-gnu-toolchain
|
git clone https://github.com/riscv/riscv-gnu-toolchain
|
||||||
cd riscv-gnu-toolchain
|
cd riscv-gnu-toolchain
|
||||||
git checkout 2023.01.31 #for 12.2.0; 2023.04.29 for 13.1
|
#git checkout 2023.01.31 #for 12.2.0; 2023.04.29 for 13.1
|
||||||
#./configure --prefix=${RISCV}
|
# Temporarily use the following commands until gcc-13 is part of riscv-gnu-toolchain (issue #1249)
|
||||||
./configure --prefix=${RISCV} --with-multilib-generator="rv32e-ilp32e--;rv32i-ilp32--;rv32im-ilp32--;rv32iac-ilp32--;rv32imac-ilp32--;rv32imafc-ilp32f--;rv32imafdc-ilp32d--;rv64i-lp64--;rv64ic-lp64--;rv64iac-lp64--;rv64imac-lp64--;rv64imafdc-lp64d--;rv64im-lp64--;"
|
git clone https://github.com/gcc-mirror/gcc -b releases/gcc-13 gcc-13
|
||||||
|
./configure --prefix=/opt/riscv --with-multilib-generator="rv32e-ilp32e--;rv32i-ilp32--;rv32im-ilp32--;rv32iac-ilp32--;rv32imac-ilp32--;rv32imafc-ilp32f--;rv32imafdc-ilp32d--;rv64i-lp64--;rv64ic-lp64--;rv64iac-lp64--;rv64imac-lp64--;rv64imafdc-lp64d--;rv64im-lp64--;" --with-gcc-src=`pwd`/gcc-13
|
||||||
|
#./configure --prefix=${RISCV} --with-multilib-generator="rv32e-ilp32e--;rv32i-ilp32--;rv32im-ilp32--;rv32iac-ilp32--;rv32imac-ilp32--;rv32imafc-ilp32f--;rv32imafdc-ilp32d--;rv64i-lp64--;rv64ic-lp64--;rv64iac-lp64--;rv64imac-lp64--;rv64imafdc-lp64d--;rv64im-lp64--;"
|
||||||
make -j ${NUM_THREADS}
|
make -j ${NUM_THREADS}
|
||||||
#make install # is this necessary
|
|
||||||
|
|
||||||
# elf2hex (https://github.com/sifive/elf2hex)
|
# elf2hex (https://github.com/sifive/elf2hex)
|
||||||
#The elf2hex utility to converts executable files into hexadecimal files for Verilog simulation.
|
#The elf2hex utility to converts executable files into hexadecimal files for Verilog simulation.
|
||||||
@ -131,8 +133,9 @@ sed -i 's/--isa=rv64ic/--isa=rv64iac/' rv64i_m/privilege/Makefile.include
|
|||||||
#pip3 install chardet==3.0.4
|
#pip3 install chardet==3.0.4
|
||||||
#pip3 install urllib3==1.22
|
#pip3 install urllib3==1.22
|
||||||
|
|
||||||
|
cd $RISCV
|
||||||
opam init -y --disable-sandboxing
|
opam init -y --disable-sandboxing
|
||||||
opam switch create ocaml-base-compiler.4.06.1
|
opam switch create ocaml-base-compiler.4.08.0
|
||||||
opam install sail -y
|
opam install sail -y
|
||||||
|
|
||||||
eval $(opam config env)
|
eval $(opam config env)
|
||||||
@ -140,13 +143,14 @@ git clone https://github.com/riscv/sail-riscv.git
|
|||||||
cd sail-riscv
|
cd sail-riscv
|
||||||
# Current bug in Sail - use hash that works for Wally
|
# Current bug in Sail - use hash that works for Wally
|
||||||
# (may remove later if Sail is ever fixed)
|
# (may remove later if Sail is ever fixed)
|
||||||
git checkout 4d05aa1698a0003a4f6f99e1380c743711c32052
|
#git checkout 4d05aa1698a0003a4f6f99e1380c743711c32052
|
||||||
make -j ${NUM_THREADS}
|
make -j ${NUM_THREADS}
|
||||||
ARCH=RV32 make -j ${NUM_THREADS}
|
ARCH=RV32 make -j ${NUM_THREADS}
|
||||||
ARCH=RV64 make -j ${NUM_THREADS}
|
# next line seems redundant
|
||||||
ln -sf $RISCV/sail-riscv/c_emulator/riscv_sim_RV64 /usr/bin/riscv_sim_RV64
|
#ARCH=RV64 make -j ${NUM_THREADS}
|
||||||
ln -sf $RISCV/sail-riscv/c_emulator/riscv_sim_RV32 /usr/bin/riscv_sim_RV32
|
sudo ln -sf $RISCV/sail-riscv/c_emulator/riscv_sim_RV64 /usr/bin/riscv_sim_RV64
|
||||||
|
sudo ln -sf $RISCV/sail-riscv/c_emulator/riscv_sim_RV32 /usr/bin/riscv_sim_RV32
|
||||||
|
|
||||||
pip3 install testresources
|
sudo pip3 install testresources
|
||||||
pip3 install riscof --ignore-installed PyYAML
|
pip3 install git+https://github.com/riscv/riscof.git
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user