-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #498 from bittide/add-disabled-jtag
Bump `clash-vexriscv` to latest version
- Loading branch information
Showing
46 changed files
with
5,107 additions
and
2,259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# syntax=docker/dockerfile:1.2 | ||
|
||
# SPDX-FileCopyrightText: 2024 Google LLC | ||
|
||
# SPDX-License-Identifier: CC0-1.0 | ||
|
||
ARG UBUNTU_VERSION | ||
FROM ubuntu:$UBUNTU_VERSION AS builder | ||
|
||
LABEL vendor="QBayLogic B.V." maintainer="[email protected]" | ||
ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 LC_ALL=C.UTF-8 PREFIX=/opt | ||
|
||
ARG DEPS_COMMON="build-essential ca-certificates curl git locales ca-certificates" | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends $DEPS_COMMON \ | ||
&& locale-gen en_US.UTF-8 \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
FROM builder AS build-openocd-vexriscv | ||
|
||
ARG DEPS_OPENOCD_VEXRISCV="autoconf automake libtool pkg-config libusb-1.0-0-dev libftdi-dev libhidapi-dev libusb-dev libyaml-dev" | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends $DEPS_OPENOCD_VEXRISCV \ | ||
&& git clone --recursive https://github.com/SpinalHDL/openocd_riscv.git \ | ||
&& cd openocd_riscv \ | ||
&& ./bootstrap \ | ||
&& ./configure --enable-ftdi --enable-dummy --prefix=/opt \ | ||
&& make -j$(nproc) \ | ||
&& make install | ||
|
||
FROM builder AS build-verilator | ||
|
||
ARG DEPS_VERILATOR="perl python3 make autoconf g++ flex bison ccache libgoogle-perftools-dev numactl perl-doc libfl2 libfl-dev zlib1g zlib1g-dev help2man" | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends $DEPS_VERILATOR | ||
|
||
ARG verilator_version="v5.020" | ||
RUN git clone https://github.com/verilator/verilator verilator \ | ||
&& cd verilator \ | ||
&& git checkout $verilator_version \ | ||
&& autoconf \ | ||
&& ./configure --prefix $PREFIX \ | ||
&& make PREFIX=$PREFIX -j$(nproc) \ | ||
&& make PREFIX=$PREFIX install \ | ||
&& cd ../.. \ | ||
&& rm -Rf verilator | ||
|
||
FROM builder AS build-ghc | ||
|
||
ARG ghcup_version="0.1.22.0" | ||
|
||
# Must be explicitly set | ||
ARG ghc_version | ||
ARG cabal_version | ||
|
||
RUN curl "https://downloads.haskell.org/~ghcup/$ghcup_version/x86_64-linux-ghcup-$ghcup_version" --output /usr/bin/ghcup \ | ||
&& chmod +x /usr/bin/ghcup \ | ||
&& ghcup install ghc $ghc_version --set \ | ||
&& ghcup install cabal $cabal_version --set | ||
|
||
FROM builder AS run | ||
|
||
LABEL vendor="QBayLogic B.V." maintainer="[email protected]" | ||
ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 LC_ALL=C.UTF-8 PATH="$PATH:/opt/bin:/root/.ghcup/bin" | ||
|
||
ARG DEPS_RUNTIME="gnupg pkg-config openjdk-8-jdk gdb-multiarch picocom libtinfo5 libtinfo-dev build-essential curl libc6-dev libgmp10-dev python3 ccache libftdi1 libhidapi-hidraw0 libusb-1.0-0 libyaml-0-2" | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends $DEPS_RUNTIME \ | ||
&& echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | tee /etc/apt/sources.list.d/sbt.list \ | ||
&& echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | tee /etc/apt/sources.list.d/sbt_old.list \ | ||
&& curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | apt-key add \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends sbt \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=build-verilator /opt /opt | ||
COPY --from=build-openocd-vexriscv /opt /opt | ||
COPY --from=build-ghc /root/.ghcup /root/.ghcup |
48 changes: 48 additions & 0 deletions
48
clash-vexriscv/.github/docker/build-and-publish-docker-image.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env bash | ||
# SPDX-FileCopyrightText: 2024 Google LLC | ||
|
||
# SPDX-License-Identifier: CC0-1.0 | ||
set -xeo pipefail | ||
|
||
REPO="ghcr.io/clash-lang" | ||
NAME="clash-vexriscv-ci" | ||
DIR=$(dirname "$0") | ||
now=$(date +%Y%m%d) | ||
|
||
if [[ "$1" == "-y" ]]; then | ||
push=y | ||
elif [[ "$1" != "" ]]; then | ||
echo "Unrecognized argument: $1" >&2 | ||
exit 1 | ||
fi | ||
|
||
UBUNTU_VERSION=jammy-20240125 | ||
GHC_VERSIONS=( "9.4.8" "9.2.8" "9.0.2") | ||
CABAL_VERSIONS=("3.10.2.0" "3.10.2.0" "3.10.2.0") | ||
|
||
for i in "${!GHC_VERSIONS[@]}" | ||
do | ||
GHC_VERSION="${GHC_VERSIONS[i]}" | ||
CABAL_VERSION="${CABAL_VERSIONS[i]}" | ||
|
||
docker buildx build \ | ||
--build-arg UBUNTU_VERSION=${UBUNTU_VERSION} \ | ||
--build-arg cabal_version=${CABAL_VERSION} \ | ||
--build-arg ghc_version=${GHC_VERSION} \ | ||
-t "${REPO}/${NAME}:${GHC_VERSION}-$now" \ | ||
"$DIR" | ||
done | ||
|
||
if [[ "${push}" == "" ]]; then | ||
read -p "Push to GitHub? (y/N) " push | ||
fi | ||
|
||
if [[ $push =~ ^[Yy]$ ]]; then | ||
for i in "${!GHC_VERSIONS[@]}" | ||
do | ||
GHC_VERSION="${GHC_VERSIONS[i]}" | ||
docker push "${REPO}/${NAME}:${GHC_VERSION}-$now" | ||
done | ||
else | ||
echo "Skipping push to container registry" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,3 +65,9 @@ log | |
vivado_* | ||
tight_setup_hold_pins.txt | ||
.Xil | ||
|
||
# Verilator debug output | ||
simulation_dump.vcd | ||
|
||
# Clash output | ||
verilog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ packages: | |
clash-vexriscv-sim/ | ||
|
||
write-ghc-environment-files: always | ||
|
||
tests: True | ||
|
||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,10 @@ | ||
-- SPDX-FileCopyrightText: 2023 Google LLC | ||
-- SPDX-FileCopyrightText: 2023-2024 Google LLC | ||
-- | ||
-- SPDX-License-Identifier: Apache-2.0 | ||
|
||
import Clash.Prelude | ||
import Clash.Annotations.TH | ||
import Prelude | ||
|
||
import VexRiscv | ||
|
||
circuit :: | ||
"CLK" ::: Clock System -> | ||
"RST" ::: Reset System -> | ||
"INPUT" ::: Signal System Input -> | ||
"OUTPUT" ::: Signal System Output | ||
circuit clk rst input = | ||
withClockResetEnable clk rst enableGen vexRiscv input | ||
|
||
makeTopEntity 'circuit | ||
import qualified Clash.Main as Clash | ||
|
||
main :: IO () | ||
main = pure () | ||
main = Clash.defaultMain ["Utils.Instance", "-main-is", "circuit", "--verilog"] |
Oops, something went wrong.