Fix README formatting #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ============================================================ | ||
| # .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 | ||