Repository navigation
feat(sv): run plain always blocks without the flip-flop shape as processes - #1729
Conversation
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. |
|
Queued — the merge queue status continues in this comment ↓. |
a7cacb6 to
746a3e2
Compare
Merge Queue Status
This pull request spent 22 minutes 29 seconds in the queue, with no time running CI. ReasonThe pull request conflicts with the base branch HintYou should update or rebase your pull request. If you want to requeue this pull request, you can post a Requeued — the merge queue status continues in this comment ↓. |
746a3e2 to
0ff6c70
Compare
0ff6c70 to
d7741b6
Compare
Merge Queue Status
This pull request spent 1 hour 12 minutes 13 seconds in the queue, with no time running CI. ReasonThe pull request conflicts with the base branch The pull request was held in the queue, conflicting with at least one of 3 pull requests ahead of it. The conflict became a base branch one after #1726 merged. HintYou should update or rebase your pull request. If you want to requeue this pull request, you can post a Requeued — the merge queue status continues in this comment ↓. |
d7741b6 to
502b43d
Compare
502b43d to
c87decc
Compare
Merge Queue Status
This pull request spent 50 minutes 19 seconds in the queue, with no time running CI. ReasonThe pull request conflicts with the base branch The pull request was held in the queue, conflicting with at least one of 3 pull requests ahead of it. The conflict became a base branch one after #1776, #1783 merged. HintYou should update or rebase your pull request. If you want to requeue this pull request, you can post a Requeued — the merge queue status continues in this comment ↓. |
A real has no least significant bit to judge an edge on, and IEEE 1800-2023 6.12 prohibits posedge, negedge and edge of a real. A process waiting on one was accepted and never woke; it is now an error. Change-Id: If5c69702c6a335e0ca9a8f0621451d23335be3fa
…esses IEEE 1800-2023 9.2.2.4 restricts only always_ff to the shape of a flip-flop. A plain always whose event control is not a clock and asynchronous resets of one-bit variables now runs as a process waiting on the same event control, instead of being rejected: an edge of a select or an expression, `edge`, an item without an edge next to edges, a multi-bit edge signal (judged on its least significant bit), and several edges of which the body tests none as a reset. Blocks of the flip-flop shape stay on the flip-flop path, lowered as before. always_ff of the other shapes stays rejected. Fixes #1708. Change-Id: Ic4652f6e110243b39566bbf2ed1d2ab3f81a2f7e
Change-Id: I8638596a6f136bca76c8d2cfa844f258f36c3d38
Change-Id: Ic07f6d1941094224ee0e090dc8381f0a424f3198
c87decc to
d8d628e
Compare
Merge Queue Status
This pull request spent 1 hour 17 minutes 10 seconds in the queue, including 1 hour 14 minutes 59 seconds running CI. Required conditions to merge
|
Part of #1123. Fixes #1708.
IEEE 1800-2023 9.2.2.4 restricts only
always_ffto the shape of a flip-flop. Celox now runs a plainalwayswhose event control does not have that shape as a process. The process waits on the same event control, using the expression-event lowering from #1681. Before this change, such a block was rejected as if it were analways_ff.always @(posedge v[0]),@(posedge (a & b)),@(edge a),@(posedge c or b)always @(posedge bus)with a multi-bitbusalways @(posedge a or posedge b) n <= n + 1;with no reset test in the bodyWhere the decision is made:
ff_process::always_falls_back_to_processdecides events that are not edges of a variable. The FF collector and the process collector both use it.runs_as_processhandles shapes that only the frontend can judge: there is no clock/reset split, or an event signal is wider than one bit. It moves these blocks to ordinary processes throughModule::run_edge_processes_as_processes. Unlike scheduled edge processes, they are not markedscheduled_edge.always_ffwith these forms stays rejected. Its messages still say always_ff, and since a plainalwaysno longer reaches those paths, they now appear only when the source saysalways_ff.Fix included:
posedge,negedgeandedgeof a real are illegal (6.12). On master, a process waiting on one, such asinitial @(posedge r), was accepted and never woke. Now it raises a new language error,AnalyzerError::RealEdgeEvent. Without this fix, sv-tests6.12--real_edge(should_fail) would have regressed. It used to be rejected only because a real is 64 bits wide.Interaction with #1712: in a
Simulator, these blocks are now processes. ASimulatordoes not run processes today, and #1712 (branch fix/simulator-rejects-processes) turns that into an error. That PR will cover these blocks as well. This PR doesn't touch theSimulatorpath.Perf
(a) Pure RTL is unchanged. For every one of the 438 untimed SV suite cases, the optimized SIR (
TraceOptions::post_optimized_sir, Debug text hashed) is byte-identical between master and this branch. Blocks of the flip-flop shape never reach the new code: the frontend clones the module only when some block falls back.Tests
New vtests, which pass on Celox, Icarus and Verilator:
plain_always_expression_edges_run_as_processesplain_always_multi_bit_edges_follow_the_lsbplain_always_edges_without_a_reset_run_as_processesThe retained Icarus and Verilator reports were refreshed from fresh runs, and the diff only adds these three cases.
edge_events_of_reals_are_errors.The pinned rejections from docs(sv): document timing controls in processes #1716 now use the
always_ffforms.sv-tests:
9.4.2--event_control_edgegoes from fail to pass in 2state and 4state. I checked this by simulation: with a toggling clock, Celox matches Icarus and Verilator (a=15, then a=0).expected.tsvis updated, and there are no other changes.--test systemverilog, the analyzer, frontend-sv and test-suite crates, clippy-D warnings, fmt anddocs:buildall pass.