-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (104 loc) · 4 KB
/
regression.yml
File metadata and controls
115 lines (104 loc) · 4 KB
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
# ============================================================
# .github/workflows/regression.yml
#
# IMPORTANT: GitHub-hosted runners do NOT have ModelSim/Questa
# installed (commercial licensed tools). This CI workflow does
# the parts that DO work in CI:
# 1. Static checks on the Python tooling
# 2. Sanity-runs regression.py + dashboard.py against the
# sample log committed under reports/sample_uvm_sim_log.txt
# (if present) so reviewers see the dashboard generates.
# 3. Verifies the repo's expected folder structure.
#
# To run the actual SystemVerilog regression in CI you need a
# self-hosted runner with Questa/ModelSim installed. A skeleton
# job for that is included below, gated to never run by default.
# ============================================================
name: regression
on:
push:
branches: [ main, master ]
pull_request:
workflow_dispatch:
jobs:
python-and-structure:
name: Python tooling + repo structure
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Python deps
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Compile-check Python
run: |
python -m py_compile tools/regression.py
python -m py_compile tools/dashboard.py
- name: Verify repo structure
run: |
for p in \
rtl/memory_ctrl.sv \
rtl/memory_ctrl_buggy.sv \
tb/simple/tb_top.sv \
tb/simple/mem_test.sv \
tb/uvm/mem_if.sv \
tb/uvm/mem_uvm_pkg.sv \
tb/uvm/tb_top_uvm.sv \
scripts/run_simple.tcl \
scripts/run_uvm.tcl \
scripts/run_uvm_bug.tcl \
tools/regression.py \
tools/dashboard.py \
docs/verification_plan.md \
docs/architecture.md \
README.md
do
test -f "$p" || { echo "MISSING: $p"; exit 1; }
done
echo "All required files present."
- name: Build a synthetic log and exercise the tools
run: |
mkdir -p reports
cat > reports/sample_log.txt <<'EOF'
# UVM_INFO @ 100: top.env.sb [SB] PASS read_chk1_addr0 expected=0x00 actual=0x00
# UVM_INFO @ 200: top.env.sb [SB] PASS read_chk2_addr1 expected=0xa1 actual=0xa1
# UVM_INFO @ 300: top.env.sb [SB] PASS read_chk3_addr7 expected=0x27 actual=0x27
# UVM_INFO @ 400: top.env.cov [COV] COVERAGE_REPORT addr=100.0% op=100.0% data=100.0% cross=100.0% trans=100.0% overall=100.0%
EOF
python tools/regression.py reports/sample_log.txt
python tools/dashboard.py reports/sample_log.txt
test -f reports/dashboard.html
echo "Dashboard HTML generated successfully."
- name: Upload dashboard artifact
uses: actions/upload-artifact@v4
with:
name: dashboard
path: reports/dashboard.html
# ----------------------------------------------------------
# OPTIONAL: real SV regression on a self-hosted runner.
# This job NEVER runs by default. To enable, register a
# self-hosted runner with Questa installed and replace the
# `if: false` guard with `if: github.event_name == ...`.
# ----------------------------------------------------------
sv-simulation-self-hosted:
name: SV regression (self-hosted, optional)
if: false # disabled until you bring your own simulator
runs-on: [self-hosted, questa]
needs: python-and-structure
steps:
- uses: actions/checkout@v4
- name: Run UVM regression
shell: bash
run: |
vsim -c -do scripts/run_uvm.tcl
python tools/regression.py reports/uvm_sim_log.txt
python tools/dashboard.py reports/uvm_sim_log.txt
- uses: actions/upload-artifact@v4
with:
name: uvm-dashboard
path: reports/dashboard.html