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
31 changes: 0 additions & 31 deletions .github/modules.json

This file was deleted.

98 changes: 49 additions & 49 deletions .github/workflows/rtl-simulation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,42 @@ env:

jobs:
module-matrix:
name: Read module matrix
name: Read module-profile matrix
runs-on: ubuntu-24.04
outputs:
matrix: ${{ steps.modules.outputs.matrix }}
flow_revision: ${{ steps.flow-revision.outputs.revision }}
steps:
- name: Check out repository
uses: actions/checkout@v7

- name: Read module manifest
- name: Read pinned mosaic-flow submodule revision
id: flow-revision
run: |
revision="$(git ls-files --stage mosaic-flow | awk '$1 == "160000" {print $2}')"
[[ "${revision}" =~ ^[0-9a-f]{40}$ ]]
echo "revision=${revision}" >> "${GITHUB_OUTPUT}"

- name: Check out pinned mosaic-flow
uses: actions/checkout@v7
with:
repository: ECASLab/mosaic-flow
ref: ${{ steps.flow-revision.outputs.revision }}
path: mosaic-flow
persist-credentials: false

- name: Verify mosaic-flow checkout
run: test "$(git -C mosaic-flow rev-parse HEAD)" = "${{ steps.flow-revision.outputs.revision }}"

- name: Generate validated module-profile matrix
id: modules
run: |
matrix="$(python3 -c \
$'import json\nprint(json.dumps(json.load(open(".github/modules.json"))))')"
make module-manifest-check
matrix="$(make module-profile-matrix)"
echo "matrix=${matrix}" >> "${GITHUB_OUTPUT}"

rtl-checks:
name: ${{ matrix.name }} native checks
name: ${{ matrix.job_name }} native checks
needs: module-matrix
runs-on: ubuntu-24.04
timeout-minutes: 15
Expand Down Expand Up @@ -81,91 +100,70 @@ jobs:
fi

- name: Validate project flow selection
run: make MODULE="${{ matrix.name }}" flow-config-check
run: make MODULE="${{ matrix.module }}" PROFILE="${{ matrix.profile }}" flow-config-check

- name: Cache open-source tools
uses: actions/cache@v5
with:
path: ~/.cache/mosaic
key: mosaic-tools-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('mosaic-flow/config/tool-versions.env') }}
key: mosaic-tools-${{ runner.os }}-${{ runner.arch }}-${{ needs.module-matrix.outputs.flow_revision }}-${{ matrix.module }}-${{ matrix.profile }}

- name: Set up pinned open-source tools
run: make MODULE="${{ matrix.name }}" setup-open-source
run: make MODULE="${{ matrix.module }}" PROFILE="${{ matrix.profile }}" setup-open-source

- name: Export pinned open-source tool paths
run: |
# shellcheck disable=SC2016
make --no-print-directory --silent \
MODULE="${{ matrix.name }}" \
MODULE="${{ matrix.module }}" PROFILE="${{ matrix.profile }}" \
--eval='mosaic-export-tool-paths: ; @printf "%s\n" "$(VERIBLE_ROOT)/bin" "$(SLANG_ROOT)/bin" "$(OSS_CAD_SUITE_ROOT)/bin"' \
mosaic-export-tool-paths >> "${GITHUB_PATH}"

- name: Record tool versions
run: |
set -o pipefail
mkdir -p "reports/${{ matrix.name }}/tool_versions"
mkdir -p "reports/${{ matrix.module }}/${{ matrix.profile }}/tool_versions"
{
verilator --version
yosys --version
sby --version
eqy --version
verible-verilog-lint --version
slang --version
} | tee "reports/${{ matrix.name }}/tool_versions/versions.log"
} | tee "reports/${{ matrix.module }}/${{ matrix.profile }}/tool_versions/versions.log"

- name: Run portable open-source RTL flow
run: |
set -o pipefail
make MODULE="${{ matrix.name }}" open-source 2>&1 | tee ci-artifacts/native-flow.log

- name: Validate timing constraints
run: |
set -o pipefail
make MODULE="${{ matrix.name }}" constraint-check 2>&1 | tee ci-artifacts/native-constraint-check.log

- name: Collect assertion coverage
run: |
set -o pipefail
make MODULE="${{ matrix.name }}" assertion-coverage 2>&1 | tee ci-artifacts/native-assertion-coverage.log
make MODULE="${{ matrix.module }}" PROFILE="${{ matrix.profile }}" clean open-source 2>&1 | tee ci-artifacts/native-flow.log

- name: Run fault-injection qualification
- name: Run clock-gate OpenROAD physical flow
if: matrix.module == 'clock_gate'
run: |
set -o pipefail
make MODULE="${{ matrix.name }}" fault-injection 2>&1 | tee ci-artifacts/native-fault-injection.log

- name: Qualify four-state input handling
run: |
set -o pipefail
make MODULE="${{ matrix.name }}" four-state-check 2>&1 | tee ci-artifacts/native-four-state-check.log

- name: Run pinned OpenROAD physical flow
if: matrix.name == 'clock_gate'
run: |
set -o pipefail
make MODULE="${{ matrix.name }}" openroad-container 2>&1 | tee ci-artifacts/native-openroad.log
make MODULE="${{ matrix.module }}" PROFILE="${{ matrix.profile }}" OPENROAD_EXECUTION_MODE=container open-physical 2>&1 | tee ci-artifacts/native-openroad.log

- name: Generate release evidence manifest
env:
MODULE_REVISION: ${{ github.sha }}
METHODOLOGY_REVISION: ${{ steps.flow-revision.outputs.revision }}
run: |
set -o pipefail
make MODULE="${{ matrix.name }}" release-manifest 2>&1 | tee ci-artifacts/native-release-manifest.log
make MODULE="${{ matrix.module }}" PROFILE="${{ matrix.profile }}" release-manifest release-manifest-validate 2>&1 | tee ci-artifacts/native-release-manifest.log

- name: Upload RTL reports
if: always()
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.name }}-native-reports
name: ${{ matrix.job_name }}-native-reports
path: |
reports/${{ matrix.name }}/
work/${{ matrix.name }}/openroad/reports/
work/${{ matrix.name }}/openroad/results/
reports/${{ matrix.module }}/
work/${{ matrix.module }}/
ci-artifacts/
if-no-files-found: error

container-checks:
name: ${{ matrix.name }} container checks
name: ${{ matrix.job_name }} container checks
needs: module-matrix
runs-on: ubuntu-24.04
timeout-minutes: 30
Expand All @@ -191,7 +189,7 @@ jobs:
- name: Read pinned mosaic-flow submodule revision
id: flow-revision
run: |
revision="$(git ls-files --stage mosaic-flow | awk '$1 == "160000" {print $2}')"
revision="${{ needs.module-matrix.outputs.flow_revision }}"
if [[ ! "${revision}" =~ ^[0-9a-f]{40}$ ]]; then
echo "mosaic-flow must be a pinned Git submodule" >&2
exit 1
Expand All @@ -217,7 +215,7 @@ jobs:
fi

- name: Validate project flow selection
run: make MODULE="${{ matrix.name }}" flow-config-check
run: make MODULE="${{ matrix.module }}" PROFILE="${{ matrix.profile }}" flow-config-check

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
Expand All @@ -230,12 +228,12 @@ jobs:
mosaic-flow=./mosaic-flow
build-args: |
MOSAIC_FLOW_REVISION=${{ steps.flow-revision.outputs.revision }}
cache-from: type=gha,scope=mosaic-module-ci-${{ matrix.name }}
cache-to: type=gha,mode=max,scope=mosaic-module-ci-${{ matrix.name }}
cache-from: type=gha,scope=mosaic-module-ci-${{ matrix.module }}-${{ matrix.profile }}
cache-to: type=gha,mode=max,scope=mosaic-module-ci-${{ matrix.module }}-${{ matrix.profile }}
load: true
platforms: linux/amd64
push: false
tags: mosaic-module-ci:${{ github.sha }}
tags: mosaic-module-ci:${{ github.sha }}-${{ matrix.module }}-${{ matrix.profile }}

- name: Run portable flow in container
run: |
Expand All @@ -245,16 +243,18 @@ jobs:
--env HOME=/tmp \
--env MODULE_REVISION="${GITHUB_SHA}" \
--env METHODOLOGY_REVISION="${{ steps.flow-revision.outputs.revision }}" \
--env RELEASE_METHODOLOGY_DIRTY=false \
--env RELEASE_EXECUTION_CONTEXT=container \
--volume "${GITHUB_WORKSPACE}:/workspace" \
"mosaic-module-ci:${GITHUB_SHA}" MODULE="${{ matrix.name }}" FLOW_openroad=disabled clean open-source constraint-check assertion-coverage fault-injection four-state-check release-manifest \
"mosaic-module-ci:${GITHUB_SHA}-${{ matrix.module }}-${{ matrix.profile }}" MODULE="${{ matrix.module }}" PROFILE="${{ matrix.profile }}" FLOW_openroad=disabled clean open-source release-manifest release-manifest-validate \
2>&1 | tee ci-artifacts/container-flow.log

- name: Upload container RTL reports
if: always()
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.name }}-container-reports
name: ${{ matrix.job_name }}-container-reports
path: |
reports/${{ matrix.name }}/
reports/${{ matrix.module }}/
ci-artifacts/
if-no-files-found: error
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN apt-get update \
git \
make \
python3 \
python3-venv \
tcl \
&& rm -rf /var/lib/apt/lists/*

Expand Down
64 changes: 8 additions & 56 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,63 +1,15 @@
SHELL := /usr/bin/env bash

MODULE ?= dff
TARGET ?= open-source

export MODULE_ROOT := $(CURDIR)
export FLOW_ROOT ?= $(abspath $(MODULE_ROOT)/mosaic-flow)

include config/design.mk
include $(FLOW_ROOT)/config/tools.mk
include $(FLOW_ROOT)/mk/module.mk

.PHONY: all-modules assertion-coverage constraint-check fault-injection four-state-check openroad-container release-manifest

## all-modules Run TARGET for every registered module in parallel
all-modules:
+@python3 -c 'import json; print("\n".join(item["name"] for item in json.load(open(".github/modules.json"))["include"]))' | \
xargs --no-run-if-empty --replace={} --max-procs="$${JOBS:-0}" \
$(MAKE) --no-print-directory -f "$(firstword $(MAKEFILE_LIST))" MODULE={} "$(TARGET)"

## assertion-coverage Prove that every required assertion antecedent is exercised
assertion-coverage:
@if [[ -n "$(ASSERTION_COVERAGE_SCRIPT)" ]]; then \
"$(ASSERTION_COVERAGE_SCRIPT)"; \
else \
echo "No assertion-coverage campaign is configured for MODULE=$(MODULE)"; \
fi

## constraint-check Validate synchronous and asynchronous SDC intent
constraint-check:
@if [[ -n "$(CONSTRAINT_CHECK_SCRIPT)" ]]; then \
"$(CONSTRAINT_CHECK_SCRIPT)"; \
else \
echo "No additional constraint-intent check is configured for MODULE=$(MODULE)"; \
fi

## fault-injection Prove that the verification environment detects known mutations
fault-injection:
@if [[ -n "$(FAULT_INJECTION_SCRIPT)" ]]; then \
"$(FAULT_INJECTION_SCRIPT)"; \
else \
echo "No fault-injection campaign is configured for MODULE=$(MODULE)"; \
fi

## four-state-check Demonstrate detection of unknown control inputs
four-state-check:
@if [[ -n "$(FOUR_STATE_CHECK_SCRIPT)" ]]; then \
"$(FOUR_STATE_CHECK_SCRIPT)"; \
else \
echo "No four-state input check is configured for MODULE=$(MODULE)"; \
fi
# Preserve the established per-module formatting policy while the shared flow
# drives format checks. Several common modules intentionally use four spaces.
export VERIBLE_FORMAT_CMD := $(MODULE_ROOT)/scripts/verible-format

## openroad-container Run the pinned ORFS image and validate physical evidence
openroad-container:
@if [[ -n "$(OPENROAD_CONTAINER_SCRIPT)" ]]; then \
"$(OPENROAD_CONTAINER_SCRIPT)"; \
else \
echo "No containerized OpenROAD flow is configured for MODULE=$(MODULE)"; \
fi
# Compatibility aliases preserve the existing module configuration syntax while
# delegating resolution to the shared project API below.
resolve_filelist = $(call mosaic_resolve_filelist,$(1))
resolve_flow_config = $(call mosaic_resolve_flow_config,$(1),$(2))

## release-manifest Validate and index the module's release evidence
release-manifest:
@"$(RELEASE_MANIFEST_SCRIPT)"
include $(FLOW_ROOT)/mk/project.mk
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ repository infrastructure and pinned [`mosaic-flow`](mosaic-flow) methodology.
| `retention_register` | Parameterizable visible state with explicit save and restore behavior | [`docs/retention_register/`](docs/retention_register/) |

The authoritative module list used by local automation and the GitHub Actions
matrix is [`.github/modules.json`](.github/modules.json).
matrix is [`config/modules.json`](config/modules.json). Parameterized modules
declare their qualified elaborations in `config/parameter-profiles/`.

## Repository structure

Expand All @@ -46,8 +47,8 @@ portable acceptance gate from the repository root:

```sh
git submodule update --init --recursive
make MODULE=dff flow-config-check
make MODULE=dff clean open-source
make MODULE=dff PROFILE=default flow-config-check
make MODULE=dff PROFILE=default clean open-source
```

Module-specific targets may extend the portable gate. Consult the selected
Expand All @@ -61,7 +62,7 @@ After all required module-specific gates pass, generate the validated evidence
index with:

```sh
make MODULE=dff release-manifest
make MODULE=dff PROFILE=default release-manifest release-manifest-validate
```

The manifest is written under `reports/<module>/release_manifest/` and is
Expand All @@ -78,7 +79,7 @@ Run the default target for every registered module concurrently with:

```sh
make all-modules
make all-modules TARGET=open-sim
make TARGET=open-sim all-modules
```

Set `JOBS` to limit concurrency. Reports and work products remain isolated under
Expand All @@ -97,8 +98,10 @@ config/modules/<name>.mk
config/modules/<name>-flows.mk
```

Append the module name to [`.github/modules.json`](.github/modules.json). The
local `all-modules` target and GitHub Actions matrix will then discover it.
Append the module name to [`config/modules.json`](config/modules.json), and add
`config/parameter-profiles/<name>.json` whenever the module has structural
parameters. The local `all-modules` target and GitHub Actions matrix will then
discover it.

## Commercial qualification

Expand Down
6 changes: 4 additions & 2 deletions config/flows.mk
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Keep flow policy separate from design identity so each module can approve its
# own required and optional checks.
# This legacy fallback is reached only by selection-free administrative targets.
# Selected modules use config/modules/<name>-flows.mk through project.mk.
ifneq ($(strip $(MODULE)),)
MODULE_FLOW_CONFIG := $(MODULE_ROOT)/config/modules/$(MODULE)-flows.mk

ifeq ($(wildcard $(MODULE_FLOW_CONFIG)),)
$(error Missing flow policy for MODULE '$(MODULE)': $(MODULE_FLOW_CONFIG))
endif

# mosaic-flow loads this file after shared defaults, so module values override
# the methodology defaults deliberately.
include $(MODULE_FLOW_CONFIG)
endif
Loading