From bc18d2d785079b76ac970373f667de1fc7e4a1e2 Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Tue, 29 May 2018 14:41:18 -0700 Subject: Improve Travis configuration and revert Yosys version * Switch Yosys back to 0.7 with patch for moved ABC repo * Add 30 min timeout for LEC tests * h/t https://stackoverflow.com/questions/43918874#44007537 * Move Travis building of Verilator and Yosys to prelude stage * Don't use automatic Travis Scala tests, do it manually --- .fix_yosys_abc.patch | 37 +++++++++++++++++++++++++++++++++++++ .install_yosys.sh | 4 +++- .travis.yml | 45 ++++++++++++++++++++++++++++++++++----------- 3 files changed, 74 insertions(+), 12 deletions(-) create mode 100644 .fix_yosys_abc.patch diff --git a/.fix_yosys_abc.patch b/.fix_yosys_abc.patch new file mode 100644 index 00000000..dac2fb18 --- /dev/null +++ b/.fix_yosys_abc.patch @@ -0,0 +1,37 @@ +diff --git a/Makefile b/Makefile +index 0a61fe65..ef336faf 100644 +--- a/Makefile ++++ b/Makefile +@@ -82,10 +82,10 @@ OBJS = kernel/version_$(GIT_REV).o + # is just a symlink to your actual ABC working directory, as 'make mrproper' + # will remove the 'abc' directory and you do not want to accidentally + # delete your work on ABC.. +-ABCREV = eb6eca6807cc ++ABCREV = a2d59be + ABCPULL = 1 +-ABCURL ?= https://bitbucket.org/alanmi/abc +-ABCMKARGS = CC="$(CXX)" CXX="$(CXX)" ++ABCURL ?= https://github.com/berkeley-abc/abc ++ABCMKARGS = CC="$(CXX)" CXX="$(CXX)" ABC_USE_LIBSTDCXX=1 + + # set ABCEXTERNAL = to use an external ABC instance + # Note: The in-tree ABC (yosys-abc) will not be installed when ABCEXTERNAL is set. +@@ -386,14 +386,14 @@ yosys-config: misc/yosys-config.in + abc/abc-$(ABCREV)$(EXE): + $(P) + ifneq ($(ABCREV),default) +- $(Q) if ( cd abc 2> /dev/null && hg identify; ) | grep -q +; then \ ++ $(Q) if ( cd abc 2> /dev/null && ! git diff-index --quiet HEAD; ); then \ + echo 'REEBE: NOP pbagnvaf ybpny zbqvsvpngvbaf! Frg NOPERI=qrsnhyg va Lbflf Znxrsvyr!' | tr 'A-Za-z' 'N-ZA-Mn-za-m'; false; \ + fi +- $(Q) if test "`cd abc 2> /dev/null && hg identify | cut -f1 -d' '`" != "$(ABCREV)"; then \ ++ $(Q) if test "`cd abc 2> /dev/null && git rev-parse --short HEAD`" != "$(ABCREV)"; then \ + test $(ABCPULL) -ne 0 || { echo 'REEBE: NOP abg hc gb qngr naq NOPCHYY frg gb 0 va Znxrsvyr!' | tr 'A-Za-z' 'N-ZA-Mn-za-m'; exit 1; }; \ + echo "Pulling ABC from $(ABCURL):"; set -x; \ +- test -d abc || hg clone $(ABCURL) abc; \ +- cd abc && $(MAKE) DEP= clean && hg pull && hg update -r $(ABCREV); \ ++ test -d abc || git clone $(ABCURL) abc; \ ++ cd abc && $(MAKE) DEP= clean && git fetch origin master && git checkout $(ABCREV); \ + fi + endif + $(Q) rm -f abc/abc-[0-9a-f]* diff --git a/.install_yosys.sh b/.install_yosys.sh index 2c627ab1..a9ab9c25 100644 --- a/.install_yosys.sh +++ b/.install_yosys.sh @@ -5,7 +5,9 @@ if [ ! -f $INSTALL_DIR/bin/yosys ]; then git clone https://github.com/cliffordwolf/yosys.git cd yosys git pull - git checkout master + git checkout yosys-0.7 + # Workaround moving ABC repo + git apply ../.fix_yosys_abc.patch make make PREFIX=$INSTALL_DIR install fi diff --git a/.travis.yml b/.travis.yml index 519047b4..ff8c1e82 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,4 @@ language: scala -scala: - - 2.11.12 - - 2.12.4 sudo: false cache: @@ -12,32 +9,58 @@ cache: git: depth: 10 -sbt_args: -Dsbt.log.noformat=true - env: global: INSTALL_DIR=$TRAVIS_BUILD_DIR/install VERILATOR_ROOT=$INSTALL_DIR PATH=$PATH:$VERILATOR_ROOT/bin:$TRAVIS_BUILD_DIR/utils/bin + SBT_ARGS="-Dsbt.log.noformat=true" -before_script: - - bash .install_verilator.sh - - verilator --version - - bash .install_yosys.sh - - yosys -V +stages: + - prepare + - test +# We do not use the built-in tests as generated by using multiple Scala +# versions because the cache is not shared between stages with any +# environmental differences. +# Instead, we specify the version of Scala manually for each test (or leave it +# as the default as defined in FIRRTL's build.sbt). jobs: include: + # Because these write to the same install directory, they must run in the + # same script + - stage: prepare + script: + - bash .install_verilator.sh + - verilator --version + - bash .install_yosys.sh + - yosys -V + - stage: test + script: + - verilator --version + - sbt ++2.11.12 $SBT_ARGS test + - stage: test + script: + - verilator --version + - sbt ++2.12.4 $SBT_ARGS test + # For Chisel tests we just use the default version - stage: test script: - - sbt clean assembly publishLocal + - verilator --version + - sbt $SBT_ARGS clean assembly publishLocal - bash .run_chisel_tests.sh - stage: test script: + - yosys -V + - "travis_wait 30 sleep 1800 &" - ./.run_formal_checks.sh RocketCore - stage: test script: + - yosys -V + - "travis_wait 30 sleep 1800 &" - ./.run_formal_checks.sh FPU - stage: test script: + - yosys -V + - "travis_wait 30 sleep 1800 &" - ./.run_formal_checks.sh ICache -- cgit v1.2.3