Repository navigation
[hardware] Qualify MaskB operand capture in MASKU - #540
Open
lionelZhaowy wants to merge 2 commits into
Open
lionelZhaowy wants to merge 2 commits into
lionelZhaowy wants to merge 2 commits into
Conversation
MaskB also feeds scalar moves, so an idle MASKU must not capture or acknowledge those operands. Gate its vd spill input and upstream ready with the current issue validity and actual use of the channel. Keep gather/compress ad-hoc reads enabled. Extend the existing vmslt test with scalar-move/old-mask sequences and valid-consumer controls. On main 34bd3bc with real CVA6, 2 lanes and VLEN=2048, the same ELF fails one of 48 checks before this fix and passes all 48 afterwards. The unchanged scalar-move tests also pass 7 and 6 checks.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MASKU can capture scalar-move data while idle and later use it as a comparison's old destination. This can corrupt a masked comparison even when the scalar move itself returns the correct value.
For e32/m1 with VL=3:
101, and v0 has110.vmv.x.sreturns the expected value0x3f800000,vmslt.vx vd, src, zero, v0.tmust produce001.000. It loses masked-off bit 0.MaskB supplies both CPU scalar moves and MASKU's buffer for the old destination (
vdspill). MASKU currently accepts data without a valid consumer. This patch qualifies input valid and upstream ready with the instruction's issue-valid. The instruction must target MASKU and read oldvdor a gather/compress source. An internal input carries issue-valid. Top-level interfaces, state and buffers stay unchanged.The existing
vmslttest adds 12 sequences: integer/FP scalar moves × VL=3/1/4 × two rounds. CSR reads use this baseline's WAIT_IDLE behavior between operations. The test checks only active mask bits, with mask-undisturbed enabled. Controls for old-vdcomparison, masked FMA, gather and all-selected compress run first.This changes the MASKU consumer without including #475, #479, #480 or #539. The first three address requests or broadcasts.
Validation
Base: main
34bd3bc152421b4601a7bf3d6e8e91ffb545c99e, with unchangedBender.lockand pinned CVA6 HPDcache.Configuration: official
ara_tb, real CVA6, 2 lanes / VLEN=2048. Tools: VCS W-2024.09-SP1, host g++ 13.3.1 and LLVM 20.1.0 with matching newlib/compiler-rt.A read-only observer traces the scalar word through the idle MASKU buffer into the failing comparison. The patched run eliminates unqualified captures and retains legitimate old-
vd, gather and compress reads.Validation covers the configuration and directed tests above. The full suite and synthesis were not run. The patch adds no data tags, so ownership in other concurrent cases remains unverified.
Test details and limits
Both RTL versions return all 12 sequences. Only the first original comparison fails, after 14 original checks and 10 positive controls pass. Later observations do not establish independent causes after contamination.
The first faulty word enters an empty buffer at cycle 43848, with issue/commit invalid and the same value returning to the CPU. VMSLT consumes it at cycle 43885. Unqualified captures/acknowledgements decrease from 23/23 to 0/0. Only two original captures coincide with CPU scalar responses.
The patched run accepts 78 old-
vd, six gather and six compress words. It records 374 lane-cycles of output waiting without hold errors. Eight cycles contain a non-MASKU instruction withuse_vd_op=1. No valid MASKU issue exercises the category without old-vdor gather/compress reads.Gather/compress sources finish loading first. VID and compress termination edge cases remain outside this test.
All runs reach the ELF entry and main and finish through the official testbench. Checks include software results, tohost, completion and assertions. VCS returns process status 0 even for the original failure. Existing vmvxs shift-overflow and non-allocatable
.commentlinker warnings remain.Reproduction and local VCS commands
Use the same PR-built ELF for both RTL versions. Give each version a fresh absolute
BUILD_DIR.SPIKE_ROOTsupplies headers only, here from/opt/spike-5cf439b2.timeout 600sets a 600-second timeout. It does not report elapsed runtime.Local builds reused the official Bender-generated list for the same base and locked dependencies. Only the checkout path changed. They also compiled this optional observer and added
-top maskb_capture_observer. The observer only reads DUT signals.Save the observer at an absolute
OBSERVERpath. Compile it before elaboration:Check case IDs 1–48 and
[MASKB_DONE] completed=12. Also check forCore Test *** SUCCESS *** (tohost = 0). The completion count alone does not indicate a pass. This observer requires this hierarchy and two lanes.Optional read-only observer used for the reported measurements
Changelog
Fixed
Checklist
OpenAI Codex assisted with the patch, regression and description. The reported builds and simulations ran. No separate human review was performed.
The affected original tests (
vmand,vmor, andvmxor) and HelloWorld now pass through the official Verilator Make entry in all four configurations: 2/4/8/16 lanes. The applications use the locked LLVM 20.1.0/newlib sources, and Verilator is built from the locked commit06263ec7. Each local run has a 10000000-cycle limit and finishes withtohost = 0, process exit 0 and no runtime assertion errors. The Make entry now accepts native simulator arguments so these runs can use that limit. License checks also pass. The RTL and dependency lock are unchanged by this test-entry update.