Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 84 additions & 14 deletions .github/workflows/tests-and-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
# and AXI-Controller bus configurations, then builds and deploys documentation.
#
# Architecture:
# 1. generate-matrix: Uses nox's JSON output to discover test sessions
# 2. tests-ahb: Runs all AHB-tagged tests in parallel (one job per test)
# 3. tests-axi: Runs all AXI-tagged tests in parallel (one job per test)
# 4. tests-axi-controller: Runs all AXI-Controller tests in parallel
# 5. test-results: Aggregates results from all test jobs
# 6. docs-build: Builds and deploys documentation (only after tests pass)
# 1. generate-timing-docs: Generates timing CSR markdown documents
# 2. generate-matrix: Uses nox's JSON output to discover test sessions
# 3. tests-ahb: Runs all AHB-tagged tests in parallel (one job per test)
# 4. tests-axi: Runs all AXI-tagged tests in parallel (one job per test)
# 5. tests-axi-controller: Runs all AXI-Controller tests in parallel
# 6. test-results: Aggregates results from all test jobs
# 7. docs-build: Builds and deploys documentation (only after tests pass)
#
# Optional: Long-running tests (i3c_ahb_verify, i3c_axi_verify) can be split
# into individual parametrized runs by enabling SPLIT_TESTS in generate-matrix.
Expand All @@ -33,6 +34,52 @@ env:
WAVES: "0"

jobs:
# ===========================================================================
# Job: Generate Timing CSR Docs
# ===========================================================================
generate-timing-docs:
name: Generate timing docs
runs-on: ubuntu-latest
env:
I3C_ROOT_DIR: ${{ github.workspace }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install system dependencies
run: |
sudo apt -qqy update
sudo apt -qqy --no-install-recommends install \
wget curl help2man libfl-dev make g++ git bison flex gperf \
libreadline-dev libbz2-dev autoconf python3-dev python3-venv \
python3-jsonschema python3-yaml python3-sphinx python3-docopt

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install Python dependencies
run: |
python -m pip install uv
uv sync

- name: Generate timing docs
run: |
mkdir -p doc/source
echo "" >> doc/source/timing_csr.md
python tools/timing/timings.py --freq=200e6 --target_name="FPGA" --md >> doc/source/timing_csr.md
echo "" >> doc/source/timing_csr.md
python tools/timing/timings.py --freq=500e6 --target_name="ASIC" --md >> doc/source/timing_csr.md

- name: Upload timing docs artifact
uses: actions/upload-artifact@v4
with:
name: timing-csr-docs
path: doc/source/timing_csr.md

# ===========================================================================
# Job: Generate Test Matrix
# ===========================================================================
Expand Down Expand Up @@ -136,12 +183,29 @@ jobs:
f.write(f"axi_controller_matrix={json.dumps(axi_controller_tests)}\n")
EOF

lint-testplans:
name: Lint Testplan Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Run Testplan Linter
run: |
export I3C_ROOT_DIR=$GITHUB_WORKSPACE
python tools/lint_testplan.py

# ===========================================================================
# Job: Run AHB Tests (Parallel)
# ===========================================================================
tests-ahb:
name: "AHB: ${{ matrix.test }}"
needs: [generate-matrix]
needs: [generate-matrix, lint-testplans]
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -216,15 +280,15 @@ jobs:
with:
name: test-results-ahb-${{ steps.sanitize.outputs.name }}
path: |
verification/cocotb/**/results*.xml
verification/cocotb/**/*.xml
verification/cocotb/**/*.log

# ===========================================================================
# Job: Run AXI Tests (Parallel)
# ===========================================================================
tests-axi:
name: "AXI: ${{ matrix.test }}"
needs: [generate-matrix]
needs: [generate-matrix, lint-testplans]
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -299,15 +363,15 @@ jobs:
with:
name: test-results-axi-${{ steps.sanitize.outputs.name }}
path: |
verification/cocotb/**/results*.xml
verification/cocotb/**/*.xml
verification/cocotb/**/*.log

# ===========================================================================
# Job: Run AXI-Controller Tests (Parallel)
# ===========================================================================
tests-axi-controller:
name: "AXI-Ctrl: ${{ matrix.test }}"
needs: [generate-matrix]
needs: [generate-matrix, lint-testplans]
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -386,7 +450,7 @@ jobs:
with:
name: test-results-axi-controller-${{ steps.sanitize.outputs.name }}
path: |
verification/cocotb/**/results*.xml
verification/cocotb/**/*.xml
verification/cocotb/**/*.log

# ===========================================================================
Expand Down Expand Up @@ -438,8 +502,8 @@ jobs:
docs-build:
name: Build documentation
runs-on: ubuntu-latest
needs: [test-results]
if: always() && needs.test-results.result == 'success'
needs: [test-results, generate-timing-docs]
if: always() && needs.test-results.result == 'success' && needs.generate-timing-docs.result == 'success'
steps:
- name: Install system dependencies
run: |
Expand All @@ -459,6 +523,12 @@ jobs:
name: tests-results
path: tests-results

- name: Download timing docs artifact
uses: actions/download-artifact@v4
with:
name: timing-csr-docs
path: doc/source

- name: Debug downloaded artifacts
run: |
echo "=== Full structure of tests-results ==="
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ build-verilator:
# Testplanning
#

BLOCKS_VERIFICATION_PLANS = $(shell find $(TESTPLAN_DIR) -type f -name "*.hjson" ! -name "target*.hjson" | sort)
CORE_VERIFICATION_PLANS = $(shell find $(TESTPLAN_DIR) -type f -name "*target*.hjson" | sort)
BLOCKS_VERIFICATION_PLANS = $(shell find $(TESTPLAN_DIR) -type f -path "*/block/*.hjson" | sort)
CORE_VERIFICATION_PLANS = $(shell find $(TESTPLAN_DIR) -type f -path "*/top/*.hjson" | sort)
verification-docs:
testplanner $(BLOCKS_VERIFICATION_PLANS) -ot $(TESTPLAN_DIR)/generated/testplans_blocks.md --project-root $(I3C_ROOT_DIR) --testplan-file-map $(TESTPLAN_DIR)/source-maps.yml --source-url-prefix $(REPO_URL)
testplanner $(CORE_VERIFICATION_PLANS) -ot $(TESTPLAN_DIR)/generated/testplans_core.md --project-root $(I3C_ROOT_DIR) --testplan-file-map $(TESTPLAN_DIR)/source-maps.yml --source-url-prefix $(REPO_URL)
Expand All @@ -134,8 +134,8 @@ cocotbxml-to-hjson-sim-results:
cocotbxml-to-hjson -i $(TESTS_RESULTS_DIR) -t $(BLOCKS_VERIFICATION_PLANS) -o $(TESTS_RESULTS_DIR) --xml-root-dir $(TESTS_XML_BASE_PATH) --tests-ignore-dirs venv .venv .pyenv --test-tracking-summary-dir ./blocks --testplan-file-map $(TESTPLAN_DIR)/source-maps.yml
cocotbxml-to-hjson -i $(TESTS_RESULTS_DIR) -t $(CORE_VERIFICATION_PLANS) -o $(TESTS_RESULTS_DIR) --xml-root-dir $(TESTS_XML_BASE_PATH) --tests-ignore-dirs venv .venv .pyenv --test-tracking-summary-dir ./core --testplan-file-map $(TESTPLAN_DIR)/source-maps.yml

BLOCKS_VERIFICATION_SIM_RESULTS = $(shell find $(TESTS_RESULTS_DIR) -type f -name "*.hjson" ! -name "target*.hjson" | sort)
CORE_VERIFICATION_SIM_RESULTS = $(shell find $(TESTS_RESULTS_DIR) -type f -name "*target*.hjson" | sort)
BLOCKS_VERIFICATION_SIM_RESULTS = $(shell find $(TESTS_RESULTS_DIR) -type f -path "*/block/*.hjson" | sort)
CORE_VERIFICATION_SIM_RESULTS = $(shell find $(TESTS_RESULTS_DIR) -type f -path "*/top/*.hjson" | sort)
verification-docs-with-sim: cocotbxml-to-hjson-sim-results
testplanner $(BLOCKS_VERIFICATION_PLANS) -s $(BLOCKS_VERIFICATION_SIM_RESULTS) -ot $(TESTPLAN_DIR)/generated/testplans_blocks.md -os $(TESTPLAN_DIR)/generated/sim-results --output-summary-title "Tests for individual blocks" --output-summary $(TESTPLAN_DIR)/generated/sim-results/index-blocks.html --project-root $(I3C_ROOT_DIR) --testplan-file-map $(TESTPLAN_DIR)/source-maps.yml --source-url-prefix $(REPO_URL)
testplanner $(CORE_VERIFICATION_PLANS) -s $(CORE_VERIFICATION_SIM_RESULTS) -ot $(TESTPLAN_DIR)/generated/testplans_core.md -os $(TESTPLAN_DIR)/generated/sim-results --output-summary-title "Tests for the core" --output-summary $(TESTPLAN_DIR)/generated/sim-results/index-top.html --project-root $(I3C_ROOT_DIR) --testplan-file-map $(TESTPLAN_DIR)/source-maps.yml --source-url-prefix $(REPO_URL)
Expand Down
Loading
Loading