Skip to content

Commit

Permalink
Merge pull request #377 from ucb-bar/dev
Browse files Browse the repository at this point in the history
Update master with latest work on dev
  • Loading branch information
SeahK authored Dec 13, 2024
2 parents 5bb76e4 + 53d0d16 commit 087a3d8
Show file tree
Hide file tree
Showing 29 changed files with 678 additions and 366 deletions.
31 changes: 3 additions & 28 deletions .github/scripts/defaults.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
#!/bin/bash

# shared variables between the different services
#
# CircleCI set values:
# $SERVER - points to the millennium build server
# $AWS_SERVER - points to the aws manager instance
# $CI_DIR - home directory on build server
# $CI_AWS_DIR - home directory on aws


#############
# SHARED VARS
#############
Expand All @@ -17,26 +8,10 @@
CI_MAKE_NPROC=4
LOCAL_MAKE_NPROC=$CI_MAKE_NPROC

# verilator version
VERILATOR_VERSION=v4.034
# local variables
LOCAL_CHECKOUT_DIR=$GITHUB_WORKSPACE

# local variables (aka within the docker container)
LOCAL_WORK_DIR=$HOME
LOCAL_CHECKOUT_DIR=$GITHUB_WORKSPACE/
LOCAL_RISCV_DIR=$HOME/riscv-tools-install
LOCAL_ESP_DIR=$HOME/esp-tools-install
LOCAL_CHIPYARD_DIR=$HOME/chipyard
LOCAL_CHIPYARD_DIR=$REMOTE_WORK_DIR
LOCAL_SIM_DIR=$LOCAL_CHIPYARD_DIR/sims/verilator
LOCAL_VERILATOR_DIR=$HOME/verilator-install
LOCAL_CONDA=/opt/conda/

CICONFIG=chipyard.config.WithNoDebug_GemminiRocketConfig

echo "::set-output name=LOCAL_WORK_DIR::$LOCAL_WORK_DIR"
echo "::set-output name=LOCAL_CHECKOUT_DIR::$LOCAL_CHECKOUT_DIR"
echo "::set-output name=LOCAL_RISCV_DIR::$LOCAL_RISCV_DIR"
echo "::set-output name=LOCAL_ESP_DIR::$LOCAL_ESP_DIR"
echo "::set-output name=LOCAL_CHIPYARD_DIR::$LOCAL_CHIPYARD_DIR"
echo "::set-output name=LOCAL_SIM_DIR::$LOCAL_SIM_DIR"
echo "::set-output name=LOCAL_VERILATOR_DIR::$LOCAL_VERILATOR_DIR"
echo "::set-output name=LOCAL_CONDA::$LOCAL_CONDA"
5 changes: 2 additions & 3 deletions .github/scripts/do-rtl-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ set -ex
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
source $SCRIPT_DIR/defaults.sh

source $SCRIPT_DIR/enable-conda.sh
eval "$(conda shell.bash hook)"

cd $LOCAL_CHIPYARD_DIR
source env.sh

cd $LOCAL_SIM_DIR
make -C $LOCAL_SIM_DIR clean
make -j$LOCAL_MAKE_NPROC -C $LOCAL_SIM_DIR VERILATOR_OPT_FLAGS="-O0 -OG" JAVA_OPTS="-Xmx2500M -Xss8M" SBT_OPTS="-Dsbt.ivy.home=$LOCAL_CHIPYARD_DIR/.ivy2 -Dsbt.supershell=false -Dsbt.global.base=$LOCAL_CHIPYARD_DIR/.sbt -Dsbt.boot.directory=$LOCAL_CHIPYARD_DIR/.sbt/boot" CONFIG=$CICONFIG

make -j$LOCAL_MAKE_NPROC -C $LOCAL_SIM_DIR CONFIG=$CICONFIG
13 changes: 0 additions & 13 deletions .github/scripts/enable-conda.sh

This file was deleted.

18 changes: 6 additions & 12 deletions .github/scripts/install-gemmini.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
#!/bin/bash

#-------------------------------------------------------------
# installs gemmini
#
# run location: circle ci docker image
#-------------------------------------------------------------

# turn echo on and error on earliest command
set -ex

# get shared variables
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
source $SCRIPT_DIR/defaults.sh

source $SCRIPT_DIR/enable-conda.sh
eval "$(conda shell.bash hook)"

mkdir -p $JAVA_TMP_DIR

cd $HOME
rm -rf chipyard
git clone --progress --verbose https://github.com/ucb-bar/chipyard.git chipyard
git clone --progress --verbose https://github.com/ucb-bar/chipyard.git $LOCAL_CHIPYARD_DIR
cd $LOCAL_CHIPYARD_DIR

git fetch
git checkout $(cat $LOCAL_CHECKOUT_DIR/CHIPYARD.hash)

./build-setup.sh riscv-tools -f -s 6 -s 7 -s 8 -s 9
export MAKEFLAGS="-j32"
./build-setup.sh riscv-tools -f -s 6 -s 7 -s 8 -s 9 -v

source env.sh

Expand All @@ -36,4 +31,3 @@ cd $LOCAL_CHECKOUT_DIR
git submodule update --init --recursive software/gemmini-rocc-tests
rm -rf $LOCAL_CHIPYARD_DIR/generators/gemmini/* $LOCAL_CHIPYARD_DIR/generators/gemmini/.git*
mv -f $LOCAL_CHECKOUT_DIR/* $LOCAL_CHECKOUT_DIR/.git* $LOCAL_CHIPYARD_DIR/generators/gemmini/

10 changes: 0 additions & 10 deletions .github/scripts/remove-chipyard.sh

This file was deleted.

7 changes: 4 additions & 3 deletions .github/scripts/run-tests-rtl.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/bash

# turn echo on and error on earliest command
set -ex

SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
source $SCRIPT_DIR/defaults.sh

source $SCRIPT_DIR/enable-conda.sh
eval "$(conda shell.bash hook)"

cd $LOCAL_CHIPYARD_DIR
source env.sh
Expand All @@ -14,5 +15,5 @@ cd $LOCAL_CHIPYARD_DIR/generators/gemmini/software/gemmini-rocc-tests
CFLAGS=-DFAST ./build.sh

cd build
make test-baremetal-bareMetalC RUNNER="'make -C $LOCAL_CHIPYARD_DIR/sims/verilator/ CONFIG=$CICONFIG run-binary-hex BINARY='"

make test-baremetal-bareMetalC RUNNER="'make -C $LOCAL_SIM_DIR CONFIG=$CICONFIG run-binary-hex BINARY='"
#make -j$LOCAL_MAKE_NPROC test-baremetal-bareMetalC RUNNER="'make -C $LOCAL_SIM_DIR CONFIG=$CICONFIG run-binary-hex BINARY='"
6 changes: 3 additions & 3 deletions .github/scripts/run-tests-spike.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/bash

# turn echo on and error on earliest command
set -ex

SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
source $SCRIPT_DIR/defaults.sh

source $SCRIPT_DIR/enable-conda.sh
eval "$(conda shell.bash hook)"

cd $LOCAL_CHIPYARD_DIR
source env.sh
Expand All @@ -25,5 +26,4 @@ cd $LOCAL_CHIPYARD_DIR/generators/gemmini/software/gemmini-rocc-tests
./build.sh

cd build
make test-baremetal

make -j$LOCAL_MAKE_NPROC test-baremetal
160 changes: 58 additions & 102 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
@@ -1,118 +1,74 @@
name: Gemmini CI

on: [push]
jobs:
install-gemmini:
name: gemmini-install
runs-on: ubuntu-latest
container:
image: ucbbar/chipyard-ci-image:3f9150
options: --entrypoint /bin/bash
steps:
- name: checkout
uses: actions/checkout@v2
- name: get paths
run: .github/scripts/defaults.sh
id: get-paths

- name: install gemmini
run: .github/scripts/install-gemmini.sh
defaults:
run:
shell: bash -leo pipefail {0}

- name: cache gemmini install
uses: actions/cache@v2
with:
path: |
${{ steps.get-paths.outputs.LOCAL_CHIPYARD_DIR }}
${{ steps.get-paths.outputs.LOCAL_CONDA }}
key: gemmini-install-${{ github.ref }}-${{ github.sha }}
env:
REMOTE_WORK_DIR: /scratch/buildbot/gemmini-ci-shared/gemmini-${{ github.sha }}
JAVA_TMP_DIR: /tmp/gemmini-${{ github.sha }}-full

build-gemmini-config:
name: build-gemmini-config
runs-on: self-hosted
needs: install-gemmini
container:
image: ucbbar/chipyard-ci-image:3f9150
options: --entrypoint /bin/bash
jobs:
install-gemmini:
runs-on: jktqos
steps:
- name: checkout
uses: actions/checkout@v2
- name: get paths
run: .github/scripts/defaults.sh
id: get-paths

- name: remove chipyard
run: .github/scripts/remove-chipyard.sh

- name: restore cache gemmini install
uses: actions/cache@v2
with:
path: |
${{ steps.get-paths.outputs.LOCAL_CHIPYARD_DIR }}
${{ steps.get-paths.outputs.LOCAL_CONDA }}
key: gemmini-install-${{ github.ref }}-${{ github.sha }}

- name: Building Gemmini Config using Verilator
run: .github/scripts/do-rtl-build.sh

- name: cache build-gemmini-config install
uses: actions/cache@v2
with:
path: |
${{ steps.get-paths.outputs.LOCAL_CHIPYARD_DIR }}
${{ steps.get-paths.outputs.LOCAL_CONDA }}
key: build-gemmini-config-${{ github.ref }}-${{ github.sha }}
- name: Delete old checkout
run: |
rm -rf ${{ github.workspace }}/* || true
rm -rf ${{ github.workspace }}/.* || true
- uses: actions/checkout@v3
- name: Setup repository
run: |
.github/scripts/install-gemmini.sh
spike-run-tests:
name: spike-run-tests
runs-on: ubuntu-latest
runs-on: jktqos
needs: install-gemmini
container:
image: ucbbar/chipyard-ci-image:3f9150
options: --entrypoint /bin/bash
steps:
- name: checkout
uses: actions/checkout@v2
- name: get paths
run: .github/scripts/defaults.sh
id: get-paths

- name: remove chipyard
run: .github/scripts/remove-chipyard.sh
- name: Delete old checkout
run: |
rm -rf ${{ github.workspace }}/* || true
rm -rf ${{ github.workspace }}/.* || true
- uses: actions/checkout@v3
- name: Run Gemmini Spike tests
run: |
.github/scripts/run-tests-spike.sh
- name: restore cache gemmini install
uses: actions/cache@v2
with:
path: |
${{ steps.get-paths.outputs.LOCAL_CHIPYARD_DIR }}
${{ steps.get-paths.outputs.LOCAL_CONDA }}
key: gemmini-install-${{ github.ref }}-${{ github.sha }}

- name: run-tests
run: .github/scripts/run-tests-spike.sh
build-gemmini-config:
runs-on: jktqos
needs: install-gemmini
steps:
- name: Delete old checkout
run: |
rm -rf ${{ github.workspace }}/* || true
rm -rf ${{ github.workspace }}/.* || true
- uses: actions/checkout@v3
- name: Building Gemmini Config using Verilator
run: |
.github/scripts/do-rtl-build.sh
rtl-run-tests:
name: rtl-run-tests
runs-on: ubuntu-latest
runs-on: jktqos
needs: build-gemmini-config
container:
image: ucbbar/chipyard-ci-image:3f9150
options: --entrypoint /bin/bash
steps:
- name: checkout
uses: actions/checkout@v2
- name: get paths
run: .github/scripts/defaults.sh
id: get-paths

- name: remove chipyard
run: .github/scripts/remove-chipyard.sh
- name: Delete old checkout
run: |
rm -rf ${{ github.workspace }}/* || true
rm -rf ${{ github.workspace }}/.* || true
- uses: actions/checkout@v3
- name: Run Gemmini Config tests using Verilator
run: |
.github/scripts/run-tests-rtl.sh
- name: restore cache build-gemmini-config install
uses: actions/cache@v2
with:
path: |
${{ steps.get-paths.outputs.LOCAL_CHIPYARD_DIR }}
${{ steps.get-paths.outputs.LOCAL_CONDA }}
key: build-gemmini-config-${{ github.ref }}-${{ github.sha }}

- name: run-tests
run: .github/scripts/run-tests-rtl.sh
cleanup:
name: cleanup
needs: [spike-run-tests, rtl-run-tests]
runs-on: jktqos
if: ${{ always() }}
steps:
- name: Delete repo copy
run: |
rm -rf ${{ env.REMOTE_WORK_DIR }}
rm -rf ${{ env.JAVA_TMP_DIR }}
2 changes: 1 addition & 1 deletion CHIPYARD.hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
569917e2f30616f85a841d16a92914ae98ad7184
d75934b0327e8ba44973769d17794df8c2c8ee8b
7 changes: 5 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ version := "3.1.0"
scalaVersion := "2.13.10"

libraryDependencies ++= Seq(
"edu.berkeley.cs" %% "chisel3" % "3.5.6",
"edu.berkeley.cs" %% "chisel3" % "3.6.0",
"edu.berkeley.cs" %% "rocketchip" % "1.2.+",
"edu.berkeley.cs" %% "chisel-iotesters" % "2.5.6",
"org.scalanlp" %% "breeze" % "1.1")

resolvers ++= Seq(
Resolver.sonatypeRepo("snapshots"),
Resolver.sonatypeRepo("releases"),
Resolver.mavenLocal)

// specified commit BEFORE scala bump to 2.13 for compatibility
// need this version for MulRecFN and fast divider
// lazy val newHardfloat = RootProject(uri("https://github.com/ucb-bar/berkeley-hardfloat.git#74cc28"))
2 changes: 1 addition & 1 deletion software/libgemmini
Submodule libgemmini updated 4 files
+1 −1 Makefile
+1 −1 README.md
+89 −38 gemmini.cc
+3 −2 gemmini.h
Loading

0 comments on commit 087a3d8

Please sign in to comment.