Skip to content

feat(sv): run always @* calls of timed tasks as processes and accept package delays - #1816

Merged
mergify[bot] merged 2 commits into
masterfrom
fix/sv-timed-task-comb-and-pkg-delays
Oct 24, 2026
Merged

mergify[bot] merged 2 commits into
masterfrom
fix/sv-timed-task-comb-and-pkg-delays

Conversation

@tignear

@tignear tignear commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Part of #1123. Fixes #1710.

Form Before Now
always @* t(a); where t contains a timing control "timed task call in a combinational process" (unsupported) process that waits on its implicit event list before each run
always_comb t(); / always_latch ... t(); with a timed t "timed task call in a combinational process" (unsupported) language error: "timed task call in an always_comb body" (or always_latch), like a direct timing control there
#pkg::D "package-scoped delay value" (unsupported) waits pkg::D, like #(pkg::D)

IEEE 1800-2023

  • 9.2.2.2.2: always @* is an ordinary always procedure, so it may call a task that suspends.
  • 9.4.2.2: its implicit event list is the variables its statement reads. That includes the task's arguments but not what the task body reads.
  • 9.4.2: the event control waits only for changes after it is reached. A change made while the task is suspended is missed.
  • 9.2.2.2: always_comb and always_latch may not suspend.
  • A.6.5: delay_value includes ps_identifier, so #pkg::D is legal without parentheses.

Change

  • Analyzer (procedural::timed_tasks::classify): an always @* comb process whose body suspends through a task call moves to the process list.
    • Its body becomes forever { @(implicit event); statement }, the same form an always @* with a direct timing control already takes.
    • CombProcess now carries a ProcessSite, so the new process has a location for diagnostics such as fix(sim)!: reject designs with processes in untimed Simulator builds #1720's ProcessRequiresSimulation.
    • A timed task call from always_comb or always_latch raises TimingControlOutsideProcess.
  • Delay values: the unparenthesized pkg::D goes through the same value binding as the parenthesized form.

Perf

Optimized SIR (TraceOptions::post_optimized_sir, hashed Debug text) is byte-identical between base 27f96bc and this branch for 655 of the 657 SV suite cases, timed cases included. The two that differ are the new cases.

Tests

  • New vtests (inserted among the timed-task cases, not at the end of timing.vtest):
    • always_star_timed_task_calls_run_as_processes
    • package_scoped_delay_values_wait_their_value
  • Reference simulators (each case is excluded with retained evidence for the tool that disagrees):
    • The always @* case passes on Icarus. Verilator 5.052 schedules it differently: y changes at 6 instead of 5. A standalone probe also shows Verilator rerunning the call for changes made while the task was suspended, and for variables only the task body reads. New entry: sv_verilator_always_star_timed_task.
    • The package delay case passes on Verilator. Icarus 13.0 can't parse #pkg::D. New entry: sv_icarus_package_delay_value.
    • Both have pre-exclusion records and LIMITATIONS paragraphs. The retained timing.json reports gain only the new records.
  • New Rust test always_star_timed_task_calls_miss_changes_while_suspended (Icarus agrees).
  • Rejections: an always_comb case and an always_latch case were added to timing_controls_outside_suspendable_processes_are_rejected, and the SV: timed task call from always @*, and package-scoped delay values #1710 entry was removed from unimplemented_timing_features_are_rejected.
  • Updated tests:
    • synthesizable::task_timing_control_is_rejected now expects the language error.
    • The analyzer test timed_task_calls_require_a_suspendable_context now checks that always @* becomes a process.
  • sv-tests matches expected.tsv; retained_reports passes; docs updated (EN and JA).

Noticed, not in this PR

%t in Celox defaults to the module's time unit, rounded: #1.5 under `timescale 1ns/1ps prints 2. Icarus and Verilator print in the design's precision (1500), and IEEE 20.4.3 makes the smallest precision the $timeformat default.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T03:06:52.261382Z 88acb3b New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bd85c2d892

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mergify

mergify Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Queued — the merge queue status continues in this comment ↓.

@tignear tignear added the merge-ready Request merging through Mergify after required checks label Oct 23, 2026
@mergify mergify Bot added the queued Mergify queue entry label Oct 23, 2026
@mergify

mergify Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-23 09:57 UTC · Rule: changes · triggered by rule Queue explicitly requested merges
  • 🚫 Left the queue — 2026-10-23 10:55 UTC · at bd85c2d89282b2f01b885958c9110b2ba9efcfda

This pull request spent 57 minutes 24 seconds in the queue, with no time running CI.

Reason

The pull request conflicts with the base branch

The pull request was held in the queue, conflicting with at least one of 4 pull requests ahead of it. The conflict became a base branch one after #1773, #1814 merged.

Hint

You should update or rebase your pull request.

If you want to requeue this pull request, you can post a @mergifyio queue comment.

Requeued — the merge queue status continues in this comment ↓.

@mergify mergify Bot added dequeued Mergify stopped this queue entry; investigate before retrying and removed queued Mergify queue entry labels Oct 23, 2026
@tignear tignear removed merge-ready Request merging through Mergify after required checks dequeued Mergify stopped this queue entry; investigate before retrying labels Oct 23, 2026
@mergify mergify Bot added the dequeued Mergify stopped this queue entry; investigate before retrying label Oct 23, 2026
@tignear
tignear force-pushed the fix/sv-timed-task-comb-and-pkg-delays branch from bd85c2d to 6b6ce69 Compare October 23, 2026 12:02
@mergify mergify Bot removed the dequeued Mergify stopped this queue entry; investigate before retrying label Oct 23, 2026
@tignear
tignear force-pushed the fix/sv-timed-task-comb-and-pkg-delays branch from 6b6ce69 to e0d3f3d Compare October 23, 2026 13:38

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e0d3f3d20f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@tignear
tignear force-pushed the fix/sv-timed-task-comb-and-pkg-delays branch from e0d3f3d to 911d5ce Compare October 23, 2026 13:51

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 911d5ce646

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…package delays

A plain always @* that calls a task containing a timing control was
rejected. It is an ordinary always procedure (IEEE 1800-2023 9.2.2.2.2),
so it now runs as a process that waits on its implicit event list, the
variables the statement reads with the task's arguments but not its body
(9.4.2.2), before each run, like an always @* with a direct timing
control. always_comb and always_latch may not suspend (9.2.2.2): a timed
task call there is now the same language error as a direct timing
control, instead of an unsupported construct.

A package-scoped delay value such as #pkg::D is a ps_identifier delay_value
(A.6.5); it is now bound like the parenthesized #(pkg::D).

Verilator 5.052 schedules the always @* case differently and Icarus 13.0
cannot parse #pkg::D; both cases are excluded with retained evidence.

The wait of an @* now keeps the statements it covers, folded branches
included (Stmt::WaitImplicit), and the frontend reads them with the
analysis that gives a combinational always @* its sensitivity: the
defaults of omitted arguments, of nested calls too, and constant-false
branches count (9.4.2.2), and timing-control expressions do not. Direct
@* waits in processes use the same analysis. Icarus prunes folded
branches and Verilator leaves defaults out; both are excluded.

Fixes #1710

Change-Id: I187e0c26549e9aca2eda399699c24ddbc8de24bf
Change-Id: I63e21eb628046b097fc69220dc1a63f1e148b286
@tignear
tignear force-pushed the fix/sv-timed-task-comb-and-pkg-delays branch from 911d5ce to 88acb3b Compare October 24, 2026 03:04
@tignear tignear added the merge-ready Request merging through Mergify after required checks label Oct 24, 2026
@mergify mergify Bot added the queued Mergify queue entry label Oct 24, 2026
@mergify

mergify Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 1 hour 16 minutes 23 seconds in the queue, including 1 hour 14 minutes 45 seconds running CI.

Required conditions to merge
  • check-success = Conventional Commit title
  • check-success = Queue validation
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/Lint & Format
    • check-neutral = @github-actions/Lint & Format
    • check-skipped = @github-actions/Lint & Format
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/NAPI Build (Linux ARM64 GNU)
    • check-neutral = @github-actions/NAPI Build (Linux ARM64 GNU)
    • check-skipped = @github-actions/NAPI Build (Linux ARM64 GNU)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/NAPI Build (Windows)
    • check-neutral = @github-actions/NAPI Build (Windows)
    • check-skipped = @github-actions/NAPI Build (Windows)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/Rust Test & NAPI Build
    • check-neutral = @github-actions/Rust Test & NAPI Build
    • check-skipped = @github-actions/Rust Test & NAPI Build
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/JS Test (Ubuntu)
    • check-neutral = @github-actions/JS Test (Ubuntu)
    • check-skipped = @github-actions/JS Test (Ubuntu)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/JS Test (Windows)
    • check-neutral = @github-actions/JS Test (Windows)
    • check-skipped = @github-actions/JS Test (Windows)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/Conventional Commit title
    • check-neutral = @github-actions/Conventional Commit title
    • check-skipped = @github-actions/Conventional Commit title

@mergify
mergify Bot merged commit c317767 into master Oct 24, 2026
30 checks passed
@mergify
mergify Bot deleted the fix/sv-timed-task-comb-and-pkg-delays branch October 24, 2026 05:21
@mergify mergify Bot removed the queued Mergify queue entry label Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-ready Request merging through Mergify after required checks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SV: timed task call from always @*, and package-scoped delay values

1 participant