From 51b8e54ff69cc096faeefd2ca87594fa8fd40b03 Mon Sep 17 00:00:00 2001 From: Todd Strader Date: Wed, 16 Oct 2019 16:55:27 -0400 Subject: [PATCH 1/2] Add Travis CI --- .travis.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..0172146 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,43 @@ +language: cpp + +cache: ccache + +env: + global: + - VERILATOR_CACHE=$HOME/verilator_cache + - VERILATOR_ROOT=$PWD/verilator + - VERILATOR_NUM_JOBS=$((`nproc` + 1)) + - OBJCACHE=ccache + - VERILATOR=$VERILATOR_ROOT/bin/verilator + - RV_ROOT=$PWD + +cache: + directories: + - $VERILATOR_CACHE + +before_install: + - git clone https://github.com/verilator/verilator.git $VERILATOR_ROOT +# This is the first revision with the build_verilator.sh script. +# Once a Verilator release captures this, it would be best to check out +# a release tag instead. + - git -C $VERILATOR_ROOT checkout 46ab907f6afdcacbf848ea090dce66f1334de663 + +before_script: + - $VERILATOR_ROOT/ci/build_verilator.sh + +stages: + - build + - test + +jobs: + include: + - stage: build + name: Build Verilator + script: echo "Done building Verilator" + - stage: test + name: Run Tests + script: + - configs/swerv.config -snapshot=mybuild + - make -j 4 -f tools/Makefile verilator snapshot=mybuild + - make -f tools/Makefile verilator-run snapshot=mybuild |& tee sim.log + - grep -q "Hello World from SweRV" sim.log From fb5ebdea262c133e559ee60bf59b1c15f77d2baa Mon Sep 17 00:00:00 2001 From: Todd Strader Date: Wed, 16 Oct 2019 17:47:14 -0400 Subject: [PATCH 2/2] Add Verilator to the PATH --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 0172146..36ad071 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ env: - VERILATOR_ROOT=$PWD/verilator - VERILATOR_NUM_JOBS=$((`nproc` + 1)) - OBJCACHE=ccache + - PATH=$PATH:$VERILATOR_ROOT/bin - VERILATOR=$VERILATOR_ROOT/bin/verilator - RV_ROOT=$PWD