Merge branch 'main' of https://github.com/openhwgroup/cvw into dev

This commit is contained in:
David Harris 2024-11-25 20:52:39 -08:00
commit f1f71f6835
17 changed files with 133 additions and 60 deletions

17
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,17 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
# Update git submodules to latest version
- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
interval: "weekly"
# Update actions in the GitHub Actions workflow files
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

View File

@ -38,25 +38,41 @@ jobs:
- name: ubuntu-20.04 - name: ubuntu-20.04
os: ubuntu-20.04 os: ubuntu-20.04
container: null container: null
regressionFail: true
- name: ubuntu-22.04 - name: ubuntu-22.04
os: ubuntu-22.04 os: ubuntu-22.04
container: null container: null
- name: ubuntu-24.04 - name: ubuntu-24.04
os: ubuntu-24.04 os: ubuntu-24.04
container: null container: null
# Debian Installations
- name: debian-12
os: ubuntu-latest
image: debian:12
imageFamily: debian
- name: debian-11
os: ubuntu-latest
image: debian:11
imageFamily: debian
# Red Hat Installations # Red Hat Installations
- name: rocky-8 - name: rocky-8
os: ubuntu-latest os: ubuntu-latest
image: rockylinux:8 image: rockylinux:8
imageFamily: redhat
regressionFail: true
- name: rocky-9 - name: rocky-9
os: ubuntu-latest os: ubuntu-latest
image: rockylinux:9 image: rockylinux:9
imageFamily: redhat
- name: almalinux-8 - name: almalinux-8
os: ubuntu-latest os: ubuntu-latest
image: almalinux:8 image: almalinux:8
imageFamily: redhat
regressionFail: true
- name: almalinux-9 - name: almalinux-9
os: ubuntu-latest os: ubuntu-latest
image: almalinux:9 image: almalinux:9
imageFamily: redhat
# User level installation # User level installation
- name: user-install - name: user-install
os: ubuntu-latest os: ubuntu-latest
@ -82,11 +98,16 @@ jobs:
steps: steps:
# Docker images need git installed or the checkout action fails # Docker images need git installed or the checkout action fails
- name: Install Dependencies for Red Hat - name: Install Dependencies for Container Image
if: ${{ matrix.image != null }} if: ${{ matrix.image != null }}
run: | run: |
dnf install -y sudo git if [ ${{ matrix.imageFamily }} == "debian" ]; then
dnf install curl -y --allowerasing || true apt-get update
apt-get install -y sudo git
elif [ ${{ matrix.imageFamily }} == "redhat" ]; then
dnf install -y sudo git
dnf install curl -y --allowerasing || true
fi
# Only clone submodules needed for standard tests/regression to save space # Only clone submodules needed for standard tests/regression to save space
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Clone Necessary Submodules - name: Clone Necessary Submodules
@ -140,12 +161,12 @@ jobs:
df -h df -h
# Run standard regression, skipping distros that are known to be broken with Verilator # Run standard regression, skipping distros that are known to be broken with Verilator
- name: Regression - name: Regression
if: ${{ matrix.name != 'ubuntu-20.04' && matrix.name != 'rocky-8' && matrix.name != 'almalinux-8'}} if: ${{ matrix.regressionFail != true }}
run: | run: |
source setup.sh source setup.sh
regression-wally regression-wally
- name: Lint + wsim Test Only (for distros with broken Verilator sim) - name: Lint + wsim Test Only (for distros with broken Verilator sim)
if: ${{ matrix.name == 'ubuntu-20.04' || matrix.name == 'rocky-8' || matrix.name == 'almalinux-8'}} if: ${{ matrix.regressionFail == true }}
run: | run: |
source setup.sh source setup.sh
mkdir -p $WALLY/sim/verilator/logs/ mkdir -p $WALLY/sim/verilator/logs/

6
.gitmodules vendored
View File

@ -8,9 +8,6 @@
[submodule "addins/coremark"] [submodule "addins/coremark"]
path = addins/coremark path = addins/coremark
url = https://github.com/eembc/coremark url = https://github.com/eembc/coremark
[submodule "addins/FreeRTOS-Kernel"]
path = addins/FreeRTOS-Kernel
url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git
[submodule "addins/vivado-boards"] [submodule "addins/vivado-boards"]
path = addins/vivado-boards path = addins/vivado-boards
url = https://github.com/Digilent/vivado-boards/ url = https://github.com/Digilent/vivado-boards/
@ -29,9 +26,6 @@
path = addins/cvw-arch-verif path = addins/cvw-arch-verif
url = https://github.com/openhwgroup/cvw-arch-verif url = https://github.com/openhwgroup/cvw-arch-verif
ignore = dirty ignore = dirty
[submodule "addins/riscvISACOV"]
path = addins/riscvISACOV
url = https://github.com/riscv-verification/riscvISACOV.git
[submodule "addins/berkeley-softfloat-3"] [submodule "addins/berkeley-softfloat-3"]
path = addins/berkeley-softfloat-3 path = addins/berkeley-softfloat-3
url = https://github.com/ucb-bar/berkeley-softfloat-3.git url = https://github.com/ucb-bar/berkeley-softfloat-3.git

View File

@ -6,9 +6,9 @@ MAKEFLAGS += --output-sync --no-print-directory
SIM = ${WALLY}/sim SIM = ${WALLY}/sim
.PHONY: all riscof testfloat combined_IF_vectors zsbl benchmarks coremark embench coverage clean .PHONY: all riscof testfloat combined_IF_vectors zsbl benchmarks coremark embench coverage cvw-arch-verif clean
all: riscof testfloat combined_IF_vectors zsbl coverage # benchmarks all: riscof testfloat combined_IF_vectors zsbl coverage cvw-arch-verif # benchmarks
# riscof builds the riscv-arch-test and wally-riscv-arch-test suites # riscof builds the riscv-arch-test and wally-riscv-arch-test suites
riscof: riscof:
@ -36,6 +36,10 @@ embench:
coverage: coverage:
$(MAKE) -C tests/coverage $(MAKE) -C tests/coverage
cvw-arch-verif:
$(MAKE) -C ${WALLY}/addins/cvw-arch-verif
clean: clean:
$(MAKE) clean -C sim $(MAKE) clean -C sim
$(MAKE) clean -C ${WALLY}/tests/fp $(MAKE) clean -C ${WALLY}/tests/fp
$(MAKE) clean -C ${WALLY}/addins/cvw-arch-verif

View File

@ -71,7 +71,7 @@ Then fork and clone the repo, source setup, make the tests and run regression
> This section describes the open source toolchain installation. > This section describes the open source toolchain installation.
### Compatibility ### Compatibility
The current version of the toolchain has been tested on Ubuntu (versions 20.04 LTS, 22.04 LTS, and 24.04 LTS) and on Red Hat/Rocky/AlmaLinux (versions 8 and 9). The current version of the toolchain has been tested on Ubuntu (versions 20.04 LTS, 22.04 LTS, and 24.04 LTS), Debian (versions 11 and 12), and Red Hat/Rocky/AlmaLinux (versions 8 and 9). Only the latest minor release of each major version is tested.
> [!WARNING] > [!WARNING]
> - Ubuntu 22.04LTS is incompatible with Synopsys Design Compiler. > - Ubuntu 22.04LTS is incompatible with Synopsys Design Compiler.

@ -1 +0,0 @@
Subproject commit 17a46c252f2f237e03a6768c5d15731215322f31

@ -1 +1 @@
Subproject commit 6d658b7b42c83fd584008d72964cc75d0876b769 Subproject commit d6bae481c784461a2d2be14325041ea284319098

@ -1 +0,0 @@
Subproject commit ac9fa2d386c0cb2f44e1e1e83a555d585034dfa3

@ -1 +1 @@
Subproject commit c180b22ed5f4112d0ef35b2c5ac1acc45f9ebb5d Subproject commit 6f5ea41584c49543e63415e37356ebb24b07d89d

@ -1 +1 @@
Subproject commit e5f0728cd284d10080ae8eb03fc86e7b5eafcb72 Subproject commit 8ed4f9981da1d80badb0b1f65e250b2dbf7a564d

View File

@ -41,52 +41,67 @@ ENDC='\033[0m' # Reset to default color
# Print section header # Print section header
section_header() { section_header() {
if tput cols > /dev/null 2>&1; then if tput cols > /dev/null 2>&1; then
printf "${SECTION_COLOR}%$(tput cols)s" | tr ' ' '#' printf "${SECTION_COLOR}%$(tput cols)s\n" | tr ' ' '#'
printf "%$(tput cols)s" | tr ' ' '#' printf "%$(tput cols)s\n" | tr ' ' '#'
echo -e "$1" printf "%s\n" "$1"
printf "%$(tput cols)s" | tr ' ' '#' printf "%$(tput cols)s\n" | tr ' ' '#'
printf "%$(tput cols)s${ENDC}" | tr ' ' '#' printf "%$(tput cols)s${ENDC}\n" | tr ' ' '#'
else else
echo -e "${SECTION_COLOR}$1${ENDC}" printf "${SECTION_COLOR}%s\n${ENDC}" "$1"
fi fi
} }
section_header "Checking System Requirements and Configuring Installation" section_header "Checking System Requirements and Configuring Installation"
# Get distribution information # Get distribution information
test -e /etc/os-release && os_release="/etc/os-release" || os_release="/usr/lib/os-release" if [ -f /etc/os-release ]; then
source "$os_release" source /etc/os-release
else
printf "${FAIL_COLOR}%s\n${ENDC}" "/etc/os-release file not found. Distribution unknown."
PRETTY_NAME=UNKNOWN
fi
# Check for compatible distro # Check for compatible distro
if [[ "$ID" == rhel || "$ID_LIKE" == *rhel* ]]; then if [[ "$ID" == rhel || "$ID_LIKE" == *rhel* ]]; then
export FAMILY=rhel export FAMILY=rhel
if [ "$ID" != rhel ] && [ "$ID" != rocky ] && [ "$ID" != almalinux ]; then if [ "$ID" != rhel ] && [ "$ID" != rocky ] && [ "$ID" != almalinux ]; then
printf "${WARNING_COLOR}%s\n${ENDC}" "For Red Hat family distros, the Wally install script has only been tested on RHEL, Rocky Linux," \ printf "${WARNING_COLOR}%s%s\n${ENDC}" "For Red Hat family distros, the Wally installation script has only been tested on RHEL, Rocky Linux," \
" and AlmaLinux. Your distro is $PRETTY_NAME. The regular Red Hat install will be attempted, but there may be issues." " and AlmaLinux. Your distro is $PRETTY_NAME. The regular Red Hat install will be attempted, but there may be issues."
fi fi
export RHEL_VERSION="${VERSION_ID:0:1}" export RHEL_VERSION="${VERSION_ID:0:1}"
if (( RHEL_VERSION < 8 )); then if (( RHEL_VERSION < 8 )); then
echo "${FAIL_COLOR}The Wally install script is only compatible with versions 8 and 9 of RHEL, Rocky Linux, and AlmaLinux. You have version $VERSION.${ENDC}" printf "${FAIL_COLOR}%s\n${ENDC}" "The Wally installation script is only compatible with versions 8 and 9 of RHEL, Rocky Linux, and AlmaLinux. You have version $VERSION."
exit 1 exit 1
fi fi
elif [[ "$ID" == ubuntu || "$ID_LIKE" == *ubuntu* ]]; then elif [[ "$ID" == ubuntu || "$ID_LIKE" == *ubuntu* ]]; then
export FAMILY=ubuntu export FAMILY=ubuntu
if [ "$ID" != ubuntu ]; then if [ "$ID" != ubuntu ]; then
printf "${WARNING_COLOR}%s\n${ENDC}" "For Ubuntu family distros, the Wally install script has only been tested on standard Ubuntu. Your distro " \ printf "${WARNING_COLOR}%s%s\n${ENDC}" "For Ubuntu family distros, the Wally installation script has only been tested on standard Ubuntu. Your distro " \
"is $PRETTY_NAME. The regular Ubuntu install will be attempted, but there may be issues." "is $PRETTY_NAME. The regular Ubuntu install will be attempted, but there may be issues."
fi fi
export UBUNTU_VERSION="${VERSION_ID:0:2}" export UBUNTU_VERSION="${VERSION_ID:0:2}"
if (( UBUNTU_VERSION < 20 )); then if (( UBUNTU_VERSION < 20 )); then
echo "${FAIL_COLOR}The Wally install script has only been tested with versions 20.04 LTS, 22.04 LTS, and 24.04 LTS of Ubuntu. You have version $VERSION.${ENDC}" printf "${FAIL_COLOR}%s\n${ENDC}" "The Wally installation script has only been tested with Ubuntu versions 20.04 LTS, 22.04 LTS, and 24.04 LTS. You have version $VERSION."
exit 1
fi
elif [[ "$ID" == debian || "$ID_LIKE" == *debian* ]]; then
export FAMILY=debian
if [ "$ID" != debian ]; then
printf "${WARNING_COLOR}%s%s\n${ENDC}" "For Debian family distros, the Wally installation script has only been tested on standard Debian (and Ubuntu). Your distro " \
"is $PRETTY_NAME. The regular Debian install will be attempted, but there may be issues."
fi
export DEBIAN_VERSION="$VERSION_ID"
if (( DEBIAN_VERSION < 11 )); then
printf "${FAIL_COLOR}%s\n${ENDC}" "The Wally installation script has only been tested with Debian versions 11 and 12. You have version $VERSION."
exit 1 exit 1
fi fi
else else
printf "${FAIL_COLOR}%s\n${ENDC}" "The Wally install script is currently only compatible with Ubuntu and Red Hat family " \ printf "${FAIL_COLOR}%s%s%s\n${ENDC}" "The Wally installation script is currently only compatible with Ubuntu, Debian, and Red Hat family " \
"(RHEL, Rocky Linux, or AlmaLinux) distros. Your detected distro is $PRETTY_NAME. You may try manually running the " \ "(RHEL, Rocky Linux, or AlmaLinux) distros. Your detected distro is $PRETTY_NAME. You may try manually running the " \
"commands in this script, but it is likely that some will need to be altered." "commands in this script, but it is likely that some will need to be altered."
exit 1 exit 1
fi fi
echo -e "${OK_COLOR}${UNDERLINE}Detected information${ENDC}" printf "${OK_COLOR}${UNDERLINE}%s\n${ENDC}" "Detected information"
echo "Distribution: $PRETTY_NAME" echo "Distribution: $PRETTY_NAME"
echo "Version: $VERSION" echo "Version: $VERSION"

View File

@ -43,43 +43,55 @@ if [ -z "$FAMILY" ]; then
fi fi
# Generate list of packages to install and package manager commands based on distro
# Packages are grouped by which tool requires them. If multiple tools need a package, it is included in the first tool only # Packages are grouped by which tool requires them. If multiple tools need a package, it is included in the first tool only
# Packages that are constant across distros
GENERAL_PACKAGES+=(rsync git make cmake curl wget tar unzip bzip2 dialog mutt ssmtp)
GNU_PACKAGES+=(autoconf automake gawk bison flex texinfo gperf libtool ninja-build patchutils bc gcc)
VERILATOR_PACKAGES+=(help2man perl clang ccache numactl)
BUILDROOT_PACKAGES+=(ncurses-base cpio)
# Distro specific packages and package manager
if [ "$FAMILY" == rhel ]; then if [ "$FAMILY" == rhel ]; then
PYTHON_VERSION=python3.12 PYTHON_VERSION=python3.12
PACKAGE_MANAGER="dnf" PACKAGE_MANAGER="dnf -y"
UPDATE_COMMAND="sudo $PACKAGE_MANAGER update -y" UPDATE_COMMAND="sudo $PACKAGE_MANAGER update"
GENERAL_PACKAGES+=(which rsync git make cmake "$PYTHON_VERSION" "$PYTHON_VERSION"-pip curl wget tar pkgconf-pkg-config dialog mutt ssmtp) GENERAL_PACKAGES+=(which "$PYTHON_VERSION" "$PYTHON_VERSION"-pip pkgconf-pkg-config gcc-c++)
GNU_PACKAGES+=(autoconf automake libmpc-devel mpfr-devel gmp-devel gawk bison flex texinfo gperf libtool patchutils bc gcc gcc-c++ zlib-devel expat-devel libslirp-devel) GNU_PACKAGES+=(libmpc-devel mpfr-devel gmp-devel zlib-devel expat-devel libslirp-devel)
QEMU_PACKAGES+=(glib2-devel libfdt-devel pixman-devel bzip2 ninja-build) QEMU_PACKAGES+=(glib2-devel libfdt-devel pixman-devel)
SPIKE_PACKAGES+=(dtc boost-regex boost-system) SPIKE_PACKAGES+=(dtc boost-regex boost-system)
VERILATOR_PACKAGES+=(help2man perl clang ccache gperftools numactl mold) VVERILATOR_PACKAGES+=(gperftools mold)
BUILDROOT_PACKAGES+=(ncurses-base ncurses ncurses-libs ncurses-devel gcc-gfortran cpio) # gcc-gfortran is only needed for compiling spec benchmarks on buildroot linux BUILDROOT_PACKAGES+=(ncurses ncurses-libs ncurses-devel gcc-gfortran) # gcc-gfortran is only needed for compiling spec benchmarks on buildroot linux
# Extra packages not availale in rhel8, nice for Verilator # Extra packages not availale in rhel8, nice for Verilator
if (( RHEL_VERSION >= 9 )); then if (( RHEL_VERSION >= 9 )); then
VERILATOR_PACKAGES+=(perl-doc) VERILATOR_PACKAGES+=(perl-doc)
fi fi
# A newer version of gcc is required for qemu # A newer version of gcc is required for qemu
OTHER_PACKAGES=(gcc-toolset-13) OTHER_PACKAGES=(gcc-toolset-13)
elif [ "$FAMILY" == ubuntu ]; then elif [[ "$FAMILY" == ubuntu || "$FAMILY" == debian ]]; then
if (( UBUNTU_VERSION >= 24 )); then if (( UBUNTU_VERSION >= 24 )); then
PYTHON_VERSION=python3.12 PYTHON_VERSION=python3.12
VERILATOR_PACKAGES+=(mold) # Not availale in Ubuntu 20.04, nice for Verilator
elif (( UBUNTU_VERSION >= 22 )); then elif (( UBUNTU_VERSION >= 22 )); then
PYTHON_VERSION=python3.11 PYTHON_VERSION=python3.11
VERILATOR_PACKAGES+=(mold) # Not availale in Ubuntu 20.04, nice for Verilator
elif (( UBUNTU_VERSION >= 20 )); then elif (( UBUNTU_VERSION >= 20 )); then
PYTHON_VERSION=python3.9 PYTHON_VERSION=python3.9
OTHER_PACKAGES+=(gcc-10 g++-10 cpp-10) # Newer version of gcc needed for Verilator OTHER_PACKAGES+=(gcc-10 g++-10 cpp-10) # Newer version of gcc needed for Verilator
elif (( DEBIAN_VERSION >= 12 )); then
PYTHON_VERSION=python3.11
elif (( DEBIAN_VERSION >= 11 )); then
PYTHON_VERSION=python3.9
fi fi
PACKAGE_MANAGER="DEBIAN_FRONTEND=noninteractive apt-get" # Mold not available in older distros for Verilator, will download binary instead
UPDATE_COMMAND="sudo $PACKAGE_MANAGER update -y && sudo $PACKAGE_MANAGER upgrade -y --with-new-pkgs" if (( UBUNTU_VERSION != 20 && DEBIAN_VERSION != 11 )); then
GENERAL_PACKAGES+=(rsync git make cmake "$PYTHON_VERSION" python3-pip "$PYTHON_VERSION"-venv curl wget tar pkg-config dialog mutt ssmtp) VERILATOR_PACKAGES+=(mold)
GNU_PACKAGES+=(autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat1-dev ninja-build libglib2.0-dev libslirp-dev) fi
PACKAGE_MANAGER="DEBIAN_FRONTEND=noninteractive apt-get -y"
UPDATE_COMMAND="sudo $PACKAGE_MANAGER update && sudo $PACKAGE_MANAGER upgrade --with-new-pkgs"
GENERAL_PACKAGES+=("$PYTHON_VERSION" python3-pip "$PYTHON_VERSION"-venv pkg-config g++)
GNU_PACKAGES+=(autotools-dev libmpc-dev libmpfr-dev libgmp-dev build-essential zlib1g-dev libexpat1-dev libglib2.0-dev libslirp-dev)
QEMU_PACKAGES+=(libfdt-dev libpixman-1-dev) QEMU_PACKAGES+=(libfdt-dev libpixman-1-dev)
SPIKE_PACKAGES+=(device-tree-compiler libboost-regex-dev libboost-system-dev) SPIKE_PACKAGES+=(device-tree-compiler libboost-regex-dev libboost-system-dev)
VERILATOR_PACKAGES+=(help2man perl g++ clang ccache libunwind-dev libgoogle-perftools-dev numactl perl-doc libfl2 libfl-dev zlib1g) VERILATOR_PACKAGES+=(libunwind-dev libgoogle-perftools-dev perl-doc libfl2 libfl-dev zlib1g)
BUILDROOT_PACKAGES+=(ncurses-base ncurses-bin libncurses-dev gfortran cpio) # gfortran is only needed for compiling spec benchmarks on buildroot linux BUILDROOT_PACKAGES+=(ncurses-bin libncurses-dev gfortran) # gfortran is only needed for compiling spec benchmarks on buildroot linux
VIVADO_PACKAGES+=(libncurses*) # Vivado hangs on the third stage of installation without this VIVADO_PACKAGES+=(libncurses*) # Vivado hangs on the third stage of installation without this
fi fi
@ -91,7 +103,7 @@ if [ "${1}" == "--check" ]; then
for pack in "${GENERAL_PACKAGES[@]}" "${GNU_PACKAGES[@]}" "${QEMU_PACKAGES[@]}" "${SPIKE_PACKAGES[@]}" "${VERILATOR_PACKAGES[@]}" "${BUILDROOT_PACKAGES[@]}" "${OTHER_PACKAGES[@]}"; do for pack in "${GENERAL_PACKAGES[@]}" "${GNU_PACKAGES[@]}" "${QEMU_PACKAGES[@]}" "${SPIKE_PACKAGES[@]}" "${VERILATOR_PACKAGES[@]}" "${BUILDROOT_PACKAGES[@]}" "${OTHER_PACKAGES[@]}"; do
rpm -q "$pack" > /dev/null || (echo -e "${FAIL_COLOR}Missing packages detected (${WARNING_COLOR}$pack${FAIL_COLOR}). Run as root to auto-install or run wally-package-install.sh first.${ENDC}" && exit 1) rpm -q "$pack" > /dev/null || (echo -e "${FAIL_COLOR}Missing packages detected (${WARNING_COLOR}$pack${FAIL_COLOR}). Run as root to auto-install or run wally-package-install.sh first.${ENDC}" && exit 1)
done done
elif [ "$FAMILY" == ubuntu ]; then elif [[ "$FAMILY" == ubuntu || "$FAMILY" == debian ]]; then
for pack in "${GENERAL_PACKAGES[@]}" "${GNU_PACKAGES[@]}" "${QEMU_PACKAGES[@]}" "${SPIKE_PACKAGES[@]}" "${VERILATOR_PACKAGES[@]}" "${BUILDROOT_PACKAGES[@]}" "${OTHER_PACKAGES[@]}"; do for pack in "${GENERAL_PACKAGES[@]}" "${GNU_PACKAGES[@]}" "${QEMU_PACKAGES[@]}" "${SPIKE_PACKAGES[@]}" "${VERILATOR_PACKAGES[@]}" "${BUILDROOT_PACKAGES[@]}" "${OTHER_PACKAGES[@]}"; do
dpkg -l "$pack" | grep "ii" > /dev/null || (echo -e "${FAIL_COLOR}Missing packages detected (${WARNING_COLOR}$pack${FAIL_COLOR}). Run as root to auto-install or run wally-package-install.sh first." && exit 1) dpkg -l "$pack" | grep "ii" > /dev/null || (echo -e "${FAIL_COLOR}Missing packages detected (${WARNING_COLOR}$pack${FAIL_COLOR}). Run as root to auto-install or run wally-package-install.sh first." && exit 1)
done done
@ -122,7 +134,7 @@ else
# Update and Upgrade tools # Update and Upgrade tools
eval "$UPDATE_COMMAND" eval "$UPDATE_COMMAND"
# Install packages listed above using appropriate package manager # Install packages listed above using appropriate package manager
sudo $PACKAGE_MANAGER install -y "${GENERAL_PACKAGES[@]}" "${GNU_PACKAGES[@]}" "${QEMU_PACKAGES[@]}" "${SPIKE_PACKAGES[@]}" "${VERILATOR_PACKAGES[@]}" "${BUILDROOT_PACKAGES[@]}" "${OTHER_PACKAGES[@]}" "${VIVADO_PACKAGES[@]}" sudo $PACKAGE_MANAGER install "${GENERAL_PACKAGES[@]}" "${GNU_PACKAGES[@]}" "${QEMU_PACKAGES[@]}" "${SPIKE_PACKAGES[@]}" "${VERILATOR_PACKAGES[@]}" "${BUILDROOT_PACKAGES[@]}" "${OTHER_PACKAGES[@]}" "${VIVADO_PACKAGES[@]}"
# Post install steps # Post install steps
# Vivado looks for ncurses5 libraries, but Ubuntu 24.04 only has ncurses6 # Vivado looks for ncurses5 libraries, but Ubuntu 24.04 only has ncurses6

View File

@ -118,7 +118,7 @@ if [ "$1" == "--clean" ] || [ "$2" == "--clean" ]; then
shift shift
fi fi
# Check for clean flag # Check for no-buildroot flag
if [ "$1" == "--no-buildroot" ] || [ "$2" == "--no-buildroot" ]; then if [ "$1" == "--no-buildroot" ] || [ "$2" == "--no-buildroot" ]; then
no_buidroot=true no_buidroot=true
shift shift
@ -263,17 +263,30 @@ if (( RHEL_VERSION == 8 )); then
fi fi
fi fi
# Mold needed for Verilator
if (( UBUNTU_VERSION == 20 || DEBIAN_VERSION == 11 )); then
STATUS="mold"
if [ ! -e "$RISCV"/bin/mold ]; then
section_header "Installing mold"
cd "$RISCV"
wget -nv --retry-connrefused $retry_on_host_error --output-document=mold.tar.gz https://github.com/rui314/mold/releases/download/v2.34.1/mold-2.34.1-x86_64-linux.tar.gz
tar xz --directory="$RISCV" --strip-components=1 -f mold.tar.gz
rm -f mold.tar.gz
echo -e "${SUCCESS_COLOR}Mold successfully installed/updated!${ENDC}"
else
echo -e "${SUCCESS_COLOR}Mold already installed.${ENDC}"
fi
fi
# RISC-V GNU Toolchain (https://github.com/riscv-collab/riscv-gnu-toolchain) # RISC-V GNU Toolchain (https://github.com/riscv-collab/riscv-gnu-toolchain)
# The RISC-V GNU Toolchain includes the GNU Compiler Collection (gcc), GNU Binutils, Newlib, # The RISC-V GNU Toolchain includes the GNU Compiler Collection (gcc), GNU Binutils, Newlib,
# and the GNU Debugger Project (gdb). It is a collection of tools used to compile RISC-V programs. # and the GNU Debugger Project (gdb). It is a collection of tools used to compile RISC-V programs.
# To install GCC from source can take hours to compile. # To install GCC from source can take hours to compile.
# This configuration enables multilib to target many flavors of RISC-V. # This configuration enables multilib to target many flavors of RISC-V.
# This book is tested with GCC 13.2.0 # This book is tested with GCC 13.2.0 and 14.2.0.
section_header "Installing/Updating RISC-V GNU Toolchain" section_header "Installing/Updating RISC-V GNU Toolchain"
STATUS="riscv-gnu-toolchain" STATUS="riscv-gnu-toolchain"
cd "$RISCV" cd "$RISCV"
# Temporarily pin riscv-gnu-toolchain to use GCC 13.2.0. GCC 14 does not work with the Q extension.
if git_check "riscv-gnu-toolchain" "https://github.com/riscv/riscv-gnu-toolchain" "$RISCV/riscv-gnu-toolchain/stamps/build-gcc-newlib-stage2"; then if git_check "riscv-gnu-toolchain" "https://github.com/riscv/riscv-gnu-toolchain" "$RISCV/riscv-gnu-toolchain/stamps/build-gcc-newlib-stage2"; then
cd "$RISCV"/riscv-gnu-toolchain cd "$RISCV"/riscv-gnu-toolchain
git reset --hard && git clean -f && git checkout master && git pull && git submodule update git reset --hard && git clean -f && git checkout master && git pull && git submodule update

View File

@ -31,7 +31,7 @@
uint8_t spi_txrx(uint8_t byte) { uint8_t spi_txrx(uint8_t byte) {
spi_sendbyte(byte); spi_sendbyte(byte);
waittx(); waitrx();
return spi_readbyte(); return spi_readbyte();
} }

View File

@ -106,7 +106,7 @@ static inline void waittx() {
} }
static inline void waitrx() { static inline void waitrx() {
while(read_reg(SPI_IP) & 2) {} while(!(read_reg(SPI_IP) & 2)) {}
} }
static inline uint8_t spi_readbyte() { static inline uint8_t spi_readbyte() {

View File

@ -110,9 +110,8 @@ if {[lcheck lst "--fcov"]} {
set FCvlog "+define+INCLUDE_TRACE2COV \ set FCvlog "+define+INCLUDE_TRACE2COV \
+define+IDV_INCLUDE_TRACE2COV \ +define+IDV_INCLUDE_TRACE2COV \
+define+COVER_BASE_RV32I \ +define+COVER_BASE_RV32I \
+incdir+$env(WALLY)/addins/riscvISACOV/source \ +incdir+$env(WALLY)/addins/cvw-arch-verif/riscvISACOV/source \
" "
set FCvopt "+TRACE2COV_ENABLE=1 +IDV_TRACE2COV=1" set FCvopt "+TRACE2COV_ENABLE=1 +IDV_TRACE2COV=1"
} }

View File

@ -26,7 +26,7 @@ module spi_fifo #(parameter M=3, N=8)( // 2^M entries of N bits
assign rdata = mem[raddr]; assign rdata = mem[raddr];
always_ff @(posedge PCLK) always_ff @(posedge PCLK)
if (winc & ~wfull) mem[waddr] <= wdata; if (winc & wen & ~wfull) mem[waddr] <= wdata;
// write and read are enabled // write and read are enabled
always_ff @(posedge PCLK) always_ff @(posedge PCLK)