From 601a22342138bb2e04686310e820e52a8a0c1234 Mon Sep 17 00:00:00 2001 From: tinebp Date: Sat, 14 Nov 2026 13:20:40 -0800 Subject: [PATCH 01/11] logic_gate: compare against the merge base, add ASIC Beacon, tie lint Beacon (logic_gate) stayed green through every synthesis-gate failure the MLP merge caused. Its baselines had been recorded on the PR's own final RTL, so the CI cell compared the head with itself (+0 % by construction). It also ran only the Xilinx flow, where the STD FPU and the ASIC multiplier never elaborate, and its verdict table was swallowed by pytest's capture. - --against-rev REV builds a reference from REV's RTL under the change's own flow and gates every build against it. On pull requests, ci.yml passes the merge base. References are cached by merge-base SHA and flow fingerprint, locked against concurrent runs, and trimmed to finished builds. A reference that fails to build is REF-FAIL, not a pass. NO-REFERENCE is reserved for a DUT absent at that revision. The `beacon-skip-reference` label is a maintainer-granted escape for flow changes the merge base cannot elaborate under. - `--update-baseline --against-rev` writes the accepted regressions into the baseline. They lapse once the merge base carries the same entry. - gate_asic runs Beacon's ASAP7 model over asic_gate.yaml's builds. It gates FF and cells, registers that got deeper against the reference, and a predicted-Fmax backstop 32 % below clock_mhz. The band comes from 84 design/target pairs against OpenSTA: any band in (25.1 %, 38.5 %) has no false positive at 800 or 1000 MHz and still catches the core/top misses. Macros are reported, not gated. - `beacon.py ties` counts the instance-input bits each DUT harness ties to constants, gated on any change. The tex wrapper that hid 128 LOD bits from Vivado reads 129 against 1. - The verdict table streams into the CI log and the job summary, and the Beacon reports are uploaded as artifacts. p_fmax is advisory only. - On a pull request the cell also checks out the submodules: the reference is staged from the commits the merge base pins, and the third_party cache restores only their working trees. - Builds are admitted by peak memory as well as by slot. Beacon's gfx and gfxvm builds peak at 9.5 and 10 GB, more than a 16 GB hosted runner holds together, and the runner was lost when both ran at once; a free slot now takes the longest build that fits next to the running ones. On a larger machine the schedule is unchanged. Validated against known-bad and known-good trees: core/top DEEPER on fdivsqrt nrm_reg (29 -> 75) and fma pipe_rnd1 (26 -> 51); cache FF +17.3 %; lmem FF +16.2 %; old tex wrapper HARNESS; and vm FF +11 % and gfx BRAM +15 % against the merge base. There are no false positives on master. A forced reference failure fails the run, and a resumed trimmed cache rebuilds. Baselines recorded on this tree with the CI pins (CIRCT 892a65a01, foldsim d8350bc0f): the new beacon_asic set (14 builds) and the beacon set, which gains only tied_bits/tied_ports. Both gates pass 14/14. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 105 ++ .github/workflows/logic_gate.yml | 38 +- AGENTS.md | 6 +- ci/baselines/synthesis/beacon/core.json | 56 + ci/baselines/synthesis/beacon/dxa.json | 8 + ci/baselines/synthesis/beacon/graphics.json | 143 ++- ci/baselines/synthesis/beacon/tensor.json | 35 + ci/baselines/synthesis/beacon/vm.json | 33 + ci/baselines/synthesis/beacon_asic/core.json | 174 ++++ ci/baselines/synthesis/beacon_asic/dxa.json | 34 + .../synthesis/beacon_asic/graphics.json | 206 ++++ .../synthesis/beacon_asic/tensor.json | 85 ++ ci/baselines/synthesis/beacon_asic/vm.json | 59 ++ ci/beacon.py | 272 ++++- ci/logic_gate.py | 9 + ci/synth_gate.py | 981 ++++++++++++++++-- ci/synth_report.py | 10 +- ci/test_runner.py | 7 +- ci/testcase.py | 6 + ci/testcases/asic_gate.yaml | 4 + ci/testcases/logic_gate.yaml | 32 +- docs/designs/beacon.md | 137 ++- docs/designs/continuous_integration.md | 92 +- 23 files changed, 2355 insertions(+), 177 deletions(-) create mode 100644 ci/baselines/synthesis/beacon_asic/core.json create mode 100644 ci/baselines/synthesis/beacon_asic/dxa.json create mode 100644 ci/baselines/synthesis/beacon_asic/graphics.json create mode 100644 ci/baselines/synthesis/beacon_asic/tensor.json create mode 100644 ci/baselines/synthesis/beacon_asic/vm.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d600f6daa..d1ec4e9a8c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -258,6 +258,12 @@ jobs: CELL: ${{ matrix.category }}-${{ matrix.driver }}-${{ matrix.xlen }}${{ matrix.shards && format('-{0}of{1}', matrix.shard, matrix.shards) || '' }} steps: - uses: actions/checkout@v4 + with: + # logic_gate builds its pull request's merge base, so it needs history and + # the submodules' git data (the third_party cache holds only their working + # trees, whose .git files point into an uncached .git/modules). + fetch-depth: ${{ matrix.category == 'logic_gate' && github.event_name == 'pull_request' && '0' || '1' }} + submodules: ${{ matrix.category == 'logic_gate' && github.event_name == 'pull_request' && 'recursive' || 'false' }} - name: Setup Vortex uses: ./.github/actions/setup-vortex with: @@ -292,6 +298,51 @@ jobs: run: | (cd build${{ matrix.xlen }} && bash ci/toolchain_install.sh --foldsim) pip install --quiet "pyslang>=11,<13" + # logic_gate on a pull request: every build is also compared with the + # same build on the merge base's RTL (ci/logic_gate.py --against-rev, + # through BEACON_AGAINST_REV). The checkout is the merge of the pull + # request into its target, so the merge base is the target's head this + # run merged into, and the diff is exactly what the pull request adds. + # The reference's builds are cached by that SHA and the flow it was + # measured under, so the pull request's next push reuses them. + # + # A maintainer may grant the label `beacon-skip-reference` (a reviewed + # decision) when a flow change cannot elaborate the merge base's RTL, + # which would otherwise read REF-FAIL on every push. The label is read + # from the event's payload, so it takes effect on the next push. + - name: Merge base + id: mb + if: matrix.category == 'logic_gate' && github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'beacon-skip-reference') + env: + TARGET: ${{ github.base_ref }} + run: | + set -euo pipefail + git fetch --no-tags origin "+refs/heads/$TARGET:refs/remotes/origin/$TARGET" + base=$(git merge-base HEAD "origin/$TARGET") + flow=$(python3 -c "import sys; sys.path.insert(0, 'ci'); import synth_gate; print(synth_gate.flow_fingerprint('.'))") + echo "merge base: $base (origin/$TARGET), flow $flow" + echo "BEACON_AGAINST_REV=$base" >> "$GITHUB_ENV" + echo "base=$base" >> "$GITHUB_OUTPUT" + echo "flow=$flow" >> "$GITHUB_OUTPUT" + - name: Merge base skipped + if: matrix.category == 'logic_gate' && github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'beacon-skip-reference') + run: | + msg="beacon-skip-reference: the merge-base comparison is SKIPPED by a maintainer's label; logic_gate's verdict is against the baselines only" + echo "::warning title=logic_gate::$msg" + printf '> [!WARNING]\n> %s\n\n' "$msg" >> "$GITHUB_STEP_SUMMARY" + # The newest entry for this merge base and flow; a later save only ever + # adds one with more finished reference builds (see the save below). + - name: Restore the merge base's Beacon builds + id: refcache + if: steps.mb.outputs.base + uses: actions/cache/restore@v4 + with: + path: .beacon_ref + key: beacon-ref-${{ steps.mb.outputs.base }}-${{ steps.mb.outputs.flow }}- + restore-keys: beacon-ref-${{ steps.mb.outputs.base }}-${{ steps.mb.outputs.flow }}- + - name: List the restored reference builds + if: steps.mb.outputs.base + run: python3 -c "import sys; sys.path.insert(0, 'ci'); import synth_gate; print('\n'.join(synth_gate.reference_cache_done('.beacon_ref')))" > "$RUNNER_TEMP/beacon_ref_done" - name: Run cell run: | cd build${{ matrix.xlen }} @@ -309,6 +360,60 @@ jobs: with: name: junit-${{ env.CELL }} path: junit-*.xml + # The gate's verdicts in the job summary, and per build the evidence a + # verdict names: the diff against the merge base, the area by unit, the + # calibrated risk, the deepest paths. + - name: Summarize logic_gate + if: always() && matrix.category == 'logic_gate' + run: | + for r in build${{ matrix.xlen }}/logic_gate.json build${{ matrix.xlen }}/logic_gate_asic.json; do + [ -f "$r" ] && python3 ci/synth_report.py "$r" >> "$GITHUB_STEP_SUMMARY" || true + done + - uses: actions/upload-artifact@v4 + if: always() && matrix.category == 'logic_gate' + with: + name: logic-gate-${{ env.CELL }} + path: | + build${{ matrix.xlen }}/logic_gate*.json + build${{ matrix.xlen }}_logic_gate/hw/syn/xilinx/dut/logic_gate_*/build.log + build${{ matrix.xlen }}_logic_gate/hw/syn/xilinx/dut/logic_gate_*/beacon_*.txt + build${{ matrix.xlen }}_logic_gate/hw/syn/xilinx/dut/logic_gate_*/beacon_*.json + build${{ matrix.xlen }}_logic_gate_asic/hw/syn/yosys/logic_gate_asic_*/build.log + build${{ matrix.xlen }}_logic_gate_asic/hw/syn/yosys/logic_gate_asic_*/beacon_diff.* + build${{ matrix.xlen }}_logic_gate_asic/hw/syn/yosys/logic_gate_asic_*/beacon/report.txt + build${{ matrix.xlen }}_logic_gate_asic/hw/syn/yosys/logic_gate_asic_*/beacon/area.txt + if-no-files-found: ignore + # Saved even when the cell fails, so a pull request's next push reuses + # every reference build that finished. The cache keeps what a later + # comparison reads (end points, instances, area, the stamps); a build + # that did not finish is dropped whole, so it reruns clean. A new entry + # is saved only when the finished set grew past what was restored, keyed + # by that set: cache entries are immutable, and none with fewer builds + # than the one restored is added after it. + - name: Trim the merge base's Beacon builds + id: refsave + if: always() && steps.mb.outputs.base + run: | + python3 - <<'PY' + import os, sys + sys.path.insert(0, "ci") + import synth_gate + synth_gate.trim_reference_cache(".beacon_ref") + with open(os.path.join(os.environ["RUNNER_TEMP"], "beacon_ref_done")) as fh: + before = {line for line in fh.read().splitlines() if line} + after = synth_gate.reference_cache_done(".beacon_ref") + grew = set(after) > before + print("reference builds: %d restored, %d finished%s" + % (len(before), len(after), "" if grew else "; nothing new to save")) + with open(os.environ["GITHUB_OUTPUT"], "a") as fh: + fh.write("id=%s\n" % (synth_gate.reference_cache_id(after) if grew else "")) + PY + - name: Save the merge base's Beacon builds + if: always() && steps.refsave.outputs.id + uses: actions/cache/save@v4 + with: + path: .beacon_ref + key: beacon-ref-${{ steps.mb.outputs.base }}-${{ steps.mb.outputs.flow }}-${{ steps.refsave.outputs.id }} complete: runs-on: ubuntu-22.04 diff --git a/.github/workflows/logic_gate.yml b/.github/workflows/logic_gate.yml index 71f53cd4cb..c93675059a 100644 --- a/.github/workflows/logic_gate.yml +++ b/.github/workflows/logic_gate.yml @@ -10,7 +10,8 @@ # # The gate itself runs in ci.yml, as the logic_gate cell planned with # perf_gate's rtlsim cells. This workflow is the manual entry point: a subset of -# the catalog on a hosted runner, or the full-GPU builds (group gpu), which need +# the catalog on a hosted runner, on the FPGA or the ASIC flow, optionally +# against another revision; or the full-GPU builds (group gpu), which need # ~95 GB per build and run only on the self-hosted machine. # # See docs/designs/continuous_integration.md §4.6. @@ -23,6 +24,13 @@ on: builds: description: "build ids/groups, space separated (blank = all)" default: "" + asic: + description: "measure asic_gate.yaml's builds on the ASIC flow (case gate_asic) instead" + type: boolean + default: false + against: + description: "also compare each build with the same build on this revision's RTL (blank = none)" + default: "" gpu: description: "run the full-GPU builds (group gpu) on the self-hosted machine instead" type: boolean @@ -40,10 +48,14 @@ jobs: if: ${{ !inputs.gpu }} runs-on: ubuntu-22.04 timeout-minutes: 90 + env: + CASE: ${{ inputs.asic && 'gate_asic' || 'gate' }} + REPORT: ${{ inputs.asic && 'logic_gate_asic.json' || 'logic_gate.json' }} steps: - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: ${{ inputs.against && '0' || '1' }} # Restores the prebuilt toolchain (CIRCT among it) and exports TOOLDIR; # prepare=true installs it on a cache miss. @@ -60,22 +72,24 @@ jobs: ../configure --tooldir=$TOOLDIR ci/toolchain_install.sh --foldsim - # The command is the one the catalog declares (the `gate` case of - # ci/testcases/logic_gate.yaml), so what CI runs and what the catalog - # says cannot drift apart. + # The command is the one the catalog declares (the `gate` or `gate_asic` + # case of ci/testcases/logic_gate.yaml), so what CI runs and what the + # catalog says cannot drift apart. - name: Gate id: run env: IN_BUILDS: ${{ github.event.inputs.builds }} + IN_AGAINST: ${{ github.event.inputs.against }} run: | set -uo pipefail - CMD=$(python3 -c "import yaml; print(next(t['run'] for t in yaml.safe_load(open('ci/testcases/logic_gate.yaml'))['tests'] if t['id'] == 'gate'))") + CMD=$(python3 -c "import os, yaml; print(next(t['run'] for t in yaml.safe_load(open('ci/testcases/logic_gate.yaml'))['tests'] if t['id'] == os.environ['CASE']))") # Dispatch inputs reach the shell through an env var, never # interpolated into the script. ARGS=() for b in ${IN_BUILDS:-}; do ARGS+=(-b "$b"); done + [ -n "${IN_AGAINST:-}" ] && ARGS+=(--against-rev "$IN_AGAINST") rc=0 - $CMD "${ARGS[@]}" --timeout 3600 --report logic_gate.json || rc=$? + $CMD "${ARGS[@]}" --timeout 3600 || rc=$? echo "rc=$rc" >> "$GITHUB_OUTPUT" exit 0 @@ -83,27 +97,31 @@ jobs: if: always() run: | set -uo pipefail - python3 ci/synth_report.py --annotate error logic_gate.json \ + python3 ci/synth_report.py --annotate error "$REPORT" \ > logic_gate_report.md || true cat logic_gate_report.md >> "$GITHUB_STEP_SUMMARY" - uses: actions/upload-artifact@v4 if: always() with: - name: logic-gate + name: logic-gate${{ inputs.asic && '-asic' || '' }} path: | - logic_gate.json + logic_gate*.json logic_gate_report.md build32_logic_gate/hw/syn/xilinx/dut/logic_gate_*/build.log build32_logic_gate/hw/syn/xilinx/dut/logic_gate_*/beacon_* build32_logic_gate/hw/syn/xilinx/dut/logic_gate_*/beacon/report.txt + build32_logic_gate_asic/hw/syn/yosys/logic_gate_asic_*/build.log + build32_logic_gate_asic/hw/syn/yosys/logic_gate_asic_*/beacon_* + build32_logic_gate_asic/hw/syn/yosys/logic_gate_asic_*/beacon/report.txt + build32_logic_gate_asic/hw/syn/yosys/logic_gate_asic_*/beacon/area.txt if-no-files-found: warn - name: Verdict run: | case "${{ steps.run.outputs.rc }}" in 0) echo "logic_gate passed" ;; - 1) echo "::error::logic_gate FAILED — a unit got deeper than its baseline"; exit 1 ;; + 1) echo "::error::logic_gate FAILED — a unit got deeper or the design grew (see the summary)"; exit 1 ;; *) echo "::error::logic_gate build error (see logs)"; exit 1 ;; esac diff --git a/AGENTS.md b/AGENTS.md index da903b39b7..f340ab9813 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -88,9 +88,9 @@ See [docs/testing.md](docs/testing.md) and [docs/debugging.md](docs/debugging.md - **RTL coverage path is `xrt`, not `rtlsim`.** When discussing or planning RTL verification, `xrt` is the canonical path — `rtlsim` bypasses the AFU surface. `rtlsim` remains useful for fast iteration on processor RTL; `xrt` is what proves the full integration. - **`ci/regression.sh` is the canonical source of tested configurations.** Use it to discover supported parameter combinations before inventing ad hoc ones. - **Perf-regression baselines (`ci/baselines/perf/*.json`) are golden data — never hand-edit them, and never "fix" a red perf gate by bumping the number.** They are regenerated only by `pytest ci -m perf_gate --update-baselines` (a human-run, reviewed step), and CI must never pass that flag. A `perf_gate` failure means real cycles moved: root-cause it, or — if the change is intended — regenerate the baseline so the diff shows the perf delta for review. Same rule as image goldens and `known_issue:`. -- **Synthesis baselines (`ci/baselines/synthesis/{xilinx,yosys,beacon}/*.json`) are golden data under the same rule** — never hand-edited, regenerated only by a human running `ci/fpga_gate.py --update-baseline` / `ci/asic_gate.py --update-baseline` / `ci/logic_gate.py --update-baseline`, never by CI. A red `fpga_gate`/`asic_gate` means real Fmax or area moved; a red `logic_gate` means a unit got deeper or the design's area grew past 5 %, and its reasons name the unit or the resource (`beacon_area.txt` has the area by unit and each memory's placement). Note the two gates measure the *same* `hw/unittest/*/VX_*_top.sv` wrappers through different flows, so a divergence between them is a finding, not noise — keep `hw/syn/{xilinx,yosys}/dut/catalog.mk` in step when you add or rename a DUT. See [docs/designs/continuous_integration.md §3.5](docs/designs/continuous_integration.md). -- **Beacon first for any RTL change that can move timing; synthesis only to confirm.** A change to a pipeline, arbiter, queue, interface or datapath can add logic levels that only the nightly `fpga_gate` would find, hours later. Beacon finds them in minutes, so iterate on it, not on Vivado or Yosys: run `ci/logic_gate.py -b ` on the parent revision once (its own build tree, e.g. `git worktree add ../ref HEAD` and `--build-dir build32_beacon_ref`), then `ci/logic_gate.py -b --against build32_beacon_ref` after each edit, and fix what `/beacon_diff.txt` reports until nothing fails (`ci/beacon.py paths` shows a deep unit's paths op by op). Run synthesis once per change, on the DUTs whose depth moved, and feed the result back with `ci/beacon.py validate`. A change to the cluster, socket, L2 or anything only the whole GPU assembles also runs the `gpu` group (`ci/logic_gate.py -b gpu -j 1`, ~30 min and ~95 GB per build). A unit that gets deeper is fixed or, if intended, re-recorded with the reason in the commit message. `beacon_diff.txt` also lists each resource of the design (LUT, FF, distributed and block RAM, DSP) and the units whose area moved, so a memory that leaves block RAM shows in minutes. Beacon does not see wires, placement or congestion; a change that moves those still needs synthesis. See [docs/designs/beacon.md §6.3](docs/designs/beacon.md). -- **`logic_gate` runs with `perf_gate`, and is treated the same way.** CI plans its cell whenever it plans perf_gate's rtlsim cells (every pull request, every push that touches the RTL or the config): perf_gate guards cycles, logic_gate guards logic depth and area. A red logic_gate means a unit got deeper or the design grew; fix it, or re-record with `ci/logic_gate.py --update-baseline` on the final tree, with the reason in the commit message. A change of CIRCT or foldsim reads `STALE` and needs the same re-record. +- **Synthesis baselines (`ci/baselines/synthesis/{xilinx,yosys,beacon,beacon_asic}/*.json`) are golden data under the same rule** — never hand-edited, regenerated only by a human running `ci/fpga_gate.py --update-baseline` / `ci/asic_gate.py --update-baseline` / `ci/logic_gate.py --update-baseline`, never by CI. A red `fpga_gate`/`asic_gate` means real Fmax or area moved; a red `logic_gate` means a unit got deeper or the design's area grew past 5 %, and its reasons name the unit or the resource (`beacon_area.txt` has the area by unit and each memory's placement). Note the two gates measure the *same* `hw/unittest/*/VX_*_top.sv` wrappers through different flows, so a divergence between them is a finding, not noise — keep `hw/syn/{xilinx,yosys}/dut/catalog.mk` in step when you add or rename a DUT. See [docs/designs/continuous_integration.md §3.5](docs/designs/continuous_integration.md). +- **Beacon first for any RTL change that can move timing; synthesis only to confirm.** A change to a pipeline, arbiter, queue, interface or datapath can add logic levels that only the nightly `fpga_gate` would find, hours later. Beacon finds them in minutes, so iterate on it, not on Vivado or Yosys: run `ci/logic_gate.py -b --against-rev HEAD` after each edit (the parent's reference is built once, under `.beacon_ref/`; `--tool beacon_asic` for the ASIC flow, which alone elaborates the STD FPU and the ASIC multiplier), and fix what `/beacon_diff.txt` reports until nothing fails (`ci/beacon.py paths` shows a deep unit's paths op by op). Run synthesis once per change, on the DUTs whose depth moved, and feed the result back with `ci/beacon.py validate`. A change to the cluster, socket, L2 or anything only the whole GPU assembles also runs the `gpu` group (`ci/logic_gate.py -b gpu -j 1`, ~30 min and ~95 GB per build). A unit that gets deeper is fixed or, if intended, re-recorded with the reason in the commit message. `beacon_diff.txt` also lists each resource of the design (LUT, FF, distributed and block RAM, DSP) and the units whose area moved, so a memory that leaves block RAM shows in minutes. Beacon does not see wires, placement or congestion; a change that moves those still needs synthesis. See [docs/designs/beacon.md §6.3](docs/designs/beacon.md). +- **`logic_gate` runs with `perf_gate`, and is treated the same way.** CI plans its cell whenever it plans perf_gate's rtlsim cells (every pull request, every push that touches the RTL or the config): perf_gate guards cycles, logic_gate guards logic depth and area. A red logic_gate means a unit got deeper, the design grew, or a harness changed what it ties off; fix it, or re-record with `ci/logic_gate.py --update-baseline` (and `--tool beacon_asic`) on the final tree, with the reason in the commit message. On a pull request the cell also compares every build with the merge base, so a re-record there must run with `--against-rev $(git merge-base HEAD origin/master)`: that writes the accepted regressions into the baseline, and the baseline diff is their review. A change of CIRCT or foldsim reads `STALE` and needs the same re-record. - **SimX is the RTL's timing model — keep them in lockstep.** Any change that moves RTL cycles (pipeline structure, arbitration, queue depths, cache/memory behavior) must land together with the matching SimX timing-model update, and vice-versa. The `model_parity` CI gate enforces this: a `check: model_parity` case (`ci/testcases/core.yaml` + per-extension parity categories) runs the same app/args/configs on simx and rtlsim and asserts exact retired-instruction match plus cycle agreement within the case tolerance (default 5%). Never widen a tolerance to absorb a divergence — model the behavior. When adding a hardware feature, add or extend a parity case that exercises it. - **When RTL debugging stalls, switch to the SimX-as-oracle pattern.** For numerical bugs, deep pipeline races, or any failure mode where rtlsim is "close but wrong": (1) build/extend the SimX C++ model so it mirrors the *new* RTL architecture and gets to PASS; (2) add matching trace dumps to both SimX and RTL (cycle, FU events, SRAM addresses+data, hazards) — same CSV format on both sides; (3) diff trace files — the first divergence is the bug. Don't keep guessing from output values; localize via trace diff. See [docs/debugging.md](docs/debugging.md#simx-as-oracle-for-rtl-debug). diff --git a/ci/baselines/synthesis/beacon/core.json b/ci/baselines/synthesis/beacon/core.json index ce8254476e..63f907709a 100644 --- a/ci/baselines/synthesis/beacon/core.json +++ b/ci/baselines/synthesis/beacon/core.json @@ -36,6 +36,8 @@ "max_levels": 16, "pred_fmax_mhz": 291.3, "risk_endpoints": 4, + "tied_bits": 0, + "tied_ports": [], "units": { "": 11, "cache/g_cache_cache/core_req_xbar/g_multi_inputs_g_multiple_outputs_g_xbar_arbs_*_xbar_arb/g_input_select_g_arbiter_arbiter/g_round_robin_rr_arbiter": 9, @@ -117,6 +119,19 @@ "max_levels": 15, "pred_fmax_mhz": 285.6, "risk_endpoints": 11, + "tied_bits": 2, + "tied_ports": [ + { + "bits": 1, + "port": "core.core_id", + "width": 1 + }, + { + "bits": 1, + "port": "core.dcache_path_drained", + "width": 1 + } + ], "units": { "core/g_compute_slices_g_slices_*_compute_slice/backend_slice/execute_slice/alu_block/alu_int/rsp_buf/g_eb1_pipe_buffer/g_register_g_pipe_regs_*_pipe_register": 13, "core/g_compute_slices_g_slices_*_compute_slice/backend_slice/execute_slice/alu_block/muldiv_unit/g_multiplier_*_multiplier/pipe_reg": 8, @@ -195,6 +210,14 @@ "max_levels": 9, "pred_fmax_mhz": 324.3, "risk_endpoints": 0, + "tied_bits": 17, + "tied_ports": [ + { + "bits": 17, + "port": "dma_req_buf.data_in", + "width": 607 + } + ], "units": { "lmem_unit/g_data_store_*_g_dual_port_lmem_store": 9 }, @@ -253,6 +276,39 @@ "max_levels": 23, "pred_fmax_mhz": 268.8, "risk_endpoints": 187, + "tied_bits": 6, + "tied_ports": [ + { + "bits": 1, + "port": "__buffer_ex496.enable", + "width": 1 + }, + { + "bits": 1, + "port": "g_clusters_0.cluster.cluster_id", + "width": 1 + }, + { + "bits": 1, + "port": "g_clusters_0.cluster.cp_mem_if_req_valid", + "width": 1 + }, + { + "bits": 1, + "port": "g_clusters_0.cluster.cp_mem_if_rsp_ready", + "width": 1 + }, + { + "bits": 1, + "port": "g_clusters_0.cluster.dev_ptw_mem_if_req_valid", + "width": 1 + }, + { + "bits": 1, + "port": "g_clusters_0.cluster.dev_ptw_mem_if_rsp_ready", + "width": 1 + } + ], "units": { "dev_ptw/walk_cache": 8, "g_clusters_*_cluster/__buffer_ex645": 8, diff --git a/ci/baselines/synthesis/beacon/dxa.json b/ci/baselines/synthesis/beacon/dxa.json index 5ab16b9eaa..2e22b25e36 100644 --- a/ci/baselines/synthesis/beacon/dxa.json +++ b/ci/baselines/synthesis/beacon/dxa.json @@ -36,6 +36,14 @@ "max_levels": 15, "pred_fmax_mhz": 298.6, "risk_endpoints": 0, + "tied_bits": 1, + "tied_ports": [ + { + "bits": 1, + "port": "dxa_core.smem_bus_if_0_rsp_valid", + "width": 1 + } + ], "units": { "dxa_core/desc_table/desc_store": 8, "dxa_core/g_workers_*_worker/addr_gen": 15, diff --git a/ci/baselines/synthesis/beacon/graphics.json b/ci/baselines/synthesis/beacon/graphics.json index 6eaf5e90b9..901383a93a 100644 --- a/ci/baselines/synthesis/beacon/graphics.json +++ b/ci/baselines/synthesis/beacon/graphics.json @@ -6,7 +6,7 @@ "dut": "gfx", "result": { "bram": 183.5, - "build_time_s": 166, + "build_time_s": 181, "deep_endpoints": 1818, "deepest_paths": [ "19 g_rtu_core_0.rtu_core/scheduler/g_recip_pe.recip_tags/g_shift.g_partial_reset.pipe_free[219] -> g_rtu_core_0.rtu_core/scheduler/g1_idx.d[4]", @@ -36,6 +36,54 @@ "max_levels": 19, "pred_fmax_mhz": 264.7, "risk_endpoints": 471, + "tied_bits": 1073, + "tied_ports": [ + { + "bits": 533, + "port": "g_mem_bus_if_0.g_i0.mem_arb.bus_in_if_0_req_data", + "width": 636 + }, + { + "bits": 533, + "port": "g_mem_bus_if_0.g_i0.mem_arb.bus_in_if_4_req_data", + "width": 636 + }, + { + "bits": 1, + "port": "graphics.cluster_id", + "width": 1 + }, + { + "bits": 1, + "port": "rtcache_dcr_flush.l1_only", + "width": 1 + }, + { + "bits": 1, + "port": "rtu_socket_arb.bus_in_if_0_arm_data", + "width": 120 + }, + { + "bits": 1, + "port": "rtu_socket_arb.bus_in_if_0_req_data", + "width": 550 + }, + { + "bits": 1, + "port": "rtu_socket_arb.bus_in_if_1_arm_data", + "width": 120 + }, + { + "bits": 1, + "port": "rtu_socket_arb.bus_in_if_1_req_data", + "width": 550 + }, + { + "bits": 1, + "port": "tcache_dcr_flush.l1_only", + "width": 1 + } + ], "units": { "g_rtu_core_*_rtu_core": 10, "g_rtu_core_*_rtu_core/cache_bus_reg/req_buf/g_eb2_stream_buffer": 10, @@ -140,7 +188,7 @@ "dut": "gfxvm", "result": { "bram": 183.5, - "build_time_s": 196, + "build_time_s": 186, "deep_endpoints": 1969, "deepest_paths": [ "19 g_rtu_core_0.rtu_core/scheduler/g_recip_pe.recip_tags/g_shift.g_partial_reset.pipe_free[219] -> g_rtu_core_0.rtu_core/scheduler/g1_idx.d[4]", @@ -170,6 +218,59 @@ "max_levels": 19, "pred_fmax_mhz": 256.3, "risk_endpoints": 475, + "tied_bits": 1075, + "tied_ports": [ + { + "bits": 533, + "port": "g_mem_bus_if_0.g_i0.mem_arb.bus_in_if_0_req_data", + "width": 636 + }, + { + "bits": 533, + "port": "ummu.core_bus_if_2_req_data", + "width": 636 + }, + { + "bits": 1, + "port": "graphics.cluster_id", + "width": 1 + }, + { + "bits": 1, + "port": "l2cache.core_bus_if_3_req_valid", + "width": 1 + }, + { + "bits": 1, + "port": "l2cache.core_bus_if_3_rsp_ready", + "width": 1 + }, + { + "bits": 1, + "port": "rtcache_dcr_flush.l1_only", + "width": 1 + }, + { + "bits": 1, + "port": "rtu_socket_arb.bus_in_if_0_arm_data", + "width": 120 + }, + { + "bits": 1, + "port": "rtu_socket_arb.bus_in_if_0_req_data", + "width": 550 + }, + { + "bits": 1, + "port": "rtu_socket_arb.bus_in_if_1_arm_data", + "width": 120 + }, + { + "bits": 1, + "port": "rtu_socket_arb.bus_in_if_1_req_data", + "width": 550 + } + ], "units": { "": 8, "cmmu": 9, @@ -319,6 +420,19 @@ "max_levels": 13, "pred_fmax_mhz": 364.6, "risk_endpoints": 0, + "tied_bits": 3, + "tied_ports": [ + { + "bits": 2, + "port": "om_core.om_bus_if_req_data", + "width": 59 + }, + { + "bits": 1, + "port": "om_core.dcr_bus_if_req_data", + "width": 45 + } + ], "units": { "om_core": 8, "om_core/mem_req_buf/g_ebN_fifo_queue/pending_size": 8, @@ -370,6 +484,19 @@ "max_levels": 14, "pred_fmax_mhz": 332.9, "risk_endpoints": 0, + "tied_bits": 2, + "tied_ports": [ + { + "bits": 1, + "port": "raster_core.dcr_bus_if_req_data", + "width": 45 + }, + { + "bits": 1, + "port": "raster_core.instance_idx", + "width": 1 + } + ], "units": { "raster_core/packer": 8, "raster_core/raster_mem": 14, @@ -390,7 +517,7 @@ "dut": "rtu", "result": { "bram": 16.5, - "build_time_s": 45, + "build_time_s": 40, "deep_endpoints": 848, "deepest_paths": [ "15 rtu_core/scheduler/ray_q[128] -> rtu_core/scheduler/tri_pe/q_a.d[32]", @@ -420,6 +547,8 @@ "max_levels": 15, "pred_fmax_mhz": 304.5, "risk_endpoints": 0, + "tied_bits": 0, + "tied_ports": [], "units": { "rtu_core": 10, "rtu_core/cache_bus_reg/req_buf/g_eb2_stream_buffer": 9, @@ -477,6 +606,14 @@ "max_levels": 11, "pred_fmax_mhz": 292.6, "risk_endpoints": 2, + "tied_bits": 1, + "tied_ports": [ + { + "bits": 1, + "port": "tex_core.dcr_bus_if_req_data", + "width": 45 + } + ], "units": { "tex_core/tex_addr/pipe_reg0": 10, "tex_core/tex_addr/pipe_reg1": 11, diff --git a/ci/baselines/synthesis/beacon/tensor.json b/ci/baselines/synthesis/beacon/tensor.json index 2126ee506b..f589a16fe5 100644 --- a/ci/baselines/synthesis/beacon/tensor.json +++ b/ci/baselines/synthesis/beacon/tensor.json @@ -36,6 +36,8 @@ "max_levels": 25, "pred_fmax_mhz": 277.7, "risk_endpoints": 17, + "tied_bits": 0, + "tied_ports": [], "units": { "tcu_shared/wgmma": 10, "tcu_shared/wgmma/tbuf/bbuf": 10, @@ -96,6 +98,39 @@ "max_levels": 25, "pred_fmax_mhz": 253.4, "risk_endpoints": 411, + "tied_bits": 6, + "tied_ports": [ + { + "bits": 1, + "port": "g_cores_0.mem_unit.dcr_flush_if_req", + "width": 1 + }, + { + "bits": 1, + "port": "g_cores_0.mem_unit.flush_l1_only", + "width": 1 + }, + { + "bits": 1, + "port": "g_cores_1.mem_unit.dcr_flush_if_req", + "width": 1 + }, + { + "bits": 1, + "port": "g_cores_1.mem_unit.flush_l1_only", + "width": 1 + }, + { + "bits": 1, + "port": "g_mem_bus_if_0.g_i0.mem_arb.bus_in_if_0_req_valid", + "width": 1 + }, + { + "bits": 1, + "port": "g_mem_bus_if_0.g_i0.mem_arb.bus_in_if_0_rsp_ready", + "width": 1 + } + ], "units": { "dcache/g_cache_wrap_*_cache_wrap/g_cache_cache/g_banks_*_bank/cache_data/g_data_slice_*_data_store": 9, "dcache/g_cache_wrap_*_cache_wrap/g_cache_cache/g_banks_*_bank/cache_mshr": 9, diff --git a/ci/baselines/synthesis/beacon/vm.json b/ci/baselines/synthesis/beacon/vm.json index 2cf7e28295..79e7e301e0 100644 --- a/ci/baselines/synthesis/beacon/vm.json +++ b/ci/baselines/synthesis/beacon/vm.json @@ -36,6 +36,39 @@ "max_levels": 23, "pred_fmax_mhz": 251.5, "risk_endpoints": 573, + "tied_bits": 118, + "tied_ports": [ + { + "bits": 57, + "port": "g_sockets_0.g_immu.immu.core_bus_if_0_req_data", + "width": 93 + }, + { + "bits": 57, + "port": "g_sockets_1.g_immu.immu.core_bus_if_0_req_data", + "width": 93 + }, + { + "bits": 1, + "port": "g_sockets_0.mmu_snoop.dcr_bus_out_if_rsp_valid", + "width": 1 + }, + { + "bits": 1, + "port": "g_sockets_1.mmu_snoop.dcr_bus_out_if_rsp_valid", + "width": 1 + }, + { + "bits": 1, + "port": "l2cache.core_bus_if_2_req_valid", + "width": 1 + }, + { + "bits": 1, + "port": "l2cache.core_bus_if_2_rsp_ready", + "width": 1 + } + ], "units": { "g_sockets_*_dcache/g_cache_wrap_*_cache_wrap/g_bypass_cache_bypass/mem_bus_out_arb/req_arb/g_input_select_g_arbiter_g_out_buf_*_out_buf/g_eb2_stream_buffer": 8, "g_sockets_*_dcache/g_cache_wrap_*_cache_wrap/g_cache_cache/cache_init": 10, diff --git a/ci/baselines/synthesis/beacon_asic/core.json b/ci/baselines/synthesis/beacon_asic/core.json new file mode 100644 index 0000000000..7a0d9f129e --- /dev/null +++ b/ci/baselines/synthesis/beacon_asic/core.json @@ -0,0 +1,174 @@ +{ + "cache": { + "clock_mhz": 800, + "config_hash": "77b79d6c7d9a6fdf", + "configs": "", + "dut": "cache", + "result": { + "build_time_s": 30, + "cells": 282062, + "endpoints": 32478, + "env": { + "circt": "CIRCT 892a65a01", + "foldsim": "foldsim d8350bc0f", + "pdk": "asap7", + "xlen": 32 + }, + "ff": 93166, + "fmax_mhz": 1107.4, + "macros": 36, + "max_stages": 28, + "overhead_ps": 231, + "period_ps": 903, + "stage_ps": 24, + "tied_bits": 0, + "tied_ports": [] + } + }, + "core": { + "clock_mhz": 800, + "config_hash": "847ad31605be03dd", + "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8", + "dut": "core", + "result": { + "build_time_s": 50, + "cells": 769936, + "endpoints": 73708, + "env": { + "circt": "CIRCT 892a65a01", + "foldsim": "foldsim d8350bc0f", + "pdk": "asap7", + "xlen": 32 + }, + "ff": 102791, + "fmax_mhz": 1051.5, + "macros": 16, + "max_stages": 30, + "overhead_ps": 231, + "period_ps": 951, + "stage_ps": 24, + "tied_bits": 2, + "tied_ports": [ + { + "bits": 1, + "port": "core.core_id", + "width": 1 + }, + { + "bits": 1, + "port": "core.dcache_path_drained", + "width": 1 + } + ] + } + }, + "lmem": { + "clock_mhz": 800, + "config_hash": "8190e614d4e4d3b6", + "configs": "-DVX_CFG_NUM_THREADS=16 -DVX_CFG_ISSUE_WIDTH=2 -DVX_CFG_EXT_A_ENABLE", + "dut": "lmem", + "result": { + "build_time_s": 25, + "cells": 120110, + "endpoints": 18134, + "env": { + "circt": "CIRCT 892a65a01", + "foldsim": "foldsim d8350bc0f", + "pdk": "asap7", + "xlen": 32 + }, + "ff": 23721, + "fmax_mhz": 1564.9, + "macros": 32, + "max_stages": 17, + "overhead_ps": 231, + "period_ps": 639, + "stage_ps": 24, + "tied_bits": 17, + "tied_ports": [ + { + "bits": 17, + "port": "dma_req_buf.data_in", + "width": 607 + } + ] + } + }, + "top": { + "clock_mhz": 800, + "config_hash": "ce21223ae8e4d63c", + "configs": "-DVX_CFG_NUM_THREADS=4 -DVX_CFG_NUM_WARPS=4", + "dut": "top", + "result": { + "build_time_s": 75, + "cells": 1438152, + "endpoints": 169931, + "env": { + "circt": "CIRCT 892a65a01", + "foldsim": "foldsim d8350bc0f", + "pdk": "asap7", + "xlen": 32 + }, + "ff": 305204, + "fmax_mhz": 749.1, + "macros": 82, + "max_stages": 46, + "overhead_ps": 231, + "period_ps": 1335, + "stage_ps": 24, + "tied_bits": 630, + "tied_ports": [ + { + "bits": 512, + "port": "g_multi_port.vortex.cp_mem_req_data", + "width": 512 + }, + { + "bits": 64, + "port": "g_multi_port.vortex.cp_mem_req_byteen", + "width": 64 + }, + { + "bits": 26, + "port": "g_multi_port.vortex.cp_mem_req_addr", + "width": 26 + }, + { + "bits": 12, + "port": "cp_core.dbg_host_r_counts", + "width": 32 + }, + { + "bits": 9, + "port": "g_multi_port.vortex.cp_mem_req_tag", + "width": 9 + }, + { + "bits": 2, + "port": "cp_core.dbg_host_w_counts", + "width": 32 + }, + { + "bits": 1, + "port": "cp_core.gpu_if_dcr_req_ready", + "width": 1 + }, + { + "bits": 1, + "port": "g_multi_port.vortex.cp_mem_req_noalloc", + "width": 1 + }, + { + "bits": 1, + "port": "g_multi_port.vortex.cp_mem_req_rw", + "width": 1 + }, + { + "bits": 1, + "port": "g_multi_port.vortex.cp_mem_req_valid", + "width": 1 + } + ] + } + } +} diff --git a/ci/baselines/synthesis/beacon_asic/dxa.json b/ci/baselines/synthesis/beacon_asic/dxa.json new file mode 100644 index 0000000000..96b6fa3be8 --- /dev/null +++ b/ci/baselines/synthesis/beacon_asic/dxa.json @@ -0,0 +1,34 @@ +{ + "dxa": { + "clock_mhz": 800, + "config_hash": "878aaaf618bd3f3c", + "configs": "", + "dut": "dxa", + "result": { + "build_time_s": 25, + "cells": 84969, + "endpoints": 11408, + "env": { + "circt": "CIRCT 892a65a01", + "foldsim": "foldsim d8350bc0f", + "pdk": "asap7", + "xlen": 32 + }, + "ff": 25280, + "fmax_mhz": 977.5, + "macros": 0, + "max_stages": 33, + "overhead_ps": 231, + "period_ps": 1023, + "stage_ps": 24, + "tied_bits": 1, + "tied_ports": [ + { + "bits": 1, + "port": "dxa_core.smem_bus_if_0_rsp_valid", + "width": 1 + } + ] + } + } +} diff --git a/ci/baselines/synthesis/beacon_asic/graphics.json b/ci/baselines/synthesis/beacon_asic/graphics.json new file mode 100644 index 0000000000..a110eebd4e --- /dev/null +++ b/ci/baselines/synthesis/beacon_asic/graphics.json @@ -0,0 +1,206 @@ +{ + "gfx": { + "clock_mhz": 800, + "config_hash": "f49712b842f2f234", + "configs": "-DVX_CFG_NUM_THREADS=4 -DVX_CFG_NUM_WARPS=4", + "dut": "gfx", + "result": { + "build_time_s": 175, + "cells": 1873933, + "endpoints": 239154, + "env": { + "circt": "CIRCT 892a65a01", + "foldsim": "foldsim d8350bc0f", + "pdk": "asap7", + "xlen": 32 + }, + "ff": 420597, + "fmax_mhz": 874.9, + "macros": 76, + "max_stages": 38, + "overhead_ps": 231, + "period_ps": 1143, + "stage_ps": 24, + "tied_bits": 1065, + "tied_ports": [ + { + "bits": 529, + "port": "g_mem_bus_if_0.g_i0.mem_arb.bus_in_if_0_req_data", + "width": 630 + }, + { + "bits": 529, + "port": "g_mem_bus_if_0.g_i0.mem_arb.bus_in_if_4_req_data", + "width": 630 + }, + { + "bits": 1, + "port": "graphics.cluster_id", + "width": 1 + }, + { + "bits": 1, + "port": "rtcache_dcr_flush.l1_only", + "width": 1 + }, + { + "bits": 1, + "port": "rtu_socket_arb.bus_in_if_0_arm_data", + "width": 106 + }, + { + "bits": 1, + "port": "rtu_socket_arb.bus_in_if_0_req_data", + "width": 140 + }, + { + "bits": 1, + "port": "rtu_socket_arb.bus_in_if_1_arm_data", + "width": 106 + }, + { + "bits": 1, + "port": "rtu_socket_arb.bus_in_if_1_req_data", + "width": 140 + }, + { + "bits": 1, + "port": "tcache_dcr_flush.l1_only", + "width": 1 + } + ] + } + }, + "om": { + "clock_mhz": 800, + "config_hash": "3ff478591f29ccf9", + "configs": "", + "dut": "om", + "result": { + "build_time_s": 15, + "cells": 35595, + "endpoints": 5135, + "env": { + "circt": "CIRCT 892a65a01", + "foldsim": "foldsim d8350bc0f", + "pdk": "asap7", + "xlen": 32 + }, + "ff": 8692, + "fmax_mhz": 1169.6, + "macros": 0, + "max_stages": 26, + "overhead_ps": 231, + "period_ps": 855, + "stage_ps": 24, + "tied_bits": 3, + "tied_ports": [ + { + "bits": 2, + "port": "om_core.om_bus_if_req_data", + "width": 59 + }, + { + "bits": 1, + "port": "om_core.dcr_bus_if_req_data", + "width": 45 + } + ] + } + }, + "raster": { + "clock_mhz": 800, + "config_hash": "f0a4c760f765a429", + "configs": "", + "dut": "raster", + "result": { + "build_time_s": 15, + "cells": 76084, + "endpoints": 12792, + "env": { + "circt": "CIRCT 892a65a01", + "foldsim": "foldsim d8350bc0f", + "pdk": "asap7", + "xlen": 32 + }, + "ff": 18195, + "fmax_mhz": 1277.1, + "macros": 4, + "max_stages": 23, + "overhead_ps": 231, + "period_ps": 783, + "stage_ps": 24, + "tied_bits": 2, + "tied_ports": [ + { + "bits": 1, + "port": "raster_core.dcr_bus_if_req_data", + "width": 45 + }, + { + "bits": 1, + "port": "raster_core.instance_idx", + "width": 1 + } + ] + } + }, + "rtu": { + "clock_mhz": 800, + "config_hash": "473d8b33a18f36fd", + "configs": "", + "dut": "rtu", + "result": { + "build_time_s": 100, + "cells": 1060729, + "endpoints": 105631, + "env": { + "circt": "CIRCT 892a65a01", + "foldsim": "foldsim d8350bc0f", + "pdk": "asap7", + "xlen": 32 + }, + "ff": 152086, + "fmax_mhz": 874.9, + "macros": 4, + "max_stages": 38, + "overhead_ps": 231, + "period_ps": 1143, + "stage_ps": 24, + "tied_bits": 0, + "tied_ports": [] + } + }, + "tex": { + "clock_mhz": 800, + "config_hash": "4d47fbece8804eb8", + "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8", + "dut": "tex", + "result": { + "build_time_s": 40, + "cells": 376164, + "endpoints": 49445, + "env": { + "circt": "CIRCT 892a65a01", + "foldsim": "foldsim d8350bc0f", + "pdk": "asap7", + "xlen": 32 + }, + "ff": 72266, + "fmax_mhz": 1239.2, + "macros": 0, + "max_stages": 24, + "overhead_ps": 231, + "period_ps": 807, + "stage_ps": 24, + "tied_bits": 1, + "tied_ports": [ + { + "bits": 1, + "port": "tex_core.dcr_bus_if_req_data", + "width": 45 + } + ] + } + } +} diff --git a/ci/baselines/synthesis/beacon_asic/tensor.json b/ci/baselines/synthesis/beacon_asic/tensor.json new file mode 100644 index 0000000000..45b7a05eb6 --- /dev/null +++ b/ci/baselines/synthesis/beacon_asic/tensor.json @@ -0,0 +1,85 @@ +{ + "tcu": { + "clock_mhz": 800, + "config_hash": "1d6c72424d1a993d", + "configs": "", + "dut": "tcu", + "result": { + "build_time_s": 100, + "cells": 1299379, + "endpoints": 25749, + "env": { + "circt": "CIRCT 892a65a01", + "foldsim": "foldsim d8350bc0f", + "pdk": "asap7", + "xlen": 32 + }, + "ff": 47446, + "fmax_mhz": 791.8, + "macros": 0, + "max_stages": 43, + "overhead_ps": 231, + "period_ps": 1263, + "stage_ps": 24, + "tied_bits": 0, + "tied_ports": [] + } + }, + "tensor": { + "clock_mhz": 800, + "config_hash": "2992cc36d736afff", + "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8", + "dut": "tensor", + "result": { + "build_time_s": 90, + "cells": 854302, + "endpoints": 86553, + "env": { + "circt": "CIRCT 892a65a01", + "foldsim": "foldsim d8350bc0f", + "pdk": "asap7", + "xlen": 32 + }, + "ff": 184699, + "fmax_mhz": 977.5, + "macros": 28, + "max_stages": 33, + "overhead_ps": 231, + "period_ps": 1023, + "stage_ps": 24, + "tied_bits": 6, + "tied_ports": [ + { + "bits": 1, + "port": "g_cores_0.mem_unit.dcr_flush_if_req", + "width": 1 + }, + { + "bits": 1, + "port": "g_cores_0.mem_unit.flush_l1_only", + "width": 1 + }, + { + "bits": 1, + "port": "g_cores_1.mem_unit.dcr_flush_if_req", + "width": 1 + }, + { + "bits": 1, + "port": "g_cores_1.mem_unit.flush_l1_only", + "width": 1 + }, + { + "bits": 1, + "port": "g_mem_bus_if_0.g_i0.mem_arb.bus_in_if_0_req_valid", + "width": 1 + }, + { + "bits": 1, + "port": "g_mem_bus_if_0.g_i0.mem_arb.bus_in_if_0_rsp_ready", + "width": 1 + } + ] + } + } +} diff --git a/ci/baselines/synthesis/beacon_asic/vm.json b/ci/baselines/synthesis/beacon_asic/vm.json new file mode 100644 index 0000000000..c850e15ba2 --- /dev/null +++ b/ci/baselines/synthesis/beacon_asic/vm.json @@ -0,0 +1,59 @@ +{ + "vm": { + "clock_mhz": 800, + "config_hash": "d06ba9a368334b96", + "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8", + "dut": "vm", + "result": { + "build_time_s": 65, + "cells": 1156412, + "endpoints": 115494, + "env": { + "circt": "CIRCT 892a65a01", + "foldsim": "foldsim d8350bc0f", + "pdk": "asap7", + "xlen": 32 + }, + "ff": 297476, + "fmax_mhz": 749.1, + "macros": 66, + "max_stages": 46, + "overhead_ps": 231, + "period_ps": 1335, + "stage_ps": 24, + "tied_bits": 114, + "tied_ports": [ + { + "bits": 55, + "port": "g_sockets_0.g_immu.immu.core_bus_if_0_req_data", + "width": 90 + }, + { + "bits": 55, + "port": "g_sockets_1.g_immu.immu.core_bus_if_0_req_data", + "width": 90 + }, + { + "bits": 1, + "port": "g_sockets_0.mmu_snoop.dcr_bus_out_if_rsp_valid", + "width": 1 + }, + { + "bits": 1, + "port": "g_sockets_1.mmu_snoop.dcr_bus_out_if_rsp_valid", + "width": 1 + }, + { + "bits": 1, + "port": "l2cache.core_bus_if_2_req_valid", + "width": 1 + }, + { + "bits": 1, + "port": "l2cache.core_bus_if_2_rsp_ready", + "width": 1 + } + ] + } + } +} diff --git a/ci/beacon.py b/ci/beacon.py index c10900a5e9..a71e86c8f7 100755 --- a/ci/beacon.py +++ b/ci/beacon.py @@ -583,18 +583,22 @@ def top_mean(regs, n=50): return sum(depths) / len(depths) if depths else 0.0 area_before, area_after = load_area(args.before), load_area(args.after) + unit_name = 'stages' if _asic_area(args.after) else 'levels' area_head = '' if bool(area_before) != bool(area_after): print('area: only the %s run counted it; not compared' % ('reference' if area_before else 'changed')) if area_before and area_after: tb, ta = area_before[''], area_after[''] + keys = area_keys(tb) area_head = '; ' + ', '.join( - f'{k} {tb[k]:g} -> {ta[k]:g}' for k in ('lut', 'bram', 'dsp')) - print(f'deepest path {deepest(before)} -> {deepest(after)} levels; ' - f'mean of the 50 deepest {top_mean(before):.1f} -> {top_mean(after):.1f}; ' - f'registers at or above {args.min_levels} levels ' - f'{watched(before)} -> {watched(after)}{area_head}') + f'{area_label(k, tb)} {tb[k]:g} -> {ta[k]:g}' + for k in (keys if 'macros' in tb else ('lut', 'bram', 'dsp'))) + head = (f'deepest path {deepest(before)} -> {deepest(after)} {unit_name}; ' + f'mean of the 50 deepest {top_mean(before):.1f} -> {top_mean(after):.1f}; ' + f'registers at or above {args.min_levels} {unit_name} ' + f'{watched(before)} -> {watched(after)}{area_head}') + print(head) deeper, shallower, new, gone = [], [], [], [] for key, (lv, start) in after.items(): @@ -655,18 +659,44 @@ def show(title, rows, moved): for b, a, (cls, u) in moved[:args.top]: print(f'{b:4d} -> {a:<4d} {cls + ": " if cls else ""}{u}') - area_regress = False + area_regress = [] if area_before and area_after: area_regress = show_area(area_before, area_after, args) # A register the reference lacks may be a renamed one, so it fails only at # the fix threshold, as a new unit does in logic_gate. - if regress or any(r[0] >= args.fix_levels for r in new): + new_regress = [r for r in new if r[0] >= args.fix_levels] + if args.json: + with open(args.json, 'w') as fh: + json.dump({'headline': head, + 'deeper': [{'register': name(k), 'before': old, 'after': lv} + for lv, old, k, _ in regress], + 'new': [{'register': name(k), 'after': lv} + for lv, k, _ in new_regress], + 'area': [{'resource': k, 'before': b, 'after': a} + for k, b, a in area_regress]}, + fh, indent=2) + fh.write('\n') + if regress or new_regress: return 1 return 3 if area_regress else 0 AREA_KEYS = ('lut', 'ff', 'lutram', 'bram', 'uram', 'dsp') +# An ASIC run (target=asap7) counts standard cells in the `lut` column, +# flip-flops, and SRAM macros; it has no distributed or block RAM or DSPs. +# Its macros are shown, not held to the tolerance: a memory that moves into +# a macro adds one and takes its flip-flops out. +ASIC_AREA_KEYS = ('lut', 'ff', 'macros') +ASIC_GATED = ('lut', 'ff') + + +def area_keys(res): + return ASIC_AREA_KEYS if 'macros' in res else AREA_KEYS + + +def area_label(key, res): + return 'cells' if key == 'lut' and 'macros' in res else key def load_area(run_dir): @@ -679,49 +709,66 @@ def load_area(run_dir): return None units = {} with open(path) as fh: + keys = AREA_KEYS + (('macros',) if _asic_area(run_dir) else ()) for row in csv.DictReader(fh): prefix = 'total_' if not row['path'] else '' - res = {k: float(row[prefix + k]) for k in AREA_KEYS} + res = {k: float(row[prefix + k]) for k in keys} res['lut'] += res['lutram'] key = unit(norm(row['path']) + '/x') if row['path'] else '' if key in units: - for k in AREA_KEYS: + for k in keys: units[key][k] += res[k] else: units[key] = res return units if '' in units else None +def _asic_area(run_dir): + """Whether the run's area count is an ASIC one: area.txt's first line + reads ` on : N cells, ...` there, and LUTs on an FPGA.""" + try: + with open(f'{run_dir}/area.txt') as fh: + return ASIC_AREA_RE.search(fh.readline()) is not None + except OSError: + return False + + def show_area(before, after, args): - """The design's resources before and after, and the units whose own LUTs, - memories or DSPs moved most; True if a resource of the design grew more - than --area-tolerance.""" + """The design's resources before and after, and the units whose own LUTs + (cells), memories or DSPs moved most; the resources of the design that + grew more than --area-tolerance, as (resource, before, after).""" tb, ta = before[''], after[''] + keys = area_keys(tb) print('\narea (design)') - regress = False - for k in AREA_KEYS: - b, a = tb[k], ta[k] + regress = [] + for k in keys: + b, a = tb[k], ta.get(k, 0.0) pct = (a - b) / b * 100 if b else (100.0 if a else 0.0) flag = '' - if pct > 100 * args.area_tolerance: - flag, regress = ' REGRESSION', True - print(f' {k:7s} {b:10g} -> {a:<10g} {pct:+6.1f}%{flag}') + if pct > 100 * args.area_tolerance and \ + ('macros' not in tb or k in ASIC_GATED): + flag = ' REGRESSION' + regress.append((area_label(k, tb), b, a)) + print(f' {area_label(k, tb):7s} {b:10g} -> {a:<10g} {pct:+6.1f}%{flag}') + # Units rank by LUTs (cells) moved, a memory or DSP counting as 100, and + # on an ASIC by flip-flops too: a memory there is either a macro or flops. + weight = {'lut': 1, 'bram': 100, 'uram': 100, 'dsp': 100, 'macros': 100, + 'ff': 1 if 'macros' in tb else 0} moved = [] + zero = dict.fromkeys(keys, 0.0) for key in set(before) | set(after): if not key: continue - b = before.get(key, dict.fromkeys(AREA_KEYS, 0.0)) - a = after.get(key, dict.fromkeys(AREA_KEYS, 0.0)) - if any(abs(a[k] - b[k]) >= 0.5 for k in AREA_KEYS): - moved.append((abs(a['lut'] - b['lut']) + 100 * ( - abs(a['bram'] - b['bram']) + abs(a['uram'] - b['uram']) - + abs(a['dsp'] - b['dsp'])), key, b, a)) + b, a = before.get(key, zero), after.get(key, zero) + if any(abs(a.get(k, 0.0) - b.get(k, 0.0)) >= 0.5 for k in keys): + moved.append((sum(abs(a.get(k, 0.0) - b.get(k, 0.0)) * weight.get(k, 0) + for k in keys), key, b, a)) if moved: moved.sort(key=lambda r: -r[0]) print(f'\nunits whose own area moved ({len(moved)}), all copies') for _, key, b, a in moved[:args.top]: - parts = [f'{k} {b[k]:g} -> {a[k]:g}' for k in AREA_KEYS - if abs(a[k] - b[k]) >= 0.5] + parts = [f'{area_label(k, tb)} {b.get(k, 0.0):g} -> {a.get(k, 0.0):g}' + for k in keys if abs(a.get(k, 0.0) - b.get(k, 0.0)) >= 0.5] print(f' {key}: ' + ', '.join(parts)) return regress @@ -1133,6 +1180,165 @@ def cmd_score(args): +# report.txt of an ASIC run: `deepest path N stages: clk2q + path + N x cell +# + setup = P ps (F MHz)`. +PERIOD_RE = re.compile(r'^deepest path (\d+) stages: (\d+) \+ (\d+) \+ \d+ x (\d+) ' + r'\+ (\d+) = (\d+) ps') +ASIC_AREA_RE = re.compile(r' on \S+: (\d+) cells, (\d+) flip-flops, (\d+) macros') + + +def cmd_asic_summary(args): + """One CSV row for an ASIC run (target=$(PDK)): the deepest path's stages, + the period report.txt converts them to and its Fmax, the per-stage and + fixed delays of that conversion, and the cells, flip-flops and SRAM + macros of area.txt.""" + row = {} + with open(f'{args.run_dir}/report.txt') as fh: + for line in fh: + m = PERIOD_RE.match(line) + if m: + row.update(max_stages=m[1], period_ps=m[6], + fmax_mhz=f'{1e6 / int(m[6]):.1f}', + stage_ps=m[4], + overhead_ps=int(m[2]) + int(m[3]) + int(m[5])) + break + with open(f'{args.run_dir}/area.txt') as fh: + m = ASIC_AREA_RE.search(fh.readline()) + if m: + row.update(cells=m[1], ff=m[2], macros=m[3]) + if 'period_ps' not in row or 'ff' not in row: + sys.exit(f'{args.run_dir}: no period in report.txt or no area in area.txt') + row['endpoints'] = sum(1 for _ in endpoints(args.run_dir)) + with open(args.out, 'w', newline='') as fh: + w = csv.DictWriter(fh, fieldnames=list(row)) + w.writeheader() + w.writerow(row) + + +# --- harness constant ties --------------------------------------------------- + +INT_TYPE = re.compile(r'^i(\d+)$') +SSA = r'%[\w.]+' + + +def _split_top(text, sep=','): + """`text` split at `sep` outside <> and ().""" + out, depth, cur = [], 0, '' + for ch in text: + if ch in '<(': + depth += 1 + elif ch in '>)': + depth -= 1 + if ch == sep and depth == 0: + out.append(cur.strip()) + cur = '' + else: + cur += ch + if cur.strip(): + out.append(cur.strip()) + return out + + +def _type_bits(t): + t = t.strip() + m = INT_TYPE.match(t) + if m: + return int(m[1]) + if t.startswith('!hw.array<'): + n, elem = t[len('!hw.array<'):-1].split('x', 1) + return int(n) * _type_bits(elem) + if t.startswith('!hw.struct<'): + return sum(_type_bits(f.split(':', 1)[1]) + for f in _split_top(t[len('!hw.struct<'):-1])) + return 1 if t == '!seq.clock' else 0 + + +def netlist_top(run_dir): + """The run's top module: the design row of area.csv, else the netlist's + last module.""" + try: + with open(f'{run_dir}/area.csv') as fh: + for row in csv.DictReader(fh): + if not row['path']: + return row['module'] + except (OSError, KeyError): + pass + return None + + +def const_ties(netlist, top=None): + """The instance-input bits `top` ties to constants, as (bits, width, port) + rows, most first. Constants are followed through concatenation, bitcast + and struct and array creation, which is how a harness zero-extends or + ties off a port. + + A harness that ties an input lets Vivado and Yosys fold the logic behind + it, while Beacon maps module by module and keeps it, so the synthesis + gates and Beacon then measure different designs. The count moves when + the harness ties more or fewer bits, and when the RTL widens or narrows + a port the harness ties: either way the synthesis gates now fold a + different amount of logic.""" + mods, cur = {}, None + with open(netlist) as fh: + for line in fh: + m = re.match(r'\s*hw\.module (?:private )?@(\S+)\(', line) + if m: + cur = m[1] + mods[cur] = [] + elif cur and re.match(r'\s*} loc', line): + cur = None + elif cur: + mods[cur].append(line) + if not mods: + raise ValueError(f'{netlist}: no hw.module') + top = top or list(mods)[-1] + if top not in mods: + raise ValueError(f'{netlist}: no module {top}') + + const, rows = {}, [] + for line in mods[top]: + line = re.sub(r' loc\(#loc\d*\)\s*$', '', line.strip()) + m = re.match(rf'({SSA}) = hw\.constant (?:true|false)\b', line) + if m: + const[m[1]] = 1 + continue + m = re.match(rf'({SSA}) = hw\.constant \S+ : (\S+)', line) + if m: + const[m[1]] = _type_bits(m[2]) + continue + m = re.match(rf'({SSA}) = comb\.concat (.*) : ', line) + if m: + const[m[1]] = sum(const.get(o.strip(), 0) for o in m[2].split(',')) + continue + m = re.match(rf'({SSA}) = hw\.bitcast ({SSA})', line) + if m: + const[m[1]] = const.get(m[2], 0) + continue + m = re.match(rf'({SSA}) = hw\.(?:struct|array)_create \((.*)\) :', line) + if m: + const[m[1]] = sum(const.get(o.strip(), 0) for o in m[2].split(',')) + continue + m = re.search(r'hw\.instance "(\S+)" @(\S+)\((.*)\) -> ', line) + if m: + for arg in _split_top(m[3]): + port, rest = arg.split(':', 1) + val, ty = rest.split(':', 1) + bits = const.get(val.strip(), 0) + if bits: + rows.append((bits, _type_bits(ty), f'{m[1]}.{port.strip()}')) + rows.sort(key=lambda r: (-r[0], r[2])) + return rows + + +def cmd_ties(args): + """Instance-input bits the DUT top ties to constants, per port.""" + rows = const_ties(f'{args.run_dir}/netlist.mlir', + args.top or netlist_top(args.run_dir)) + for bits, width, port in rows: + print(f'{bits:8d} of {width:6d} {port}') + print(f'{sum(r[0] for r in rows)} instance input bits tied to constants') + + def main(): ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) @@ -1207,6 +1413,9 @@ def main(): p.add_argument('--area-tolerance', type=float, default=0.05, help="a resource of the design that grows by more than this " "fraction fails (exit 3)") + p.add_argument('--json', metavar='FILE', + help="also write the headline and the failing registers " + "and resources here") p.set_defaults(fn=cmd_diff) p = sub.add_parser("buffers", help="elastic buffers that pass deep paths") @@ -1242,6 +1451,17 @@ def main(): p.add_argument('--csv', help="also write every register's prediction here") p.set_defaults(fn=cmd_score) + p = sub.add_parser("asic-summary", help="period and area of an ASIC run, as CSV") + p.add_argument('run_dir') + p.add_argument('out') + p.set_defaults(fn=cmd_asic_summary) + + p = sub.add_parser("ties", help="instance-input bits the DUT top ties to " + "constants") + p.add_argument('run_dir') + p.add_argument('--top', help="top module (default: the run's design)") + p.set_defaults(fn=cmd_ties) + args = ap.parse_args() return args.fn(args) or 0 diff --git a/ci/logic_gate.py b/ci/logic_gate.py index 79f1f33ce6..79373a314a 100755 --- a/ci/logic_gate.py +++ b/ci/logic_gate.py @@ -20,6 +20,13 @@ beacon_risk.txt: the learned calibration's slowest registers and its Fmax, reported, not gated +With --tool beacon_asic it measures ci/testcases/asic_gate.yaml's builds on +the ASIC flow instead (hw/syn/yosys/dut, ASAP7 cell stages, flip-flops and +SRAM macros; baselines in ci/baselines/synthesis/beacon_asic/). With +--against-rev REV, each build is also compared register by register with the +same build on REV's RTL, measured under this checkout's flow: CI passes a +pull request's merge base (BEACON_AGAINST_REV). + It needs CIRCT and foldsim (ci/toolchain_install.sh --circt --foldsim); the Xilinx environment is not used. @@ -27,6 +34,8 @@ ci/logic_gate.py --list ci/logic_gate.py # all builds, gate against baselines ci/logic_gate.py -b cache -b tcu # explicit builds + ci/logic_gate.py --tool beacon_asic # asic_gate's builds, ASIC flow + ci/logic_gate.py --against-rev $(git merge-base HEAD origin/master) ci/logic_gate.py --update-baseline # re-record (human-reviewed, never in CI) Beacon runs by hand through the flow's own entry point -- diff --git a/ci/synth_gate.py b/ci/synth_gate.py index b986ac225e..1aaecc699f 100755 --- a/ci/synth_gate.py +++ b/ci/synth_gate.py @@ -7,12 +7,13 @@ post-synthesis timing and area against the recorded numbers, so an RTL change that quietly costs timing closure or area cannot land green. -Three backends, one gate. Everything that is not "how do I drive the tool and +Four backends, one gate. Everything that is not "how do I drive the tool and what does it call its numbers" is shared: - --tool=xilinx Vivado synthesis + place-and-route -> ci/fpga_gate.py - --tool=yosys Yosys + OpenSTA on an ASIC PDK -> ci/asic_gate.py - --tool=beacon logic levels per RTL unit, no synthesis -> ci/logic_gate.py + --tool=xilinx Vivado synthesis + place-and-route -> ci/fpga_gate.py + --tool=yosys Yosys + OpenSTA on an ASIC PDK -> ci/asic_gate.py + --tool=beacon logic levels per RTL unit, no synthesis -> ci/logic_gate.py + --tool=beacon_asic Beacon's cell stages on asic_gate's builds (ASAP7) Spec : ci/testcases/.yaml (what to build) Baselines : ci/baselines/synthesis//.json (last accepted metrics) @@ -30,10 +31,13 @@ import argparse import concurrent.futures import csv +import fcntl +import glob import hashlib import json import os import re +import shlex import shutil import signal import subprocess @@ -63,7 +67,11 @@ # Verdicts that do not fail the run. KNOWN-ISSUE is a tracked expected failure # (see gate()); XPASS is one that stopped reproducing -- reported loudly, but a # gate that hard-failed on an unexpected PASS would be the wrong incentive. -PASSING = ("PASS", "RECORDED", "KNOWN-ISSUE", "XPASS") +# Against a reference (--against-rev), ACCEPTED is a regression the baseline's +# re-record accepted, and NO-REFERENCE a build the reference revision does not +# have at all (a DUT the change adds), judged against its baseline alone. REF-FAIL, a reference that failed to measure the build, fails. +PASSING = ("PASS", "RECORDED", "KNOWN-ISSUE", "XPASS", "ACCEPTED", + "NO-REFERENCE") POLL_INTERVAL = 5 HEARTBEAT = 300 # seconds between "still alive, here is where it is" lines @@ -90,6 +98,7 @@ class Tool: name = "" # --tool value, and ci/baselines/synthesis// gate = "" # ci/testcases/.yaml, and the build-dir/prefix/stamp name + spec = "" # another gate's ci/testcases/.yaml, if not the gate's own flow = "" # DUT entry point, relative to a configured build tree metrics = () # recorded, in report order; build_time_s is bookkeeping @@ -107,11 +116,22 @@ class Tool: metric_tolerance = {} integral = () # recorded as ints; every other metric is a rounded float columns = () # (header, metric, format, width) for the report table + # Whether the build's clock_mhz is part of config_hash: it is an input of + # a synthesis run, but only a gate threshold for an estimate that does not + # read it, where raising the target must not invalidate the measurements. + clock_in_hash = True + # What a register's depth is counted in, for the reasons --against gives. + depth_unit = "levels" + # The dut/catalog.mk variable naming a DUT's top module (). + top_var = "_PRJ" # Scheduling weights (seconds) for a build with no recorded build_time_s yet. # Only ever used to ORDER the queue, so a rough magnitude is enough. weights = {} fallback_weight = 1800 + # Peak memory (GB) of a build, for admission: builds start together only if + # their peaks fit in the machine. A DUT not listed is not limited. + mem_gb = {} job_label = "tool" # what --tool-jobs buys, in the schedule banner # Log lines that mark a phase transition, in order. Progress is reported @@ -169,6 +189,18 @@ def evidence(self, work): """Files of a finished build that explain its reasons.""" return [] + def notes(self, build, metrics, args): + """Advisory lines printed under the report table; never a verdict.""" + return [] + + def top_module(self, dut_root, dut): + """The DUT's top module, from dut/catalog.mk ("" if not declared).""" + return _make_var(_catalog(dut_root), dut + self.top_var) + + def diff_levels(self, build, metrics): + """(watch, fix) thresholds for `beacon.py diff` against a reference.""" + return metrics.get("watch_levels") or 8, metrics.get("fix_levels") or 12 + def incomplete(self, metrics): """Whether a cached result predates something this tool now records. @@ -208,6 +240,41 @@ def dut_names(dut_root): return set(_make_var(_catalog(dut_root), "DUTS").split()) +# --- Beacon, both targets ---------------------------------------------------- + +def harness_ties(work): + """The instance-input bits the DUT top ties to constants, from the Beacon + run's netlist (ci/beacon.py ties): the count and the ports that carry + the most. A finished run always has its netlist, so a missing or + unreadable one is a build error, never a count of zero.""" + run = os.path.join(work, "beacon") + netlist = os.path.join(run, "netlist.mlir") + if not os.path.exists(netlist): + raise BuildError("no %s to count the harness's constant ties in" % netlist) + import beacon + try: + rows = beacon.const_ties(netlist, beacon.netlist_top(run)) + except ValueError as e: + raise BuildError("counting the harness's constant ties: %s" % e) + return {"tied_bits": sum(r[0] for r in rows), + "tied_ports": [{"port": p, "bits": n, "width": w} + for n, w, p in rows[:10]]} + + +def ties_reasons(metrics, base): + """A harness whose constant ties changed: the synthesis gates fold the + logic behind a tied input and Beacon does not, so they now measure a + different design than the one their budgets were set on. Either way it + needs a reviewed re-record; a baseline without the count is not gated.""" + now, was = metrics.get("tied_bits"), base.get("tied_bits") + if now is None or was is None or now == was: + return [] + return ["harness: %d -> %d instance-input bits tied to constants -- " + "CHANGED: the synthesis gates now fold %s of the logic Beacon " + "counts; review the fpga_gate/asic_gate budget, then re-record" + % (was, now, "more" if now > was else "less")] + + class Xilinx(Tool): """Vivado synthesis + place-and-route (hw/syn/xilinx/dut).""" @@ -330,6 +397,7 @@ class Yosys(Tool): name = "yosys" gate = "asic_gate" flow = "hw/syn/yosys/dut" + top_var = "_TOP" metrics = ("fmax_mhz", "wns_ns", "tns_ns", "cell_area_um2", "seq_area_um2", "sram_area_um2", "cell_count", "power_mw", "build_time_s") @@ -502,13 +570,16 @@ class Beacon(Tool): ("lutram", "lutram", "%d", 9), ("bram", "bram", "%g", 8), ("uram", "uram", "%d", 6), ("dsp", "dsp", "%d", 6), ("p_fmax", "pred_fmax_mhz", "%.1f", 8), - ("risk", "risk_endpoints", "%d", 6)) + ("risk", "risk_endpoints", "%d", 6), + ("tied", "tied_bits", "%d", 6)) # Elaboration and mapping of the widest DUTs; the level count itself is # seconds. weights = {"top": 600, "vortex": 600, "gfx": 600, "core": 300, "tensor": 300, "tcu": 300} fallback_weight = 120 + # Measured peaks: together they exceed a 16 GB hosted runner. + mem_gb = {"gfx": 9.5, "gfxvm": 10.0} job_label = "make" # The netlist exists once foldsim-opt starts mapping it; a typo in a define @@ -584,6 +655,7 @@ def extras(self, work): "fix_levels": doc.get("fix_levels"), "watch_levels": doc.get("watch_levels")} out.update(self.risk(work)) + out.update(harness_ties(work)) return out def risk(self, work): @@ -624,19 +696,29 @@ def risk(self, work): return {"pred_fmax_mhz": round(fmax, 1), "risk_endpoints": risky} def incomplete(self, metrics): - return metrics.get("units") is None + return metrics.get("units") is None or "tied_bits" not in metrics + + def notes(self, build, metrics, args): + # The calibrated Fmax against the clock is a pointer, not a verdict: + # held to it, it failed known-good builds as often as bad ones. + pfmax, clock = metrics.get("pred_fmax_mhz"), build.get("clock_mhz") + if pfmax is None or not clock or pfmax >= clock: + return [] + return ["p_fmax %.1f MHz is %.1f%% below the %g MHz clock; slowest " + "registers in %s (advisory, not gated)" + % (pfmax, 100.0 * (clock - pfmax) / clock, clock, self.RISK)] def compare(self, metrics, base): """Per unit: deeper than its baseline fails; a new unit at the fix threshold fails; shallower, or gone from the watch list, is an improvement to lock in. Per interface output: more bits reached combinationally from outside its instance fails, fewer is an - improvement.""" + improvement. A harness whose constant ties changed fails.""" + reasons = ties_reasons(metrics, base) cur, ref = metrics.get("units"), base.get("units") if cur is None or ref is None: - return [] + return reasons fix = metrics.get("fix_levels") or 0 - reasons = [] for unit in sorted(set(cur) | set(ref)): now, was = cur.get(unit), ref.get(unit) if was is None: @@ -684,7 +766,159 @@ def describe_baseline(self, base): return "max %d levels" % base["max_levels"] -TOOLS = {t.name: t for t in (Xilinx(), Yosys(), Beacon())} +class BeaconAsic(Tool): + """Beacon on the ASIC flow (hw/syn/yosys/dut, target `beacon`, + target=$(PDK)): asic_gate's builds, DUT for DUT and config for config, in + minutes instead of hours. + + foldsim-estimate-timing counts cell stages (docs/designs/beacon.md 4.3) + and converts the deepest path to a period with the library's delays; + foldsim-estimate-area counts cells, flip-flops and SRAM macros, a memory + without a macro as flip-flops. Flip-flops and cells are held to the + baseline (5 %), so a memory that leaves its SRAM macro, or one Yosys must + build from flip-flops, fails here before the nightly synthesis. The + predicted Fmax is held to the build's clock_mhz with a wide band (see + FMAX_BAND): a backstop for a path far too deep to close, not a timing + verdict. The sensitive timing check is register by register against a + reference (--against-rev), where a path that got deeper fails by name. + """ + + name = "beacon_asic" + gate = "logic_gate_asic" + spec = "asic_gate" + flow = "hw/syn/yosys/dut" + top_var = "_TOP" + + metrics = ("fmax_mhz", "period_ps", "max_stages", "cells", "ff", "macros", + "endpoints", "stage_ps", "overhead_ps", "build_time_s") + gated = ("ff", "cells") + integral = ("period_ps", "max_stages", "cells", "ff", "macros", + "endpoints", "stage_ps", "overhead_ps", "build_time_s") + key_metric = "period_ps" + summary = "beacon_asic_summary.csv" + # The predicted Fmax fails only more than FMAX_BAND below clock_mhz. + # Beacon's period runs 0.59-1.05x OpenSTA's on the 14 DUTs (it prices + # vm's L2 TLB MRU update at 46 stages where STA closes it at 1266 MHz), + # so a tight band fails designs that close. Over every validated (design, + # target) pair, the lowest prediction of a design STA closes is 0.749 of + # its target (vm and the fixed top, 749 MHz at 1 GHz), and the highest of + # one that misses badly is 0.615 (core and top before their FPU fixes, + # 492 MHz at 800). 0.32 splits that gap evenly in ratio (about 10 % margin + # each side) and holds at both the 800 MHz and the 1 GHz target. + FMAX_BAND = 0.32 + metric_tolerance = {"fmax_mhz": FMAX_BAND} + # Beacon reads no clock: the target only sets the band and the stage + # thresholds, so a new target must not invalidate the measurements. + clock_in_hash = False + depth_unit = "stages" + columns = (("fmax", "fmax_mhz", "%.0f", 7), + ("stages", "max_stages", "%d", 7), + ("cells", "cells", "%d", 9), + ("ff", "ff", "%d", 8), + ("macros", "macros", "%d", 7), + ("tied", "tied_bits", "%d", 6)) + weights = {"top": 600, "gfx": 600, "core": 300, "tensor": 300, "vm": 300} + fallback_weight = 120 + job_label = "make" + elab_done = "foldsim-beacon-map" + phases = ( + ("gen_sources.sh", "sources"), + ("circt_elaborate.sh", "elaboration"), + (elab_done, "mapping"), + ("foldsim-estimate-timing", "stages"), + ("foldsim-estimate-area", "area"), + ("asic-summary", "reporting"), + ) + error_re = re.compile(r"^(?:ERROR|FATAL|Error)\b|: error:|^\S+: \*\*\* ") + + REPORT = os.path.join("beacon", "report.txt") + AREA = os.path.join("beacon", "area.txt") + + def env(self, args): + return {"circt": tool_version("circt-verilog", "--version", + package="circt", line_prefix="CIRCT"), + "foldsim": tool_version("foldsim-opt", "--version", + package="foldsim", + line_prefix="foldsim"), + "pdk": os.environ.get("PDK", "asap7"), + "xlen": args.xlen} + + def hash_key(self, env): + return [env["circt"], env["foldsim"], env["pdk"], str(env["xlen"])] + + def env_warning(self, build, env): + return Beacon.env_warning(self, build, env) + + tops = Yosys.tops + work_dir = Yosys.work_dir + + def diff_levels(self, build, metrics): + """(watch, fix) stages for `beacon.py diff`: the most that fit 90 % + and 100 % of the target period, plus one, with the run's own delays + (period = overhead + stages x stage).""" + period = 1e6 / float(build["clock_mhz"]) + stage = metrics.get("stage_ps") or 24 + over = metrics.get("overhead_ps") or 231 + return (int((0.9 * period - over) // stage) + 1, + int((period - over) // stage) + 1) + + def _make(self, dut_root, build, target): + return ["make", "-C", dut_root, build["dut"], "TARGET=" + target, + "PREFIX=%s_%s" % (self.gate, build["id"]), + "CONFIGS=" + build["configs"]] + + def clean(self, dut_root, work, build, benv): + shutil.rmtree(work, ignore_errors=True) + os.makedirs(work, exist_ok=True) + + def build_command(self, dut_root, work, build, env, args): + os.makedirs(work, exist_ok=True) + script = os.path.join(os.path.dirname(os.path.abspath(__file__)), + "beacon.py") + make = " ".join(shlex.quote(a) for a in self._make(dut_root, build, "beacon")) + return ["sh", "-c", "%s && echo asic-summary && %s %s asic-summary %s %s" + % (make, shlex.quote(sys.executable), shlex.quote(script), + shlex.quote(os.path.join(work, "beacon")), + shlex.quote(os.path.join(work, self.summary)))], {} + + def extras(self, work): + return harness_ties(work) + + def incomplete(self, metrics): + return "tied_bits" not in metrics + + def compare(self, metrics, base): + return ties_reasons(metrics, base) + + def notes(self, build, metrics, args): + # Below the target but inside the band: worth a look, not a verdict. + # Beyond the band, gate() already failed it. + fmax, clock = metrics.get("fmax_mhz"), build.get("clock_mhz") + if fmax is None or not clock or fmax >= clock: + return [] + band = threshold(build, "fmax_mhz", args) + shortfall = (clock - fmax) / float(clock) + if shortfall > band: + return [] + return ["predicted Fmax %.0f MHz is %.1f%% below the %g MHz target, " + "inside the %.0f%% band; deepest path in %s (advisory)" + % (fmax, 100 * shortfall, clock, 100 * band, self.REPORT)] + + def evidence(self, work): + return [p for p in (os.path.join(work, self.REPORT), + os.path.join(work, self.AREA)) + if os.path.exists(p)] + + def describe(self, m): + return "Fmax=%.0f MHz (%d stages) %d cells, %d FFs" % ( + m.get("fmax_mhz") or 0, m.get("max_stages") or 0, + m.get("cells") or 0, m.get("ff") or 0) + + def describe_baseline(self, base): + return "Fmax=%.0f MHz %d FFs" % (base.get("fmax_mhz") or 0, base.get("ff") or 0) + + +TOOLS = {t.name: t for t in (Xilinx(), Yosys(), Beacon(), BeaconAsic())} def tool_version(name, flag, package=None, line_prefix=None): @@ -742,15 +976,18 @@ def spec_path(root, gate): return os.path.join(root, "ci", "testcases", gate + ".yaml") -def baseline_dir(root, tool): - return os.path.join(root, "ci", "baselines", "synthesis", tool) +def baseline_dir(root, tool, override=None): + """ci/baselines/synthesis/, or / to read and write + proposed baselines outside the tree.""" + return os.path.join(override or os.path.join(root, "ci", "baselines", + "synthesis"), tool) -def baseline_path(root, tool, group): - return os.path.join(baseline_dir(root, tool), group + ".json") +def baseline_path(root, tool, group, override=None): + return os.path.join(baseline_dir(root, tool, override), group + ".json") -def load_catalog(root, tool, xlen=32): +def load_catalog(root, tool, xlen=32, baselines_from=None): """Builds keyed by id: the SPEC from ci/testcases/.yaml, joined to its recorded metrics from ci/baselines/synthesis//.json. @@ -758,8 +995,12 @@ def load_catalog(root, tool, xlen=32): (and is hand-authored, commented, reviewed), the baseline says what the last accepted answer was (and is machine-written). Neither file can be mistaken for the other's job. + + A tool that measures another gate's builds (`spec`) takes their designs + and targets, not their verdict policy: that gate's `known_issue` and + `thresholds` describe its own tool's numbers. """ - with open(spec_path(root, tool.gate)) as fh: + with open(spec_path(root, tool.spec or tool.gate)) as fh: doc = yaml.safe_load(fh) defaults = doc.get("defaults") or {} # `builds:`, not `tests:` -- a synthesis build is not a pytest case (no @@ -768,11 +1009,11 @@ def load_catalog(root, tool, xlen=32): # is ours. spec = doc.get("builds") if not spec: - sys.exit("ERROR: no `builds:` block in %s" % spec_path(root, tool.gate)) + sys.exit("ERROR: no `builds:` block in %s" % spec_path(root, tool.spec or tool.gate)) baselines = {} for group in {e.get("group", "default") for e in spec}: - path = baseline_path(root, tool.name, group) + path = baseline_path(root, tool.name, group, baselines_from) if os.path.exists(path): with open(path) as fh: baselines[group] = json.load(fh) @@ -782,7 +1023,7 @@ def load_catalog(root, tool, xlen=32): bid = entry["id"] if bid in builds: sys.exit("ERROR: duplicate build id '%s' in %s" - % (bid, spec_path(root, tool.gate))) + % (bid, spec_path(root, tool.spec or tool.gate))) required = {"dut", "clock_mhz", "configs"} | ({tool.budget_key} if tool.budget_key else set()) missing = required - set(entry) if missing: @@ -797,10 +1038,11 @@ def load_catalog(root, tool, xlen=32): build["xlen"] = entry.get("xlen", xlen) build["profile"] = entry.get("profile", "") build["opt_in"] = bool(entry.get("opt_in", False)) - build["known_issue"] = entry.get("known_issue", - defaults.get("known_issue", "")) - build["thresholds"] = entry.get("thresholds", - defaults.get("thresholds", {})) + borrowed = bool(tool.spec) + build["known_issue"] = "" if borrowed else entry.get( + "known_issue", defaults.get("known_issue", "")) + build["thresholds"] = {} if borrowed else entry.get( + "thresholds", defaults.get("thresholds", {})) recorded = baselines.get(group, {}).get(bid, {}) result = recorded.get("result") or {} # An all-null skeleton means "never recorded" -- the file ships with the @@ -809,6 +1051,9 @@ def load_catalog(root, tool, xlen=32): else None build["baseline_env"] = result.get("env") or {} build["config_hash"] = recorded.get("config_hash") + # Regressions against a reference that the last re-record accepted + # (--update-baseline with --against-rev); see compare_against(). + build["accepted"] = recorded.get("accepted") or {} builds[bid] = build return builds @@ -833,7 +1078,8 @@ def select(builds, selectors): def config_hash(build, env, tool): """Fingerprint the synthesis inputs; a change invalidates the stored metrics.""" - key = "|".join([build["dut"], str(build["clock_mhz"]), build["configs"]] + clock = [str(build["clock_mhz"])] if tool.clock_in_hash else [] + key = "|".join([build["dut"]] + clock + [build["configs"]] + tool.hash_key(dict(env, xlen=build["xlen"]))) # Appended only when set, so builds without a strategy override or a # profile keep the hash their baselines were recorded under. @@ -846,7 +1092,7 @@ def config_hash(build, env, tool): return hashlib.sha256(key.encode()).hexdigest()[:16] -def save_baselines(root, tool, results, env): +def save_baselines(root, tool, results, env, override=None): """Write measured metrics to the golden baselines (never done by CI). Each entry records the GPU configuration it represents -- dut, target clock, @@ -855,13 +1101,17 @@ def save_baselines(root, tool, results, env): source of truth for what to build; config_hash fingerprints that spec and invalidates the metrics if it drifts, so the recorded config cannot be hand-edited to disagree with the numbers next to it without failing the gate. + + Recorded against a revision (--against-rev), an entry also lists the + regressions against it as `accepted`: what the re-record decided, in the + diff a reviewer reads, and what compare_against() lets pass. """ by_group = {} for r in results: by_group.setdefault(r["build"]["group"], []).append(r) - os.makedirs(baseline_dir(root, tool.name), exist_ok=True) + os.makedirs(baseline_dir(root, tool.name, override), exist_ok=True) for group, rs in by_group.items(): - path = baseline_path(root, tool.name, group) + path = baseline_path(root, tool.name, group, override) entries = {} if os.path.exists(path): with open(path) as fh: @@ -879,6 +1129,11 @@ def save_baselines(root, tool, results, env): entries[b["id"]]["impl_strategy"] = b["impl_strategy"] if b.get("profile"): entries[b["id"]]["profile"] = b["profile"] + against = r.get("against") or {} + if against.get("rev") and against.get("regressions"): + entries[b["id"]]["accepted"] = { + "against": against["rev"], + "regressions": against["regressions"]} with open(path, "w") as fh: json.dump(entries, fh, indent=2, sort_keys=True) fh.write("\n") @@ -1142,6 +1397,17 @@ def run_build(build, build_dir, env, args, tool): if not tool.incomplete(stamp["metrics"]): say(build, "cache", "already built for this config -- reusing") return stamp["metrics"] + # The diagnostics are read from the finished build's own files, + # so they can usually be brought up to date without the tool. + try: + metrics = dict(stamp["metrics"], **tool.extras(work)) + except BuildError: + metrics = stamp["metrics"] + if not tool.incomplete(metrics): + save_stamp(work, chash, "done", stamp_file, metrics) + say(build, "cache", "already built for this config -- reusing, " + "diagnostics re-read") + return metrics say(build, "resum", "built, but its diagnostics predate this gate -- " "re-reporting from checkpoint") resume = True @@ -1209,6 +1475,20 @@ def weight(build, tool): return recorded or tool.weights.get(build["dut"], tool.fallback_weight) +def mem_need(build, tool): + """Peak memory (GB) a build is admitted with; 0 when not estimated.""" + return tool.mem_gb.get(build["dut"], 0) + + +def mem_budget(): + """GB the builds may hold at once: 85 % of the machine's memory.""" + with open("/proc/meminfo") as fh: + for line in fh: + if line.startswith("MemTotal:"): + return 0.85 * int(line.split()[1]) / (1024 * 1024) + return float("inf") + + def run_all(builds, build_dir, env, args, tool): """Longest-processing-time-first list scheduling. @@ -1228,26 +1508,44 @@ def run_all(builds, build_dir, env, args, tool): tool.prepare_flow(tool.dut_root(build_dir), env) + # Each free slot takes the longest pending build whose peak fits next to + # the running ones; a build that fits nowhere runs alone. + budget = mem_budget() results = [] + pending = list(order) + running = {} with concurrent.futures.ThreadPoolExecutor(max_workers=args.jobs) as pool: - futures = {pool.submit(run_build, b, build_dir, env, args, tool): b - for b in order} - for fut in concurrent.futures.as_completed(futures): - b = futures[fut] - work = build_work(b, build_dir, tool) - try: - metrics = fut.result() - say(b, "done", "%s (%dm)" % (tool.describe(metrics), - metrics["build_time_s"] // 60)) - results.append({"build": b, "metrics": metrics, "error": None, - "work": work}) - except (BuildError, subprocess.CalledProcessError) as e: - say(b, "FAIL", str(e)) - results.append({"build": b, "metrics": None, "error": str(e), - "work": work}) + while pending or running: + used = sum(mem_need(b, tool) for b in running.values()) + for b in list(pending): + if len(running) >= args.jobs: + break + if running and used + mem_need(b, tool) > budget: + continue + pending.remove(b) + used += mem_need(b, tool) + running[pool.submit(run_build, b, build_dir, env, args, tool)] = b + done, _ = concurrent.futures.wait( + running, return_when=concurrent.futures.FIRST_COMPLETED) + for fut in done: + b = running.pop(fut) + results.append(finish_build(fut, b, build_dir, tool)) return sorted(results, key=lambda r: r["build"]["id"]) +def finish_build(fut, b, build_dir, tool): + """A finished build's result row, reported as it lands.""" + work = build_work(b, build_dir, tool) + try: + metrics = fut.result() + say(b, "done", "%s (%dm)" % (tool.describe(metrics), + metrics["build_time_s"] // 60)) + return {"build": b, "metrics": metrics, "error": None, "work": work} + except (BuildError, subprocess.CalledProcessError) as e: + say(b, "FAIL", str(e)) + return {"build": b, "metrics": None, "error": str(e), "work": work} + + # --------------------------------------------------------------------------- # gate # --------------------------------------------------------------------------- @@ -1369,15 +1667,18 @@ def report_entry(r, env, tool): entry["xlen"] = b["xlen"] if b.get("profile"): entry["profile"] = b["profile"] + if r.get("against"): + entry["against"] = r["against"] return entry -def report(results, env, args, gated, tool, record=False): +def report(results, env, args, gated, tool, mode="gate"): """Print the metric table; return the list of failing verdicts. In record mode the table is the review artifact for the baseline update, so the per-metric deltas are still shown (that is the diff a human signs off on) - but they are not verdicts -- recording IS the intent. + but they are not verdicts -- recording IS the intent. In measure mode (a + reference run for --against-rev) nothing is judged at all. """ head = "%-10s %-8s" + "".join(" %%%ds" % c[3] for c in tool.columns) title = head % (("build", "dut") + tuple(c[0] for c in tool.columns)) \ @@ -1389,9 +1690,10 @@ def report(results, env, args, gated, tool, record=False): failures = [] for r in results: b = r["build"] - if record: - verdict, reasons = ("RECORDED", []) if r["metrics"] \ - else ("BUILD-FAIL", [r["error"]]) + if mode != "gate": + verdict, reasons = (("RECORDED" if mode == "record" else "MEASURED", + []) if r["metrics"] + else ("BUILD-FAIL", [r["error"]])) else: verdict, reasons = gate(r, env, args, gated, tool) r["verdict"] = verdict @@ -1425,47 +1727,487 @@ def cell(key, fmt): "NO-BASELINE"): for path in tool.evidence(works[bid]): print(" see %s" % path) + notes = [(r["build"]["id"], n) for r in results if r["metrics"] + for n in tool.notes(r["build"], r["metrics"], args)] + if notes: + print("\nadvisory (not gated):") + for bid, note in notes: + print(" %-10s %s" % (bid, note)) return failures -def compare_against(results, ref_dir, tool): - """Each finished build's Beacon run against the same build in ref_dir: - end points register by register, and area by unit; return the builds a - register got deeper in, or whose area grew past the tolerance, as failing - verdicts.""" + + +# --------------------------------------------------------------------------- +# reference runs (--against, --against-rev) +# --------------------------------------------------------------------------- + +# Where --against-rev's reference takes REV's files: the RTL, the harnesses, +# the RTL the flows add (DPI headers, the ASIC RAM stubs) and the +# configuration; submodules are taken at the commit REV pins. Every other +# file is this checkout's, so both sides are measured by the same flow and +# the same tools. +REF_PATHS = ("hw/rtl", "hw/unittest", "hw/dpi", "hw/syn/libs/no_mem", + "VX_config.toml", "VX_types.toml") +# Tracked paths no Beacon run reads: the reference stays valid across them. +FLOW_EXCLUDE = ("docs", "sim", "tests", "**/*.md") +# The default of --against-rev: how CI passes a pull request's merge base. +AGAINST_REV_ENV = "BEACON_AGAINST_REV" +# The default of --ref-cache. +REF_CACHE_ENV = "BEACON_REF_CACHE" +# Reference trees kept in the cache, the one in use among them. +REF_KEEP = 4 +# Regressions listed per build against a reference; beacon_diff.txt has all. +REASONS_SHOWN = 10 + + +class RefError(Exception): + """The reference cannot be staged; the run is not gated (exit 2).""" + + +def git(root, *argv): + return subprocess.check_output(["git", "-C", root] + list(argv)) + + +def submodules(root): + """Paths of this checkout's submodules (gitlinks).""" + return [line.split(b"\t", 1)[1].decode() + for line in git(root, "ls-files", "-s", "-z").split(b"\0") + if line.startswith(b"160000 ")] + + +def paths_at(root, rev, paths): + """The ones of `paths` that exist at REV.""" + return [p for p in paths if git(root, "ls-tree", "--name-only", rev, "--", p)] + + +def flow_fingerprint(root): + """This checkout's flow, as staged and as edited: every tracked file but + REF_PATHS, the submodules and FLOW_EXCLUDE. A reference measured under + another flow is rebuilt; under this one it is reused whatever the RTL + here does, which is what an RTL iteration loop wants.""" + spec = ["--", "."] + [":(exclude,glob)%s" % p if "*" in p else ":(exclude)%s" % p + for p in REF_PATHS + tuple(submodules(root)) + FLOW_EXCLUDE] + h = hashlib.sha256() + h.update(git(root, "ls-files", "-s", *spec)) + h.update(git(root, "diff", "--binary", *spec)) + return h.hexdigest()[:16] + + +def _extract(argv, dst): + """`argv` (a git archive) unpacked into dst; False if it failed.""" + os.makedirs(dst, exist_ok=True) + archive = subprocess.Popen(argv, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + tar = subprocess.run(["tar", "-C", dst, "-xf", "-"], stdin=archive.stdout, + stderr=subprocess.DEVNULL) + archive.stdout.close() + return archive.wait() == 0 and tar.returncode == 0 + + +def stage_reference(root, rev, src): + """A source tree of this checkout's tracked files with REV's REF_PATHS and + REV's submodule commits: REV's design under this checkout's flow.""" + shutil.rmtree(src, ignore_errors=True) + os.makedirs(src) + subs = submodules(root) + skip = tuple(p + "/" for p in REF_PATHS) + for line in git(root, "ls-files", "-s", "-z").split(b"\0"): + if not line: + continue + path = line.decode().split("\t", 1)[1] + if path in REF_PATHS or path.startswith(skip) or path in subs: + continue + dst = os.path.join(src, path) + os.makedirs(os.path.dirname(dst), exist_ok=True) + if os.path.isfile(os.path.join(root, path)): + shutil.copy2(os.path.join(root, path), dst) + paths = paths_at(root, rev, REF_PATHS) + if not paths: + raise RefError("%s has none of %s: not a revision of this design" + % (rev, ", ".join(REF_PATHS))) + if not _extract(["git", "-C", root, "archive", rev] + paths, src): + raise RefError("git archive %s %s failed" % (rev, " ".join(paths))) + for path in subs: + dst = os.path.join(src, path) + pinned = git(root, "ls-tree", rev, "--", path).split() + if len(pinned) < 3 or pinned[1] != b"commit": + # REV does not pin it: the flow finds this checkout's copy there. + os.makedirs(os.path.dirname(dst), exist_ok=True) + os.symlink(os.path.join(root, path), dst) + continue + stage_submodule(os.path.join(root, path), pinned[2].decode(), dst, rev) + open(os.path.join(src, ".ready"), "w").close() + + +def stage_submodule(repo, sha, dst, rev): + """The submodule checked out at `repo`, at commit `sha`, into dst, with + its own submodules at the commits it pins. One not checked out here is + left empty, as it is in this checkout.""" + os.makedirs(dst, exist_ok=True) + if not os.path.exists(os.path.join(repo, ".git")): + return + if not _extract(["git", "-C", repo, "archive", sha], dst): + raise RefError("%s does not have %s, the commit %s pins (git -C %s fetch)" + % (repo, sha[:12], rev, repo)) + for line in git(repo, "ls-tree", "-r", "-z", sha).split(b"\0"): + meta, _, path = line.decode().partition("\t") + if meta.split()[:2] == ["160000", "commit"]: + stage_submodule(os.path.join(repo, path), meta.split()[2], + os.path.join(dst, path), rev) + + +def defines_module(root, module, rev=None): + """Whether REF_PATHS define `module`, at REV or in this checkout.""" + pattern = r"^[[:space:]]*module[[:space:]]+%s([^A-Za-z0-9_$]|$)" % re.escape(module) + where = ([rev, "--"] + paths_at(root, rev, REF_PATHS) if rev + else ["--"] + list(REF_PATHS)) + rc = subprocess.run(["git", "-C", root, "grep", "-q", "-E", pattern] + where, + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode + if rc not in (0, 1): + raise RefError("git grep %s failed (exit %d)" % (rev or "", rc)) + return rc == 0 + + +def absent_at(root, rev, tool, dut): + """Whether REV has no such DUT at all: neither the DUT in its catalog nor + its top module. Conclusive only for a top this checkout's REF_PATHS + define; a top generated or kept elsewhere, or one the catalog names by + configuration, counts as present. A DUT REV has under another top (a + renamed harness) is present, so its failed reference reads REF-FAIL.""" + catalog = os.path.join(root, *tool.flow.split("/")) + top = tool.top_module(catalog, dut) + if not top or "$" in top or not defines_module(root, top): + return False + try: + text = git(root, "show", "%s:%s/catalog.mk" % (rev, tool.flow)).decode() + except subprocess.CalledProcessError: + return False + if dut in _make_var(text, "DUTS").split(): + return False + return not defines_module(root, top, rev) + + +def prune_references(cache, keep): + """Remove the cache's reference trees beyond the REF_KEEP most recently + used; `keep` is always kept, and one another run holds is skipped.""" + trees = [] + for d in os.listdir(cache): + try: + if re.fullmatch(r"[0-9a-f]{12}", d) and d != keep: + trees.append((os.path.getmtime(os.path.join(cache, d)), d)) + except OSError: + continue # removed by another run since the listing + for _, d in sorted(trees, reverse=True)[REF_KEEP - 1:]: + with open(os.path.join(cache, d + ".lock"), "a") as fh: + try: + fcntl.flock(fh, fcntl.LOCK_EX | fcntl.LOCK_NB) + except OSError: + continue + shutil.rmtree(os.path.join(cache, d), ignore_errors=True) + + +def reference_tree(root, rev, args, tool, builds, xlen): + """Measure `builds` on REV's design under this checkout's flow; return + (the build tree to compare against, REV's SHA, the ids of the builds + REV does not have (absent_at), the reference run's exit code, the held + lock). + + The reference lives in //: `src/` is the staged source tree + and `build_/` its builds, resumable like any gate session, so + a second run against the same REV reuses every finished build. CI keeps + the build trees in its cache keyed by the merge base's SHA. A change of + this checkout's flow (flow_fingerprint) discards both. .lock is held + exclusively while the tree is checked, staged and built, and shared + while it is read, so runs on one cache (the FPGA and the ASIC flow, or + worktrees sharing BEACON_REF_CACHE) never remove each other's files.""" + try: + sha = subprocess.check_output( + ["git", "-C", root, "rev-parse", "--verify", "%s^{commit}" % rev], + stderr=subprocess.DEVNULL).decode().strip() + except subprocess.CalledProcessError: + raise RefError("--against-rev %s is not a commit in %s (fetch it first)" + % (rev, root)) + cache = os.path.abspath(args.ref_cache or os.environ.get(REF_CACHE_ENV) or + os.path.join(root, ".beacon_ref")) + os.makedirs(cache, exist_ok=True) + ref = os.path.join(cache, sha[:12]) + lock = open(ref + ".lock", "a") + fcntl.flock(lock, fcntl.LOCK_EX) + src = os.path.join(ref, "src") + build_dir = os.path.join(ref, "build%d_%s" % (xlen, tool.gate)) + stamp = os.path.join(ref, "flow") + flow = flow_fingerprint(root) + try: + with open(stamp) as fh: + same = fh.read().strip() == flow + except OSError: + same = False + if not same: + shutil.rmtree(ref, ignore_errors=True) + os.makedirs(ref, exist_ok=True) + os.utime(ref) + prune_references(cache, sha[:12]) + if not os.path.exists(os.path.join(src, ".ready")): + print("reference: staging %s (%s) in %s" % (rev, sha[:12], src), flush=True) + stage_reference(root, sha, src) + with open(stamp, "w") as fh: + fh.write(flow + "\n") + + absent = {b["id"] for b in builds if absent_at(root, sha, tool, b["dut"])} + for bid in sorted(absent): + print("reference: %s has no DUT for %s" % (sha[:12], bid), flush=True) + present = [b["id"] for b in builds if b["id"] not in absent] + rc = 0 + if present: + argv = [sys.executable, os.path.join(src, "ci", "logic_gate.py"), + "--tool", tool.name, "--build-dir", build_dir, "--resume", + "--measure-only", "--xlen", str(xlen), "-j", str(args.jobs), + "--timeout", str(args.timeout)] + if args.tool_jobs: + argv += ["--tool-jobs", str(args.tool_jobs)] + if args.configs: + argv.append("--configs=" + args.configs) + for bid in present: + argv += ["-b", bid] + env = dict(os.environ) + env.pop(AGAINST_REV_ENV, None) + print("reference: %s (%s) in %s" % (rev, sha[:12], build_dir), flush=True) + rc = subprocess.run(argv, env=env).returncode + if rc: + print("ERROR: the reference run failed (exit %d)" % rc, flush=True) + fcntl.flock(lock, fcntl.LOCK_SH) + return build_dir, sha, absent, rc, lock + + +def live_acceptance(build, root, rev, tool): + """The baseline's accepted regressions, unless the reference already has + them: a re-record's acceptance holds until it lands, and once the + reference revision's baseline carries the same entry the change it + accepted is part of the reference and the acceptance has done its job.""" + accepted = build.get("accepted") or {} + if not accepted or not rev: + return accepted + path = "ci/baselines/synthesis/%s/%s.json" % (tool.name, build["group"]) + try: + landed = json.loads(git(root, "show", "%s:%s" % (rev, path))) + except (subprocess.CalledProcessError, ValueError): + return accepted + return {} if (landed.get(build["id"]) or {}).get("accepted") == accepted \ + else accepted + + +def accepted_by(accepted, reg): + """Whether the baseline's last re-record accepted this regression: the + same register, resource or harness, and no worse than then.""" + for a in (accepted or {}).get("regressions", ()): + if a.get("kind") == reg["kind"] and a.get("name") == reg["name"]: + if reg["kind"] == "ties": + return a.get("after") == reg["after"] + return reg["after"] <= a.get("after", float("-inf")) + return False + + +def regression_reason(reg, tool, fix): + kind, name, unit = reg["kind"], reg["name"], tool.depth_unit + if kind == "deeper": + return ("%s: %d -> %d %s -- DEEPER than the reference" + % (name, reg["before"], reg["after"], unit)) + if kind == "new": + return ("%s: new at %d %s (fix threshold %d) -- DEEPER than the " + "reference" % (name, reg["after"], unit, fix)) + if kind == "area": + return ("%s: %g -> %g (%+.1f%%) -- AREA grown past the tolerance " + "against the reference" + % (name, reg["before"], reg["after"], + 100.0 * (reg["after"] - reg["before"]) / reg["before"] + if reg["before"] else 100.0)) + return ties_reasons({"tied_bits": reg["after"]}, + {"tied_bits": reg["before"]})[0] + + +def compare_against(results, ref_dir, tool, env, root, rev=None, absent=()): + """Each finished build's Beacon run against the same build in ref_dir + (ci/beacon.py diff): register by register, area by resource, and the + harness's constant ties. Sets each result's `against`: its verdict, + the regressions, and the reasons. + + A build the reference revision does not have (a DUT the change adds, + absent_at) reads NO-REFERENCE and is judged against its baseline alone. Any + other build without a finished reference of the same config is REF-FAIL: + a reference that timed out or crashed must not pass for one that agrees. + + A regression the baseline's re-record accepted (--update-baseline with + --against-rev, stored in the baseline entry) reads ACCEPTED until that + acceptance reaches the reference (live_acceptance). One the re-record + did not see fails.""" script = os.path.join(os.path.dirname(os.path.abspath(__file__)), "beacon.py") - failures = [] + label = rev[:12] if rev else ref_dir + rows = [] for r in results: b, work = r["build"], r.get("work") if not r["metrics"] or not work: continue - ref = os.path.join(build_work(b, ref_dir, tool), "beacon") - cur = os.path.join(work, "beacon") - if not os.path.exists(os.path.join(ref, "endpoints.csv")): - print("\n%s: no reference run in %s" % (b["id"], ref)) + against = {"reference": label, "rev": rev, "regressions": []} + r["against"] = against + if b["id"] in absent: + against.update(verdict="NO-REFERENCE", reasons=[ + "%s has no %s DUT (neither in its catalog nor its top module): " + "judged against its baseline only" % (label, b["dut"])]) + rows.append((b["id"], "NO-REFERENCE", "-")) + continue + ref_work = build_work(b, ref_dir, tool) + ref = os.path.join(ref_work, "beacon") + try: + with open(os.path.join(ref_work, tool.gate + ".json")) as fh: + stamp = json.load(fh) + except (OSError, ValueError): + stamp = {} + problem = (None if stamp.get("status") == "done" and stamp.get("metrics") + and os.path.exists(os.path.join(ref, "endpoints.csv")) + else "no finished reference build in %s (see its build.log)" + % ref_work) + if not problem and stamp.get("config_hash") != config_hash(b, env, tool): + problem = ("the reference in %s was measured under another " + "configuration (config hash %s, this build %s)" + % (ref_work, stamp.get("config_hash"), + config_hash(b, env, tool))) + if problem: + against.update(verdict="REF-FAIL", reasons=[problem]) + rows.append((b["id"], "REF-FAIL", "-")) continue + ref_metrics = stamp["metrics"] out = os.path.join(work, "beacon_diff.txt") + doc_path = os.path.join(work, "beacon_diff.json") + if os.path.exists(doc_path): + os.remove(doc_path) + watch, fix = tool.diff_levels(b, r["metrics"]) with open(out, "w") as fh: - m = r["metrics"] - rc = subprocess.run([sys.executable, script, "diff", ref, cur, - "--min-levels", str(m.get("watch_levels") or 8), - "--fix-levels", str(m.get("fix_levels") or 12)], + rc = subprocess.run([sys.executable, script, "diff", ref, + os.path.join(work, "beacon"), + "--min-levels", str(watch), + "--fix-levels", str(fix), + "--json", doc_path], stdout=fh, stderr=subprocess.STDOUT).returncode - with open(out) as fh: - head = fh.readline().strip() - print("\n%s against %s: %s%s\n see %s" - % (b["id"], ref_dir, head, " -- REGRESSION" if rc in (1, 3) else "", - out)) - if rc == 1: - failures.append((b["id"], "DEEPER", ["a register got deeper than in " - "the reference: %s" % out])) - elif rc == 3: - failures.append((b["id"], "AREA", ["the design's area grew past the " - "tolerance against the " - "reference: %s" % out])) - elif rc: - failures.append((b["id"], "BUILD-FAIL", ["beacon.py diff failed: %s" % out])) - return failures + against["diff"] = out + try: + with open(doc_path) as fh: + doc = json.load(fh) + except (OSError, ValueError): + doc = None + if rc not in (0, 1, 3) or doc is None: + against.update(verdict="BUILD-FAIL", + reasons=["beacon.py diff failed (exit %d): %s" % (rc, out)]) + rows.append((b["id"], "BUILD-FAIL", "-")) + continue + regs = [dict(kind="deeper", name=d["register"], before=d["before"], + after=d["after"]) for d in doc["deeper"]] + regs += [dict(kind="new", name=d["register"], before=None, + after=d["after"]) for d in doc["new"]] + regs += [dict(kind="area", name=d["resource"], before=d["before"], + after=d["after"]) for d in doc["area"]] + was, now = ref_metrics.get("tied_bits"), r["metrics"].get("tied_bits") + if was is not None and now is not None and was != now: + regs.append(dict(kind="ties", name="tied_bits", before=was, after=now)) + accepted = live_acceptance(b, root, rev, tool) + open_regs = [g for g in regs if not accepted_by(accepted, g)] + kinds = {g["kind"] for g in open_regs} + verdict = ("DEEPER" if kinds & {"deeper", "new"} else + "AREA" if "area" in kinds else + "HARNESS" if "ties" in kinds else + "ACCEPTED" if regs else "PASS") + # Generate copies of one register repeat its line; the diff has them all. + shown = open_regs[:REASONS_SHOWN] + reasons = [regression_reason(g, tool, fix) for g in shown] + covered = [g for g in regs if g not in open_regs] + reasons += ["accepted by the baseline's re-record against %s: %s" + % (accepted.get("against", "?")[:12], + regression_reason(g, tool, fix)) + for g in covered[:max(0, REASONS_SHOWN - len(shown))]] + hidden = len(regs) - len(reasons) + if hidden > 0: + reasons.append("... and %d more" % hidden) + if reasons: + reasons.append("see %s" % out) + against.update(verdict=verdict, regressions=regs, reasons=reasons, + headline=doc.get("headline", "")) + rows.append((b["id"], verdict, doc.get("headline", ""))) + + if rows: + print("\nagainst %s (%s):" % (label, ref_dir)) + for bid, verdict, head in rows: + print(" %-10s %-12s %s" % (bid, verdict, head)) + for r in results: + a = r.get("against") or {} + if a.get("verdict") not in (None, "PASS"): + print("\n%s against %s: %s" % (r["build"]["id"], label, a["verdict"])) + for reason in a["reasons"]: + print(" - %s" % reason) + + +def trim_reference_cache(cache): + """Shrink a reference cache to what a later comparison reads (stamps, end + points, instances, area) before CI saves it. A build that did not finish + is removed whole, so the next run under the same key rebuilds it clean + instead of resuming from a tree whose generated sources are gone.""" + for ref in glob.glob(os.path.join(cache, "[0-9a-f]" * 12)): + shutil.rmtree(os.path.join(ref, "src"), ignore_errors=True) + works = glob.glob(os.path.join(ref, "build*", "hw", "syn", "*", "logic_gate*_*")) \ + + glob.glob(os.path.join(ref, "build*", "hw", "syn", "*", "dut", "logic_gate*_*")) + for work in [w for w in works if os.path.isdir(w)]: + stamps = glob.glob(os.path.join(work, "logic_gate*.json")) + try: + with open(stamps[0]) as fh: + done = json.load(fh).get("status") == "done" + except (IndexError, OSError, ValueError): + done = False + if not done: + shutil.rmtree(work) + continue + for top, dirs, files in os.walk(work): + for d in [d for d in dirs if d == "src"]: + shutil.rmtree(os.path.join(top, d)) + dirs.remove(d) + for f in files: + if f.endswith((".mlir", ".mlirbc")) or \ + f in ("paths.jsonl", "sources.txt", "sources.f"): + os.remove(os.path.join(top, f)) + + +def reference_cache_done(cache): + """The finished reference builds in a cache, one line each: the stamp's + path and the config hash it was measured under.""" + done = [] + for stamp in glob.glob(os.path.join(cache, "*", "build*", "hw", "syn", "**", + "logic_gate*.json"), recursive=True): + try: + with open(stamp) as fh: + doc = json.load(fh) + except (OSError, ValueError): + continue + if doc.get("status") == "done": + done.append("%s %s" % (os.path.relpath(stamp, cache), doc.get("config_hash"))) + return sorted(done) + + +def reference_cache_id(done): + """A digest of reference_cache_done()'s lines: CI saves a cache under it + once the set has grown, so a later push can save the builds an earlier + one did not finish, under a new key.""" + return hashlib.sha256("\n".join(done).encode()).hexdigest()[:16] + + +def merge_against(results): + """Fold each build's verdict against the reference into its verdict: a + failing one replaces a passing baseline verdict, and every reason is + kept.""" + for r in results: + a = r.get("against") + if not a or a["verdict"] == "PASS": + continue + if a["verdict"] not in PASSING and r["verdict"] in PASSING: + r["verdict"] = a["verdict"] + r["reasons"] = r["reasons"] + ["against %s: %s" % (a["reference"], x) + for x in a["reasons"]] # --------------------------------------------------------------------------- @@ -1505,17 +2247,38 @@ def main(argv=None, default_tool="xilinx"): % (",".join(tool.gated), default_tool)) ap.add_argument("--update-baseline", action="store_true", help="record this run's metrics as the new golden baseline. " - "Human-reviewed; CI must never pass this.") + "Human-reviewed; CI must never pass this. With " + "--against-rev, the regressions against that revision " + "are recorded as accepted") + ap.add_argument("--baseline-dir", metavar="DIR", + help="read and write the baselines under DIR// " + "instead of ci/baselines/synthesis//, e.g. to " + "propose baselines for review outside the tree") ap.add_argument("--build-dir", metavar="DIR", help="build tree to synthesize in (default: " "/build_, configured on demand)") ap.add_argument("--against", metavar="DIR", help="Beacon only: the build tree of a reference run, " "typically the parent revision's; each build's end " - "points are compared register by register, and its " - "area by unit, with the same build there " - "(ci/beacon.py diff); a register that got deeper, or " - "area grown past the tolerance, fails the run") + "points are compared register by register, its " + "area by resource and unit (ci/beacon.py diff), and " + "its harness's constant ties, with the same build " + "there; a register that got deeper, area grown past " + "the tolerance, or changed ties fail the run") + ap.add_argument("--against-rev", metavar="REV", + default=os.environ.get(AGAINST_REV_ENV) or None, + help="Beacon only: as --against, with the reference built " + "here first from REV's RTL (%s) under this " + "checkout's flow, so a change is judged against its " + "merge base and not only against a baseline it may " + "have re-recorded itself (default: $%s)" + % (", ".join(REF_PATHS), AGAINST_REV_ENV)) + ap.add_argument("--ref-cache", metavar="DIR", + help="where --against-rev keeps its reference trees, one " + "per revision (default: $%s, else /.beacon_ref)" + % REF_CACHE_ENV) + ap.add_argument("--measure-only", action="store_true", + help=argparse.SUPPRESS) ap.add_argument("--configs", metavar="FLAGS", default="", help="extra -D flags appended to every selected build's " "configs, for a non-default configuration: run the " @@ -1566,7 +2329,7 @@ def main(argv=None, default_tool="xilinx"): args.metric_threshold = overrides root = source_root() - builds = load_catalog(root, tool, args.xlen) + builds = load_catalog(root, tool, args.xlen, args.baseline_dir) if args.matrix: # Ordered longest-first so the slowest DUT is dispatched into the fan-out @@ -1596,8 +2359,11 @@ def main(argv=None, default_tool="xilinx"): return 0 tool.check_env() - if args.against and tool.name != "beacon": - sys.exit("ERROR: --against compares Beacon runs; use it with --tool=beacon") + if args.measure_only: + args.against = args.against_rev = None + if (args.against or args.against_rev) and not tool.name.startswith("beacon"): + sys.exit("ERROR: --against compares Beacon runs; use it with --tool=beacon " + "or --tool=beacon_asic") if args.configs and args.update_baseline: sys.exit("ERROR: --configs cannot record a baseline: the catalog " "baselines are the catalog configurations") @@ -1623,10 +2389,22 @@ def main(argv=None, default_tool="xilinx"): # One configured build tree per ISA width: a build that pins its own xlen # runs in that width's tree. xlens = sorted({b["xlen"] for b in selected}) - if len(xlens) > 1 and (args.build_dir or args.against): + if len(xlens) > 1 and (args.build_dir or args.against or args.against_rev): sys.exit("ERROR: --build-dir/--against name one build tree, and the " "selected builds span xlen %s; select one width" % "/".join(map(str, xlens))) + if args.against and not os.path.isdir(args.against): + print("ERROR: --against %s is not a build tree" % args.against) + return 2 + # ref_lock stays held (shared) until the run ends, while the reference is read. + against_sha, absent, ref_rc, ref_lock = None, set(), 0, None + if args.against_rev and not args.dry_run: + try: + args.against, against_sha, absent, ref_rc, ref_lock = reference_tree( + root, args.against_rev, args, tool, selected, xlens[0]) + except (RefError, subprocess.CalledProcessError) as e: + print("ERROR: reference %s: %s" % (args.against_rev, e)) + return 2 results = [] for xlen in xlens: build_dir = args.build_dir or os.path.join( @@ -1640,14 +2418,18 @@ def main(argv=None, default_tool="xilinx"): results.sort(key=lambda r: r["build"]["id"]) gated = tuple(m for m in (args.gate.split(",") if args.gate else tool.gated) if m) - outcomes = report(results, env, args, gated, tool, args.update_baseline) - failures = [o for o in outcomes if o[1] not in PASSING] + mode = ("measure" if args.measure_only else + "record" if args.update_baseline else "gate") + report(results, env, args, gated, tool, mode) if args.against: - failures += compare_against(results, args.against, tool) + compare_against(results, args.against, tool, env, root, against_sha, + absent) + if mode == "gate": + merge_against(results) ok = [r for r in results if r["metrics"]] if args.update_baseline and ok: - save_baselines(root, tool, ok, env) + save_baselines(root, tool, ok, env, args.baseline_dir) if args.report: with open(args.report, "w") as fh: @@ -1655,21 +2437,32 @@ def main(argv=None, default_tool="xilinx"): "tolerance": args.threshold, "metric_thresholds": args.metric_threshold, "gated": list(gated), + "against": against_sha or args.against, "builds": [report_entry(r, env, tool) for r in results]}, fh, indent=2) fh.write("\n") print("\nwrote %s" % args.report) - - if args.update_baseline: + if mode != "gate": # Recording IS the intent; a delta is what we just wrote down. A build # that never produced metrics is still a failure, `known_issue` or not: # there is nothing to record, so excusing it would end the run claiming # a baseline it did not write. Same reasoning as the BUILD-FAIL verdict # in gate(). broken = [r for r in results if not r["metrics"]] - return 2 if broken else 0 - if any(v == "BUILD-FAIL" for _, v, _ in failures): + return 2 if broken or ref_rc else 0 + + counts = {} + for r in results: + counts[r["verdict"]] = counts.get(r["verdict"], 0) + 1 + failures = [r for r in results if r["verdict"] not in PASSING] + print("\n%s: %d builds%s%s -- %s" + % (tool.gate, len(results), + "".join(", %d %s" % (n, v) for v, n in sorted(counts.items())), + ", the reference run failed (exit %d)" % ref_rc if ref_rc else "", + "FAILED" if failures or ref_rc else "passed")) + # A build error on either side means the change was not gated. + if ref_rc or any(r["verdict"] in ("BUILD-FAIL", "REF-FAIL") for r in failures): return 2 return 1 if failures else 0 diff --git a/ci/synth_report.py b/ci/synth_report.py index dbfe8fa35b..4b94e06406 100755 --- a/ci/synth_report.py +++ b/ci/synth_report.py @@ -26,7 +26,8 @@ # Same contract as synth_gate.PASSING: a tracked known issue and an unexpected # pass are reported, not failed. -PASSING = ("PASS", "RECORDED", "KNOWN-ISSUE", "XPASS") +PASSING = ("PASS", "RECORDED", "KNOWN-ISSUE", "XPASS", "ACCEPTED", + "NO-REFERENCE") # Every metric any tool records, shown in this order when a build reports it. COLUMNS = (("Fmax (MHz)", "fmax_mhz", "%.1f"), @@ -45,7 +46,12 @@ ("DSP", "dsp", "%d"), ("Max levels", "max_levels", "%d"), ("End points >= 12", "deep_endpoints", "%d"), - ("End points >= 8", "watch_endpoints", "%d")) + ("End points >= 8", "watch_endpoints", "%d"), + ("p_fmax (MHz)", "pred_fmax_mhz", "%.1f"), + ("Stages", "max_stages", "%d"), + ("Cells (Beacon)", "cells", "%d"), + ("Macros", "macros", "%d"), + ("Tied bits", "tied_bits", "%d")) # Slack sits near zero by design, so a relative change of it says nothing. NO_DELTA = ("wns_ns", "tns_ns") diff --git a/ci/test_runner.py b/ci/test_runner.py index 446d12c1bb..e0eaecc315 100644 --- a/ci/test_runner.py +++ b/ci/test_runner.py @@ -189,5 +189,10 @@ def test_case(case, sim_build, request): _release_parity(case, xlen) return argv, env = case.run_command(xlen) - rc = tc.execute(argv, env) + capture = request.config.pluginmanager.getplugin("capturemanager") + if case.stream and capture is not None: + with capture.global_and_fixture_disabled(): + rc = tc.execute(argv, env) + else: + rc = tc.execute(argv, env) assert rc == 0, "{} failed (exit {}): {}".format(case.id, rc, " ".join(argv)) diff --git a/ci/testcase.py b/ci/testcase.py index 719aad87f4..d15c9de2fa 100644 --- a/ci/testcase.py +++ b/ci/testcase.py @@ -143,6 +143,10 @@ def __init__(self, category, entry, driver, defaults, suite=None): # VORTEX_RANDOMIZE_VA). Merged over the CONFIGS env; values are # strings passed through verbatim. self.env = {k: str(v) for k, v in dict(entry.get("env", {})).items()} + # A script case whose output is its report (a gate's verdict table) + # streams it into the CI log; pytest otherwise shows a passing case's + # output nowhere. + self.stream = bool(entry.get("stream", defaults.get("stream", False))) # Stable, unique id: :: self.id = "{}:{}:{}".format(category, entry["id"], self.marker_driver) @@ -626,6 +630,8 @@ def cmd_lint(args): errors.append("{}: make-run case needs 'dir' and 'target'".format(c.id)) if c.via == "script" and not c.run: errors.append("{}: script case missing 'run'".format(c.id)) + if c.stream and c.via != "script": + errors.append("{}: stream applies to script cases only".format(c.id)) if any(int(x) not in (32, 64) for x in c.xlens): errors.append("{}: xlen must be 32 and/or 64".format(c.id)) if c.release_parity: diff --git a/ci/testcases/asic_gate.yaml b/ci/testcases/asic_gate.yaml index 237fadea35..16073d80db 100644 --- a/ci/testcases/asic_gate.yaml +++ b/ci/testcases/asic_gate.yaml @@ -49,6 +49,10 @@ # `VX_cache_wrap #(.PASSTHRU(!`VX_CFG_L2_ENABLED))`, and the Yosys catalog was # missing L2_ENABLE. It now carries the real 256 KB L2, as `gfx` and `tensor` do. # +# logic_gate's `gate_asic` case (ci/logic_gate.py --tool beacon_asic) measures +# these same builds with Beacon on every pull request, in minutes: it takes +# their designs and clock_mhz, not their known_issue or thresholds. +# # See docs/designs/continuous_integration.md §3.5. category: asic_gate defaults: diff --git a/ci/testcases/logic_gate.yaml b/ci/testcases/logic_gate.yaml index 39c16efbde..b06b1105cb 100644 --- a/ci/testcases/logic_gate.yaml +++ b/ci/testcases/logic_gate.yaml @@ -33,14 +33,28 @@ # 300 MHz ones. # # The gate runs with perf_gate: a perf_gate regression is cycles, this one is -# depth and area, and both are asserted on every change to the RTL. Its case -# is on the rtlsim driver at tier smoke, so ci.yml plans its cell exactly when +# depth and area, and both are asserted on every change to the RTL. Its cases +# are on the rtlsim driver at tier smoke, so ci.yml plans its cell exactly when # it plans perf_gate's rtlsim cells (every pull request, every push that # touches the RTL or the config). The cell installs foldsim (`needs`). # +# Two cases, one cell: `gate` measures the builds below on the FPGA flow, and +# `gate_asic` measures asic_gate.yaml's builds on the ASIC flow +# (--tool beacon_asic, ASAP7 cell stages, flip-flops and SRAM macros; its +# baselines are ci/baselines/synthesis/beacon_asic/). On a pull request ci.yml +# also passes the merge base (BEACON_AGAINST_REV, the default of +# --against-rev): each build is compared register by register with the same +# build on the merge base's RTL, so a baseline the pull request re-records +# cannot hide its own deltas. Both stream their output, so the verdict table +# is in the CI log. +# # Run one by name: ci/logic_gate.py -b tcu +# Against master: ci/logic_gate.py -b tcu --against-rev $(git merge-base HEAD origin/master) # By hand, no gate: make -C hw/syn/xilinx/dut tcu-beacon # Re-record: ci/logic_gate.py --update-baseline (human-reviewed, never CI) +# In a pull request, add --against-rev : the +# regressions against it are recorded as accepted, and the +# baseline diff is their review. # --------------------------------------------------------------------------- category: logic_gate defaults: @@ -58,7 +72,19 @@ tests: driver: rtlsim needs: - foldsim - run: ci/logic_gate.py -j 2 + stream: true + run: ci/logic_gate.py -j 2 --report logic_gate.json + +# asic_gate.yaml's 14 builds: 7 minutes at -j 2, 5.4 GB peak per build. Its +# predicted Fmax is held to their clock_mhz with a wide band, as a backstop; +# flip-flops and cells to the baseline. +- id: gate_asic + tier: smoke + driver: rtlsim + needs: + - foldsim + stream: true + run: ci/logic_gate.py --tool beacon_asic -j 2 --report logic_gate_asic.json # The full-GPU builds (group gpu, below): ~30 min and ~95 GB of memory each, # so one at a time, on a large self-hosted machine -- never a hosted runner. diff --git a/docs/designs/beacon.md b/docs/designs/beacon.md index fd6a2ee04a..7a1d5c5d80 100644 --- a/docs/designs/beacon.md +++ b/docs/designs/beacon.md @@ -43,16 +43,19 @@ make -C hw/syn/xilinx/dut tcu-beacon # build_tcu/beacon_area.txt LUTs, FFs, memories and DSPs, by unit; each memory's placement ``` -The whole catalog as a gate, and a baseline update (a human step): +The whole catalog as a gate, on the FPGA and the ASIC flow, against the +merge base as a pull request is judged, and a baseline update (a human step): ```bash ci/logic_gate.py -j 2 +ci/logic_gate.py --tool beacon_asic -j 2 +ci/logic_gate.py -j 2 --against-rev $(git merge-base HEAD origin/master) ci/logic_gate.py -b om --update-baseline ``` Any CIRCT netlist, with `ci/beacon.py` (subcommands `run`, `summarize`, `paths`, `validate`, `retime-split`, `ports`, `buffers`, -`calibrate`, `score`; +`calibrate`, `score`, `diff`, `asic-summary`, `ties`; `foldsim-opt` from the `PATH` or `FOLDSIM_OPT`): ```bash @@ -497,12 +500,26 @@ four minutes, and checks each against `ci/baselines/synthesis/beacon/`: 5 % below is an improvement to lock in. A memory that moves between distributed and block RAM shows as both columns moving. +- the **harness**: the instance-input bits the DUT top ties to constants + (`ci/beacon.py ties`, column `tied`) must not change from the baseline. + Vivado and Yosys fold the logic behind a tied input; Beacon maps module + by module and does not, so a harness edit makes the synthesis gates + measure a different design while Beacon's numbers stay put. A tied count + that moves needs a reviewed look at the synthesis budgets, then a + re-record. (A tex wrapper that zero-extended 128 LOD bits read 129 tied + bits, the corrected one 1; Vivado's LUTs moved 28 % and Beacon's not at + all.) + A failing build names its `beacon_paths.txt`, where the failing unit is a heading with its paths op by op, its `beacon_area.txt`, and its `beacon_risk.txt`, the registers the learned calibration (§7.1) predicts slowest; CI uploads them with the build's logs. The calibration's Fmax and count of likely failures are columns of the report (`p_fmax`, `risk`), not -gated: a wire-dominated path that levels rank low shows there first. +gated: a wire-dominated path that levels rank low shows there first. A +`p_fmax` below the build's clock is printed as an advisory line, never a +verdict: held to the clock (2 % below), it failed 7 builds Vivado closed +against 3 it did not, among them the known-good core, at 285.6 MHz on both +sides of a fix that took Vivado from 286 to 298 MHz. Depth is deterministic, so the tolerance is zero. Area is as deterministic, but a feature adds some by design, so it has the Fmax gate's @@ -511,26 +528,104 @@ is the CIRCT and foldsim versions, `DEVICE` and `XLEN`: a new foldsim reads as STALE, not as a regression. Baselines are golden data, re-recorded only by a human (`--update-baseline`), as for the other gates. +**ASIC (`--tool beacon_asic`).** The same gate on `asic_gate.yaml`'s builds, +through the ASIC flow's `beacon` target (§6.1, ASAP7, §4.3), with its own +baselines (`ci/baselines/synthesis/beacon_asic/`). The FPGA builds use the +DSP FPU and a DSP multiplier, so the STD FPU and the ASIC multiplier tree, +where `asic_gate` misses timing, are only elaborated here. The 14 builds take +7 minutes at `-j 2` (the FPGA catalog 9), with at most 5.4 GB per process. + +- **flip-flops and cells** within 5 % of the baseline, both ways, as the FPGA + area. A memory without a macro is priced as flip-flops (Yosys builds it + so): an asynchronous read that left an SRAM macro read +17 % flip-flops on + the cache, named `g_mask_async.byteen_store`, where `asic_gate` measured + +22 % area the next night. SRAM macros are reported, not gated: a memory + that moves into a macro adds one and removes its flip-flops (the fix of + that cache took it from 32 to 36). +- **predicted Fmax** no more than 32 % below `clock_mhz`. Beacon's period + runs 0.59–1.05 × OpenSTA's (it prices vm's L2 TLB MRU update at 46 stages, + 749 MHz, where STA closes at 1266 MHz), so the band is a backstop for a + path no model error explains, not a timing verdict. Over every validated + pair of a design and a target, the lowest prediction of a design STA + closes is 0.749 of its target (vm, and top after the FPU fix, at 1 GHz), + the highest of one that misses badly 0.615 (core and top before it, 492 MHz + at 800); 32 % sits between them with about 10 % margin each side, at both + the 800 MHz and the 1 GHz target. A prediction below the target but inside + the band is printed as an advisory line. +- **the harness's constant ties**, as above. + +`clock_mhz` is not in the ASIC fingerprint: Beacon reads no clock, so a new +target moves the band and the stage thresholds, not the measurements. The +borrowed builds bring their designs and targets, not `asic_gate`'s +`known_issue` or `thresholds`, which describe Yosys's numbers. + +**Against the merge base (`--against-rev REV`).** A baseline recorded on a +change's own head cannot see that change: when Beacon arrived together with +the RTL it should have flagged, its baselines were recorded on that RTL and +the gate compared the head with itself (+0 % by construction). So a pull +request is also judged against its merge base. The reference is REV's +design (`hw/rtl`, `hw/unittest`, `hw/dpi`, `hw/syn/libs/no_mem`, the +configuration TOMLs, and the submodules at the commits REV pins) under this +checkout's flow (CI, scripts, catalog), so both sides are measured by the +same Beacon. It is staged and built in `//` (`--ref-cache`, +default `.beacon_ref/`, the four most recently used kept), under a lock on +`.lock`, and reused while the flow is unchanged. Each build is then +compared with the same build there by `beacon.py diff` (§6.3), and its +tied bits with the reference's. Only registers at or above the watch +threshold in either run count (8 levels; on the ASIC flow the stages that +fit 90 % of the period, 38 at 800 MHz and 28 at 1 GHz): + +| verdict | meaning | fails | +|---|---|---| +| `DEEPER` | a watched register 4 or more levels (stages) deeper, or newly at the fix threshold | yes | +| `AREA` | a resource of the design past the 5 % tolerance (on the ASIC flow cells and flip-flops) | yes | +| `HARNESS` | the tied bits changed | yes | +| `REF-FAIL` | the reference did not measure the build: it failed, timed out, or ran under another configuration; the run exits 2, as for a build error | yes | +| `ACCEPTED` | every regression is one the baseline's re-record accepted | no | +| `NO-REFERENCE` | REV has no such DUT, neither in its catalog nor its top module: a DUT the change adds, judged against its baseline alone. A DUT REV has under another top (a renamed harness) is `REF-FAIL` | no | + +A change to the flow itself (source generation, include lists, a pyslang +rule) can leave the merge base's RTL unable to elaborate under it, and then +every build reads `REF-FAIL`. The way out is a pull-request label, +`beacon-skip-reference`, which only a maintainer grants, as a reviewed +decision: `ci.yml` then leaves the merge base unset, and the cell says so in +its log and job summary; the verdict is against the baselines alone. + +On the ASIC flow the thresholds come from the clock: the fix threshold is +the stages that fit the target period with the run's own delays (43 at +800 MHz, 33 at 1 GHz), the watch threshold those that fit 90 % of it. + +**A baseline re-record in a pull request ships its `beacon_diff` against +the merge base.** Re-record with `--update-baseline --against-rev `: the regressions against it are written into each baseline entry +(`accepted`), so the baseline diff under review lists, register by register +and resource by resource, what the change accepts, and CI reads them as +`ACCEPTED`. A later regression the re-record did not see still fails, and +a re-record without `--against-rev` accepts nothing. An acceptance holds +until it lands: once the reference revision's own baseline carries the +same `accepted` entry, the change it accepted is part of the reference, and +it is ignored. + ### 6.3 RTL timing work: Beacon first Beacon is the inner loop of any RTL change that can move timing. A DUT takes minutes in Beacon and hours in Vivado or Yosys, so a deeper path is found and fixed while the change is still open, and synthesis runs once, to confirm. -1. **Reference.** Beacon on the parent revision, once per base, in a build - tree of its own: +1. **Reference and change.** Beacon on the parent revision, built once per + base under `.beacon_ref//`, and the same builds on the working tree, + each compared with the reference register by register: ```bash - git worktree add ../ref HEAD - ../ref/ci/logic_gate.py -b core -b lmem --build-dir $PWD/build32_beacon_ref + ci/logic_gate.py -b core -b lmem --against-rev HEAD + ci/logic_gate.py --tool beacon_asic -b core --against-rev HEAD # the ASIC flow ``` -2. **Change.** The same builds on the working tree, each compared with the - reference register by register: + `--against ` compares with a reference run anywhere else + (e.g. `git worktree add ../ref HEAD` and + `../ref/ci/logic_gate.py -b core --build-dir $PWD/build32_beacon_ref`). - ```bash - ci/logic_gate.py -b core -b lmem --against build32_beacon_ref - ``` +2. **Iterate.** Edit and rerun the same command: the reference is reused. A change behind a non-default knob is compared at that setting: give both runs the same `--configs="-D..."`, which appends the flags to every @@ -543,7 +638,8 @@ fixed while the change is still open, and synthesis runs once, to confirm. threshold, before and after; then it lists the registers that got deeper, new deep registers, and the ones that got shallower, then the units whose deepest register moved. With area, the headline adds the LUTs, block RAMs - and DSPs before and after, and a section lists each resource of the + and DSPs (cells, flip-flops and SRAM macros on the ASIC flow) before and + after, and a section lists each resource of the design and the units whose own area moved, all copies; a resource more than 5 % larger fails the run (`AREA`). The run fails (`DEEPER`) on a register 4 or more levels deeper, one that reaches the fix threshold (12) from below, or a new @@ -875,9 +971,18 @@ Beacon cannot answer, run on a checkpoint Vivado's inference rules, and what Vivado packs into DSP, block RAM and SRL cells Beacon counts as fabric. Logic that nothing observable reads is counted; Vivado removes it. -- **Devices.** The V80 and the U55C (Vivado), and ASAP7 RVT TT (the Yosys - flow). The ASAP7 numbers are Beacon's period estimate, a sizing - guide, not a sign-off: they come within about 10–30 % of OpenSTA. +- **Devices.** Every Xilinx family of §4.2 (the gate runs the U55C's, and the + learned calibration exists for it only), and ASAP7 RVT TT (the Yosys + flow). The ASAP7 numbers are Beacon's period estimate, a sizing guide, + not a sign-off: 0.59–1.05 × OpenSTA's Fmax on the 14 `asic_gate` DUTs. Two + known gaps: the 32 × 32 multiplier fed from dispatch reads 28–29 stages + (~900 ps) where OpenSTA has 1318 ps, since the partial-product generator + and the operand fan-out are not priced; and vm's L2 TLB `set_mru` update + reads 46 stages where STA closes it under 800 ps. +- **Harnesses.** A constant on an instance input does not reach the logic + behind it (each module is mapped once), so Beacon measures a unit whole + where Vivado and Yosys fold what a harness ties off. The `ties` count + makes such a harness visible; it does not model the folding. - **Toolchain.** The catalog maps only with three CIRCT Synth fixes (zero-width mux, constant SOP cut, a failing longest-path query), which reach CI through the foldsim prebuilt. diff --git a/docs/designs/continuous_integration.md b/docs/designs/continuous_integration.md index b550453f3d..a4045fd2a6 100644 --- a/docs/designs/continuous_integration.md +++ b/docs/designs/continuous_integration.md @@ -292,13 +292,13 @@ and without synthesis. | | `fpga_gate` | `asic_gate` | `logic_gate` | |---|---|---|---| -| flow | Vivado synthesis, place and route | Yosys (slang frontend) → ABC → OpenSTA, on ASAP7 | CIRCT → `foldsim-estimate-timing` (logic levels as Vivado counts them on `DEVICE`'s family) and `foldsim-estimate-area` (its cells, memories and DSPs) | -| design tree | `hw/syn/xilinx/dut` | `hw/syn/yosys/dut` | `hw/syn/xilinx/dut`, target `beacon` | -| gated | `fmax_mhz` against the target clock, `lut` against `lut_budget` | `fmax_mhz` against the target clock, `cell_area_um2` against `area_budget_um2` | `max_levels` against the baseline, the deepest end point of every RTL unit, and `lut`, `ff`, `lutram`, `bram`, `uram`, `dsp` against the baseline | -| also recorded | `wns_ns`, `lutram`, `ff`, `bram`, `uram`, `dsp`, critical paths, high-fanout nets | `wns_ns`, `tns_ns`, `seq_area_um2`, `sram_area_um2`, `cell_count`, `power_mw` | end point bits at ≥ 12 and ≥ 8 levels, the deepest paths | -| comparable when | same device, optimization level, xlen | same PDK, VT, corner, xlen | same CIRCT, foldsim, xlen | -| runner | self-hosted, licensed Vivado | hosted, one job per design | hosted, one `ci.yml` cell for the catalog, planned with `perf_gate`; the opt-in `gpu` group self-hosted | -| default tolerance | Fmax 2 %, LUT 5 % | Fmax 2 %, cell area 5 % | depth none: Beacon is deterministic; area 5 % | +| flow | Vivado synthesis, place and route | Yosys (slang frontend) → ABC → OpenSTA, on ASAP7 | CIRCT → `foldsim-estimate-timing` (logic levels as Vivado counts them on `DEVICE`'s family; ASAP7 cell stages with `--tool beacon_asic`) and `foldsim-estimate-area` (its cells, memories and DSPs) | +| design tree | `hw/syn/xilinx/dut` | `hw/syn/yosys/dut` | `hw/syn/xilinx/dut` (`fpga_gate`'s builds) and `hw/syn/yosys/dut` (`asic_gate`'s), target `beacon` | +| gated | `fmax_mhz` against the target clock, `lut` against `lut_budget` | `fmax_mhz` against the target clock, `cell_area_um2` against `area_budget_um2` | FPGA: `max_levels` against the baseline, the deepest end point of every RTL unit, and `lut`, `ff`, `lutram`, `bram`, `uram`, `dsp` against the baseline. ASIC: `ff` and `cells` against the baseline, predicted `fmax_mhz` against the target clock (wide band). Both: the harness's tied bits against the baseline, and on a pull request every register and resource against the merge base | +| also recorded | `wns_ns`, `lutram`, `ff`, `bram`, `uram`, `dsp`, critical paths, high-fanout nets | `wns_ns`, `tns_ns`, `seq_area_um2`, `sram_area_um2`, `cell_count`, `power_mw` | end point bits at ≥ 12 and ≥ 8 levels, the deepest paths, the calibrated `p_fmax`; ASIC: stages, period, SRAM macros | +| comparable when | same device, optimization level, xlen | same PDK, VT, corner, xlen | same CIRCT, foldsim, device or PDK, xlen | +| runner | self-hosted, licensed Vivado | hosted, one job per design | hosted, one `ci.yml` cell for both catalogs, planned with `perf_gate`; the opt-in `gpu` group self-hosted | +| default tolerance | Fmax 2 %, LUT 5 % | Fmax 2 %, cell area 5 % | depth none: Beacon is deterministic; area 5 %; ASIC predicted Fmax 32 % | The synthesis gates are not pytest cells. A cell is a build tree plus a driver; a synthesis build is neither, and it is hours long. They are standalone scripts @@ -307,11 +307,14 @@ selection means "everything a cell can run", which excludes them. `logic_gate` is a cell, because it guards what `perf_gate` guards from the other side: perf_gate catches a change that costs cycles, logic_gate one that -costs depth or area. Its `gate` case is a script case on the rtlsim driver at -tier smoke, so the planner schedules its cell exactly when it schedules -perf_gate's rtlsim cells: every pull request, and every push whose diff forces -rtlsim in (the RTL or the config). The cell installs foldsim and pyslang -(`needs: foldsim`). Only its `gpu` case stays opt-in, in tier `timing_gpu`. +costs depth or area. Its `gate` (FPGA flow) and `gate_asic` (ASIC flow) +cases are script cases on the rtlsim driver at tier smoke, so the planner +schedules its cell exactly when it schedules perf_gate's rtlsim cells: every +pull request, and every push whose diff forces rtlsim in (the RTL or the +config). The cell installs foldsim and pyslang (`needs: foldsim`). Only its +`gpu` case stays opt-in, in tier `timing_gpu`. Both cases set `stream`, so +their output, the verdict table among it, is in the job log rather than in +pytest's capture, which shows a passing case's output nowhere. #### One implementation, two adapters @@ -329,7 +332,7 @@ entry points that pin the tool. | file | written by | holds | |---|---|---| | `ci/testcases/{fpga,asic,logic}_gate.yaml` | a person | per build: a design, a target clock, an area budget (synthesis gates), `CONFIGS`, a group, optional `thresholds`, `known_issue`, `xlen`, `profile` and `opt_in` | -| `ci/baselines/synthesis/{xilinx,yosys,beacon}/.json` | the gate | measured metrics, the config hash, the tool versions and environment | +| `ci/baselines/synthesis/{xilinx,yosys,beacon,beacon_asic}/.json` | the gate | measured metrics, the config hash, the tool versions and environment | Groups are `core`, `tensor`, `graphics`, `dxa` and `vm`, plus `logic_gate`'s opt-in `gpu`. `asic_gate` uses the @@ -397,8 +400,9 @@ slack: it does not see wires, so it gates depth, which it predicts (Spearman the DUT flow's `DEVICE` (the U55C by default), which `gen_platform.py --emit=family` reads from `hw/syn/xilinx/platforms`; the device is part of the baseline fingerprint, as it is for `fpga_gate`. -Beacon has profiles for the V80 and the U55C only, and fails on any other -`DEVICE`. A +Beacon has a profile for every Xilinx family (Versal and the UltraScale+ +families) and for ASAP7, and fails on any other target; the learned +calibration exists for the U55C only. A **unit** is an end point's instance path with generate indices folded (`g_banks_3_bank` → `g_banks_*_bank`). @@ -409,6 +413,10 @@ Beacon has profiles for the V80 and the U55C only, and fails on any other | a shallower unit, or one that drops below the watch threshold (8), reads `IMPROVED` | the gain must be recorded | | no output of a build's `interfaces` modules reached combinationally from outside the instance in more bits than its baseline | modules register their outgoing interfaces: a path that runs through a core, socket or cluster boundary is what fails routing across SLRs, and Beacon names it by port | | no resource of the design (`lut`, `ff`, `lutram`, `bram`, `uram`, `dsp`) more than 5 % above its baseline | area found in minutes, not in a nightly Vivado run; a memory that moves between distributed and block RAM moves two columns, and `beacon_area.txt` names each memory's placement | +| the harness ties as many instance-input bits to constants as at its baseline (`tied`) | synthesis folds the logic behind a tied input and Beacon does not, so a harness edit makes `fpga_gate`/`asic_gate` measure a different design while Beacon's numbers stay put; the change needs a reviewed budget, then a re-record | +| ASIC (`gate_asic`): flip-flops and cells within 5 % of the baseline | a memory that leaves its SRAM macro, or one Yosys must build from flip-flops, found before the nightly `asic_gate` | +| ASIC: predicted Fmax no more than 32 % below `clock_mhz` | a backstop for a path far too deep to close; Beacon's period runs 0.59–1.05 × OpenSTA's, so a tighter band fails designs that close ([beacon.md §6.2](beacon.md)) | +| on a pull request: no register at or above the watch threshold (8 levels; ASIC: the stages that fit 90 % of the period, 28 at 1 GHz) 4 or more levels (stages) deeper than on the merge base, none newly at the fix threshold, no resource past 5 %, the same tied bits; a reference that failed fails (`REF-FAIL`) | a baseline the pull request re-records cannot hide the pull request's own deltas | Beside the assertions, each build reports what levels miss: the learned calibration ([beacon.md §7.1](beacon.md)) scores every register from its @@ -426,6 +434,51 @@ Beacon's mapping (`BEACON_INTERFACES` in the DUT flow), and `ports.csv` counts, per output port, the bits a combinational path from outside the instance reaches. +#### Against the merge base + +On a pull request, `ci.yml` computes `git merge-base HEAD origin/` +(the checkout is the merge commit, so that is the target's head it merged +into) and passes it as `BEACON_AGAINST_REV`, the default of +`ci/logic_gate.py --against-rev`. The gate then stages the merge base's +design (`hw/rtl`, `hw/unittest`, `hw/dpi`, `hw/syn/libs/no_mem`, the +configuration TOMLs, the submodules it pins) under the pull request's own +flow, measures the same builds there, and compares each build register by +register (`beacon_diff.txt`). A DUT the merge base does not have, neither +in its catalog nor as a top module, reads `NO-REFERENCE` and is judged +against its baseline alone; any other +build the reference could not measure is `REF-FAIL`, and the cell fails +as on a build error. + +A flow change the merge base's RTL cannot elaborate under (a new source +generation step, an include list, a pyslang rule) reads `REF-FAIL` on every +push. For that case a maintainer may grant the pull-request label +`beacon-skip-reference`; granting it is a reviewed maintainer action, like +a `known_issue`. `ci.yml` reads it from the event's payload, so it takes +effect on the next push: the merge base is not passed, and the cell prints +a warning in its log and job summary that its verdict is against the +baselines alone. Without it the gate compares a head with +baselines the same head may have recorded; that is how Beacon passed the +RTL it arrived with at +0 %. The reference's builds are cached by the merge +base's SHA and a fingerprint of the flow, so the pull request's next push +reuses them; the first run of a pull request costs about twice the cell. +The cache is saved even when the cell fails, without the builds that did +not finish, which rerun clean. + +The rule: **a baseline re-record in a pull request ships its `beacon_diff` +against the merge base.** `--update-baseline --against-rev ` +writes the regressions against it into each baseline entry (`accepted`), so +the reviewed baseline diff names every register and resource it accepts, +and the cell reads them as `ACCEPTED`. Anything the re-record did not see +still fails; a re-record without `--against-rev` accepts nothing. The +acceptance lapses once it lands: when the merge base's own baseline carries +it, the regression is part of the merge base. + +The cell writes `logic_gate.json` and `logic_gate_asic.json`, renders them +into the job summary, and uploads per build its log, `beacon_diff.txt`, +`beacon_area.txt`, `beacon_risk.txt` and `beacon_paths.txt` (the ASIC +flow's `beacon/report.txt` and `beacon/area.txt`) as the +`logic-gate-` artifact. + Depth has no tolerance: the same RTL and tools give the same levels. Area is as deterministic, but a feature adds some by design, so it has `fpga_gate`'s LUT tolerance; its LUTs are the area mapping's scaled to Vivado's average @@ -610,11 +663,12 @@ adding it: an over-budget design costs a silent job kill, not a red gate. Manual dispatch only: the gate itself runs in `ci.yml` as the `logic_gate` cell (§3.5). A dispatch runs Beacon on the catalog, or on the builds it names, in one hosted job: it restores the toolchain, installs foldsim -(`ci/toolchain_install.sh --foldsim`), runs the catalog's `run:` command with -`--report`, and renders the report with +(`ci/toolchain_install.sh --foldsim`), runs the catalog's `run:` command +(`gate`, or `gate_asic` with `asic: true`; `against` adds `--against-rev`), +and renders its report with [`synth_report.py`](../../ci/synth_report.py) into the workflow summary. The -artifacts are the report and, per design, the build log, the summary and -Beacon's deepest paths. +artifacts are the report and, per design, the build log, the summary, +Beacon's deepest paths and the diff against the reference. A manual dispatch with `gpu: true` runs the catalog's `gpu` case instead, on the self-hosted machine: one build at a time, up to two hours each, since each From b46f133a8034f6c312b3b37a1eea7da28b8379df Mon Sep 17 00:00:00 2001 From: tinebp Date: Sat, 14 Nov 2026 13:20:41 -0800 Subject: [PATCH 02/11] pe_serializer: select the bypass buffer through an OUT_BUF code, drop OUT_SKID VX_pe_serializer had two parameters for one choice, OUT_BUF and a separate OUT_SKID flag, and every FPU core passed OUT_BUF (0) with OUT_SKID (1). OUT_BUF already encodes the output buffer kind (size, register depth, LUTRAM), so the bypass buffer becomes one more code in that encoding: bit 4, `OUT_BUF_BYPASS = (16|1)`. A module without a bypass buffer reads the low bits and falls back to one registered entry. The FPU cores pass `OUT_BUF_BYPASS. The generated netlist is the same: the same VX_bypass_buffer under the same g_out_skid generate block, whose nets the synthesis baselines record. Co-Authored-By: Claude Opus 5.5 --- docs/designs/floating_point_unit.md | 2 +- hw/rtl/VX_platform.vh | 6 ++++++ hw/rtl/fpu/VX_fpu_dsp.sv | 18 ++++++------------ hw/rtl/fpu/VX_fpu_std.sv | 15 +++++---------- hw/rtl/libs/VX_pe_serializer.sv | 14 +++++--------- 5 files changed, 23 insertions(+), 32 deletions(-) diff --git a/docs/designs/floating_point_unit.md b/docs/designs/floating_point_unit.md index d749a7732b..f2df789672 100644 --- a/docs/designs/floating_point_unit.md +++ b/docs/designs/floating_point_unit.md @@ -229,7 +229,7 @@ counted from the last batch: | `L + 1` | the response arbiter's registered output, read by the commit arbiter or the lane gather | Every core ends in a zero-latency skid register (`VX_bypass_buffer`; the -serializer's `OUT_SKID`). A result passes it in the cycle the core produces +serializer's `OUT_BUF` bypass code, `` `OUT_BUF_BYPASS ``). A result passes it in the cycle the core produces it, so the register costs no latency; with the default tag store of two entries (§10) every cycle of latency is a cycle of FPU throughput. It stays because its ready is registered, and that ready drives the core's clock diff --git a/hw/rtl/VX_platform.vh b/hw/rtl/VX_platform.vh index e88862fccd..82105b932d 100644 --- a/hw/rtl/VX_platform.vh +++ b/hw/rtl/VX_platform.vh @@ -320,6 +320,12 @@ // lut(x): (x & 8) != 0 `define TO_OUT_BUF_LUTRAM(s) ((s & 8) != 0) +// bypass(x): (x & 16) != 0, a one-entry VX_bypass_buffer: zero latency, the +// input ready registered, the output not. A module without that buffer reads +// the low bits and falls back to one registered entry. +`define TO_OUT_BUF_BYPASS(s) ((s & 16) != 0) +`define OUT_BUF_BYPASS (16 | 1) + `define MP_REPEAT(n,f,s) `_MP_REPEAT_``n(f,s) `define _MP_REPEAT_0(f,s) `define _MP_REPEAT_1(f,s) `f(0) diff --git a/hw/rtl/fpu/VX_fpu_dsp.sv b/hw/rtl/fpu/VX_fpu_dsp.sv index 785acd40fe..6099ee9c20 100644 --- a/hw/rtl/fpu/VX_fpu_dsp.sv +++ b/hw/rtl/fpu/VX_fpu_dsp.sv @@ -168,8 +168,7 @@ module VX_fpu_dsp import VX_gpu_pkg::*, VX_fpu_pkg::*; #( .SHARED_WIDTH (INST_FPU_BITS+1+INST_FMT_BITS+INST_FRM_BITS), .TAG_WIDTH (TAG_WIDTH), .PE_REG (0), - .OUT_BUF (0), - .OUT_SKID (1), + .OUT_BUF (`OUT_BUF_BYPASS), .PE_ENABLES (NUM_PES_FMA) ) pe_ser ( .clk (clk), @@ -327,8 +326,7 @@ module VX_fpu_dsp import VX_gpu_pkg::*, VX_fpu_pkg::*; #( .SHARED_WIDTH (INST_FPU_BITS+1+INST_FRM_BITS), .TAG_WIDTH (TAG_WIDTH), .PE_REG (0), - .OUT_BUF (0), - .OUT_SKID (1), + .OUT_BUF (`OUT_BUF_BYPASS), .PE_ENABLES (NUM_PES_FMA64) ) pe_ser ( .clk (clk), @@ -472,8 +470,7 @@ module VX_fpu_dsp import VX_gpu_pkg::*, VX_fpu_pkg::*; #( .SHARED_WIDTH (INST_FMT_BITS+INST_FRM_BITS), .TAG_WIDTH (TAG_WIDTH), .PE_REG (0), - .OUT_BUF (0), - .OUT_SKID (1), + .OUT_BUF (`OUT_BUF_BYPASS), .PE_ENABLES (NUM_PES_DIV) ) div_pe_ser ( .clk (clk), @@ -562,8 +559,7 @@ module VX_fpu_dsp import VX_gpu_pkg::*, VX_fpu_pkg::*; #( .SHARED_WIDTH (INST_FMT_BITS+INST_FRM_BITS), .TAG_WIDTH (TAG_WIDTH), .PE_REG (0), - .OUT_BUF (0), - .OUT_SKID (1), + .OUT_BUF (`OUT_BUF_BYPASS), .PE_ENABLES (NUM_PES_SQRT) ) sqrt_pe_ser ( .clk (clk), @@ -672,8 +668,7 @@ module VX_fpu_dsp import VX_gpu_pkg::*, VX_fpu_pkg::*; #( .SHARED_WIDTH (INST_FPU_BITS+2*INST_FMT_BITS+INST_FRM_BITS), .TAG_WIDTH (TAG_WIDTH), .PE_REG (0), - .OUT_BUF (0), - .OUT_SKID (1), + .OUT_BUF (`OUT_BUF_BYPASS), .PE_ENABLES (NUM_PES_CVT) ) pe_ser ( .clk (clk), @@ -774,8 +769,7 @@ module VX_fpu_dsp import VX_gpu_pkg::*, VX_fpu_pkg::*; #( .SHARED_WIDTH (INST_FPU_BITS+INST_FMT_BITS+INST_FRM_BITS), .TAG_WIDTH (TAG_WIDTH), .PE_REG (0), - .OUT_BUF (0), - .OUT_SKID (1), + .OUT_BUF (`OUT_BUF_BYPASS), .PE_ENABLES (NUM_PES_NCP) ) pe_ser ( .clk (clk), diff --git a/hw/rtl/fpu/VX_fpu_std.sv b/hw/rtl/fpu/VX_fpu_std.sv index f6a9e6316c..e003584354 100644 --- a/hw/rtl/fpu/VX_fpu_std.sv +++ b/hw/rtl/fpu/VX_fpu_std.sv @@ -165,8 +165,7 @@ module VX_fpu_std import VX_gpu_pkg::*, VX_fpu_pkg::*; #( .SHARED_WIDTH (INST_FPU_BITS+1+INST_FMT_BITS+INST_FRM_BITS), .TAG_WIDTH (TAG_WIDTH), .PE_REG (0), - .OUT_BUF (0), - .OUT_SKID (1) + .OUT_BUF (`OUT_BUF_BYPASS) ) pe_ser ( .clk (clk), .reset (reset), @@ -315,8 +314,7 @@ module VX_fpu_std import VX_gpu_pkg::*, VX_fpu_pkg::*; #( .SHARED_WIDTH (INST_FPU_BITS+1+INST_FRM_BITS), .TAG_WIDTH (TAG_WIDTH), .PE_REG (0), - .OUT_BUF (0), - .OUT_SKID (1) + .OUT_BUF (`OUT_BUF_BYPASS) ) pe_ser ( .clk (clk), .reset (reset), @@ -406,8 +404,7 @@ module VX_fpu_std import VX_gpu_pkg::*, VX_fpu_pkg::*; #( .SHARED_WIDTH (1+INST_FMT_BITS+INST_FRM_BITS), .TAG_WIDTH (TAG_WIDTH), .PE_REG (0), - .OUT_BUF (0), - .OUT_SKID (1) + .OUT_BUF (`OUT_BUF_BYPASS) ) pe_ser ( .clk (clk), .reset (reset), @@ -491,8 +488,7 @@ module VX_fpu_std import VX_gpu_pkg::*, VX_fpu_pkg::*; #( .SHARED_WIDTH (INST_FPU_BITS+2*INST_FMT_BITS+INST_FRM_BITS), .TAG_WIDTH (TAG_WIDTH), .PE_REG (0), - .OUT_BUF (0), - .OUT_SKID (1) + .OUT_BUF (`OUT_BUF_BYPASS) ) pe_ser ( .clk (clk), .reset (reset), @@ -594,8 +590,7 @@ module VX_fpu_std import VX_gpu_pkg::*, VX_fpu_pkg::*; #( .SHARED_WIDTH (INST_FPU_BITS+INST_FMT_BITS+INST_FRM_BITS), .TAG_WIDTH (TAG_WIDTH), .PE_REG (0), - .OUT_BUF (0), - .OUT_SKID (1) + .OUT_BUF (`OUT_BUF_BYPASS) ) pe_ser ( .clk (clk), .reset (reset), diff --git a/hw/rtl/libs/VX_pe_serializer.sv b/hw/rtl/libs/VX_pe_serializer.sv index 03029407aa..68a3cceea0 100644 --- a/hw/rtl/libs/VX_pe_serializer.sv +++ b/hw/rtl/libs/VX_pe_serializer.sv @@ -24,9 +24,6 @@ module VX_pe_serializer #( parameter TAG_WIDTH = 0, parameter PE_REG = 0, parameter OUT_BUF = 0, - // a zero-latency skid register on the output in place of OUT_BUF: the - // input ready is registered, the output is not - parameter OUT_SKID = 0, // copies of the PE clock enable, each its own net parameter PE_ENABLES = 1 ) ( @@ -74,10 +71,11 @@ module VX_pe_serializer #( wire valid_out_n; localparam DEPTH = PE_REG + LATENCY; + localparam OUT_BYPASS = `TO_OUT_BUF_BYPASS(OUT_BUF); // The skid's registered enable also reads the stage before the last. - localparam NUM_TAPS = (OUT_SKID != 0 && DEPTH > 1 && NUM_LANES == NUM_PES) ? 2 : 1; + localparam NUM_TAPS = (OUT_BYPASS && DEPTH > 1 && NUM_LANES == NUM_PES) ? 2 : 1; - `STATIC_ASSERT (OUT_SKID == 0 || DEPTH != 0, ("invalid parameter")) + `STATIC_ASSERT (!OUT_BYPASS || DEPTH != 0, ("invalid parameter")) wire [NUM_TAPS-1:0][1 + NUM_PES + TAG_WIDTH_S-1:0] shift_out; @@ -189,7 +187,7 @@ module VX_pe_serializer #( end - if (OUT_SKID != 0) begin : g_enable_r + if (OUT_BYPASS) begin : g_enable_r // The core's clock enable, ready_out_u || ~valid_out_u, computed a // cycle ahead from the skid's and the last stage's next state, so the @@ -232,9 +230,7 @@ module VX_pe_serializer #( end - if (OUT_SKID != 0) begin : g_out_skid - - `UNUSED_PARAM (OUT_BUF) + if (OUT_BYPASS) begin : g_out_skid VX_bypass_buffer #( .DATAW ((NUM_LANES * DATA_OUT_WIDTH) + NUM_LANES + TAG_WIDTH_S) From be25c3679417bd5e10c074d61de17e8c0d1d22ea Mon Sep 17 00:00:00 2001 From: tinebp Date: Sat, 14 Nov 2026 13:20:42 -0800 Subject: [PATCH 03/11] tcu: assert the TCU_LD ordering that the per-block AGU relies on Moving the TCU_LD AGU into each TCU block (fc0a35bb4) dropped the gather buffer: load responses now write the metadata RAM directly, while MMAs read it. That is safe only if no MMA of the loading warp that reads the loaded region (sparse or MX metadata) is presented to the core while the load is in flight. Older MMAs have left the in-order execute stream; younger ones wait on the scoreboard. A simulation-only assert now checks it, qualified on a valid MMA and a busy AGU. sgemm_tcu_wg_sp-4 passes with it in rtlsim. With sparse MMAs no longer waiting on the TCU_LD's scoreboard bit (a temporary decode fault), the same case fails on the assert at cycle 91283. No area: the check is outside synthesis. Co-Authored-By: Claude Opus 5.5 --- hw/rtl/tcu/VX_tcu_block.sv | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/hw/rtl/tcu/VX_tcu_block.sv b/hw/rtl/tcu/VX_tcu_block.sv index 1e493f9d83..09874fb555 100644 --- a/hw/rtl/tcu/VX_tcu_block.sv +++ b/hw/rtl/tcu/VX_tcu_block.sv @@ -96,6 +96,35 @@ module VX_tcu_block import VX_gpu_pkg::*, VX_tcu_pkg::*; #( assign result_if.data = agu_result_valid ? agu_result_data : core_result_if.data; assign agu_result_ready = result_if.ready; assign core_result_if.ready = result_if.ready && !agu_result_valid; + + // A TCU_LD writes its response fragments straight into the metadata RAM, + // which an MMA reads while it is presented to the core. That is safe only + // if no MMA of the loading warp that reads the region being loaded is + // presented while the load is in flight: an older one has left the + // in-order execute stream before the TCU_LD enters the AGU, and a younger + // one waits at issue on the scoreboard until the TCU_LD retires. +`ifndef SYNTHESIS +`ifdef VX_CFG_TCU_SPARSE_ENABLE + wire mma_reads_sp = (execute_if.data.op_type == INST_TCU_WMMA_SP) + `ifdef VX_CFG_TCU_WGMMA_ENABLE + || (execute_if.data.op_type == INST_TCU_WGMMA_SP) + `endif + ; +`else + wire mma_reads_sp = 1'b0; +`endif +`ifdef VX_CFG_TCU_MX_ENABLE + wire mma_reads_mx = tcu_fmt_is_mx(execute_if.data.op_args.tcu.fmt_s); +`else + wire mma_reads_mx = 1'b0; +`endif + // ~ld_ready: the AGU holds a TCU_LD, so its wid and slot are registered + wire mma_reads_ld_region = meta_wr_idx[4] ? mma_reads_mx : mma_reads_sp; + `RUNTIME_ASSERT(~(core_execute_if.valid && ~agu_ld_ready + && (execute_if.data.header.wid == meta_wr_wid) && mma_reads_ld_region), + ("%t: *** %s MMA reads metadata a TCU_LD is loading: wid=%0d, slot=%0d, op_type=%0d (#%0d)", + $time, INSTANCE_ID, meta_wr_wid, meta_wr_idx, execute_if.data.op_type, execute_if.data.header.uuid)) +`endif `else assign core_execute_if.valid = execute_if.valid; assign core_execute_if.data = execute_if.data; From 0d7bd5f5558cd3431e4b457adf1b3fa39b93810e Mon Sep 17 00:00:00 2001 From: tinebp Date: Sat, 14 Nov 2026 17:05:11 -0800 Subject: [PATCH 04/11] asic_gate: raise the target to 1 GHz and close timing on gfx and tcu The ASIC gate's 800 MHz target sat well below what most DUTs reach on ASAP7. Raising it to 1 GHz (floor 980 MHz) left two misses, both fixed at their source: - gfx 971.7 MHz: VX_raster_earlyz's EVAL1 formed za*2qx + zb*2qy + zc in one cycle. zc now goes into four per-pixel offsets (zc + i0*za + i1*zb), computed in parallel, and EVAL2's per-pixel sum becomes a two-input add. Results are bit-identical, and instruction and cycle counts are unchanged; the cost is 128 flops. gfx: 1046.8 MHz. - tcu 874 MHz: VX_config.toml gave ASIC builds the simulation-only single-cycle TFR multiply (tcu_latency_tfr 4). ASIC now uses the 2-stage multiply that FPGA builds already use (latency 5, a product register): tcu 1101.7 MHz, tensor 1125.0 MHz, tcu area +2.6 %. Simulation and FPGA builds are unchanged. The latency-5 path passed rtlsim on fp8, bf8, fp16, sparse, WGMMA and sparse WGMMA. All 14 ASIC DUTs pass at 1 GHz (tfu 1031.5, top 1040.4 and core 1036.3 are the closest). The yosys baselines are re-recorded at the new target, because clock_mhz is part of each build's config hash. Beacon is re-recorded against the parent with --against-rev, accepting two deltas: - gfx: earlyz's new sum register `quad_zprod` at 14 levels (the unit's deepest path drops from 16 to 14); - tcu/tensor ASIC: FF 47,446 -> 66,855 from the product register. The ASIC Beacon thresholds follow the new clock. The toml edit changes the generated config headers, and with them every perf case's config hash, although no simulation build sees ASIC defined. The 49 perf entries keep their cycle and instruction counts; only config_hash is refreshed, and only where the stored hash matched the parent's config. Co-Authored-By: Claude Opus 5.5 --- VX_config.toml | 7 +- ci/baselines/perf/core.json | 32 ++++----- ci/baselines/perf/dxa.json | 22 +++--- ci/baselines/perf/graphics.json | 18 ++--- ci/baselines/perf/raytracing.json | 6 +- ci/baselines/perf/tensor.json | 10 +-- ci/baselines/perf/tensor_mx.json | 2 +- ci/baselines/perf/tensor_sp.json | 2 +- ci/baselines/perf/tensor_wg.json | 6 +- ci/baselines/synthesis/beacon/graphics.json | 54 +++++++++----- ci/baselines/synthesis/beacon_asic/core.json | 14 ++-- ci/baselines/synthesis/beacon_asic/dxa.json | 4 +- .../synthesis/beacon_asic/graphics.json | 20 +++--- .../synthesis/beacon_asic/tensor.json | 37 ++++++---- ci/baselines/synthesis/beacon_asic/tfu.json | 28 ++++++++ ci/baselines/synthesis/beacon_asic/vm.json | 2 +- ci/baselines/synthesis/yosys/core.json | 68 +++++++++--------- ci/baselines/synthesis/yosys/dxa.json | 12 ++-- ci/baselines/synthesis/yosys/graphics.json | 70 +++++++++---------- ci/baselines/synthesis/yosys/tensor.json | 34 ++++----- ci/baselines/synthesis/yosys/tfu.json | 10 +-- ci/baselines/synthesis/yosys/vm.json | 18 ++--- ci/testcases/asic_gate.yaml | 28 ++++---- hw/rtl/raster/VX_raster_earlyz.sv | 36 ++++++---- 24 files changed, 304 insertions(+), 236 deletions(-) create mode 100644 ci/baselines/synthesis/beacon_asic/tfu.json diff --git a/VX_config.toml b/VX_config.toml index 352e6bd3eb..a79426767e 100644 --- a/VX_config.toml +++ b/VX_config.toml @@ -399,9 +399,10 @@ tcu_latency_dsp = "expr: 1 + 8 + clog2(2 * $tcu_tc_k + 1) * 11" tcu_latency_bhf = "expr: 4 + clog2(2 * $tcu_tc_k + 1) * 3" tcu_latency_fpnew = "expr: 14 + clog2(2 * $tcu_tc_k) * 7" tcu_latency_dpi = 4 -# TFR = mul stages + align + accumulate + round: 5 = 2-stage multiply -# (DSP48 PREG on FPGA), 4 = single-cycle multiply used in simulation. -tcu_latency_tfr = "expr: 5 if ($VIVADO or $QUARTUS) else 4" +# TFR = mul stages + align + accumulate + round: 5 = 2-stage multiply, the +# hardware build (DSP48 PREG on FPGA, a product register on ASIC); +# 4 = single-cycle multiply used in simulation. +tcu_latency_tfr = "expr: 5 if ($VIVADO or $QUARTUS or $ASIC) else 4" VX_CFG_TCU_LATENCY = "expr: $tcu_latency_dsp if $VX_CFG_TCU_TYPE_DSP else ($tcu_latency_bhf if $VX_CFG_TCU_TYPE_BHF else ($tcu_latency_fpnew if $VX_CFG_TCU_TYPE_FPNEW else ($tcu_latency_dpi if $VX_CFG_TCU_TYPE_DPI else $tcu_latency_tfr)))" # Tensor throughput divider: the FEDP array holds TC_M x TC_N / ratio dot # products and a micro-op occupies it for `ratio` cycles. A power of two that diff --git a/ci/baselines/perf/core.json b/ci/baselines/perf/core.json index 00eb37259f..9a415a3cca 100644 --- a/ci/baselines/perf/core.json +++ b/ci/baselines/perf/core.json @@ -6,7 +6,7 @@ }, "app": "raycast", "args": "", - "config_hash": "b8c6981a97ccadea", + "config_hash": "0076c1c7149fd820", "configs": "-DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -17,7 +17,7 @@ }, "app": "raycast", "args": "", - "config_hash": "c01be3e7a6d583f9", + "config_hash": "86f96396293472bc", "configs": "-DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -28,7 +28,7 @@ }, "app": "sgemm", "args": "-n128", - "config_hash": "9a2a587319b4b6ff", + "config_hash": "50be41688c7a5892", "configs": "-DVX_CFG_NUM_WARPS=8 -DVX_CFG_NUM_CORES=2 -DVX_CFG_NUM_THREADS=16 -DVX_CFG_L2_ENABLE", "driver": "rtlsim" }, @@ -39,7 +39,7 @@ }, "app": "sgemm", "args": "-n128", - "config_hash": "4779eb308b6a3d8b", + "config_hash": "d10e965d669b6ad7", "configs": "-DVX_CFG_NUM_WARPS=8 -DVX_CFG_NUM_CORES=2 -DVX_CFG_NUM_THREADS=4 -DVX_CFG_L2_ENABLE", "driver": "rtlsim" }, @@ -50,7 +50,7 @@ }, "app": "sgemm", "args": "-n128", - "config_hash": "c6dd8e74c685a837", + "config_hash": "ee77f6b8863fdaa2", "configs": "-DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -61,7 +61,7 @@ }, "app": "sgemm", "args": "-n128", - "config_hash": "f059fa051adfdc5b", + "config_hash": "b5741e7c3eff913a", "configs": "-DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -72,7 +72,7 @@ }, "app": "sgemmx", "args": "-n128", - "config_hash": "4db5fdf810c124a4", + "config_hash": "aa7c1792b3058b0f", "configs": "-DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -83,7 +83,7 @@ }, "app": "sgemmx", "args": "-n128", - "config_hash": "06a7a885f48e581c", + "config_hash": "6e8155cd4f44cb4c", "configs": "-DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -94,7 +94,7 @@ }, "app": "sgemv", "args": "-m512 -n512", - "config_hash": "ff06318f7623e442", + "config_hash": "bc01cb851ff753ef", "configs": "-DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -105,7 +105,7 @@ }, "app": "sgemv", "args": "-m512 -n512", - "config_hash": "0c627fc4764b369d", + "config_hash": "77b34ef7d9d04cc3", "configs": "-DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -116,7 +116,7 @@ }, "app": "softmax", "args": "-n64", - "config_hash": "df3574042b185c85", + "config_hash": "937a6052df977e92", "configs": "-DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -127,7 +127,7 @@ }, "app": "softmax", "args": "-n64", - "config_hash": "94464970e4cd1c5b", + "config_hash": "012f90b9f6a5c4eb", "configs": "-DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -138,7 +138,7 @@ }, "app": "stencil3d", "args": "-n32", - "config_hash": "a804702659ffd39b", + "config_hash": "28209a489433d581", "configs": "-DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -149,7 +149,7 @@ }, "app": "stencil3d", "args": "-n32", - "config_hash": "32be34a2a2b4ea2d", + "config_hash": "ba97d9a86c5b0e88", "configs": "-DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -160,7 +160,7 @@ }, "app": "vecadd", "args": "-n16384", - "config_hash": "480840182f56a552", + "config_hash": "d69831f16765927d", "configs": "-DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -171,7 +171,7 @@ }, "app": "vecadd", "args": "-n16384", - "config_hash": "5831ed3e27f15597", + "config_hash": "15bed1c965f199d5", "configs": "-DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" } diff --git a/ci/baselines/perf/dxa.json b/ci/baselines/perf/dxa.json index ffa0a2fba5..5ceb5e67a4 100644 --- a/ci/baselines/perf/dxa.json +++ b/ci/baselines/perf/dxa.json @@ -6,7 +6,7 @@ }, "app": "dxa_copy_mcast", "args": "", - "config_hash": "d4a511b0581f21b7", + "config_hash": "f685f7e8453a1a76", "configs": "-DVX_CFG_EXT_DXA_ENABLE", "driver": "rtlsim" }, @@ -17,7 +17,7 @@ }, "app": "dxa_copy", "args": "-d1", - "config_hash": "4b9316ca9d0b35f7", + "config_hash": "c0dbd5eb66a60f10", "configs": "-DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -28,7 +28,7 @@ }, "app": "dxa_copy", "args": "-d1", - "config_hash": "5ee196af8bf42639", + "config_hash": "91a6022549e40496", "configs": "-DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -39,7 +39,7 @@ }, "app": "sgemm2_dxa_mcast", "args": "-n128", - "config_hash": "39a0c9828b778fc1", + "config_hash": "f39cb8922a760292", "configs": "-DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -50,7 +50,7 @@ }, "app": "sgemm2_dxa_mcast", "args": "-n128", - "config_hash": "6322a9e16a8b225c", + "config_hash": "19f0c371a91978e5", "configs": "-DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -61,7 +61,7 @@ }, "app": "sgemm2_dxa", "args": "-n128 -t4 -m1", - "config_hash": "c00cf17500da51f3", + "config_hash": "7d8dca8d11bfa2b8", "configs": "-DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -72,7 +72,7 @@ }, "app": "sgemm2_dxa", "args": "-n128 -t4 -m1", - "config_hash": "f569976a86025971", + "config_hash": "5e0a57f876ead851", "configs": "-DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -83,7 +83,7 @@ }, "app": "sgemm_tcu_wg_dxa_mcast", "args": "-m 128 -n 128 -k 64", - "config_hash": "0594d82d1ae694cd", + "config_hash": "6ee1ce1e30271b27", "configs": "-DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1 -DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -94,7 +94,7 @@ }, "app": "sgemm_tcu_wg_dxa_mcast", "args": "-m 128 -n 128 -k 64", - "config_hash": "10302ae69ccd6853", + "config_hash": "fdaf784cac06b135", "configs": "-DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1 -DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -105,7 +105,7 @@ }, "app": "sgemm_tcu_wg_dxa", "args": "-m 128 -n 128 -k 64", - "config_hash": "c117cba295eb7b8f", + "config_hash": "17fcdb7f133e7b77", "configs": "-DVX_CFG_ISSUE_WIDTH=4 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_WGMMA_ENABLE -DVX_CFG_EXT_DXA_ENABLE -DWGMMA_NRC=16 -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1 -DVX_CFG_NUM_WARPS=8 -DVX_CFG_NUM_THREADS=32", "driver": "rtlsim" }, @@ -116,7 +116,7 @@ }, "app": "sgemm_tcu_wg_sp_dxa", "args": "-m 128 -n 128 -k 128", - "config_hash": "8752070400cc4bad", + "config_hash": "c1903e04a7a46374", "configs": "-DVX_CFG_ISSUE_WIDTH=4 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_WGMMA_ENABLE -DVX_CFG_TCU_SPARSE_ENABLE -DVX_CFG_EXT_DXA_ENABLE -DWGMMA_NRC=32 -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1 -DVX_CFG_NUM_WARPS=8 -DVX_CFG_NUM_THREADS=32", "driver": "rtlsim" } diff --git a/ci/baselines/perf/graphics.json b/ci/baselines/perf/graphics.json index bb7d57ad37..274f88d9d1 100644 --- a/ci/baselines/perf/graphics.json +++ b/ci/baselines/perf/graphics.json @@ -6,7 +6,7 @@ }, "app": "gfx_draw3d", "args": "-w 128 -h 128 -t box.cgltrace -r box_ref_128.png", - "config_hash": "d066e997351d6091", + "config_hash": "b9ae34046251fac7", "configs": "-DVX_CFG_EXT_TEX_ENABLE -DVX_CFG_EXT_RASTER_ENABLE -DVX_CFG_EXT_OM_ENABLE -DVX_CFG_NUM_CORES=2 -DVX_CFG_NUM_THREADS=4 -DVX_CFG_L2_ENABLE", "driver": "rtlsim" }, @@ -17,7 +17,7 @@ }, "app": "gfx_draw3d", "args": "-w 128 -h 128 -t box.cgltrace -r box_ref_128.png", - "config_hash": "7f821662bcd9350b", + "config_hash": "97e007bf4af71f24", "configs": "-DVX_CFG_EXT_TEX_ENABLE -DVX_CFG_EXT_RASTER_ENABLE -DVX_CFG_EXT_OM_ENABLE -DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -28,7 +28,7 @@ }, "app": "gfx_draw3d", "args": "-w 128 -h 128 -t box.cgltrace -r box_ref_128.png", - "config_hash": "abeea1f4bd5835b8", + "config_hash": "16e4ff86b50dfeb0", "configs": "-DVX_CFG_EXT_TEX_ENABLE -DVX_CFG_EXT_RASTER_ENABLE -DVX_CFG_EXT_OM_ENABLE -DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -39,7 +39,7 @@ }, "app": "gfx_om", "args": "-w 128 -h 128 -r whitebox_128.png", - "config_hash": "f8b4772627f6694e", + "config_hash": "32b92586e12960d3", "configs": "-DVX_CFG_EXT_OM_ENABLE -DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -50,7 +50,7 @@ }, "app": "gfx_om", "args": "-w 128 -h 128 -r whitebox_128.png", - "config_hash": "83fe586e0324c98c", + "config_hash": "669d36bc2f61a5a8", "configs": "-DVX_CFG_EXT_OM_ENABLE -DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -61,7 +61,7 @@ }, "app": "gfx_raster", "args": "-w 128 -h 128 -t triangle.cgltrace -r triangle_ref_128.png", - "config_hash": "01c927e4cd4d2f16", + "config_hash": "12fd2263afeaf71b", "configs": "-DVX_CFG_EXT_RASTER_ENABLE -DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -72,7 +72,7 @@ }, "app": "gfx_raster", "args": "-w 128 -h 128 -t triangle.cgltrace -r triangle_ref_128.png", - "config_hash": "5752a6abf8f5525e", + "config_hash": "4a9935fb649318b3", "configs": "-DVX_CFG_EXT_RASTER_ENABLE -DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -83,7 +83,7 @@ }, "app": "gfx_tex", "args": "-i toad.png -r toad_ref_f0.png -f 0 -g 0", - "config_hash": "1d6f815855946df8", + "config_hash": "5f48e794c81b31a0", "configs": "-DVX_CFG_EXT_TEX_ENABLE -DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -94,7 +94,7 @@ }, "app": "gfx_tex", "args": "-i toad.png -r toad_ref_f0.png -f 0 -g 0", - "config_hash": "dd425127b83cf5d7", + "config_hash": "39f259e6962fff66", "configs": "-DVX_CFG_EXT_TEX_ENABLE -DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" } diff --git a/ci/baselines/perf/raytracing.json b/ci/baselines/perf/raytracing.json index 91995894eb..61a29318b4 100644 --- a/ci/baselines/perf/raytracing.json +++ b/ci/baselines/perf/raytracing.json @@ -6,7 +6,7 @@ }, "app": "rt_raycast", "args": "", - "config_hash": "acf96f38d26b37ee", + "config_hash": "cdcc27d7e9fdecdb", "configs": "-DVX_CFG_EXT_RTU_ENABLE -DVX_CFG_NUM_CORES=2 -DVX_CFG_NUM_THREADS=4 -DVX_CFG_L2_ENABLE", "driver": "rtlsim" }, @@ -17,7 +17,7 @@ }, "app": "rt_raycast", "args": "", - "config_hash": "f219bd68b8919361", + "config_hash": "8f283c30f6aaecdf", "configs": "-DVX_CFG_EXT_RTU_ENABLE -DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -28,7 +28,7 @@ }, "app": "rt_raycast", "args": "", - "config_hash": "917af3d6cb8141f1", + "config_hash": "05235d8415e5e2d4", "configs": "-DVX_CFG_EXT_RTU_ENABLE -DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" } diff --git a/ci/baselines/perf/tensor.json b/ci/baselines/perf/tensor.json index 7915568887..89183423d9 100644 --- a/ci/baselines/perf/tensor.json +++ b/ci/baselines/perf/tensor.json @@ -6,7 +6,7 @@ }, "app": "sgemm_tcu", "args": "-m 128 -n 128 -k 128", - "config_hash": "a7561a368b57a589", + "config_hash": "33ee9cd268c5743e", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8 -DVX_CFG_ISSUE_WIDTH=4 -DVX_CFG_EXT_TCU_ENABLE -DITYPE=fp16 -DOTYPE=fp32 -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1", "driver": "rtlsim" }, @@ -17,7 +17,7 @@ }, "app": "sgemm_tcu", "args": "-m 128 -n 128 -k 128", - "config_hash": "b9e30456c7f28a6b", + "config_hash": "e72e70a9bd461b0f", "configs": "-DVX_CFG_NUM_WARPS=8 -DVX_CFG_EXT_TCU_ENABLE -DITYPE=fp16 -DOTYPE=fp32 -DVX_CFG_NUM_CORES=2 -DVX_CFG_NUM_THREADS=16 -DVX_CFG_L2_ENABLE", "driver": "rtlsim" }, @@ -28,7 +28,7 @@ }, "app": "sgemm_tcu", "args": "-m 128 -n 128 -k 128", - "config_hash": "1024fbfdcdc8ddfe", + "config_hash": "491c58eb36129ab7", "configs": "-DVX_CFG_NUM_WARPS=8 -DVX_CFG_EXT_TCU_ENABLE -DITYPE=fp16 -DOTYPE=fp32 -DVX_CFG_NUM_CORES=2 -DVX_CFG_NUM_THREADS=4 -DVX_CFG_L2_ENABLE", "driver": "rtlsim" }, @@ -39,7 +39,7 @@ }, "app": "sgemm_tcu", "args": "-m 128 -n 128 -k 128", - "config_hash": "82bd11eb91545e71", + "config_hash": "6feda83b1a53a43a", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_EXT_TCU_ENABLE -DITYPE=fp16 -DOTYPE=fp32", "driver": "rtlsim" }, @@ -50,7 +50,7 @@ }, "app": "sgemm2_tcu", "args": "-m 128 -n 128 -k 64", - "config_hash": "f99117358868d147", + "config_hash": "ea1f183f506410da", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8 -DVX_CFG_ISSUE_WIDTH=4 -DVX_CFG_EXT_TCU_ENABLE -DITYPE=fp16 -DOTYPE=fp32 -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1", "driver": "rtlsim" } diff --git a/ci/baselines/perf/tensor_mx.json b/ci/baselines/perf/tensor_mx.json index ea2521a7df..56ed7d1c97 100644 --- a/ci/baselines/perf/tensor_mx.json +++ b/ci/baselines/perf/tensor_mx.json @@ -6,7 +6,7 @@ }, "app": "sgemm_tcu_mx", "args": "-m 128 -n 128 -k32", - "config_hash": "510fb15505c2186c", + "config_hash": "a412f7da5066084b", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_MX_ENABLE -DVX_CFG_TCU_FP8_ENABLE -DITYPE=mxfp8 -DOTYPE=fp32 -DVX_CFG_TCU_TYPE_DPI", "driver": "rtlsim" } diff --git a/ci/baselines/perf/tensor_sp.json b/ci/baselines/perf/tensor_sp.json index 18a11f1abe..1cae9a1bf1 100644 --- a/ci/baselines/perf/tensor_sp.json +++ b/ci/baselines/perf/tensor_sp.json @@ -6,7 +6,7 @@ }, "app": "sgemm_tcu_sp", "args": "-m 128 -n 128 -k 128", - "config_hash": "d0478f5845022094", + "config_hash": "875ddba9797281cf", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_SPARSE_ENABLE", "driver": "rtlsim" } diff --git a/ci/baselines/perf/tensor_wg.json b/ci/baselines/perf/tensor_wg.json index d0e015b3db..188783bc99 100644 --- a/ci/baselines/perf/tensor_wg.json +++ b/ci/baselines/perf/tensor_wg.json @@ -6,7 +6,7 @@ }, "app": "sgemm_tcu_wg", "args": "-m64 -n64 -k64", - "config_hash": "efde633399f4c558", + "config_hash": "399a2ad5cb9f462c", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8 -DVX_CFG_ISSUE_WIDTH=4 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_WGMMA_ENABLE -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1 -DVX_CFG_TCU_FEDP2K -DITYPE=fp16 -DOTYPE=fp32 -DWGMMA_NRC=8 -DWGMMA_RS", "driver": "rtlsim" }, @@ -17,7 +17,7 @@ }, "app": "sgemm_tcu_wg", "args": "-m 128 -n 128 -k 128", - "config_hash": "bc6a525dae9193f4", + "config_hash": "32207252360ed203", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8 -DVX_CFG_ISSUE_WIDTH=4 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_WGMMA_ENABLE -DITYPE=fp16 -DOTYPE=fp32 -DWGMMA_NRC=32 -DWGMMA_SS -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1", "driver": "rtlsim" }, @@ -28,7 +28,7 @@ }, "app": "sgemm_tcu_wg_sp", "args": "-m 128 -n 128 -k 128", - "config_hash": "e4b8228c0dca994e", + "config_hash": "d4c92cf3213ec8ab", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8 -DVX_CFG_ISSUE_WIDTH=4 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_WGMMA_ENABLE -DVX_CFG_TCU_SPARSE_ENABLE -DWGMMA_NRC=32 -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1", "driver": "rtlsim" } diff --git a/ci/baselines/synthesis/beacon/graphics.json b/ci/baselines/synthesis/beacon/graphics.json index 901383a93a..e9ece858de 100644 --- a/ci/baselines/synthesis/beacon/graphics.json +++ b/ci/baselines/synthesis/beacon/graphics.json @@ -1,13 +1,24 @@ { "gfx": { + "accepted": { + "against": "28fc2c581262d2d7d4e1dc432d50cc303e3dea2e", + "regressions": [ + { + "after": 14, + "before": null, + "kind": "new", + "name": "graphics/g_raster_core_0.raster_core/raster_slices_0.raster_earlyz/quad_zprod.d" + } + ] + }, "clock_mhz": 250, "config_hash": "d39e5baadbeea03c", "configs": "-DVX_CFG_NUM_THREADS=16 -DVX_CFG_NUM_WARPS=16", "dut": "gfx", "result": { "bram": 183.5, - "build_time_s": 181, - "deep_endpoints": 1818, + "build_time_s": 171, + "deep_endpoints": 1738, "deepest_paths": [ "19 g_rtu_core_0.rtu_core/scheduler/g_recip_pe.recip_tags/g_shift.g_partial_reset.pipe_free[219] -> g_rtu_core_0.rtu_core/scheduler/g1_idx.d[4]", "19 g_rtu_core_0.rtu_core/scheduler/g_recip_pe.recip_tags/g_shift.g_partial_reset.pipe_free[219] -> g_rtu_core_0.rtu_core/scheduler/lvl_q_arr.ra[4]", @@ -21,17 +32,17 @@ "18 g_rtu_core_0.rtu_core/scheduler/g_recip_pe.recip_tags/g_shift.g_partial_reset.pipe_free[219] -> g_rtu_core_0.rtu_core/scheduler/ctx_arbiter/g_model1.reqs_mask.d[29]" ], "dsp": 1140, - "endpoints": 314111, + "endpoints": 314239, "env": { "circt": "CIRCT 892a65a01", "device": "xcu55c-fsvh2892-2L-e", "foldsim": "foldsim d8350bc0f", "xlen": 32 }, - "ff": 400294, + "ff": 400422, "fix_levels": 12, "interfaces": {}, - "lut": 319599, + "lut": 319847, "lutram": 14119, "max_levels": 19, "pred_fmax_mhz": 264.7, @@ -120,7 +131,7 @@ "graphics/g_om_steer_*_steer_pending": 9, "graphics/g_raster_core_*_raster_core/packer": 8, "graphics/g_raster_core_*_raster_core/raster_mem": 14, - "graphics/g_raster_core_*_raster_core/raster_slices_*_raster_earlyz": 16, + "graphics/g_raster_core_*_raster_core/raster_slices_*_raster_earlyz": 14, "graphics/g_raster_core_*_raster_core/raster_slices_*_raster_slice/block_evaluator/pipe_reg": 9, "graphics/g_raster_core_*_raster_core/raster_slices_*_raster_slice/block_evaluator/quad_evaluator/pipe_reg": 12, "graphics/g_raster_core_*_raster_core/raster_slices_*_raster_slice/tile_evaluator/g_fifo_queue_*_fifo_queue/g_ebN_fifo_queue/g_depth_n_dp_ram": 8, @@ -177,19 +188,30 @@ "tcache/g_cache_wrap_*_cache_wrap/g_cache_cache/g_banks_*_bank/reg_s1": 10 }, "uram": 0, - "watch_endpoints": 17383, + "watch_endpoints": 17007, "watch_levels": 8 } }, "gfxvm": { + "accepted": { + "against": "28fc2c581262d2d7d4e1dc432d50cc303e3dea2e", + "regressions": [ + { + "after": 14, + "before": null, + "kind": "new", + "name": "graphics/g_raster_core_0.raster_core/raster_slices_0.raster_earlyz/quad_zprod.d" + } + ] + }, "clock_mhz": 250, "config_hash": "dda6e15b71ddde55", "configs": "-DVX_CFG_NUM_THREADS=16 -DVX_CFG_NUM_WARPS=16", "dut": "gfxvm", "result": { "bram": 183.5, - "build_time_s": 186, - "deep_endpoints": 1969, + "build_time_s": 181, + "deep_endpoints": 1889, "deepest_paths": [ "19 g_rtu_core_0.rtu_core/scheduler/g_recip_pe.recip_tags/g_shift.g_partial_reset.pipe_free[219] -> g_rtu_core_0.rtu_core/scheduler/g1_idx.d[4]", "19 g_rtu_core_0.rtu_core/scheduler/g_recip_pe.recip_tags/g_shift.g_partial_reset.pipe_free[219] -> g_rtu_core_0.rtu_core/scheduler/lvl_q_arr.ra[4]", @@ -203,17 +225,17 @@ "18 g_rtu_core_0.rtu_core/scheduler/g_recip_pe.recip_tags/g_shift.g_partial_reset.pipe_free[219] -> g_rtu_core_0.rtu_core/scheduler/ctx_arbiter/g_model1.reqs_mask.d[29]" ], "dsp": 1140, - "endpoints": 328768, + "endpoints": 328896, "env": { "circt": "CIRCT 892a65a01", "device": "xcu55c-fsvh2892-2L-e", "foldsim": "foldsim d8350bc0f", "xlen": 32 }, - "ff": 415143, + "ff": 415271, "fix_levels": 12, "interfaces": {}, - "lut": 330949, + "lut": 331197, "lutram": 14557, "max_levels": 19, "pred_fmax_mhz": 256.3, @@ -313,7 +335,7 @@ "graphics/g_om_steer_*_steer_pending": 9, "graphics/g_raster_core_*_raster_core/packer": 8, "graphics/g_raster_core_*_raster_core/raster_mem": 14, - "graphics/g_raster_core_*_raster_core/raster_slices_*_raster_earlyz": 16, + "graphics/g_raster_core_*_raster_core/raster_slices_*_raster_earlyz": 14, "graphics/g_raster_core_*_raster_core/raster_slices_*_raster_slice/block_evaluator/pipe_reg": 9, "graphics/g_raster_core_*_raster_core/raster_slices_*_raster_slice/block_evaluator/quad_evaluator/pipe_reg": 12, "graphics/g_raster_core_*_raster_core/raster_slices_*_raster_slice/tile_evaluator/g_fifo_queue_*_fifo_queue/g_ebN_fifo_queue/g_depth_n_dp_ram": 8, @@ -379,7 +401,7 @@ "ummu/tlb/mshr/reqpool": 10 }, "uram": 0, - "watch_endpoints": 18681, + "watch_endpoints": 18305, "watch_levels": 8 } }, @@ -517,7 +539,7 @@ "dut": "rtu", "result": { "bram": 16.5, - "build_time_s": 40, + "build_time_s": 45, "deep_endpoints": 848, "deepest_paths": [ "15 rtu_core/scheduler/ray_q[128] -> rtu_core/scheduler/tri_pe/q_a.d[32]", @@ -576,7 +598,7 @@ "dut": "tex", "result": { "bram": 0.0, - "build_time_s": 60, + "build_time_s": 70, "deep_endpoints": 0, "deepest_paths": [ "11 tex_core/tex_addr/pipe_reg0/g_pipe.g_partial_reset.pipe_free[4197] -> tex_core/tex_addr/pipe_reg1/g_pipe.g_partial_reset.pipe_free.d[831]", diff --git a/ci/baselines/synthesis/beacon_asic/core.json b/ci/baselines/synthesis/beacon_asic/core.json index 7a0d9f129e..c26d1de552 100644 --- a/ci/baselines/synthesis/beacon_asic/core.json +++ b/ci/baselines/synthesis/beacon_asic/core.json @@ -1,11 +1,11 @@ { "cache": { - "clock_mhz": 800, + "clock_mhz": 1000, "config_hash": "77b79d6c7d9a6fdf", "configs": "", "dut": "cache", "result": { - "build_time_s": 30, + "build_time_s": 25, "cells": 282062, "endpoints": 32478, "env": { @@ -26,12 +26,12 @@ } }, "core": { - "clock_mhz": 800, + "clock_mhz": 1000, "config_hash": "847ad31605be03dd", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8", "dut": "core", "result": { - "build_time_s": 50, + "build_time_s": 60, "cells": 769936, "endpoints": 73708, "env": { @@ -63,7 +63,7 @@ } }, "lmem": { - "clock_mhz": 800, + "clock_mhz": 1000, "config_hash": "8190e614d4e4d3b6", "configs": "-DVX_CFG_NUM_THREADS=16 -DVX_CFG_ISSUE_WIDTH=2 -DVX_CFG_EXT_A_ENABLE", "dut": "lmem", @@ -95,12 +95,12 @@ } }, "top": { - "clock_mhz": 800, + "clock_mhz": 1000, "config_hash": "ce21223ae8e4d63c", "configs": "-DVX_CFG_NUM_THREADS=4 -DVX_CFG_NUM_WARPS=4", "dut": "top", "result": { - "build_time_s": 75, + "build_time_s": 80, "cells": 1438152, "endpoints": 169931, "env": { diff --git a/ci/baselines/synthesis/beacon_asic/dxa.json b/ci/baselines/synthesis/beacon_asic/dxa.json index 96b6fa3be8..76e9bb3a9f 100644 --- a/ci/baselines/synthesis/beacon_asic/dxa.json +++ b/ci/baselines/synthesis/beacon_asic/dxa.json @@ -1,11 +1,11 @@ { "dxa": { - "clock_mhz": 800, + "clock_mhz": 1000, "config_hash": "878aaaf618bd3f3c", "configs": "", "dut": "dxa", "result": { - "build_time_s": 25, + "build_time_s": 20, "cells": 84969, "endpoints": 11408, "env": { diff --git a/ci/baselines/synthesis/beacon_asic/graphics.json b/ci/baselines/synthesis/beacon_asic/graphics.json index a110eebd4e..c69cd935b7 100644 --- a/ci/baselines/synthesis/beacon_asic/graphics.json +++ b/ci/baselines/synthesis/beacon_asic/graphics.json @@ -1,20 +1,20 @@ { "gfx": { - "clock_mhz": 800, + "clock_mhz": 1000, "config_hash": "f49712b842f2f234", "configs": "-DVX_CFG_NUM_THREADS=4 -DVX_CFG_NUM_WARPS=4", "dut": "gfx", "result": { "build_time_s": 175, - "cells": 1873933, - "endpoints": 239154, + "cells": 1875629, + "endpoints": 239282, "env": { "circt": "CIRCT 892a65a01", "foldsim": "foldsim d8350bc0f", "pdk": "asap7", "xlen": 32 }, - "ff": 420597, + "ff": 420725, "fmax_mhz": 874.9, "macros": 76, "max_stages": 38, @@ -72,7 +72,7 @@ } }, "om": { - "clock_mhz": 800, + "clock_mhz": 1000, "config_hash": "3ff478591f29ccf9", "configs": "", "dut": "om", @@ -109,7 +109,7 @@ } }, "raster": { - "clock_mhz": 800, + "clock_mhz": 1000, "config_hash": "f0a4c760f765a429", "configs": "", "dut": "raster", @@ -146,12 +146,12 @@ } }, "rtu": { - "clock_mhz": 800, + "clock_mhz": 1000, "config_hash": "473d8b33a18f36fd", "configs": "", "dut": "rtu", "result": { - "build_time_s": 100, + "build_time_s": 130, "cells": 1060729, "endpoints": 105631, "env": { @@ -172,12 +172,12 @@ } }, "tex": { - "clock_mhz": 800, + "clock_mhz": 1000, "config_hash": "4d47fbece8804eb8", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8", "dut": "tex", "result": { - "build_time_s": 40, + "build_time_s": 45, "cells": 376164, "endpoints": 49445, "env": { diff --git a/ci/baselines/synthesis/beacon_asic/tensor.json b/ci/baselines/synthesis/beacon_asic/tensor.json index 45b7a05eb6..0ac4a29458 100644 --- a/ci/baselines/synthesis/beacon_asic/tensor.json +++ b/ci/baselines/synthesis/beacon_asic/tensor.json @@ -1,46 +1,57 @@ { "tcu": { - "clock_mhz": 800, + "accepted": { + "against": "28fc2c581262d2d7d4e1dc432d50cc303e3dea2e", + "regressions": [ + { + "after": 66855.0, + "before": 47446.0, + "kind": "area", + "name": "ff" + } + ] + }, + "clock_mhz": 1000, "config_hash": "1d6c72424d1a993d", "configs": "", "dut": "tcu", "result": { - "build_time_s": 100, - "cells": 1299379, - "endpoints": 25749, + "build_time_s": 120, + "cells": 1320372, + "endpoints": 44630, "env": { "circt": "CIRCT 892a65a01", "foldsim": "foldsim d8350bc0f", "pdk": "asap7", "xlen": 32 }, - "ff": 47446, - "fmax_mhz": 791.8, + "ff": 66855, + "fmax_mhz": 893.7, "macros": 0, - "max_stages": 43, + "max_stages": 37, "overhead_ps": 231, - "period_ps": 1263, + "period_ps": 1119, "stage_ps": 24, "tied_bits": 0, "tied_ports": [] } }, "tensor": { - "clock_mhz": 800, + "clock_mhz": 1000, "config_hash": "2992cc36d736afff", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8", "dut": "tensor", "result": { - "build_time_s": 90, - "cells": 854302, - "endpoints": 86553, + "build_time_s": 85, + "cells": 859424, + "endpoints": 89451, "env": { "circt": "CIRCT 892a65a01", "foldsim": "foldsim d8350bc0f", "pdk": "asap7", "xlen": 32 }, - "ff": 184699, + "ff": 188237, "fmax_mhz": 977.5, "macros": 28, "max_stages": 33, diff --git a/ci/baselines/synthesis/beacon_asic/tfu.json b/ci/baselines/synthesis/beacon_asic/tfu.json new file mode 100644 index 0000000000..9567710d52 --- /dev/null +++ b/ci/baselines/synthesis/beacon_asic/tfu.json @@ -0,0 +1,28 @@ +{ + "tfu": { + "clock_mhz": 1000, + "config_hash": "fd7c2ca30634d513", + "configs": "", + "dut": "tfu", + "result": { + "build_time_s": 15, + "cells": 15143, + "endpoints": 2332, + "env": { + "circt": "CIRCT 892a65a01", + "foldsim": "foldsim d8350bc0f", + "pdk": "asap7", + "xlen": 32 + }, + "ff": 1806, + "fmax_mhz": 913.2, + "macros": 0, + "max_stages": 36, + "overhead_ps": 231, + "period_ps": 1095, + "stage_ps": 24, + "tied_bits": 0, + "tied_ports": [] + } + } +} diff --git a/ci/baselines/synthesis/beacon_asic/vm.json b/ci/baselines/synthesis/beacon_asic/vm.json index c850e15ba2..f007f60c6a 100644 --- a/ci/baselines/synthesis/beacon_asic/vm.json +++ b/ci/baselines/synthesis/beacon_asic/vm.json @@ -1,6 +1,6 @@ { "vm": { - "clock_mhz": 800, + "clock_mhz": 1000, "config_hash": "d06ba9a368334b96", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8", "dut": "vm", diff --git a/ci/baselines/synthesis/yosys/core.json b/ci/baselines/synthesis/yosys/core.json index 7d640d4ff2..899dd7b151 100644 --- a/ci/baselines/synthesis/yosys/core.json +++ b/ci/baselines/synthesis/yosys/core.json @@ -1,13 +1,13 @@ { "cache": { - "clock_mhz": 800, - "config_hash": "4fd77575a6f5f52c", + "clock_mhz": 1000, + "config_hash": "243f3272b030bf88", "configs": "", "dut": "cache", "result": { - "build_time_s": 296, - "cell_area_um2": 59584.48, - "cell_count": 547028, + "build_time_s": 231, + "cell_area_um2": 50318.467, + "cell_count": 460847, "env": { "corner": "tt", "pdk": "asap7", @@ -16,23 +16,23 @@ "xlen": 32, "yosys": "Yosys 0.69" }, - "fmax_mhz": 1291.823, - "power_mw": 161.0, - "seq_area_um2": 28618.499, - "sram_area_um2": 16307.2, + "fmax_mhz": 1265.182, + "power_mw": 169.0, + "seq_area_um2": 23986.724, + "sram_area_um2": 18345.6, "tns_ns": 0.0, - "wns_ns": 0.476 + "wns_ns": 0.21 } }, "core": { - "clock_mhz": 800, - "config_hash": "67eb0ef49175ab38", + "clock_mhz": 1000, + "config_hash": "6eb9c40627fdf1e9", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8", "dut": "core", "result": { - "build_time_s": 803, - "cell_area_um2": 76015.6, - "cell_count": 731009, + "build_time_s": 773, + "cell_area_um2": 76102.687, + "cell_count": 731229, "env": { "corner": "tt", "pdk": "asap7", @@ -41,21 +41,21 @@ "xlen": 32, "yosys": "Yosys 0.69" }, - "fmax_mhz": 1019.992, - "power_mw": 832.0, - "seq_area_um2": 25929.947, + "fmax_mhz": 1036.269, + "power_mw": 1010.0, + "seq_area_um2": 25935.779, "sram_area_um2": 27814.4, "tns_ns": 0.0, - "wns_ns": 0.27 + "wns_ns": 0.035 } }, "lmem": { - "clock_mhz": 800, - "config_hash": "47081ee86b993ce8", + "clock_mhz": 1000, + "config_hash": "0fcc12bd8d9372df", "configs": "-DVX_CFG_NUM_THREADS=16 -DVX_CFG_ISSUE_WIDTH=2 -DVX_CFG_EXT_A_ENABLE", "dut": "lmem", "result": { - "build_time_s": 110, + "build_time_s": 100, "cell_area_um2": 17137.142, "cell_count": 166236, "env": { @@ -66,23 +66,23 @@ "xlen": 32, "yosys": "Yosys 0.69" }, - "fmax_mhz": 2003.606, - "power_mw": 42.2, + "fmax_mhz": 2023.882, + "power_mw": 52.8, "seq_area_um2": 6527.758, "sram_area_um2": 55628.8, "tns_ns": 0.0, - "wns_ns": 0.751 + "wns_ns": 0.506 } }, "top": { - "clock_mhz": 800, - "config_hash": "23d795386c3e20c0", + "clock_mhz": 1000, + "config_hash": "f73eafd49ee4e963", "configs": "-DVX_CFG_NUM_THREADS=4 -DVX_CFG_NUM_WARPS=4", "dut": "top", "result": { - "build_time_s": 1376, - "cell_area_um2": 172526.117, - "cell_count": 1609348, + "build_time_s": 1331, + "cell_area_um2": 172608.8, + "cell_count": 1610034, "env": { "corner": "tt", "pdk": "asap7", @@ -91,12 +91,12 @@ "xlen": 32, "yosys": "Yosys 0.69" }, - "fmax_mhz": 1028.807, - "power_mw": 247.0, - "seq_area_um2": 72499.05, + "fmax_mhz": 1040.366, + "power_mw": 309.0, + "seq_area_um2": 72506.048, "sram_area_um2": 72302.4, "tns_ns": 0.0, - "wns_ns": 0.278 + "wns_ns": 0.039 } } } diff --git a/ci/baselines/synthesis/yosys/dxa.json b/ci/baselines/synthesis/yosys/dxa.json index b981098265..5dd6faf9ce 100644 --- a/ci/baselines/synthesis/yosys/dxa.json +++ b/ci/baselines/synthesis/yosys/dxa.json @@ -1,11 +1,11 @@ { "dxa": { - "clock_mhz": 800, - "config_hash": "1333820f22e64ab6", + "clock_mhz": 1000, + "config_hash": "d44055ed50a07e29", "configs": "", "dut": "dxa", "result": { - "build_time_s": 90, + "build_time_s": 80, "cell_area_um2": 12868.366, "cell_count": 121130, "env": { @@ -16,12 +16,12 @@ "xlen": 32, "yosys": "Yosys 0.69" }, - "fmax_mhz": 1128.668, - "power_mw": 36.4, + "fmax_mhz": 1135.074, + "power_mw": 45.5, "seq_area_um2": 5658.206, "sram_area_um2": 0.0, "tns_ns": 0.0, - "wns_ns": 0.364 + "wns_ns": 0.119 } } } diff --git a/ci/baselines/synthesis/yosys/graphics.json b/ci/baselines/synthesis/yosys/graphics.json index dc5d66875a..36b38cc276 100644 --- a/ci/baselines/synthesis/yosys/graphics.json +++ b/ci/baselines/synthesis/yosys/graphics.json @@ -1,13 +1,13 @@ { "gfx": { - "clock_mhz": 800, - "config_hash": "e37c317b7e74dff1", + "clock_mhz": 1000, + "config_hash": "b4c6dde8e27a55c7", "configs": "-DVX_CFG_NUM_THREADS=4 -DVX_CFG_NUM_WARPS=4", "dut": "gfx", "result": { - "build_time_s": 1632, - "cell_area_um2": 188729.556, - "cell_count": 1727374, + "build_time_s": 1582, + "cell_area_um2": 190520.52, + "cell_count": 1739654, "env": { "corner": "tt", "pdk": "asap7", @@ -16,17 +16,17 @@ "xlen": 32, "yosys": "Yosys 0.69" }, - "fmax_mhz": 868.206, - "power_mw": 1100.0, - "seq_area_um2": 77183.604, + "fmax_mhz": 1046.792, + "power_mw": 1350.0, + "seq_area_um2": 78460.52, "sram_area_um2": 35811.2, "tns_ns": 0.0, - "wns_ns": 0.098 + "wns_ns": 0.045 } }, "om": { - "clock_mhz": 800, - "config_hash": "09a643af0223b91f", + "clock_mhz": 1000, + "config_hash": "1407877236a20841", "configs": "", "dut": "om", "result": { @@ -41,21 +41,21 @@ "xlen": 32, "yosys": "Yosys 0.69" }, - "fmax_mhz": 1166.997, - "power_mw": 25.2, + "fmax_mhz": 1173.847, + "power_mw": 30.8, "seq_area_um2": 2482.099, "sram_area_um2": 0.0, "tns_ns": 0.0, - "wns_ns": 0.393 + "wns_ns": 0.148 } }, "raster": { - "clock_mhz": 800, - "config_hash": "f8ed08b239870bd8", + "clock_mhz": 1000, + "config_hash": "756874a837a20709", "configs": "", "dut": "raster", "result": { - "build_time_s": 65, + "build_time_s": 60, "cell_area_um2": 10207.312, "cell_count": 92158, "env": { @@ -66,23 +66,23 @@ "xlen": 32, "yosys": "Yosys 0.69" }, - "fmax_mhz": 1221.299, - "power_mw": 56.7, + "fmax_mhz": 1228.803, + "power_mw": 70.6, "seq_area_um2": 3983.839, "sram_area_um2": 3728.0, "tns_ns": 0.0, - "wns_ns": 0.431 + "wns_ns": 0.186 } }, "rtu": { - "clock_mhz": 800, - "config_hash": "37dd15cd75261ada", + "clock_mhz": 1000, + "config_hash": "5d89e24dd85fbb34", "configs": "", "dut": "rtu", "result": { - "build_time_s": 1130, - "cell_area_um2": 97093.979, - "cell_count": 893398, + "build_time_s": 1044, + "cell_area_um2": 95949.347, + "cell_count": 881230, "env": { "corner": "tt", "pdk": "asap7", @@ -91,21 +91,21 @@ "xlen": 32, "yosys": "Yosys 0.69" }, - "fmax_mhz": 959.785, - "power_mw": 628.0, - "seq_area_um2": 38161.692, + "fmax_mhz": 1131.734, + "power_mw": 736.0, + "seq_area_um2": 38202.516, "sram_area_um2": 4598.4, "tns_ns": 0.0, - "wns_ns": 0.208 + "wns_ns": 0.116 } }, "tex": { - "clock_mhz": 800, - "config_hash": "c90d90099c96a888", + "clock_mhz": 1000, + "config_hash": "5a9b1eef7ff43cb4", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8", "dut": "tex", "result": { - "build_time_s": 281, + "build_time_s": 241, "cell_area_um2": 58598.755, "cell_count": 553165, "env": { @@ -116,12 +116,12 @@ "xlen": 32, "yosys": "Yosys 0.69" }, - "fmax_mhz": 1225.49, - "power_mw": 260.0, + "fmax_mhz": 1233.046, + "power_mw": 325.0, "seq_area_um2": 19287.007, "sram_area_um2": 0.0, "tns_ns": 0.0, - "wns_ns": 0.434 + "wns_ns": 0.189 } } } diff --git a/ci/baselines/synthesis/yosys/tensor.json b/ci/baselines/synthesis/yosys/tensor.json index b59fd09221..b62c378bb4 100644 --- a/ci/baselines/synthesis/yosys/tensor.json +++ b/ci/baselines/synthesis/yosys/tensor.json @@ -1,13 +1,13 @@ { "tcu": { - "clock_mhz": 800, - "config_hash": "5110889c4c9985a1", + "clock_mhz": 1000, + "config_hash": "8ede09784dc2eeb0", "configs": "", "dut": "tcu", "result": { - "build_time_s": 2210, - "cell_area_um2": 74231.737, - "cell_count": 760362, + "build_time_s": 1150, + "cell_area_um2": 76124.702, + "cell_count": 744692, "env": { "corner": "tt", "pdk": "asap7", @@ -16,23 +16,23 @@ "xlen": 32, "yosys": "Yosys 0.69" }, - "fmax_mhz": 870.549, + "fmax_mhz": 1101.686, "power_mw": 359.0, - "seq_area_um2": 12099.067, + "seq_area_um2": 17121.877, "sram_area_um2": 0.0, "tns_ns": 0.0, - "wns_ns": 0.101 + "wns_ns": 0.092 } }, "tensor": { - "clock_mhz": 800, - "config_hash": "5e33a96e107c9a6b", + "clock_mhz": 1000, + "config_hash": "f7974ef5771ec154", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8", "dut": "tensor", "result": { - "build_time_s": 834, - "cell_area_um2": 96735.909, - "cell_count": 888126, + "build_time_s": 718, + "cell_area_um2": 100009.454, + "cell_count": 914743, "env": { "corner": "tt", "pdk": "asap7", @@ -41,12 +41,12 @@ "xlen": 32, "yosys": "Yosys 0.69" }, - "fmax_mhz": 1119.445, - "power_mw": 236.0, - "seq_area_um2": 41783.364, + "fmax_mhz": 1124.986, + "power_mw": 305.0, + "seq_area_um2": 43771.493, "sram_area_um2": 52361.6, "tns_ns": 0.0, - "wns_ns": 0.357 + "wns_ns": 0.111 } } } diff --git a/ci/baselines/synthesis/yosys/tfu.json b/ci/baselines/synthesis/yosys/tfu.json index a2289a92b0..9377ad18c7 100644 --- a/ci/baselines/synthesis/yosys/tfu.json +++ b/ci/baselines/synthesis/yosys/tfu.json @@ -1,7 +1,7 @@ { "tfu": { - "clock_mhz": 800, - "config_hash": "e22492d24465c10d", + "clock_mhz": 1000, + "config_hash": "5e071e2419b516e2", "configs": "", "dut": "tfu", "result": { @@ -16,12 +16,12 @@ "xlen": 32, "yosys": "Yosys 0.69" }, - "fmax_mhz": 1026.167, - "power_mw": 15.6, + "fmax_mhz": 1031.46, + "power_mw": 19.2, "seq_area_um2": 507.384, "sram_area_um2": 0.0, "tns_ns": 0.0, - "wns_ns": 0.276 + "wns_ns": 0.03 } } } diff --git a/ci/baselines/synthesis/yosys/vm.json b/ci/baselines/synthesis/yosys/vm.json index 80a9234b8f..070d89b9b7 100644 --- a/ci/baselines/synthesis/yosys/vm.json +++ b/ci/baselines/synthesis/yosys/vm.json @@ -1,13 +1,13 @@ { "vm": { - "clock_mhz": 800, - "config_hash": "45673f23cbf3b123", + "clock_mhz": 1000, + "config_hash": "b76c79624308b9cc", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8", "dut": "vm", "result": { - "build_time_s": 889, - "cell_area_um2": 133457.913, - "cell_count": 1190756, + "build_time_s": 733, + "cell_area_um2": 135877.056, + "cell_count": 1212964, "env": { "corner": "tt", "pdk": "asap7", @@ -16,12 +16,12 @@ "xlen": 32, "yosys": "Yosys 0.69" }, - "fmax_mhz": 1265.983, - "power_mw": 348.0, - "seq_area_um2": 63571.424, + "fmax_mhz": 1213.445, + "power_mw": 437.0, + "seq_area_um2": 64770.484, "sram_area_um2": 103470.4, "tns_ns": 0.0, - "wns_ns": 0.46 + "wns_ns": 0.176 } } } diff --git a/ci/testcases/asic_gate.yaml b/ci/testcases/asic_gate.yaml index 16073d80db..25515f511d 100644 --- a/ci/testcases/asic_gate.yaml +++ b/ci/testcases/asic_gate.yaml @@ -110,7 +110,7 @@ builds: - id: cache group: core dut: cache - clock_mhz: 800 + clock_mhz: 1000 area_budget_um2: 48726 configs: "" @@ -123,7 +123,7 @@ builds: - id: core group: core dut: core - clock_mhz: 800 + clock_mhz: 1000 area_budget_um2: 84624 configs: "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8" @@ -132,7 +132,7 @@ builds: - id: lmem group: core dut: lmem - clock_mhz: 800 + clock_mhz: 1000 area_budget_um2: 17137 configs: "-DVX_CFG_NUM_THREADS=16 -DVX_CFG_ISSUE_WIDTH=2 -DVX_CFG_EXT_A_ENABLE" @@ -142,7 +142,7 @@ builds: - id: top group: core dut: top - clock_mhz: 800 + clock_mhz: 1000 area_budget_um2: 187230 # 11.2 GB Yosys peak at NT=NW=4 (8/8: 18.6 GB). configs: "-DVX_CFG_NUM_THREADS=4 -DVX_CFG_NUM_WARPS=4" @@ -153,7 +153,7 @@ builds: - id: dxa group: dxa dut: dxa - clock_mhz: 800 + clock_mhz: 1000 area_budget_um2: 12449 configs: "" @@ -164,7 +164,7 @@ builds: - id: tfu group: tfu dut: tfu - clock_mhz: 800 + clock_mhz: 1000 area_budget_um2: 2073 configs: "" @@ -175,7 +175,7 @@ builds: - id: tcu group: tensor dut: tcu - clock_mhz: 800 + clock_mhz: 1000 area_budget_um2: 74407 configs: "" @@ -184,7 +184,7 @@ builds: - id: tensor group: tensor dut: tensor - clock_mhz: 800 + clock_mhz: 1000 area_budget_um2: 104438 configs: "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8" @@ -194,7 +194,7 @@ builds: - id: raster group: graphics dut: raster - clock_mhz: 800 + clock_mhz: 1000 area_budget_um2: 10527 configs: "" @@ -202,7 +202,7 @@ builds: - id: om group: graphics dut: om - clock_mhz: 800 + clock_mhz: 1000 area_budget_um2: 5926 configs: "" @@ -211,7 +211,7 @@ builds: - id: tex group: graphics dut: tex - clock_mhz: 800 + clock_mhz: 1000 area_budget_um2: 61159 configs: "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8" @@ -219,7 +219,7 @@ builds: - id: rtu group: graphics dut: rtu - clock_mhz: 800 + clock_mhz: 1000 area_budget_um2: 98965 configs: "" @@ -228,7 +228,7 @@ builds: - id: gfx group: graphics dut: gfx - clock_mhz: 800 + clock_mhz: 1000 area_budget_um2: 242203 # 14.6 GB Yosys peak at NT=NW=4 (8/8: 19.5 GB). configs: "-DVX_CFG_NUM_THREADS=4 -DVX_CFG_NUM_WARPS=4" @@ -240,6 +240,6 @@ builds: - id: vm group: vm dut: vm - clock_mhz: 800 + clock_mhz: 1000 area_budget_um2: 146445 configs: "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8" diff --git a/hw/rtl/raster/VX_raster_earlyz.sv b/hw/rtl/raster/VX_raster_earlyz.sv index c95061aa05..5de806811a 100644 --- a/hw/rtl/raster/VX_raster_earlyz.sv +++ b/hw/rtl/raster/VX_raster_earlyz.sv @@ -73,9 +73,11 @@ module VX_raster_earlyz import VX_gpu_pkg::*; import VX_raster_pkg::*; import VX // X = pos_x*2 + (i&1), Y = pos_y*2 + (i>>1) // // Late-Z truncates the int64 MAC to int32 before saturating, so the whole - // evaluation is mod-2^32 and 32-bit products suffice. The quad origin term - // za*2qx + zb*2qy + zc is computed once per quad from the registered wave; - // each pixel then adds za/zb for its intra-quad offset a stage later. + // evaluation is mod-2^32 and 32-bit products suffice. EVAL1 forms the quad + // origin products za*2qx + zb*2qy once per quad, and, beside them, the four + // intra-quad offsets zc + i0*za + i1*zb shared by every quad; EVAL2 sums one + // of each per pixel. Keeping zc out of the product sum leaves EVAL1 two + // multiplies and one add deep. // ═══════════════════════════════════════════════════════════════════════ wire [NUM_PIX-1:0] pix_cov_in; @@ -105,27 +107,32 @@ module VX_raster_earlyz import VX_gpu_pkg::*; import VX_raster_pkg::*; import VX reg [NUM_PIX-1:0][W_ADDR_BITS-1:0] wave_waddr; reg [NUM_PIX-1:0] wave_cov; - // Per-quad EVAL1 products (from the registered wave). - reg [OUTPUT_QUADS-1:0][31:0] quad_zbase; // za*2qx + zb*2qy + zc (mod 2^32) + // EVAL1 products (from the registered wave). + reg [OUTPUT_QUADS-1:0][31:0] quad_zprod; // za*2qx + zb*2qy (mod 2^32) reg [OUTPUT_QUADS-1:0][31:0] quad_ypitch; // 2qy * zbuf_pitch + reg [3:0][31:0] pix_zoff; // zc + i0*za + i1*zb (mod 2^32) wire signed [31:0] za = wave_zplane[0]; // A' (Q7.24) wire signed [31:0] zb = wave_zplane[1]; // B' wire signed [31:0] zc = wave_zplane[2]; // C' - wire [OUTPUT_QUADS-1:0][31:0] quad_zbase_n; + wire [OUTPUT_QUADS-1:0][31:0] quad_zprod_n; wire [OUTPUT_QUADS-1:0][31:0] quad_ypitch_n; for (genvar q = 0; q < OUTPUT_QUADS; ++q) begin : g_quad_eval wire [`VX_RASTER_DIM_BITS-1:0] qx2 = {wave_stamps[q].pos_x, 1'b0}; wire [`VX_RASTER_DIM_BITS-1:0] qy2 = {wave_stamps[q].pos_y, 1'b0}; - assign quad_zbase_n[q] = 32'(za * $signed({{(32-`VX_RASTER_DIM_BITS){1'b0}}, qx2}) - + zb * $signed({{(32-`VX_RASTER_DIM_BITS){1'b0}}, qy2}) - + zc); + assign quad_zprod_n[q] = 32'(za * $signed({{(32-`VX_RASTER_DIM_BITS){1'b0}}, qx2}) + + zb * $signed({{(32-`VX_RASTER_DIM_BITS){1'b0}}, qy2})); assign quad_ypitch_n[q] = 32'(qy2) * dcrs.zbuf_pitch; end - // Per-pixel EVAL2 composition (from the registered per-quad products): - // zbits(p) = quad_zbase + i0*za + i1*zb (mod 2^32), then saturate; + wire [3:0][31:0] pix_zoff_n; + for (genvar i = 0; i < 4; ++i) begin : g_zoff_eval + assign pix_zoff_n[i] = 32'(zc + (i[0] ? za : 32'sd0) + (i[1] ? zb : 32'sd0)); + end + + // Per-pixel EVAL2 composition (from the registered EVAL1 terms): + // zbits(p) = quad_zprod + pix_zoff[i] (mod 2^32), then saturate; // waddr(p) = {zbuf_addr,4'b0} + X + ((2qy + i1) * pitch)[31:2] // The [31:2] shift is applied after the full 32-bit row product, so the // odd row adds the pitch before shifting (carries out of bits [1:0]). @@ -135,9 +142,7 @@ module VX_raster_earlyz import VX_gpu_pkg::*; import VX_raster_pkg::*; import VX for (genvar i = 0; i < 4; ++i) begin : g_pix localparam p = q * 4 + i; wire [`VX_RASTER_DIM_BITS-1:0] px = {wave_stamps[q].pos_x, 1'b0} | `VX_RASTER_DIM_BITS'(i[0]); - wire signed [31:0] zbits = $signed(quad_zbase[q]) - + (i[0] ? za : 32'sd0) - + (i[1] ? zb : 32'sd0); + wire [31:0] zbits = quad_zprod[q] + pix_zoff[i]; assign pix_cand_n[p] = zbits[31] ? 24'd0 : (|zbits[30:24]) ? 24'(OM_DEPTH_MASK) : zbits[23:0]; @@ -232,8 +237,9 @@ module VX_raster_earlyz import VX_gpu_pkg::*; import VX_raster_pkg::*; import VX end end STATE_EVAL1: begin - quad_zbase <= quad_zbase_n; + quad_zprod <= quad_zprod_n; quad_ypitch <= quad_ypitch_n; + pix_zoff <= pix_zoff_n; state <= STATE_EVAL2; end STATE_EVAL2: begin From 22759a3a5c84118a71cb3adcca9eb0ca68625816 Mon Sep 17 00:00:00 2001 From: tinebp Date: Fri, 13 Nov 2026 02:36:07 -0800 Subject: [PATCH 05/11] cache flush: one typed fence operation from runtime to every cache level The work a fence or flush owes the caches was encoded five ways: the runtime's CP_FLUSH_FLAG_L1_ONLY (two copies), bit 16 of the CACHE_FLUSH DCR write, byteen bit 0 of the core flush token, the byteen/is_addr_io/ is_noalloc overloads of the LSU fence token, and three bools in SimX. The token kinds were readable only through a 5-row table, each level re-derived the kind it forwarded, and the names described cache levels ("L1-only") rather than meaning. As in the PTX, Vulkan and HSA memory models, the operation is now ordering x scope: fence_op = {ACQ, REL, SYS, IO}, defined once in VX_types.toml. The same field rides every hop: the CMD_CACHE_FLUSH header flags [5:2], the CACHE_FLUSH DCR write value, the flush token (in amo_op, with amo_valid 0; no new wires), and SimX. Each cache applies one rule: above the scope's point of coherence an acquire walks, a release drains, and the level forwards the same operation; the point of coherence answers. ACQ_FORWARD becomes the structural NEXT_IS_POC. A cache flush is ACQ|REL at device or system scope; asserts in the CP, the DCR receiver and SimX reject anything else. Every single-kind fence and flush does the same cache work as before. Two multi-token rounds change: IO plus a memory fence now drains the point of coherence instead of walking it, and full plus IO keeps the IO bit, so every level waits for its non-cacheable path. Also fixes a release fence on a write-back level above the point of coherence (a single-core dcache next to TEX, RTU, raster, OM or DXA): it only quiesced, leaving dirty lines that those memory clients could not see. It now walks, in RTL and SimX. Without the A extension the LSU has no amo_op lane field, so the op crosses the LSU in is_noalloc/is_addr_io and VX_lsu_mem_path restores the typed field before the request leaves; a dedicated field would cost two flip-flops. Beacon against the parent: core -23 LUT, cache -12 LUT, gfx -55 LUT -9 FF, core without A -18 LUT, tensor -25 LUT; no FF increase and no path deeper. The gfx and tensor harness tie counts drop (removed flush_l1_only ports), so their FPGA and ASIC Beacon baselines are re-recorded against the merge base. The VX_types.toml edit changes the generated config headers, and with them every perf case's config hash. The 49 perf entries keep their cycle and instruction counts; only config_hash is refreshed. The cp_dcr_proxy unittest encodes flushes with the new constants (user approved). Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 14 +- VX_types.toml | 19 +- ci/baselines/perf/core.json | 32 ++-- ci/baselines/perf/dxa.json | 22 +-- ci/baselines/perf/graphics.json | 18 +- ci/baselines/perf/raytracing.json | 6 +- ci/baselines/perf/tensor.json | 10 +- ci/baselines/perf/tensor_mx.json | 2 +- ci/baselines/perf/tensor_sp.json | 2 +- ci/baselines/perf/tensor_wg.json | 6 +- ci/baselines/synthesis/beacon/graphics.json | 51 +++--- ci/baselines/synthesis/beacon/tensor.json | 35 ++-- .../synthesis/beacon_asic/graphics.json | 31 ++-- .../synthesis/beacon_asic/tensor.json | 31 ++-- ci/testcases/regression.yaml | 11 +- docs/assets/img/mlp_cp_dma_llc.svg | 2 +- docs/assets/img/mlp_fences.svg | 4 +- docs/assets/img/mlp_launch_flush.svg | 8 +- docs/designs/cache_subsystem.md | 101 ++++++----- docs/designs/command_processor.md | 29 +-- docs/designs/lsu_pipeline_design.md | 6 +- docs/designs/mlp_optimizations.md | 22 +-- docs/designs/multicache_amo_coherence.md | 5 +- docs/designs/virtual_memory_subsystem.md | 2 +- hw/rtl/VX_gpu_pkg.sv | 48 +++-- hw/rtl/VX_graphics.sv | 56 +++--- hw/rtl/VX_socket.sv | 6 +- hw/rtl/VX_trace_pkg.sv | 1 - hw/rtl/cache/VX_cache.sv | 27 ++- hw/rtl/cache/VX_cache_bypass.sv | 2 +- hw/rtl/cache/VX_cache_cluster.sv | 4 +- hw/rtl/cache/VX_cache_init.sv | 153 ++++++++-------- hw/rtl/cache/VX_cache_wrap.sv | 4 +- hw/rtl/core/VX_core.sv | 8 +- hw/rtl/core/VX_dcr_data.sv | 18 +- hw/rtl/core/VX_dcr_flush.sv | 11 +- hw/rtl/core/VX_decode.sv | 30 ++-- hw/rtl/core/VX_lsu_block.sv | 38 ++-- hw/rtl/core/VX_lsu_mem_path.sv | 43 ++++- hw/rtl/core/VX_mem_unit.sv | 4 +- hw/rtl/core/VX_uop_amo.sv | 7 +- hw/rtl/cp/VX_cp_dcr_proxy.sv | 44 +++-- hw/rtl/cp/VX_cp_pkg.sv | 2 - hw/rtl/mem/VX_cp_llc_port.sv | 12 +- hw/rtl/om/VX_om_steer.sv | 4 +- hw/unittest/cp_dcr_proxy/main.cpp | 57 +++--- hw/unittest/gfx/VX_gfx_top.sv | 4 +- hw/unittest/mem_unit/VX_mem_unit_top.sv | 2 +- hw/unittest/tensor/VX_tensor_top.sv | 2 +- sim/common/cmd_processor.cpp | 17 +- sim/common/cmd_processor.h | 10 +- sim/rtlsim/main.cpp | 2 +- sim/simx/cluster.cpp | 18 +- sim/simx/cluster.h | 4 +- sim/simx/constants.h | 7 +- sim/simx/cp_llc_port.h | 6 +- sim/simx/decode.cpp | 16 +- sim/simx/lsu_unit.cpp | 12 +- sim/simx/main.cpp | 2 +- sim/simx/mem/cache.cpp | 166 +++++++----------- sim/simx/mem/cache.h | 10 +- sim/simx/mem/cache_cluster.cpp | 4 +- sim/simx/mem/cache_cluster.h | 2 +- sim/simx/mem/lsu_mem_adapter.cpp | 4 +- sim/simx/mem/mem_coalescer.cpp | 2 +- sim/simx/processor.cpp | 16 +- sim/simx/processor_impl.h | 4 +- sim/simx/socket.cpp | 10 +- sim/simx/socket.h | 2 +- sim/simx/types.h | 18 +- sw/runtime/common/device.cpp | 30 ++-- sw/runtime/common/queue.cpp | 4 +- sw/runtime/common/vortex2_internal.h | 4 +- 73 files changed, 758 insertions(+), 668 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57c58a52cb..d51123df89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,7 +40,7 @@ follows the version pins recorded in [VERSION](VERSION) (`VORTEX_VERSION`, DRAM reads -33%. - **Command-processor DMA through the shared LLC (`VX_CFG_CP_LLC_CLIENT`, on by default).** When one LLC serves every core, the CP's transfers enter it on their own client slot, so host transfers need only an L1 flush, not a walk of the whole LLC; transfers - of at least half the LLC write around it. A launch behind DMA writes waits for an L1-only flush token sent on the slot. The runtime + of at least half the LLC write around it. A launch behind DMA writes waits for a device-scope flush token sent on the slot. The runtime sees the new `DMA_LLC_CLIENT` CP capability. *Why:* rtlsim at 2 clusters + L2 + L3: dogfood -30%, multikernel -42.7%; dogfood -64% with an 8 MB L3. - **Foldsim: threaded FPGA simulation of Vortex on the Alveo V80, built on CIRCT.** Every class of identical units (sockets, issue slices, ALUs, FPUs, load-store units) is time-multiplexed through one physical copy, cycle-exact against the RTL, with no Yosys or sv2v: `circt-verilog` imports Vortex, Foldsim's `foldsim-extract-models` / `foldsim-compose` cut it into threaded models joined by one token fabric (Foldsim is its own project on CIRCT, installed by `ci/toolchain_install.sh --foldsim`; [hw/syn/foldsim/](hw/syn/foldsim/)), and the V80's native flow packages it with a latency-bandwidth memory endpoint and a command-queue control block ([hw/rtl/afu/foldsim/](hw/rtl/afu/foldsim/)). `--driver=foldsim` runs it on the card (`TARGET=hw`, VRT + QDMA) or in-process in Verilator (`avedsim`, the default). Vortex's RTL is unchanged: units get plain-port boundaries and instance IDs as ports from a source-to-source pass on the flow's copy ([hw/syn/foldsim/lift_boundaries.py](hw/syn/foldsim/lift_boundaries.py)). See [docs/designs/foldsim.md](docs/designs/foldsim.md). @@ -89,13 +89,15 @@ follows the version pins recorded in [VERSION](VERSION) (`VORTEX_VERSION`, flush token down every memory port and answers once all ports have; every independently buffered write path (each dcache lane, each OM input of the ocache) carries its own token. Read-only caches (icache, tcache, rtcache, rcache) no longer forward flushes. `DBG_FLUSH_STALL` adds random input backpressure to the flush path for stress tests. -- **L1-only flush between launches.** When a single LLC serves every memory client it is the point of coherence, so a launch - boundary cleans only the L1s: `CMD_CACHE_FLUSH` gains an L1-only flag, carried as a flush-token kind that a shared LLC answers - without a walk. Replicated LLCs and LLCs with peer clients (TEX, RTU, RASTER, OM, DXA) still walk. The runtime posts flushes +- **Device-scope flush between launches.** When a single LLC serves every memory client it is the point of coherence, so a launch + boundary cleans only the levels above it. One typed fence operation (`VX_FENCE_ACQ`/`REL`/`SYS`/`IO` in `VX_types.toml`) carries + the cache work from the `CMD_CACHE_FLUSH` header through the `CACHE_FLUSH` DCR write to every flush token, and a shared LLC + answers a device-scope (`ACQ|REL`) token without a walk. Replicated LLCs and LLCs with peer clients (TEX, RTU, RASTER, OM, DXA) still walk. The runtime posts flushes lazily and flushes fully before any device-memory transfer, and device busy stays high until every core write, uncached IO stores included, is visible in memory. *Why:* per-launch flush cost at 4 cores + L2 drops from 2,750 to 180 cycles. -- **Targeted fences.** A memory fence sends an L1-only flush token that the shared LLC answers without a walk. A fence that orders - only device (I/O) accesses decodes as its own LSU op, and its token makes each level drain to its memory ports without walking. +- **Targeted fences.** A memory fence sends its fence operation (acquire, release or both) in a flush token that the shared LLC + answers without a walk. A fence that orders only device (I/O) accesses sends an `IO` token, which makes each level drain to its + memory ports without walking. *Why:* printf, which fences after each device write, runs 13.6x faster on rtlsim at 2 cores + L2. - **LMEM DMA arbitration.** DXA writes into shared memory and the TCU's WGMMA operand reads now share the local-memory DMA port round-robin. DXA had fixed priority and starved the TCU for about 510 cycles per tiled-scatter transfer. *Why:* rtlsim WGMMA with diff --git a/VX_types.toml b/VX_types.toml index 3bb610637c..4babbab5f2 100644 --- a/VX_types.toml +++ b/VX_types.toml @@ -82,10 +82,21 @@ VX_DCR_BASE_CACHE_FLUSH = 0x000 VX_DCR_BASE_MPM_VALUE = 0x001 VX_DCR_BASE_STATE_END = 0x002 -[cache_flush] -# VX_DCR_BASE_CACHE_FLUSH write value: flush only the levels above the -# last-level cache, which stays the point of coherence for the next kernel. -VX_CACHE_FLUSH_L1_ONLY = 0x10000 +# Fence operation: the cache work a memory fence or a cache flush owes, carried +# by the CMD_CACHE_FLUSH header, the VX_DCR_BASE_CACHE_FLUSH write value and +# every flush token. Device scope ends at the shared last-level cache, system +# scope at memory. +[fence_op] +VX_FENCE_ACQ = 0x1 # acquire: later reads see writes made visible at the scope +VX_FENCE_REL = 0x2 # release: earlier writes reach the scope's point of coherence +VX_FENCE_SYS = 0x4 # system scope +VX_FENCE_IO = 0x8 # also order the non-cacheable (IO) path +VX_FENCE_OP_BITS = 4 +# CMD_CACHE_FLUSH carries its fence operation in the header flags, above the +# flags every command shares. A cache flush, as a command and as the +# VX_DCR_BASE_CACHE_FLUSH write value, is ACQ|REL at device scope or +# ACQ|REL|SYS at system scope; any other value is illegal. +VX_CP_FLUSH_OP_SHIFT = 2 [dcr_mmu] VX_DCR_MMU_STATE_BEGIN = 0x004 diff --git a/ci/baselines/perf/core.json b/ci/baselines/perf/core.json index 9a415a3cca..3fd2eba78d 100644 --- a/ci/baselines/perf/core.json +++ b/ci/baselines/perf/core.json @@ -6,7 +6,7 @@ }, "app": "raycast", "args": "", - "config_hash": "0076c1c7149fd820", + "config_hash": "55cc313a7e04e175", "configs": "-DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -17,7 +17,7 @@ }, "app": "raycast", "args": "", - "config_hash": "86f96396293472bc", + "config_hash": "dd27d4e019b1ce48", "configs": "-DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -28,7 +28,7 @@ }, "app": "sgemm", "args": "-n128", - "config_hash": "50be41688c7a5892", + "config_hash": "bb3179476f050efd", "configs": "-DVX_CFG_NUM_WARPS=8 -DVX_CFG_NUM_CORES=2 -DVX_CFG_NUM_THREADS=16 -DVX_CFG_L2_ENABLE", "driver": "rtlsim" }, @@ -39,7 +39,7 @@ }, "app": "sgemm", "args": "-n128", - "config_hash": "d10e965d669b6ad7", + "config_hash": "d7960926dfeeeb1a", "configs": "-DVX_CFG_NUM_WARPS=8 -DVX_CFG_NUM_CORES=2 -DVX_CFG_NUM_THREADS=4 -DVX_CFG_L2_ENABLE", "driver": "rtlsim" }, @@ -50,7 +50,7 @@ }, "app": "sgemm", "args": "-n128", - "config_hash": "ee77f6b8863fdaa2", + "config_hash": "fa3eb81110539fb3", "configs": "-DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -61,7 +61,7 @@ }, "app": "sgemm", "args": "-n128", - "config_hash": "b5741e7c3eff913a", + "config_hash": "faa73f4f1a81a3d0", "configs": "-DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -72,7 +72,7 @@ }, "app": "sgemmx", "args": "-n128", - "config_hash": "aa7c1792b3058b0f", + "config_hash": "5e051358cb6705f1", "configs": "-DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -83,7 +83,7 @@ }, "app": "sgemmx", "args": "-n128", - "config_hash": "6e8155cd4f44cb4c", + "config_hash": "0286292d319c5b4e", "configs": "-DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -94,7 +94,7 @@ }, "app": "sgemv", "args": "-m512 -n512", - "config_hash": "bc01cb851ff753ef", + "config_hash": "2a1bbb428f8d6870", "configs": "-DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -105,7 +105,7 @@ }, "app": "sgemv", "args": "-m512 -n512", - "config_hash": "77b34ef7d9d04cc3", + "config_hash": "575d72e47c1c0daa", "configs": "-DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -116,7 +116,7 @@ }, "app": "softmax", "args": "-n64", - "config_hash": "937a6052df977e92", + "config_hash": "d656cb5ba22d494f", "configs": "-DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -127,7 +127,7 @@ }, "app": "softmax", "args": "-n64", - "config_hash": "012f90b9f6a5c4eb", + "config_hash": "f5c775b6c4dbc1cf", "configs": "-DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -138,7 +138,7 @@ }, "app": "stencil3d", "args": "-n32", - "config_hash": "28209a489433d581", + "config_hash": "5082708220a3aab3", "configs": "-DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -149,7 +149,7 @@ }, "app": "stencil3d", "args": "-n32", - "config_hash": "ba97d9a86c5b0e88", + "config_hash": "7c57f7380ccb6a94", "configs": "-DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -160,7 +160,7 @@ }, "app": "vecadd", "args": "-n16384", - "config_hash": "d69831f16765927d", + "config_hash": "37045d524c1e46ce", "configs": "-DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -171,7 +171,7 @@ }, "app": "vecadd", "args": "-n16384", - "config_hash": "15bed1c965f199d5", + "config_hash": "d353d7d15f65b5fd", "configs": "-DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" } diff --git a/ci/baselines/perf/dxa.json b/ci/baselines/perf/dxa.json index 5ceb5e67a4..926c0cef32 100644 --- a/ci/baselines/perf/dxa.json +++ b/ci/baselines/perf/dxa.json @@ -6,7 +6,7 @@ }, "app": "dxa_copy_mcast", "args": "", - "config_hash": "f685f7e8453a1a76", + "config_hash": "902d06551db54908", "configs": "-DVX_CFG_EXT_DXA_ENABLE", "driver": "rtlsim" }, @@ -17,7 +17,7 @@ }, "app": "dxa_copy", "args": "-d1", - "config_hash": "c0dbd5eb66a60f10", + "config_hash": "07394e6aa480a2d8", "configs": "-DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -28,7 +28,7 @@ }, "app": "dxa_copy", "args": "-d1", - "config_hash": "91a6022549e40496", + "config_hash": "2bb76314b3aac79b", "configs": "-DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -39,7 +39,7 @@ }, "app": "sgemm2_dxa_mcast", "args": "-n128", - "config_hash": "f39cb8922a760292", + "config_hash": "cbfcd136a9cbf5f3", "configs": "-DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -50,7 +50,7 @@ }, "app": "sgemm2_dxa_mcast", "args": "-n128", - "config_hash": "19f0c371a91978e5", + "config_hash": "4c813805db4d6ceb", "configs": "-DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -61,7 +61,7 @@ }, "app": "sgemm2_dxa", "args": "-n128 -t4 -m1", - "config_hash": "7d8dca8d11bfa2b8", + "config_hash": "dc6a4fb24203f236", "configs": "-DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -72,7 +72,7 @@ }, "app": "sgemm2_dxa", "args": "-n128 -t4 -m1", - "config_hash": "5e0a57f876ead851", + "config_hash": "c0117149996966a4", "configs": "-DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -83,7 +83,7 @@ }, "app": "sgemm_tcu_wg_dxa_mcast", "args": "-m 128 -n 128 -k 64", - "config_hash": "6ee1ce1e30271b27", + "config_hash": "4578525b3dad120a", "configs": "-DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1 -DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -94,7 +94,7 @@ }, "app": "sgemm_tcu_wg_dxa_mcast", "args": "-m 128 -n 128 -k 64", - "config_hash": "fdaf784cac06b135", + "config_hash": "cf9987cc4e0ec4b6", "configs": "-DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_EXT_DXA_ENABLE -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1 -DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -105,7 +105,7 @@ }, "app": "sgemm_tcu_wg_dxa", "args": "-m 128 -n 128 -k 64", - "config_hash": "17fcdb7f133e7b77", + "config_hash": "2dfa43c0ffd2af2a", "configs": "-DVX_CFG_ISSUE_WIDTH=4 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_WGMMA_ENABLE -DVX_CFG_EXT_DXA_ENABLE -DWGMMA_NRC=16 -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1 -DVX_CFG_NUM_WARPS=8 -DVX_CFG_NUM_THREADS=32", "driver": "rtlsim" }, @@ -116,7 +116,7 @@ }, "app": "sgemm_tcu_wg_sp_dxa", "args": "-m 128 -n 128 -k 128", - "config_hash": "c1903e04a7a46374", + "config_hash": "5cb40c33773fc66c", "configs": "-DVX_CFG_ISSUE_WIDTH=4 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_WGMMA_ENABLE -DVX_CFG_TCU_SPARSE_ENABLE -DVX_CFG_EXT_DXA_ENABLE -DWGMMA_NRC=32 -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1 -DVX_CFG_NUM_WARPS=8 -DVX_CFG_NUM_THREADS=32", "driver": "rtlsim" } diff --git a/ci/baselines/perf/graphics.json b/ci/baselines/perf/graphics.json index 274f88d9d1..bd4a616520 100644 --- a/ci/baselines/perf/graphics.json +++ b/ci/baselines/perf/graphics.json @@ -6,7 +6,7 @@ }, "app": "gfx_draw3d", "args": "-w 128 -h 128 -t box.cgltrace -r box_ref_128.png", - "config_hash": "b9ae34046251fac7", + "config_hash": "89c0128e9ca4f6fd", "configs": "-DVX_CFG_EXT_TEX_ENABLE -DVX_CFG_EXT_RASTER_ENABLE -DVX_CFG_EXT_OM_ENABLE -DVX_CFG_NUM_CORES=2 -DVX_CFG_NUM_THREADS=4 -DVX_CFG_L2_ENABLE", "driver": "rtlsim" }, @@ -17,7 +17,7 @@ }, "app": "gfx_draw3d", "args": "-w 128 -h 128 -t box.cgltrace -r box_ref_128.png", - "config_hash": "97e007bf4af71f24", + "config_hash": "e624b9b51f6baef3", "configs": "-DVX_CFG_EXT_TEX_ENABLE -DVX_CFG_EXT_RASTER_ENABLE -DVX_CFG_EXT_OM_ENABLE -DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -28,7 +28,7 @@ }, "app": "gfx_draw3d", "args": "-w 128 -h 128 -t box.cgltrace -r box_ref_128.png", - "config_hash": "16e4ff86b50dfeb0", + "config_hash": "270685a4f2b573e4", "configs": "-DVX_CFG_EXT_TEX_ENABLE -DVX_CFG_EXT_RASTER_ENABLE -DVX_CFG_EXT_OM_ENABLE -DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -39,7 +39,7 @@ }, "app": "gfx_om", "args": "-w 128 -h 128 -r whitebox_128.png", - "config_hash": "32b92586e12960d3", + "config_hash": "8f81b9cbea824821", "configs": "-DVX_CFG_EXT_OM_ENABLE -DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -50,7 +50,7 @@ }, "app": "gfx_om", "args": "-w 128 -h 128 -r whitebox_128.png", - "config_hash": "669d36bc2f61a5a8", + "config_hash": "96b6e6d47c8f0e6f", "configs": "-DVX_CFG_EXT_OM_ENABLE -DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -61,7 +61,7 @@ }, "app": "gfx_raster", "args": "-w 128 -h 128 -t triangle.cgltrace -r triangle_ref_128.png", - "config_hash": "12fd2263afeaf71b", + "config_hash": "465f2e520f475df5", "configs": "-DVX_CFG_EXT_RASTER_ENABLE -DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -72,7 +72,7 @@ }, "app": "gfx_raster", "args": "-w 128 -h 128 -t triangle.cgltrace -r triangle_ref_128.png", - "config_hash": "4a9935fb649318b3", + "config_hash": "f672749b1816d04d", "configs": "-DVX_CFG_EXT_RASTER_ENABLE -DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" }, @@ -83,7 +83,7 @@ }, "app": "gfx_tex", "args": "-i toad.png -r toad_ref_f0.png -f 0 -g 0", - "config_hash": "5f48e794c81b31a0", + "config_hash": "54f35f4d8236a2f5", "configs": "-DVX_CFG_EXT_TEX_ENABLE -DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -94,7 +94,7 @@ }, "app": "gfx_tex", "args": "-i toad.png -r toad_ref_f0.png -f 0 -g 0", - "config_hash": "39f259e6962fff66", + "config_hash": "dba2310b8ed2bc68", "configs": "-DVX_CFG_EXT_TEX_ENABLE -DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" } diff --git a/ci/baselines/perf/raytracing.json b/ci/baselines/perf/raytracing.json index 61a29318b4..2c55a513a7 100644 --- a/ci/baselines/perf/raytracing.json +++ b/ci/baselines/perf/raytracing.json @@ -6,7 +6,7 @@ }, "app": "rt_raycast", "args": "", - "config_hash": "cdcc27d7e9fdecdb", + "config_hash": "926004202e1230cc", "configs": "-DVX_CFG_EXT_RTU_ENABLE -DVX_CFG_NUM_CORES=2 -DVX_CFG_NUM_THREADS=4 -DVX_CFG_L2_ENABLE", "driver": "rtlsim" }, @@ -17,7 +17,7 @@ }, "app": "rt_raycast", "args": "", - "config_hash": "8f283c30f6aaecdf", + "config_hash": "cde0e92d03a53a87", "configs": "-DVX_CFG_EXT_RTU_ENABLE -DVX_CFG_NUM_THREADS=16", "driver": "rtlsim" }, @@ -28,7 +28,7 @@ }, "app": "rt_raycast", "args": "", - "config_hash": "05235d8415e5e2d4", + "config_hash": "fffab4e1c8cfe28a", "configs": "-DVX_CFG_EXT_RTU_ENABLE -DVX_CFG_NUM_THREADS=4", "driver": "rtlsim" } diff --git a/ci/baselines/perf/tensor.json b/ci/baselines/perf/tensor.json index 89183423d9..5626ed1d00 100644 --- a/ci/baselines/perf/tensor.json +++ b/ci/baselines/perf/tensor.json @@ -6,7 +6,7 @@ }, "app": "sgemm_tcu", "args": "-m 128 -n 128 -k 128", - "config_hash": "33ee9cd268c5743e", + "config_hash": "4fbb4f6c32f0fac9", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8 -DVX_CFG_ISSUE_WIDTH=4 -DVX_CFG_EXT_TCU_ENABLE -DITYPE=fp16 -DOTYPE=fp32 -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1", "driver": "rtlsim" }, @@ -17,7 +17,7 @@ }, "app": "sgemm_tcu", "args": "-m 128 -n 128 -k 128", - "config_hash": "e72e70a9bd461b0f", + "config_hash": "2dcf0a1b4eea6c29", "configs": "-DVX_CFG_NUM_WARPS=8 -DVX_CFG_EXT_TCU_ENABLE -DITYPE=fp16 -DOTYPE=fp32 -DVX_CFG_NUM_CORES=2 -DVX_CFG_NUM_THREADS=16 -DVX_CFG_L2_ENABLE", "driver": "rtlsim" }, @@ -28,7 +28,7 @@ }, "app": "sgemm_tcu", "args": "-m 128 -n 128 -k 128", - "config_hash": "491c58eb36129ab7", + "config_hash": "234a9a6ed54055b5", "configs": "-DVX_CFG_NUM_WARPS=8 -DVX_CFG_EXT_TCU_ENABLE -DITYPE=fp16 -DOTYPE=fp32 -DVX_CFG_NUM_CORES=2 -DVX_CFG_NUM_THREADS=4 -DVX_CFG_L2_ENABLE", "driver": "rtlsim" }, @@ -39,7 +39,7 @@ }, "app": "sgemm_tcu", "args": "-m 128 -n 128 -k 128", - "config_hash": "6feda83b1a53a43a", + "config_hash": "1a511d0897922770", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_EXT_TCU_ENABLE -DITYPE=fp16 -DOTYPE=fp32", "driver": "rtlsim" }, @@ -50,7 +50,7 @@ }, "app": "sgemm2_tcu", "args": "-m 128 -n 128 -k 64", - "config_hash": "ea1f183f506410da", + "config_hash": "2a6b68d4c73246ad", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8 -DVX_CFG_ISSUE_WIDTH=4 -DVX_CFG_EXT_TCU_ENABLE -DITYPE=fp16 -DOTYPE=fp32 -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1", "driver": "rtlsim" } diff --git a/ci/baselines/perf/tensor_mx.json b/ci/baselines/perf/tensor_mx.json index 56ed7d1c97..f3f47dd3e4 100644 --- a/ci/baselines/perf/tensor_mx.json +++ b/ci/baselines/perf/tensor_mx.json @@ -6,7 +6,7 @@ }, "app": "sgemm_tcu_mx", "args": "-m 128 -n 128 -k32", - "config_hash": "a412f7da5066084b", + "config_hash": "2d2b1b822bd13001", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_MX_ENABLE -DVX_CFG_TCU_FP8_ENABLE -DITYPE=mxfp8 -DOTYPE=fp32 -DVX_CFG_TCU_TYPE_DPI", "driver": "rtlsim" } diff --git a/ci/baselines/perf/tensor_sp.json b/ci/baselines/perf/tensor_sp.json index 1cae9a1bf1..715eea6d87 100644 --- a/ci/baselines/perf/tensor_sp.json +++ b/ci/baselines/perf/tensor_sp.json @@ -6,7 +6,7 @@ }, "app": "sgemm_tcu_sp", "args": "-m 128 -n 128 -k 128", - "config_hash": "875ddba9797281cf", + "config_hash": "3f34e8ee3f7f7e13", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_SPARSE_ENABLE", "driver": "rtlsim" } diff --git a/ci/baselines/perf/tensor_wg.json b/ci/baselines/perf/tensor_wg.json index 188783bc99..561ab5adac 100644 --- a/ci/baselines/perf/tensor_wg.json +++ b/ci/baselines/perf/tensor_wg.json @@ -6,7 +6,7 @@ }, "app": "sgemm_tcu_wg", "args": "-m64 -n64 -k64", - "config_hash": "399a2ad5cb9f462c", + "config_hash": "242cd0e42b1e6d8d", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8 -DVX_CFG_ISSUE_WIDTH=4 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_WGMMA_ENABLE -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1 -DVX_CFG_TCU_FEDP2K -DITYPE=fp16 -DOTYPE=fp32 -DWGMMA_NRC=8 -DWGMMA_RS", "driver": "rtlsim" }, @@ -17,7 +17,7 @@ }, "app": "sgemm_tcu_wg", "args": "-m 128 -n 128 -k 128", - "config_hash": "32207252360ed203", + "config_hash": "731fefa477a89198", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8 -DVX_CFG_ISSUE_WIDTH=4 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_WGMMA_ENABLE -DITYPE=fp16 -DOTYPE=fp32 -DWGMMA_NRC=32 -DWGMMA_SS -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1", "driver": "rtlsim" }, @@ -28,7 +28,7 @@ }, "app": "sgemm_tcu_wg_sp", "args": "-m 128 -n 128 -k 128", - "config_hash": "d4c92cf3213ec8ab", + "config_hash": "b5b5adc71557d418", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8 -DVX_CFG_ISSUE_WIDTH=4 -DVX_CFG_EXT_TCU_ENABLE -DVX_CFG_TCU_WGMMA_ENABLE -DVX_CFG_TCU_SPARSE_ENABLE -DWGMMA_NRC=32 -DVX_CFG_NUM_ALU_BLOCKS=1 -DVX_CFG_NUM_LSU_BLOCKS=1 -DVX_CFG_NUM_FPU_BLOCKS=1", "driver": "rtlsim" } diff --git a/ci/baselines/synthesis/beacon/graphics.json b/ci/baselines/synthesis/beacon/graphics.json index e9ece858de..4fd2f3a012 100644 --- a/ci/baselines/synthesis/beacon/graphics.json +++ b/ci/baselines/synthesis/beacon/graphics.json @@ -1,13 +1,19 @@ { "gfx": { "accepted": { - "against": "28fc2c581262d2d7d4e1dc432d50cc303e3dea2e", + "against": "26d2bc4b5409a35a111e8316ac3a87d07b15fc80", "regressions": [ { "after": 14, "before": null, "kind": "new", "name": "graphics/g_raster_core_0.raster_core/raster_slices_0.raster_earlyz/quad_zprod.d" + }, + { + "after": 1071, + "before": 1073, + "kind": "ties", + "name": "tied_bits" } ] }, @@ -17,7 +23,7 @@ "dut": "gfx", "result": { "bram": 183.5, - "build_time_s": 171, + "build_time_s": 155, "deep_endpoints": 1738, "deepest_paths": [ "19 g_rtu_core_0.rtu_core/scheduler/g_recip_pe.recip_tags/g_shift.g_partial_reset.pipe_free[219] -> g_rtu_core_0.rtu_core/scheduler/g1_idx.d[4]", @@ -32,22 +38,22 @@ "18 g_rtu_core_0.rtu_core/scheduler/g_recip_pe.recip_tags/g_shift.g_partial_reset.pipe_free[219] -> g_rtu_core_0.rtu_core/scheduler/ctx_arbiter/g_model1.reqs_mask.d[29]" ], "dsp": 1140, - "endpoints": 314239, + "endpoints": 314280, "env": { "circt": "CIRCT 892a65a01", "device": "xcu55c-fsvh2892-2L-e", "foldsim": "foldsim d8350bc0f", "xlen": 32 }, - "ff": 400422, + "ff": 400445, "fix_levels": 12, "interfaces": {}, - "lut": 319847, + "lut": 319803, "lutram": 14119, "max_levels": 19, "pred_fmax_mhz": 264.7, "risk_endpoints": 471, - "tied_bits": 1073, + "tied_bits": 1071, "tied_ports": [ { "bits": 533, @@ -64,11 +70,6 @@ "port": "graphics.cluster_id", "width": 1 }, - { - "bits": 1, - "port": "rtcache_dcr_flush.l1_only", - "width": 1 - }, { "bits": 1, "port": "rtu_socket_arb.bus_in_if_0_arm_data", @@ -88,11 +89,6 @@ "bits": 1, "port": "rtu_socket_arb.bus_in_if_1_req_data", "width": 550 - }, - { - "bits": 1, - "port": "tcache_dcr_flush.l1_only", - "width": 1 } ], "units": { @@ -194,13 +190,19 @@ }, "gfxvm": { "accepted": { - "against": "28fc2c581262d2d7d4e1dc432d50cc303e3dea2e", + "against": "26d2bc4b5409a35a111e8316ac3a87d07b15fc80", "regressions": [ { "after": 14, "before": null, "kind": "new", "name": "graphics/g_raster_core_0.raster_core/raster_slices_0.raster_earlyz/quad_zprod.d" + }, + { + "after": 1073, + "before": 1075, + "kind": "ties", + "name": "tied_bits" } ] }, @@ -210,7 +212,7 @@ "dut": "gfxvm", "result": { "bram": 183.5, - "build_time_s": 181, + "build_time_s": 160, "deep_endpoints": 1889, "deepest_paths": [ "19 g_rtu_core_0.rtu_core/scheduler/g_recip_pe.recip_tags/g_shift.g_partial_reset.pipe_free[219] -> g_rtu_core_0.rtu_core/scheduler/g1_idx.d[4]", @@ -225,22 +227,22 @@ "18 g_rtu_core_0.rtu_core/scheduler/g_recip_pe.recip_tags/g_shift.g_partial_reset.pipe_free[219] -> g_rtu_core_0.rtu_core/scheduler/ctx_arbiter/g_model1.reqs_mask.d[29]" ], "dsp": 1140, - "endpoints": 328896, + "endpoints": 328937, "env": { "circt": "CIRCT 892a65a01", "device": "xcu55c-fsvh2892-2L-e", "foldsim": "foldsim d8350bc0f", "xlen": 32 }, - "ff": 415271, + "ff": 415294, "fix_levels": 12, "interfaces": {}, - "lut": 331197, + "lut": 331144, "lutram": 14557, "max_levels": 19, "pred_fmax_mhz": 256.3, "risk_endpoints": 475, - "tied_bits": 1075, + "tied_bits": 1073, "tied_ports": [ { "bits": 533, @@ -267,11 +269,6 @@ "port": "l2cache.core_bus_if_3_rsp_ready", "width": 1 }, - { - "bits": 1, - "port": "rtcache_dcr_flush.l1_only", - "width": 1 - }, { "bits": 1, "port": "rtu_socket_arb.bus_in_if_0_arm_data", diff --git a/ci/baselines/synthesis/beacon/tensor.json b/ci/baselines/synthesis/beacon/tensor.json index f589a16fe5..78b4e48cc7 100644 --- a/ci/baselines/synthesis/beacon/tensor.json +++ b/ci/baselines/synthesis/beacon/tensor.json @@ -62,14 +62,25 @@ } }, "tensor": { + "accepted": { + "against": "26d2bc4b5409a35a111e8316ac3a87d07b15fc80", + "regressions": [ + { + "after": 4, + "before": 6, + "kind": "ties", + "name": "tied_bits" + } + ] + }, "clock_mhz": 250, "config_hash": "f4269536f1b2647b", "configs": "-DVX_CFG_NUM_THREADS=16 -DVX_CFG_NUM_WARPS=16", "dut": "tensor", "result": { "bram": 114.5, - "build_time_s": 110, - "deep_endpoints": 4737, + "build_time_s": 85, + "deep_endpoints": 4761, "deepest_paths": [ "25 g_cores_0.tcu_unit/g_blocks_0.tcu_block/tcu_core/g_i_0.g_j_0.fedp/pipe_acc/g_pipe.g_no_reset.pipe[39] -> g_cores_0.tcu_unit/g_blocks_0.tcu_block/tcu_core/g_i_0.g_j_0.fedp/pipe_norm_round/g_pipe.g_no_reset.pipe.d[14]", "25 g_cores_0.tcu_unit/g_blocks_0.tcu_block/tcu_core/g_i_0.g_j_0.fedp/pipe_acc/g_pipe.g_no_reset.pipe[39] -> g_cores_0.tcu_unit/g_blocks_0.tcu_block/tcu_core/g_i_0.g_j_0.fedp/pipe_norm_round/g_pipe.g_no_reset.pipe.d[17]", @@ -83,43 +94,33 @@ "25 g_cores_0.tcu_unit/g_blocks_0.tcu_block/tcu_core/g_i_0.g_j_1.fedp/pipe_acc/g_pipe.g_no_reset.pipe[39] -> g_cores_0.tcu_unit/g_blocks_0.tcu_block/tcu_core/g_i_0.g_j_1.fedp/pipe_norm_round/g_pipe.g_no_reset.pipe.d[18]" ], "dsp": 267, - "endpoints": 170624, + "endpoints": 170647, "env": { "circt": "CIRCT 892a65a01", "device": "xcu55c-fsvh2892-2L-e", "foldsim": "foldsim d8350bc0f", "xlen": 32 }, - "ff": 161523, + "ff": 161531, "fix_levels": 12, "interfaces": {}, - "lut": 260189, + "lut": 259747, "lutram": 12672, "max_levels": 25, "pred_fmax_mhz": 253.4, "risk_endpoints": 411, - "tied_bits": 6, + "tied_bits": 4, "tied_ports": [ { "bits": 1, "port": "g_cores_0.mem_unit.dcr_flush_if_req", "width": 1 }, - { - "bits": 1, - "port": "g_cores_0.mem_unit.flush_l1_only", - "width": 1 - }, { "bits": 1, "port": "g_cores_1.mem_unit.dcr_flush_if_req", "width": 1 }, - { - "bits": 1, - "port": "g_cores_1.mem_unit.flush_l1_only", - "width": 1 - }, { "bits": 1, "port": "g_mem_bus_if_0.g_i0.mem_arb.bus_in_if_0_req_valid", @@ -197,7 +198,7 @@ "l2cache/g_cache_cache/g_core_req_skid_*_req_skid": 9 }, "uram": 0, - "watch_endpoints": 26226, + "watch_endpoints": 26346, "watch_levels": 8 } } diff --git a/ci/baselines/synthesis/beacon_asic/graphics.json b/ci/baselines/synthesis/beacon_asic/graphics.json index c69cd935b7..559a510439 100644 --- a/ci/baselines/synthesis/beacon_asic/graphics.json +++ b/ci/baselines/synthesis/beacon_asic/graphics.json @@ -1,27 +1,38 @@ { "gfx": { + "accepted": { + "against": "26d2bc4b5409a35a111e8316ac3a87d07b15fc80", + "regressions": [ + { + "after": 1063, + "before": 1065, + "kind": "ties", + "name": "tied_bits" + } + ] + }, "clock_mhz": 1000, "config_hash": "f49712b842f2f234", "configs": "-DVX_CFG_NUM_THREADS=4 -DVX_CFG_NUM_WARPS=4", "dut": "gfx", "result": { - "build_time_s": 175, - "cells": 1875629, - "endpoints": 239282, + "build_time_s": 100, + "cells": 1875217, + "endpoints": 239287, "env": { "circt": "CIRCT 892a65a01", "foldsim": "foldsim d8350bc0f", "pdk": "asap7", "xlen": 32 }, - "ff": 420725, + "ff": 420724, "fmax_mhz": 874.9, "macros": 76, "max_stages": 38, "overhead_ps": 231, "period_ps": 1143, "stage_ps": 24, - "tied_bits": 1065, + "tied_bits": 1063, "tied_ports": [ { "bits": 529, @@ -38,11 +49,6 @@ "port": "graphics.cluster_id", "width": 1 }, - { - "bits": 1, - "port": "rtcache_dcr_flush.l1_only", - "width": 1 - }, { "bits": 1, "port": "rtu_socket_arb.bus_in_if_0_arm_data", @@ -62,11 +68,6 @@ "bits": 1, "port": "rtu_socket_arb.bus_in_if_1_req_data", "width": 140 - }, - { - "bits": 1, - "port": "tcache_dcr_flush.l1_only", - "width": 1 } ] } diff --git a/ci/baselines/synthesis/beacon_asic/tensor.json b/ci/baselines/synthesis/beacon_asic/tensor.json index 0ac4a29458..4fabf553fa 100644 --- a/ci/baselines/synthesis/beacon_asic/tensor.json +++ b/ci/baselines/synthesis/beacon_asic/tensor.json @@ -37,49 +37,50 @@ } }, "tensor": { + "accepted": { + "against": "26d2bc4b5409a35a111e8316ac3a87d07b15fc80", + "regressions": [ + { + "after": 4, + "before": 6, + "kind": "ties", + "name": "tied_bits" + } + ] + }, "clock_mhz": 1000, "config_hash": "2992cc36d736afff", "configs": "-DVX_CFG_NUM_THREADS=8 -DVX_CFG_NUM_WARPS=8", "dut": "tensor", "result": { - "build_time_s": 85, - "cells": 859424, - "endpoints": 89451, + "build_time_s": 65, + "cells": 860583, + "endpoints": 89468, "env": { "circt": "CIRCT 892a65a01", "foldsim": "foldsim d8350bc0f", "pdk": "asap7", "xlen": 32 }, - "ff": 188237, + "ff": 188243, "fmax_mhz": 977.5, "macros": 28, "max_stages": 33, "overhead_ps": 231, "period_ps": 1023, "stage_ps": 24, - "tied_bits": 6, + "tied_bits": 4, "tied_ports": [ { "bits": 1, "port": "g_cores_0.mem_unit.dcr_flush_if_req", "width": 1 }, - { - "bits": 1, - "port": "g_cores_0.mem_unit.flush_l1_only", - "width": 1 - }, { "bits": 1, "port": "g_cores_1.mem_unit.dcr_flush_if_req", "width": 1 }, - { - "bits": 1, - "port": "g_cores_1.mem_unit.flush_l1_only", - "width": 1 - }, { "bits": 1, "port": "g_mem_bus_if_0.g_i0.mem_arb.bus_in_if_0_req_valid", diff --git a/ci/testcases/regression.yaml b/ci/testcases/regression.yaml index 40759e9f2f..686087444e 100644 --- a/ci/testcases/regression.yaml +++ b/ci/testcases/regression.yaml @@ -545,8 +545,9 @@ tests: cores: 2 l2cache: true # Kernel to kernel with no host transfer between (one command batch): the -# launch flushes are L1-only, so the last-level cache alone carries each -# round's writes to the next round, and the full flush runs before readback. +# launch flushes are device-scope, so the last-level cache alone carries each +# round's writes to the next round, and the system-scope flush runs before +# readback. - id: flush_coherence-chain-1 via: blackbox drivers: @@ -578,7 +579,7 @@ tests: l2cache: true l3cache: true # Replicated last-level caches (per-core dcaches without an L2, per-cluster L2s -# without an L3) are not a point of coherence, so an L1-only flush must still +# without an L3) are not a point of coherence, so a device-scope flush must still # invalidate them. - id: flush_coherence-chain-4 via: blackbox @@ -602,7 +603,7 @@ tests: l2cache: true # Each round loads its input with a DXA tile copy, which reaches memory beside # the single dcache, so that dcache is not a point of coherence and must still -# be written back on an L1-only flush. +# be written back on a device-scope flush. - id: flush_coherence-chain-6 via: blackbox drivers: @@ -661,7 +662,7 @@ tests: app: sgemm args: -n32 configs: -DVX_CFG_DCACHE_NUM_BANKS=16 -DVX_CFG_PLATFORM_MEMORY_NUM_BANKS=16 -# The shared L2 keeps its lines across the L1-only launch flushes. +# The shared L2 keeps its lines across the device-scope launch flushes. - id: model_parity-flush-chain check: model_parity via: blackbox diff --git a/docs/assets/img/mlp_cp_dma_llc.svg b/docs/assets/img/mlp_cp_dma_llc.svg index 58c436f523..acf2bca1b5 100644 --- a/docs/assets/img/mlp_cp_dma_llc.svg +++ b/docs/assets/img/mlp_cp_dma_llc.svg @@ -39,7 +39,7 @@ L2: coherent DRAM - L1-only flush + device-scope flush client slot diff --git a/docs/assets/img/mlp_fences.svg b/docs/assets/img/mlp_fences.svg index 5c4b1d5056..e51378b1ec 100644 --- a/docs/assets/img/mlp_fences.svg +++ b/docs/assets/img/mlp_fences.svg @@ -20,7 +20,7 @@ Before: full flush per fence - After: L1-only token + After: device-scope token core: fence L1: walk all lines @@ -34,7 +34,7 @@ L1: write back dirty L2 (LLC): ack, no walk DRAM: not touched - L1-only token + device-scope token dirty lines ack diff --git a/docs/assets/img/mlp_launch_flush.svg b/docs/assets/img/mlp_launch_flush.svg index 5d10af1f49..4e02a597e2 100644 --- a/docs/assets/img/mlp_launch_flush.svg +++ b/docs/assets/img/mlp_launch_flush.svg @@ -1,5 +1,5 @@ - - Flush cycles per launch, drawn to scale: a full flush walks the L2; an L1-only flush skips it. + + Flush cycles per launch, drawn to scale: a full flush walks the L2; a device-scope flush skips it.