aboutsummaryrefslogtreecommitdiff
path: root/.travis.yml
blob: 739875652b77d51da5b170cb350c04586d99cbcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
language: scala
sudo: false

jdk: openjdk8

cache:
  directories:
    $HOME/.cache/coursier
    $HOME/.sbt
    $INSTALL_DIR

git:
  depth: 10

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:
  - OLDEST_SHARED=`git log --format=%H $TRAVIS_COMMIT_RANGE | tail -n1`
  - OLDEST_COMMIT=`git log --format=%H | tail -n1`
  - if [ $OLDEST_SHARED == $OLDEST_COMMIT ]; then git fetch --unshallow; fi

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
      name: "Install: [Verilator, Yosys]"
      script:
        - bash .install_verilator.sh
        - verilator --version
        - bash .install_yosys.sh
        - yosys -V
    - stage: prepare
      name: "Compile FIRRTL to share with subsequent stages"
      script:
        - sbt $SBT_ARGS assembly
      workspaces:
        create:
          name: firrtl_build
          paths:
            - target/
            - utils/bin/firrtl.jar
            - project/project/
            - project/target/
    - stage: test
      name: "Unidoc builds (no warnings)"
      workspaces:
        use: firrtl_build
      script:
        - sbt $SBT_ARGS +unidoc
    - stage: test
      name: "Tests: FIRRTL (2.13)"
      workspaces:
        use: firrtl_build
      script:
        - verilator --version
        - sbt ++2.13.2 $SBT_ARGS test
    - stage: test
      name: "Tests: FIRRTL (2.12)"
      workspaces:
        use: firrtl_build
      script:
        - verilator --version
        - sbt $SBT_ARGS test
    - stage: test
      name: "Tests: FIRRTL (2.11)"
      script:
        - verilator --version
        - sbt ++2.11.12 $SBT_ARGS test
    - stage: test
      name: "Tests: chisel3 (2.12)"
      workspaces:
        use: firrtl_build
      script:
        - verilator --version
        - sbt $SBT_ARGS +publishLocal
        - bash .run_chisel_tests.sh
    - stage: test
      name: "Formal equivalence: RocketCore"
      workspaces:
        use: firrtl_build
      script:
        - yosys -V
        - "travis_wait 30 sleep 1800 &"
        - ./.run_formal_checks.sh RocketCore
    - stage: test
      name: "Formal equivalence: FPU"
      workspaces:
        use: firrtl_build
      script:
        - yosys -V
        - "travis_wait 30 sleep 1800 &"
        - ./.run_formal_checks.sh FPU
    - stage: test
      name: "Formal equivalence: ICache"
      workspaces:
        use: firrtl_build
      script:
        - yosys -V
        - "travis_wait 30 sleep 1800 &"
        - ./.run_formal_checks.sh ICache
    - stage: test
      name: "Formal equivalence: small expression-tree stress tests"
      workspaces:
        use: firrtl_build
      script:
        - yosys -V
        - "travis_wait 30 sleep 1800 &"
        - ./.run_formal_checks.sh Ops
        - ./.run_formal_checks.sh AddNot
    - stage: test
      name: "Sanity check benchmarking scripts"
      workspaces:
        use: firrtl_build
      script:
        - benchmark/scripts/benchmark_cold_compile.py -N 2 --designs regress/ICache.fir --versions HEAD
        - benchmark/scripts/find_heap_bound.py -- -cp firrtl*jar firrtl.stage.FirrtlMain -i regress/ICache.fir -o out -X verilog