aboutsummaryrefslogtreecommitdiff
path: root/rv64cpu/.github/workflows/ci.yml
blob: 03551faf5bd2108f8b1b02e1cc3d7006a83432ef (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
name: CI

on:
  push:
    branches: [ main, develop ]
  pull_request:
    branches: [ main ]

jobs:
  verilator-build:
    name: Verilator Build & Test
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          submodules: recursive

      - name: Install dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y \
            verilator \
            cmake \
            build-essential \
            git \
            autoconf \
            flex \
            bison \
            libfl-dev

      - name: Check Verilator version
        run: verilator --version

      - name: Configure
        run: cmake -B build -DENABLE_TRACE=OFF

      - name: Build
        run: cmake --build build -j$(nproc)

      - name: Test
        run: ctest --test-dir build --output-on-failure --timeout 120

  lint:
    name: Verilator Lint
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Install Verilator
        run: |
          sudo apt-get update
          sudo apt-get install -y verilator

      - name: Lint RTL
        run: |
          verilator --lint-only --sv -Wall \
            -Irtl/core/include \
            rtl/soc/richard_soc.sv \
            $(find rtl -name '*.sv' ! -name 'richard_soc.sv') \
            || echo "Lint completed with warnings"