Repository navigation
merge queue: merged #2654: fix(testbench): keep unknown bits in TB writes and conditions - #2680
Closed
mergify[bot] wants to merge 4 commits into
Closed
mergify[bot] wants to merge 4 commits into
mergify[bot] wants to merge 4 commits into
Conversation
The symbols a scope imports and the package being analyzed were installed into the shared analysis state behind RefCells, swapped by guards on the way in and out of each scope, with a revision that told memoized elaborations the state had changed. They are now values of the analysis context: entering a scope or a package derives a context for it, a generate item keeps the imports of the scope that elaborated it, and the elaboration memo keys entries by the context's imports and package. Functions that read the imports take the context instead of the state. Change-Id: I082a6f20410bbcaea1391f510c56832fae20f57a
In a four-state build a Veryl testbench lost every unknown bit it wrote: `r = 'x` stored 0 and `s = 'z` stored 1, in both schedulers. The frontend dropped the mask of constants, and TB expressions ran in bit registers with two-state result slots. TB expressions now keep unknown bits as the HDL does: - Constants with x/z digits are emitted with their mask, in Celox's encoding. Unsized fill literals (`'0`, `'1`, `'x`, `'z`) fill their context (IEEE 1800-2023 5.7.1). - In a four-state build, loads of four-state storage, masked constants and every result computed from one use logic registers, so the shared SIR operators propagate X. Result slots and saved values that hold one keep a mask plane. - A condition with no known one bit is false: `if`, and immediate assertions (12.4, 16.3). - A conditional operator with an unknown condition combines both arms bit by bit (11.4.11). Arms that write state, make strings or load an unchecked dynamic address still run only as the condition's known bits select, so that a known condition never runs the other arm; an unknown condition then runs the second one. - A selected write at an unknown index writes nothing, and a read there is x, or 0 from two-state storage (11.5.1). An unknown index never addresses memory. - A wildcard pattern's unknown bits match anything (11.4.6). - A cast to a two-state type, a two-state destination (a variable or a function argument), loop bounds, counts and other numeric uses read unknown bits as 0 (6.11.2). - Narrow loads and selections drop their other bits by moving bits, so z bits stay z. Message arguments now get their mask from the expression result, which replaces the plain-load special case that #2625 added. A two-state build creates no logic registers, so its generated code does not change. A constant's unknown bits read as 0 there, which turns a `'z` into 0 instead of 1 (6.11.2); a wildcard pattern's unknown bits read as 0 too, as they did before. `four_state_tb_edges` now really moves its reset to and from x and z: those moves take 5 host edge batches instead of 2, and its count differs from the reference scheduler by the missed negedge of #2650. Fixes #2645 Change-Id: Id06ef4acf030dff9789a05cb375d1144dc99f280
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.
Note
This is a merge queue draft opened by Mergify. Its pull request has merged, and nobody needs to act on it.
Mergify opened it for batch supposed-beurrenoisette-1dr20t of the
changesqueue, to test #2654 before it merged intomaster.🎉 What landed
Mergify merged its pull request into
master, then closed this draft:89e2819This draft's code was built in this order:
masteratbd12187cd8d31fQueued ahead of this batch
This pull request entered the queue before this batch and is not part of it.
Metadata for CI tooling, read by
mergify ci1 scope
coreRequired conditions of queue rule
changesfor mergecheck-success = Conventional Commit titlecheck-success = Queue validationcheck-success = Verify workflow lockfilemaster]:check-success = @github-actions/Lint & Formatcheck-neutral = @github-actions/Lint & Formatcheck-skipped = @github-actions/Lint & Formatmaster]:check-success = @github-actions/Rust Test & NAPI Buildcheck-neutral = @github-actions/Rust Test & NAPI Buildcheck-skipped = @github-actions/Rust Test & NAPI Buildmaster]:check-success = @github-actions/JS Test (Ubuntu)check-neutral = @github-actions/JS Test (Ubuntu)check-skipped = @github-actions/JS Test (Ubuntu)master]:check-success = @github-actions/Conventional Commit titlecheck-neutral = @github-actions/Conventional Commit titlecheck-skipped = @github-actions/Conventional Commit titlemaster]:check-success = @github-actions/Queue validationcheck-neutral = @github-actions/Queue validationcheck-skipped = @github-actions/Queue validationmaster]:check-success = @github-actions/Verify workflow lockfilecheck-neutral = @github-actions/Verify workflow lockfilecheck-skipped = @github-actions/Verify workflow lockfileRequired conditions to stay in the queue
-conflict-draft-head ~= ^(integration/|renovate/veryl-crates$|upgrade/veryl-|release-please--branches--master--components--celox$|master$)-head ~= ^renovate/-label = release:holdbase ~= ^(master|develop)$base ~= ^stack/body ~= (?m)^Depends-On:head != release-please--branches--master--components--celoxlabel = merge-readymaster]:check-success = @github-actions/Lint & Formatcheck-neutral = @github-actions/Lint & Formatcheck-skipped = @github-actions/Lint & Formatmaster]:check-success = @github-actions/Rust Test & NAPI Buildcheck-neutral = @github-actions/Rust Test & NAPI Buildcheck-skipped = @github-actions/Rust Test & NAPI Buildmaster]:check-success = @github-actions/JS Test (Ubuntu)check-neutral = @github-actions/JS Test (Ubuntu)check-skipped = @github-actions/JS Test (Ubuntu)master]:check-success = @github-actions/Conventional Commit titlecheck-neutral = @github-actions/Conventional Commit titlecheck-skipped = @github-actions/Conventional Commit titlemaster]:check-skipped = @github-actions/Queue validationcheck-neutral = @github-actions/Queue validationcheck-success = @github-actions/Queue validationmaster]:check-success = @github-actions/Verify workflow lockfilecheck-neutral = @github-actions/Verify workflow lockfilecheck-skipped = @github-actions/Verify workflow lockfile