mirror of
https://github.com/antonblanchard/chiselwatt.git
synced 2026-01-11 23:53:33 +00:00
commit
936679ee06
@ -6,4 +6,4 @@ services: docker
|
||||
before_install: docker pull verilator/verilator:latest
|
||||
|
||||
script:
|
||||
docker run --rm -t -v `pwd`:/build -w /build --entrypoint /bin/bash verilator/verilator:latest -c "apt update && apt install -y default-jre-headless gnupg python3-pexpect && apt update && echo 'deb https://dl.bintray.com/sbt/debian /' | tee -a /etc/apt/sources.list.d/sbt.list && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823 && apt update && apt install -y sbt && make && make check && ./scripts/test_micropython_long.py"
|
||||
docker run --rm -t -v `pwd`:/build -w /build --entrypoint /bin/bash verilator/verilator:latest -c "apt update && apt install -y default-jre-headless python3-pexpect curl && make && make check && ./scripts/test_micropython_long.py"
|
||||
|
||||
4
Makefile
4
Makefile
@ -7,7 +7,7 @@ verilog_files = Core.v MemoryBlackBox.v
|
||||
verilator_binary = chiselwatt
|
||||
|
||||
$(verilog_files): $(scala_files)
|
||||
sbt 'runMain CoreObj'
|
||||
scripts/mill chiselwatt.run
|
||||
|
||||
$(verilator_binary): $(verilog_files) chiselwatt.cpp uart.c
|
||||
# Warnings disabled until we fix the Chisel issues
|
||||
@ -24,7 +24,7 @@ clean:
|
||||
@rm -f LoadStoreInsns.hex MemoryBlackBoxInsns.hex
|
||||
|
||||
scala_tests: $(verilator_binary)
|
||||
sbt testOnly
|
||||
scripts/mill chiselwatt.test
|
||||
|
||||
tests = $(sort $(patsubst tests/%.out,%,$(wildcard tests/*.out)))
|
||||
|
||||
|
||||
10
README.md
10
README.md
@ -4,16 +4,6 @@ A tiny POWER Open ISA soft processor written in Chisel.
|
||||
|
||||
## Simulation using verilator
|
||||
|
||||
* Chisel uses `sbt` (the scala build tool), but unfortunately most of the
|
||||
distros package an ancient version. On Fedora you can install an upstream
|
||||
version using:
|
||||
|
||||
```sh
|
||||
$ sudo dnf remove sbt
|
||||
$ sudo curl https://bintray.com/sbt/rpm/rpm | sudo tee /etc/yum.repos.d/bintray-sbt-rpm.repo
|
||||
$ sudo dnf --enablerepo=bintray--sbt-rpm install sbt
|
||||
```
|
||||
|
||||
* Chiselwatt uses `verilator` for simulation. Either install this from your
|
||||
distro or build it. On Fedora you can install the distro version using:
|
||||
|
||||
|
||||
2
build.sc
2
build.sc
@ -47,5 +47,5 @@ trait HasMacroParadise extends ScalaModule {
|
||||
object chiselwatt extends CrossSbtModule with HasChisel3 with HasChiselTests with HasXsource211 with HasMacroParadise {
|
||||
override def millSourcePath = super.millSourcePath
|
||||
def crossScalaVersion = "2.12.10"
|
||||
def mainClass = Some("CoreObj")
|
||||
}
|
||||
|
||||
|
||||
48
scripts/mill
Executable file
48
scripts/mill
Executable file
@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# This is a wrapper script, that automatically download mill from GitHub release pages
|
||||
# You can give the required mill version with MILL_VERSION env variable
|
||||
# If no version is given, it falls back to the value of DEFAULT_MILL_VERSION
|
||||
DEFAULT_MILL_VERSION=0.6.0
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z "$MILL_VERSION" ] ; then
|
||||
if [ -f ".mill-version" ] ; then
|
||||
MILL_VERSION="$(head -n 1 .mill-version 2> /dev/null)"
|
||||
elif [ -f "mill" ] && [ "$BASH_SOURCE" != "mill" ] ; then
|
||||
MILL_VERSION=$(grep -F "DEFAULT_MILL_VERSION=" "mill" | head -n 1 | cut -d= -f2)
|
||||
else
|
||||
MILL_VERSION=$DEFAULT_MILL_VERSION
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "x${XDG_CACHE_HOME}" != "x" ] ; then
|
||||
MILL_DOWNLOAD_PATH="${XDG_CACHE_HOME}/mill/download"
|
||||
else
|
||||
MILL_DOWNLOAD_PATH="${HOME}/.cache/mill/download"
|
||||
fi
|
||||
MILL_EXEC_PATH="${MILL_DOWNLOAD_PATH}/${MILL_VERSION}"
|
||||
|
||||
version_remainder="$MILL_VERSION"
|
||||
MILL_MAJOR_VERSION="${version_remainder%%.*}"; version_remainder="${version_remainder#*.}"
|
||||
MILL_MINOR_VERSION="${version_remainder%%.*}"; version_remainder="${version_remainder#*.}"
|
||||
|
||||
if [ ! -x "$MILL_EXEC_PATH" ] ; then
|
||||
mkdir -p $MILL_DOWNLOAD_PATH
|
||||
if [ "$MILL_MAJOR_VERSION" -gt 0 ] || [ "$MILL_MINOR_VERSION" -ge 5 ] ; then
|
||||
ASSEMBLY="-assembly"
|
||||
fi
|
||||
DOWNLOAD_FILE=$MILL_EXEC_PATH-tmp-download
|
||||
MILL_DOWNLOAD_URL="https://github.com/lihaoyi/mill/releases/download/${MILL_VERSION%%-*}/$MILL_VERSION${ASSEMBLY}"
|
||||
curl --fail -L -o "$DOWNLOAD_FILE" "$MILL_DOWNLOAD_URL"
|
||||
chmod +x "$DOWNLOAD_FILE"
|
||||
mv "$DOWNLOAD_FILE" "$MILL_EXEC_PATH"
|
||||
unset DOWNLOAD_FILE
|
||||
unset MILL_DOWNLOAD_URL
|
||||
fi
|
||||
|
||||
unset MILL_DOWNLOAD_PATH
|
||||
unset MILL_VERSION
|
||||
|
||||
exec $MILL_EXEC_PATH "$@"
|
||||
Loading…
x
Reference in New Issue
Block a user