aboutsummaryrefslogtreecommitdiff
path: root/.run_formal_checks.sh
diff options
context:
space:
mode:
authorJack Koenig2017-10-01 14:09:02 -0700
committerJack2017-10-01 23:55:13 -0700
commitb103bc89a6819115651b244df191f00969a539af (patch)
tree5e0a596b54b93a9fcb0eecc69b0afe801a6d927e /.run_formal_checks.sh
parentb495fdbedf126f4bae2d1bfcb7174f30d4f75fd1 (diff)
Add script for formally comparing emitted Verilog
Also add Travis test for running this script on PRs
Diffstat (limited to '.run_formal_checks.sh')
-rw-r--r--.run_formal_checks.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/.run_formal_checks.sh b/.run_formal_checks.sh
new file mode 100644
index 00000000..f3b72a67
--- /dev/null
+++ b/.run_formal_checks.sh
@@ -0,0 +1,17 @@
+set -e
+# Run formal check only for PRs
+if [ $TRAVIS_PULL_REQUEST = "false" ]; then
+ echo "Not a pull request, no formal check"
+ exit 0
+elif [[ $TRAVIS_COMMIT_MESSAGE == *"[skip formal checks]"* ]]; then
+ echo "Commit message says to skip formal checks"
+ exit 0
+else
+ # $TRAVIS_BRANCH is branch targeted by PR
+ # Travis does a shallow clone, checkout PR target so that we have it
+ # THen return to previous branch so HEAD points to the commit we're testing
+ git remote set-branches origin $TRAVIS_BRANCH && git fetch
+ git checkout $TRAVIS_BRANCH
+ git checkout -
+ bash ./scripts/formal_equiv.sh HEAD $TRAVIS_BRANCH
+fi