diff --git a/.travis.yml b/.travis.yml index d4b1155..bf645b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,67 +1,84 @@ language: scala +dist: xenial + notifications: email: on_success: never -# See 'project/Version.scala' scala: - - 2.11.6 + - 2.11.12 sbt_args: -no-colors -J-Xss2m -script: - - export VEXRISCV_REGRESSION_FREERTOS_COUNT=no - - export VEXRISCV_REGRESSION_THREAD_COUNT=1 - - sbt -jvm-opts travis/jvmopts.compile compile - - sbt -jvm-opts travis/jvmopts.test test +addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - git + - make + - autoconf + - g++ + - flex + - bison jdk: - - oraclejdk8 -# - oraclejdk7 -# - openjdk7 + - openjdk10 -env: - - VEXRISCV_REGRESSION_CONFIG_COUNT=0 - - VEXRISCV_REGRESSION_CONFIG_COUNT=5 - - VEXRISCV_REGRESSION_CONFIG_COUNT=5 - - VEXRISCV_REGRESSION_CONFIG_COUNT=5 - - VEXRISCV_REGRESSION_CONFIG_COUNT=5 +jobs: + include: + - stage: prepare cache-verilator + script: + - cp scripts/regression/verilator.mk $HOME/makefile + - cd $HOME + - make verilator_binary + - &test + stage: Test + name: TEST_DHRYSTONE + script: + - make regression_dhrystone -C scripts/regression + - <<: *test + stage: Test + name: TEST_BAREMETAL + script: + - make regression_random_baremetal -C scripts/regression + - <<: *test + stage: Test + name: TEST_BAREMETAL + script: + - make regression_random_baremetal -C scripts/regression + - <<: *test + stage: Test + name: TEST_MIXED + script: + - make regression_random -C scripts/regression + - <<: *test + stage: Test + name: TEST_LINUX + script: + - make regression_random_linux -C scripts/regression + - <<: *test + stage: Test + name: TEST_LINUX + script: + - make regression_random_linux -C scripts/regression before_install: - # JDK fix - - cat /etc/hosts # optionally check the content *before* - - sudo hostname "$(hostname | cut -c1-63)" - - sed -e "s/^\\(127\\.0\\.0\\.1.*\\)/\\1 $(hostname | cut -c1-63)/" /etc/hosts | sudo tee /etc/hosts - - cat /etc/hosts # optionally check the content *after* - cd .. - - # Verilator - - sudo apt-get install git make autoconf g++ flex bison -y # First time prerequisites - - wget https://www.veripool.org/ftp/verilator-4.012.tgz - - tar xvzf verilator*.t*gz - - cd verilator* - - ./configure - - make -j$(nproc) - - sudo make install - - cd .. - - git clone https://github.com/SpinalHDL/SpinalHDL.git -b dev - - cd VexRiscv - - git submodule update --init --recursive - #- curl -T README.md -udolu1990:$BINTRAY_KEY https://api.bintray.com/content/spinalhdl/VexRiscv/test/0.0.4/README.md - #- curl -X POST -udolu1990:$BINTRAY_KEY https://api.bintray.com/content/spinalhdl/VexRiscv/test/0.0.4/publish - #- sbt compile - + - export VERILATOR_ROOT=$HOME/verilator + - export PATH=$VERILATOR_ROOT/bin:$PATH before_cache: - # Tricks to avoid unnecessary cache updates - - find $HOME/.ivy2 -name "ivydata-*.properties" -delete - - find $HOME/.sbt -name "*.lock" -delete + - rm -fv $HOME/.ivy2/.sbt.ivy.lock + - find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete + - find $HOME/.sbt -name "*.lock" -print -delete cache: directories: - $HOME/.ivy2/cache - - $HOME/.sbt/boot/ - - verilator-4.012 \ No newline at end of file + - $HOME/.sbt + - $HOME/verilator + diff --git a/scripts/regression/.gitignore b/scripts/regression/.gitignore new file mode 100644 index 0000000..319b95a --- /dev/null +++ b/scripts/regression/.gitignore @@ -0,0 +1,2 @@ +verilator* +!verilator.mk diff --git a/scripts/regression/makefile b/scripts/regression/makefile new file mode 100644 index 0000000..11ef24f --- /dev/null +++ b/scripts/regression/makefile @@ -0,0 +1,7 @@ +.ONESHELL: + +include verilator.mk +include regression.mk + + + diff --git a/scripts/regression/regression.mk b/scripts/regression/regression.mk new file mode 100644 index 0000000..a9d8e31 --- /dev/null +++ b/scripts/regression/regression.mk @@ -0,0 +1,32 @@ +.ONESHELL: + + +regression_random: + cd ../.. + export VEXRISCV_REGRESSION_CONFIG_COUNT=4 + export VEXRISCV_REGRESSION_FREERTOS_COUNT=no + export VEXRISCV_REGRESSION_THREAD_COUNT=1 + sbt "testOnly vexriscv.TestIndividualFeatures" + +regression_random_linux: + cd ../.. + export VEXRISCV_REGRESSION_CONFIG_LINUX_RATE=1.0 + export VEXRISCV_REGRESSION_CONFIG_COUNT=3 + export VEXRISCV_REGRESSION_FREERTOS_COUNT=no + export VEXRISCV_REGRESSION_THREAD_COUNT=1 + sbt "testOnly vexriscv.TestIndividualFeatures" + + +regression_random_baremetal: + cd ../.. + export VEXRISCV_REGRESSION_CONFIG_LINUX_RATE=0.0 + export VEXRISCV_REGRESSION_CONFIG_COUNT=50 + export VEXRISCV_REGRESSION_FREERTOS_COUNT=no + export VEXRISCV_REGRESSION_THREAD_COUNT=1 + sbt "testOnly vexriscv.TestIndividualFeatures" + + + +regression_dhrystone: + cd ../.. + sbt "testOnly vexriscv.DhrystoneBench" diff --git a/scripts/regression/verilator.mk b/scripts/regression/verilator.mk new file mode 100644 index 0000000..b13ca4c --- /dev/null +++ b/scripts/regression/verilator.mk @@ -0,0 +1,20 @@ + +.ONESHELL: + +verilator/configure: + rm -rf verilator* + wget https://www.veripool.org/ftp/verilator-4.012.tgz + tar xvzf verilator*.t*gz + mv verilator-4.012 verilator + +verilator/Makefile: verilator/configure + cd verilator + ./configure + +verilator/bin/verilator_bin: verilator/Makefile + cd verilator + make -j$(shell nproc) + rm -rf src/obj_dbg + rm -rf src/obj_opt + +verilator_binary: verilator/bin/verilator_bin diff --git a/src/test/cpp/regression/main.cpp b/src/test/cpp/regression/main.cpp index 415ed67..8631351 100644 --- a/src/test/cpp/regression/main.cpp +++ b/src/test/cpp/regression/main.cpp @@ -3680,7 +3680,7 @@ int main(int argc, char **argv, char **env) { redo(REDO,WorkspaceRegression("icache").withRiscvRef()->loadHex("../raw/icache/build/icache.hex")->bootAt(0x80000000u)->run(50e3);); #endif #ifdef DBUS_CACHED - redo(REDO,WorkspaceRegression("dcache").loadHex("../raw/dcache/build/dcache.hex")->bootAt(0x80000000u)->run(500e3);); + redo(REDO,WorkspaceRegression("dcache").loadHex("../raw/dcache/build/dcache.hex")->bootAt(0x80000000u)->run(2500e3);); #endif #ifdef MMU diff --git a/src/test/scala/vexriscv/MuraxSim.scala b/src/test/scala/vexriscv/MuraxSim.scala index 2cb7802..6a6a19c 100644 --- a/src/test/scala/vexriscv/MuraxSim.scala +++ b/src/test/scala/vexriscv/MuraxSim.scala @@ -75,7 +75,7 @@ object MuraxSim { }) setAlignmentX(awt.Component.CENTER_ALIGNMENT) }) - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) + setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE) pack() setVisible(true) diff --git a/src/test/scala/vexriscv/TestIndividualFeatures.scala b/src/test/scala/vexriscv/TestIndividualFeatures.scala index 1c72c51..65bbfcd 100644 --- a/src/test/scala/vexriscv/TestIndividualFeatures.scala +++ b/src/test/scala/vexriscv/TestIndividualFeatures.scala @@ -585,10 +585,11 @@ class TestIndividualFeatures extends FunSuite { println(s"Seed=$seed") for(i <- 0 until sys.env.getOrElse("VEXRISCV_REGRESSION_CONFIG_COUNT", "100").toInt){ var positions : List[VexRiscvPosition] = null - val universe = VexRiscvUniverse.universes.filter(e => rand.nextBoolean()) + var universe = mutable.HashSet[VexRiscvUniverse]() + if(sys.env.getOrElse("VEXRISCV_REGRESSION_CONFIG_LINUX_RATE", "0.5").toDouble > Math.random()) universe += VexRiscvUniverse.CATCH_ALL do{ - positions = dimensions.map(d => d.randomPosition(universe, rand)) + positions = dimensions.map(d => d.randomPosition(universe.toList, rand)) }while(!positions.forall(_.isCompatibleWith(positions))) val testSeed = rand.nextInt()