Skip to content

[hardware] Wait for VF4/VF8 extension hazards - #543

Open
lionelZhaowy wants to merge 2 commits into
pulp-platform:mainfrom
lionelZhaowy:fix-ext4-ext8-hazards
Open

lionelZhaowy wants to merge 2 commits into
pulp-platform:mainfrom
lionelZhaowy:fix-ext4-ext8-hazards

Conversation

@lionelZhaowy

@lionelZhaowy lionelZhaowy commented Nov 7, 2026 •

Copy link
Copy Markdown

An older whole-register load can overwrite a correct VF4 or VF8 vsext/vzext result. At e32/m4 and VL=256, vl4re8.v v24, (...) followed by vzext.vf4 v24, v8 produces 224 wrong elements on main.

The requester's widening-hazard throttle allows two writes per source read, but VF4/VF8 can produce four or eight. This patch waits for the existing dependency bits to clear for those four conversions. Their RAW/WAR dependencies also wait conservatively. Other request types keep their current behavior. Related hazard work: #203.

The same ELF passes all 1037 checks with the fix. The four original zero/sign VF4/VF8 cases report 224/224/120/120 errors.

Validation, reproduction and scope

The new apps/ext_hazards test uses disjoint aligned register groups and
checks every result, guards, VL, and vstart. On main
34bd3bc152421b4601a7bf3d6e8e91ffb545c99e, the four zero/sign VF4/VF8
cases report 224/224/120/120 errors. With this patch, the same ELF passes
all 1037 checks. Both versions finish normally. The unmodified official
vsext, vzext, and vwmul tests pass with the patch.

Validation uses the official ara_tb, real CVA6, locked dependencies,
2 lanes/VLEN2048, LLVM 20.1.0, and VCS W-2024.09-SP1. VCS elaboration and
lint pass without added diagnostics. Real requester DC generic synthesis
has zero latches and adds nine flip-flops. There is no technology mapping
or timing result. Other lane counts and broader performance effects were
not measured.

See apps/ext_hazards/README.md for the trigger, result table, and public
build/run commands. Existing RTL authors and licenses remain unchanged.
The patch adaptation, regression, and explanation were prepared with AI
assistance.

ext_hazards 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.

lionelZhaowy and others added 2 commits November 7, 2026 10:23
Wait until existing hazards clear before VF4/VF8 widening reads. The original two-write throttle permits older destination loads to overwrite new extension results. Keep other request types unchanged.

Add an official-runtime regression with independent byte expectations. The same ELF reports 688 errors on main and zero with this change. Three official vector regressions, VCS lint, and real-module 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