Skip to content
antmicroPublic

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

45 Commits

Folders and files

Repository files navigation

mdash

Copyright (c) 2026 Antmicro

Self-contained single-page application for tracking RTL-to-GDSII build metrics of digital designs built with OpenROAD. Measured runs are collected in CI, serialized with the Python tools in tools/ and rendered into a static page:

  • Overview - cards for open pull requests and tracked branches, grouped by design configuration, each showing its latest run
  • History - metric plots over time for the main branch
  • Compare - two runs side by side with the diff between them
  • Details - raw metrics of a single run

The build is a single HTML file (build/index.html) hostable on any static web server.

Prerequisites

  • Node.js >= 22 and npm (engines in metrics_dashboard/package.json)
  • Python >= 3.10 with the tool dependencies: pip install . or pip install ".[dev]" to also get the development tools (pytest, black, isort)
  • For the CI generation example below: jq and envsubst (GNU gettext)

Integration

Dashboard integration requires providing a configuration file (see sample-data/config.json) and, for every measured run, a <metrics>.json metrics report with its accompanying <metrics>.metadata.json metadata file.

Configuration

The configuration must be compatible with tools/schemas/config.schema.json. Paths are node names joined with .; metadata fields are referenced with an @ prefix (e.g. @pr_title).

  • repository - (required) the tracked repository (owner/name); the runs are the branches pushed to it and the PRs targeting it (fork PRs included)
  • labels - (required) flat map of node name (category or metric) or metadata field to the label displayed in the dashboard (e.g. tns -> TNS)
  • unit_types - (required) map of unit type to target unit (e.g. area -> um^2, power -> mW; "" for unitless); metrics whose unit type has no entry are kept in their source units
  • unit_types_file - (required) path, relative to the config file, of the unit-types file (tools/schemas/unit_types.schema.json, e.g. sample-data/units_flatmap.json): a flat map of metric paths to unit types (e.g. synthesis.modules.*.area -> area). A * segment matches one or more node names; exact paths win over wildcards, then the ones with more literal segments
  • main_branch - (optional) branch used by default across the dashboard (history, run summaries, first on the overview); defaults to main
  • units - (optional) map of metadata field to display unit (e.g. @frequency -> MHz); metadata values are shown as-is, without conversion
  • summary - (optional) metric paths and metadata fields shown in the summary boxes of the history and comparison views
  • overview - (optional) metric paths and metadata fields shown on the overview cards
  • unplottable - (optional) categories or metrics excluded from plotting; a bare name matches that node anywhere in the hierarchy, a path matches that node and everything below it
  • jobs - (optional) category holding CI job results, shown in the Jobs view as a grid of jobs by day of the main branch's runs: a tile is shaded by the day's pass rate and shows the day's passed/total count; a job's latest result sums up its newest day (flaky if it both passed and failed); a tile opens the day's results with links and the job's statistics; every job is a category with a status metric (passed, failed, canceled, ...), an optional url metric linking to its log and an optional duration metric, e.g. {"jobs": {"workflow": {"job_a": {"status": "passed", "url": "...", "duration": 61}}}}
  • title - (optional) title of the dashboard's page, RTL to GDSII metrics by default
  • hidden_tabs - (optional) views not shown in the dashboard, e.g. ["overview", "history", "compare"] for a jobs-only dashboard
  • retention_period - (optional) how long the runs are kept, counting from the build date, e.g. 20 days, 2 weeks, 6 months or 1 year; the older runs are removed during serialization

Metrics & metadata

A run's metrics report and metadata file must be compatible with tools/schemas/metrics.schema.json and tools/schemas/metadata.schema.json.

Metrics

The metrics file consists of:

  • a units node mapping each unit type to the unit the metrics are delivered in (e.g. power -> 1nW); a metric's unit type comes from the config's unit-types file
  • the remaining top-level keys: nested objects are categories, leaves (keys pointing to string, boolean or number values) are metrics

During serialization the values are converted to the config's target units: if unit_types targets area at um^2 while a metrics file delivers area as mm^2, the values are multiplied by 10^6.

Example metrics file:

{
  "floorplan": {
    "power": {
      "Sequential": {
        "internal": 532.685469,
        "total": 749.094045
      }
    }
  },
  "units": {
    "power": "1nW"
  }
}

Paired with the unit-types map:

{
  "floorplan.power.*": "power"
}

This provides the internal and total metrics of floorplan > power > Sequential; via the unit-types map they resolve to the power unit type and are interpreted as delivered in nW.

Metadata

The metadata file describes the run that produced the metrics report. Depending on the event that triggered the run, different properties are required.

Fields for both triggers:

  • is_pr - trigger type: false for a push, true for a pull request
  • current_commit - SHA of the commit the run was performed at
  • date - date and time of the run, YYYY-MM-DD HH:MM
  • source_repository - name of the repository the run was performed on
  • source_branch - branch the run was performed on

Optional fields:

  • pipeline_status - passed, passed_with_warnings, failed or canceled; displayed as unknown when omitted
  • url - link displayed on the overview card of the run's reference
  • configuration - variant of the design the run built, for branches or PRs triggering multiple flows; the dashboard groups the runs by it
  • commit_message - commit message, referenceable as @commit_message in summary and overview fields

When is_pr is true, the metadata additionally contains:

  • pr_number - (required) PR number, displayed in the overview
  • pr_title - (required) PR title, displayed in the overview
  • target_repository - (required) repository the PR targets
  • target_branch - (optional) branch the PR targets

Templates for the two metadata kinds (envsubst templates held under $TEMPLATE_PATH); unset optional variables substitute to an empty string and are dropped by the generation step below:

Template example ($TEMPLATE_PATH/push.json.tpl):

{
  "is_pr": false,
  "current_commit": "${COMMIT}",
  "configuration": "${CONFIGURATION}",
  "commit_message": ${COMMIT_MESSAGE},
  "source_branch": "${SRC_BRANCH}",
  "source_repository": "${SRC_REPO}",
  "date": "${DATE}",
  "pipeline_status": "${STATUS}",
  "url": "${URL}"
}

Template example ($TEMPLATE_PATH/pr.json.tpl):

{
  "is_pr": true,
  "current_commit": "${COMMIT}",
  "configuration": "${CONFIGURATION}",
  "commit_message": ${COMMIT_MESSAGE},
  "source_branch": "${SRC_BRANCH}",
  "source_repository": "${SRC_REPO}",
  "date": "${DATE}",
  "pipeline_status": "${STATUS}",
  "url": "${URL}",
  "pr_number": ${PR_NUMBER},
  "pr_title": ${PR_TITLE_JSON},
  "target_branch": "${TGT_BRANCH}",
  "target_repository": "${TGT_REPO}"
}
Generation example

Sample GitHub Actions steps producing the metadata files, assuming the metrics_* artifacts unpack to metrics/metrics_*/*.json (jq and envsubst required):

- name: Download metrics
  uses: actions/download-artifact@v4
  with:
    pattern: metrics_*
    path: ./metrics

- name: Prepare runs
  env:
    TEMPLATE: ${{ github.event_name == 'pull_request' && 'pr' || 'push' }}
    STATUS: ${{ inputs.pipeline_status }}
    URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
    SRC_BRANCH: ${{ github.head_ref || github.ref_name }}
    SRC_REPO: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
    TGT_BRANCH: ${{ github.base_ref }}
    TGT_REPO: ${{ github.repository }}
    PR_NUMBER: ${{ github.event.number }}
    PR_TITLE: ${{ github.event.pull_request.title }}
  run: |
    export DATE=$(date -u '+%Y-%m-%d %H:%M')
    export COMMIT=$(git rev-parse --short=7 HEAD)
    export COMMIT_MESSAGE=$(jq -n --arg t "$(git log -1 --format=%B)" '$t')
    export PR_TITLE_JSON=$(jq -n --arg t "$PR_TITLE" '$t')

    shopt -s nullglob
    for dir in metrics/metrics_*/; do
      for f in "$dir"*.json; do
        case "$f" in
          */metadata.json|*.metadata.json) continue ;;
        esac
        # Unset optional fields substitute to ""; drop them instead
        envsubst < "$TEMPLATE_PATH/$TEMPLATE.json.tpl" \
          | jq 'with_entries(select(.value != "" and .value != null))' \
          > "${f%.json}.metadata.json"
      done
    done

The serialized data can then be built with the serializer (see Data preparation) over metrics/metrics_*/*_report.json.

The dashboard workflow takes the pipeline status as an input; the calling workflow supplies it from the job it gates on (RUN in this example):

Metrics-Dashboard:
  needs: RUN
  uses: ./.github/workflows/metrics-dashboard.yml
  with:
    pipeline_status: >-
      ${{ needs.RUN.result == 'success' && 'passed'
       || needs.RUN.result == 'cancelled' && 'canceled'
       || 'failed' }}

Data preparation

Before the dashboard is built, the runs are validated, normalized and serialized into the columnar data.json (plus a config.json filtered to the keys the dashboard consumes) under metrics_dashboard/src/lib/data/.

Serialization

To normalize and serialize metric files run the serialize_json.py script:

python tools/serialize_json.py -o metrics_dashboard/src/lib/data/ \
       -i sample-data/*_report.json -c sample-data/config.json

Runs are merged into any existing data.json, so the output directory accumulates them (re-adding the same run is a no-op):

  • new runs are skipped when their metrics file fails validation; metadata schema violations are reported but the run is still merged
  • when a new run reports a different unit for an already stored metric, its values are converted to the stored unit; values that cannot be converted are dropped with a warning
  • --open-prs [PR ...] prunes the PR runs not on the list, along with the metrics only they provided; passing --open-prs with no arguments drops all PR runs
  • --no-strict drops malformed entries from the pre-existing data.json instead of failing on it

Validation

Optionally, a metrics file, its metadata and the configuration can be validated separately using the Python validate_metrics.py script; the same validation always runs during serialization:

python tools/validate_metrics.py -c sample-data/config.json sample-data/counter_01_report.json

Building the dashboard

The dashboard expects serialized data data.json and config.json files in metrics_dashboard/src/lib/data. Refer to Data preparation section for serialization instructions.

cd metrics_dashboard
git submodule update --init  # component library submodules (src/lib/aesir, src/lib/aesir-html)
npm i  # install project npm dependencies
npm run build  # invoke static page build

The output is a single file written to build/index.html. Preview it with npm run preview or simply open it in the browser of choice.

Development

The app can be served by a development server that live-reloads the performed changes:

cd metrics_dashboard
npm i  # install project npm dependencies
npm run dev  # run the development server

This will start the development server and log the URL where it can be accessed.

Checks

The dashboard uses TypeScript and external linters; run checks with:

npm run check   # svelte-check (types)
npm run lint    # prettier + eslint
npm test        # vitest (unit tests)

The Python tools have separate checks, with the dependencies from pip install ".[dev]" (see Prerequisites) run:

python -m pytest tools  # unit tests
python -m black tools   # formatting
python -m isort tools   # import order

Layout

  • tools/ - Python scripts that validate the configuration, metrics and metadata files and serialize them into the data.json and config.json used by the dashboard
    • serialize_json.py - serialization script, utilizes the other tools for validation and data normalization
    • validate_metrics.py - validates metrics, metadata and config files against the schemas as well as performs validation that cannot be performed by a schema - e.g. validating the units from the config against supplied metrics files, checking that the configured label / summary / overview fields exist in the actual metrics files
    • units.py and unit_sources.py - associating and normalizing units specified for the metric files; resolve each metric's unit type through the config's unit-types file
    • schemas/ - JSON schemas for the metrics, metadata, configuration and unit-types files
    • tests/ - pytest suite for the tools
  • sample-data/ - example data set used to generate and visualize the dashboard
  • metrics_dashboard/ - Svelte dashboard project
    • .npmrc, .prettierignore, .prettierrc, eslint.config.js, package.json, package-lock.json, svelte.config.js, tsconfig.json, vite.config.ts - configuration of the project and its tooling (Vite, TypeScript, ESLint, Prettier)
    • index.html - the page everything's bound to
    • src/ - dashboard page sources
      • app.svelte - the main Svelte app (mounted by main.ts)
      • main.ts - entry point for the app
      • lib/ - sources for the page views, data processing, plotting
        • data/ - directory where the generated data.json and config.json are expected
        • metrics.ts - importing the serialized metrics & config, mapping and preparing structures for easier plotting and lookups
        • units.ts - logic for handling the units (formatting, scaling)
        • data.ts - metrics loader; handles missing data, builds the dataset for plotting
        • aesir.ts - column alignment for the tables of the comparison and details views (used by metric-tables.svelte)
      • lib/components/ - Svelte components
        • compare.svelte - comparison view, selects two runs and shows them side by side with the diff between them
        • details.svelte - details dialog with the raw metrics of a run, opened by the View details button on the overview page
        • history.svelte - plots metrics over time for the main branch (config's main_branch)
        • metric-tables.svelte - tables for metrics used both in the comparison and details views
        • overview.svelte - view tracking open PRs & selected branches, grouped by design configuration; one card per group of runs, always showing the latest run
        • run-picker.svelte - dropdown wrapper for selecting the run displayed by the details and comparison views
        • summary.svelte - box with user-configured pinned information for the history and comparison views

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages