Repository navigation
fix(sv): preserve signedness of power expressions - #1718
Merged
mergify[bot] merged 1 commit intoOct 22, 2026
Conversation
The SV frontend classified every power expression as unsigned. Expressions such as $signed(error) / 2**4 consequently zero-extended negative errors; a 13-bit -384 became 7808 and divided to 488 instead of -24. This prevented Taxi's PTP control loops from locking. Use the base's signedness in both expression and port-connection classifiers, with a self-determined exponent (IEEE 1800-2023 11.6.1, Table 11-21). Add classifier tests and shared two-state/four-state regressions covering constant and dynamic powers, signed/unsigned bases and destinations, sized casts, and continuous/always_comb/always_ff execution. Validation: - SV common suite on all five backend variants: 3658 passed, 20 existing ignores. - SV frontend unit tests: 3 passed. - New cases: Icarus 2 passed; Verilator 1 passed, four-state case unsupported. - Minimal reproducer at O0 and O1: five input vectors each, no mismatches. - Original Taxi clock_cdc[96] and td_leaf full tests pass at O1/two-state with inferred_latch=warn; original sources unchanged. - cargo fmt and affected library/integration clippy checks pass with warnings denied. Change-Id: I0cf4f9c8176f5e537ff239b7d8a0eb644ef54d8a
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
|
Queued — the merge queue status continues in this comment ↓. |
Contributor
Merge Queue Status
This pull request spent 1 hour 45 minutes 49 seconds in the queue, including 1 hour 43 minutes 36 seconds running CI. Required conditions to merge
|
mergify
Bot
deleted the
stack/tignear/fix/sv-power-signedness/preserve-signedness-power-expressions--0cf4f9c8
branch
October 22, 2026 08:00
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.
The SV frontend classified every power expression as unsigned. Expressions
such as $signed(error) / 2**4 consequently zero-extended negative errors;
a 13-bit -384 became 7808 and divided to 488 instead of -24. This prevented
Taxi's PTP control loops from locking.
Use the base's signedness in both expression and port-connection classifiers,
with a self-determined exponent (IEEE 1800-2023 11.6.1, Table 11-21).
Add classifier tests and shared two-state/four-state regressions covering
constant and dynamic powers, signed/unsigned bases and destinations, sized
casts, and continuous/always_comb/always_ff execution.
Validation: