Repository navigation
fix(sim): keep clock copies sensed at the opposite edge apart - #1373
Conversation
A whole-variable copy of a clock joined its source's domain even when it was sensed at the opposite edge, so always_ff @(negedge c) with assign c = clk ran at clk's rising edge. Such a copy is now a clock derived from its source.
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. |
Merge Queue Status
This pull request spent 1 minute 35 seconds in the queue, with no time running CI. ReasonThe pull request #1373 has been manually updated Requeued — the merge queue status continues in this comment ↓. |
Merge Queue Status
This pull request spent 33 minutes 11 seconds in the queue, including 24 minutes 27 seconds running CI. Required conditions to merge
|
A whole-variable copy of a clock joined its source's clock domain even when it was sensed at the opposite edge. With
assign c = clk;andalways_ff @(negedge c), the block ran on clk's rising edge. A Verylclock_negedgechild port connected to a rising-edge clock behaved the same way.unify_clock_domainsnow cuts a copy edge apart when its two ends are sensed at different edges, before it resolves canonical domains. A copy sensed at no edge takes the edge of its drivers, so chains such asassign c = clk; assign d = c; always_ff @(negedge d)are split, including chains through child ports. A root sensed at no edge, such as an SV input used only through copies, takes the edge of its first copy that is sensed at one. A copy that is cut off becomes a derived clock and fires on the source's falling edge, as IEEE 1800 requires.Sensing one signal at both edges is still rejected with an explicit error (#443).
Tests:
derived_register_clock.rsadds six cases: a Veryl internal copy, a Veryl falling-edge child port, SV@(negedge c), an SV chain of copies, an SV chain through a child port, and an unsensed SV input copied to both edges. All six fail on master.cargo nextest run --workspace --features celox/systemverilog: 13759 passed. clippy is clean.