Skip to content

[hardware] Reject unsupported active arithmetic vstart - #544

Open
lionelZhaowy wants to merge 2 commits into
pulp-platform:mainfrom
lionelZhaowy:fix-active-vstart
Open

lionelZhaowy wants to merge 2 commits into
pulp-platform:mainfrom
lionelZhaowy:fix-active-vstart

Conversation

@lionelZhaowy

@lionelZhaowy lionelZhaowy commented Nov 7, 2026 •

Copy link
Copy Markdown

With VL=4 and vstart=1, main executes vadd.vv and vsext.vf4 but overwrites destination element zero. That prestart element must remain unchanged. The regression accepts either correct resumed execution or a precise illegal-instruction exception. Main produces neither.

RVV 1.0 section 3.7 permits rejecting a vstart value that the implementation cannot produce for that instruction. This patch applies that policy to active nonzero vstart for VADD.vv/vx/vi and the six integer extensions. It preserves the vstart>=VL no-write path, memory interfaces and CSR interfaces. It does not add arithmetic restart support.

The same six-case ELF reports two prestart errors on main and passes with the patch. The active-start cases trap without writing the destination.

Validation, reproduction and scope

On official main 34bd3bc152421b4601a7bf3d6e8e91ffb545c99e, six cases
produce two prestart errors. The same ELF passes with the patch. The two
active-start cases report cause 2, the original instruction in mtval, and
the original vstart, with no destination write. Normal-start and empty-body
controls pass. Both versions finish normally. Patched RTL also passes the
unmodified official vadd, vsext, vzext, and vwmul tests.

Validation uses the official ara_tb and real CVA6, locked dependencies,
2 lanes/VLEN2048, LLVM 20.1.0, and VCS W-2024.09-SP1. VCS elaboration and
lint add no diagnostics. Real dispatcher generic DC synthesis has 738
flip-flops and zero latches in both versions. There is no technology mapping
or timing result. Direct nonzero-start probes cover the two stated forms.

Related reports: #237 covers an older vstart>=VL boundary. #494 concerns
the separate mandatory-illegal instruction list. This patch covers neither
that list nor successful arithmetic restart.

See apps/active_vstart/README.md for complete public commands and checks.
The RTL retains its authors and license. The patch, regression, and
explanation were prepared with AI assistance.

active_vstart now runs in the existing CI matrix at 2 lanes / VLEN2048, with a native 10000000-cycle limit. The fixed-size application is not added to the larger-VLEN simulation entries. It compiles in all four configurations. Local verification uses the locked LLVM 20.1.0/newlib sources and Verilator commit 06263ec7: the new application passes at 2 lanes, and HelloWorld plus the affected original instruction tests pass at 2/4/8/16 lanes. All 13 local runs finish with tohost = 0, exit 0 and no runtime assertion errors. License checks pass. This update leaves the RTL and dependency lock unchanged.

Reject active nonzero vstart for VADD and integer extensions under RVV 1.0 section 3.7. Preserve the existing empty-body path. Do not add restart execution capability.

Add a public official-runtime regression. The same ELF shows two prestart errors on main and passes with precise rejection. Four official regressions, VCS lint, and real dispatcher generic synthesis pass for two lanes and VLEN2048.

The patch, test, and explanation were prepared with AI assistance. Preserve the existing RTL authors and license.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant