initial ci commit

This commit is contained in:
Abraham Gonzalez
2019-05-11 17:16:32 -07:00
parent d0128d8f24
commit e5d9f539c5
5 changed files with 224 additions and 0 deletions

22
.circleci/build-toolchains.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
# create the riscv tools binaries from riscv-boom/boom-template with rocket-chip hash given by riscv-boom
# turn echo on and error on earliest command
set -ex
if [ ! -d "$HOME/esp-tools-install" ]; then
cd $HOME/
# init all submodules including the tools
./project/scripts/build-toolchains.sh esp-tools
fi
if [ ! -d "$HOME/riscv-tools-install" ]; then
cd $HOME/
# init all submodules including the tools
./project/scripts/build-toolchains.sh riscv-tools
fi

18
.circleci/build-verilator.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
# build verilator and init submodules with rocket-chip hash given by riscv-boom
# turn echo on and error on earliest command
set -ex
cd $HOME/project
# init all submodules (according to what boom-template wants)
./scripts/init-submodules-no-riscv-tools.sh
cd sims/verisim
if [ ! -d "$HOME/project/sims/verisim/verilator" ]; then
# make boom-template verilator version
make verilator_install
fi

154
.circleci/config.yml Normal file
View File

@@ -0,0 +1,154 @@
# CircleCI Configuration File
# version of circleci
version: 2
# set of jobs to run
jobs:
install-toolchains:
docker:
- image: riscvboom/riscvboom-images:0.0.5
environment:
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
TERM: dumb
steps:
# Checkout the code
- checkout
- run:
name: Create hash of toolchains
command: |
.circleci/create-hash.sh
- restore_cache:
keys:
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
- restore_cache:
keys:
- esp-tools-installed-v1-{{ checksum "../esp-tools.hash" }}
- run:
name: Building toolchains
command: |
.circleci/build-toolchains.sh
no_output_timeout: 120m
- save_cache:
key: riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
paths:
- "/home/riscvuser/riscv-tools-install"
- save_cache:
key: esp-tools-installed-v1-{{ checksum "../esp-tools.hash" }}
paths:
- "/home/riscvuser/esp-tools-install"
install-verilator:
docker:
- image: riscvboom/riscvboom-images:0.0.5
environment:
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
TERM: dumb
steps:
# Checkout the code
- checkout
- restore_cache:
keys:
- verilator-installed-v1-{{ checksum "sims/verisim/verilator.mk" }}
- run:
name: Build Verilator
command: |
.circleci/build-verilator.sh
no_output_timeout: 120m
- save_cache:
key: verilator-installed-v1-{{ checksum "sims/verisim/verilator.mk" }}
paths:
- "/home/riscvuser/project/sims/verisim/verilator"
prepare-example:
docker:
- image: riscvboom/riscvboom-images:0.0.5
environment:
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
TERM: dumb
steps:
# Checkout the code
- checkout
- restore_cache:
keys:
- verilator-installed-v1-{{ checksum "sims/verisim/verilator.mk" }}
- run:
name: Building BoomConfig using Verilator
command: .circleci/do-rtl-build.sh example
no_output_timeout: 120m
- save_cache:
key: example-{{ .Branch }}-{{ .Revision }}
paths:
- "/home/riscvuser/project/sims/verisim"
example-run-benchmark-tests:
docker:
- image: riscvboom/riscvboom-images:0.0.5
environment:
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
TERM: dumb
steps:
# Checkout the code
- checkout
- run:
name: Create hash of toolchains
command: |
.circleci/create-hash.sh
- restore_cache:
keys:
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
- restore_cache:
keys:
- esp-tools-installed-v1-{{ checksum "../esp-tools.hash" }}
- restore_cache:
keys:
- example-{{ .Branch }}-{{ .Revision }}
- run:
name: Run example benchmark tests
command: make run-bmark-tests -C sims/verisim SUB_PROJECT=example
# Order and dependencies of jobs to run
workflows:
version: 2
build-and-test-boom-configs:
jobs:
# Make the toolchain
- install-toolchains
# Build verilator
- install-verilator:
requires:
- install-toolchains
# Prepare the verilator builds
- prepare-example:
requires:
- install-verilator
# Run the respective tests
# Run the example tests
- example-run-benchmark-tests:
requires:
- prepare-example

17
.circleci/create-hash.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
# get the hash of riscv-tools
# turn echo on and error on earliest command
set -ex
# enter bhd repo
cd $HOME/project
# get the version of riscv-tools from the git submodule hash
git submodule status | grep "riscv-tools" | awk '{print$1}' | grep -o "[[:alnum:]]*" >> $HOME/riscv-tools.hash
git submodule status | grep "esp-tools" | awk '{print$1}' | grep -o "[[:alnum:]]*" >> $HOME/esp-tools.hash
echo "Hashfile for riscv-tools and esp-tools created in $HOME"
echo "Contents: riscv-tools:$(cat $HOME/riscv-tools.hash)"
echo "Contents: esp-tools:$(cat $HOME/esp-tools.hash)"

13
.circleci/do-rtl-build.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
# create the different verilator builds of BOOM based on arg
# turn echo on and error on earliest command
set -ex
# this file assumes cache is updated correctly
# enter the verisim directory and build the specific config
cd $HOME/project/sims/verisim
make clean
make SUB_PROJECT=$1 JAVA_ARGS="-Xmx2G -Xss8M"