Skip to content

Commit 6bdf36d

Browse files
committed
updates to ci
1 parent fd92323 commit 6bdf36d

File tree

11 files changed

+138
-164
lines changed

11 files changed

+138
-164
lines changed

.github/scripts/build-toolchains.sh

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/scripts/defaults.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ LOCAL_ESP_DIR=$HOME/esp-tools-install
2828
LOCAL_CHIPYARD_DIR=$HOME/chipyard
2929
LOCAL_SIM_DIR=$LOCAL_CHIPYARD_DIR/sims/verilator
3030
LOCAL_VERILATOR_DIR=$HOME/verilator-install
31+
LOCAL_CONDA=/opt/conda/
3132

3233
echo "::set-output name=LOCAL_WORK_DIR::$LOCAL_WORK_DIR"
3334
echo "::set-output name=LOCAL_CHECKOUT_DIR::$LOCAL_CHECKOUT_DIR"
@@ -36,3 +37,4 @@ echo "::set-output name=LOCAL_ESP_DIR::$LOCAL_ESP_DIR"
3637
echo "::set-output name=LOCAL_CHIPYARD_DIR::$LOCAL_CHIPYARD_DIR"
3738
echo "::set-output name=LOCAL_SIM_DIR::$LOCAL_SIM_DIR"
3839
echo "::set-output name=LOCAL_VERILATOR_DIR::$LOCAL_VERILATOR_DIR"
40+
echo "::set-output name=LOCAL_CONDA::$LOCAL_CONDA"

.github/scripts/do-rtl-build.sh

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,27 @@ set -ex
77
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
88
source $SCRIPT_DIR/defaults.sh
99

10-
rm -rf $LOCAL_CHIPYARD_DIR/generators/gemmini/*
11-
cd $LOCAL_CHECKOUT_DIR
12-
git submodule update --init --recursive software/gemmini-rocc-tests
13-
mv -f $LOCAL_CHECKOUT_DIR/* $LOCAL_CHIPYARD_DIR/generators/gemmini/
10+
source $SCRIPT_DIR/enable-conda.sh
1411

12+
cd $LOCAL_CHIPYARD_DIR
13+
source env.sh
1514

16-
TOOLS_DIR=$LOCAL_ESP_DIR
17-
LD_LIB_DIR=$LOCAL_ESP_DIR/lib
15+
cd $LOCAL_CHIPYARD_DIR
16+
echo Printing current chipyard commit
17+
git log -1 --format="%H"
1818

19-
# enter the verilator directory and build the specific config on remote server
19+
cd $LOCAL_CHIPYARD_DIR/generators/gemmini
20+
echo Printing current gemmini commit
21+
git log -1 --format="%H"
22+
23+
cd $LOCAL_CHIPYARD_DIR/generators/rocket-chip
24+
echo Printing rocket-chip commit
25+
git log -1 --format="%H"
26+
27+
echo Printing rocket-chip sources
28+
ls src/main/scala/
29+
30+
cd $LOCAL_SIM_DIR
2031
make -C $LOCAL_SIM_DIR clean
21-
export RISCV=$TOOLS_DIR
22-
export LD_LIBRARY_PATH=$LD_LIB_DIR
23-
export PATH=$LOCAL_VERILATOR_DIR/bin:$PATH
24-
export VERILATOR_ROOT=$LOCAL_VERILATOR_DIR
25-
export COURSIER_CACHE=$LOCAL_WORK_DIR/.coursier-cache
2632
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=GemminiRocketConfig
33+

.github/scripts/enable-conda.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
export PATH="$LOCAL_CONDA/bin:$PATH"
4+
conda init
5+
source ~/.bashrc
6+
conda activate base
7+
if ! { conda env list | grep 'chipyard'; } >/dev/null 2>&1; then
8+
conda create -n chipyard
9+
conda activate chipyard
10+
conda install -c conda-forge conda-lock
11+
fi
12+
conda activate chipyard
13+

.github/scripts/install-gemmini.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
#-------------------------------------------------------------
4+
# installs gemmini
5+
#
6+
# run location: circle ci docker image
7+
#-------------------------------------------------------------
8+
9+
# turn echo on and error on earliest command
10+
set -ex
11+
12+
# get shared variables
13+
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
14+
source $SCRIPT_DIR/defaults.sh
15+
16+
source $SCRIPT_DIR/enable-conda.sh
17+
18+
cd $HOME
19+
rm -rf chipyard
20+
git clone --progress --verbose https://github.com/ucb-bar/chipyard.git chipyard
21+
cd $LOCAL_CHIPYARD_DIR
22+
23+
echo "Checking out Chipyard version: $(cat $LOCAL_CHECKOUT_DIR/CHIPYARD.hash)"
24+
git fetch
25+
git checkout $(cat $LOCAL_CHECKOUT_DIR/CHIPYARD.hash)
26+
27+
./build-setup.sh esp-tools
28+
29+
source env.sh
30+
31+
cd toolchains/esp-tools/riscv-isa-sim/build
32+
echo "Checking out Spike version $(cat $LOCAL_CHECKOUT_DIR/SPIKE.hash)"
33+
git checkout $(cat $LOCAL_CHECKOUT_DIR/SPIKE.hash)
34+
make && make install
35+
36+
cd $LOCAL_CHECKOUT_DIR
37+
chown -R $(whoami) .
38+
git config --global --add safe.directory $LOCAL_CHECKOUT_DIR
39+
git submodule update --init --recursive software/gemmini-rocc-tests
40+
rm -rf $LOCAL_CHIPYARD_DIR/generators/gemmini/* $LOCAL_CHIPYARD_DIR/generators/gemmini/.git*
41+
mv -f $LOCAL_CHECKOUT_DIR/* $LOCAL_CHECKOUT_DIR/.git* $LOCAL_CHIPYARD_DIR/generators/gemmini/
42+

.github/scripts/install-verilator.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/scripts/prepare-for-rtl-build.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/scripts/remove-chipyard.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
6+
source $SCRIPT_DIR/defaults.sh
7+
8+
rm -rf $LOCAL_CHIPYARD_DIR
9+
rm -rf $LOCAL_CONDA
10+

.github/scripts/run-tests-rtl.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ set -ex
55
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
66
source $SCRIPT_DIR/defaults.sh
77

8+
source $SCRIPT_DIR/enable-conda.sh
89

9-
TOOLS_DIR=$LOCAL_ESP_DIR
10-
PATH=$PATH:$LOCAL_ESP_DIR/bin
10+
cd $LOCAL_CHIPYARD_DIR
11+
source env.sh
1112

1213
cd $LOCAL_CHIPYARD_DIR/generators/gemmini/software/gemmini-rocc-tests
1314
CFLAGS=-DFAST ./build.sh
1415

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

18-

.github/scripts/run-tests-spike.sh

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,25 @@ set -ex
55
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
66
source $SCRIPT_DIR/defaults.sh
77

8+
source $SCRIPT_DIR/enable-conda.sh
89

9-
# clone and build our version of spike
10-
TOOLS_DIR=$LOCAL_ESP_DIR
11-
PATH=$PATH:$LOCAL_ESP_DIR/bin
10+
cd $LOCAL_CHIPYARD_DIR
11+
source env.sh
1212

13-
git clone https://github.com/ucb-bar/esp-isa-sim.git
14-
cd esp-isa-sim
15-
git checkout $(cat $LOCAL_CHECKOUT_DIR/SPIKE.hash)
16-
cp $LOCAL_CHIPYARD_DIR/generators/gemmini/software/gemmini-rocc-tests/include/gemmini_params.h gemmini/
13+
cd $LOCAL_CHIPYARD_DIR/toolchains/esp-tools/riscv-isa-sim
14+
echo Printing current spike commit
15+
git log -1 --format="%H"
1716

18-
mkdir build
19-
cd build
20-
../configure --prefix=$TOOLS_DIR
21-
make -j8 install
17+
cd $LOCAL_CHIPYARD_DIR/generators/gemmini
18+
echo Printing current gemmini commit
19+
git log -1 --format="%H"
2220

2321
cd $LOCAL_CHIPYARD_DIR/generators/gemmini/software/gemmini-rocc-tests
22+
echo Printing current gemmini-rocc-tests commit
23+
git log -1 --format="%H"
24+
2425
./build.sh
2526

2627
cd build
2728
make test-baremetal
29+

0 commit comments

Comments
 (0)