Repository navigation
feat(sv)!: support wait fork and disable fork process control #2116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -968,7 +968,10 @@ impl<'s, 't, 'a> BodyBuilder<'s, 't, 'a> { | |
| _ => self.subroutine_call_statement(*id), | ||
| }, | ||
| StatementKind::Assertion { .. } => Err(unsupported("concurrent assertion")), | ||
| StatementKind::WaitFork => Err(unsupported("wait fork statement")), | ||
| StatementKind::WaitFork => { | ||
| self.allow_timing("wait fork statement")?; | ||
| Ok(vec![Stmt::WaitFork]) | ||
|
Comment on lines
+971
to
+973
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Tasks containing the newly accepted Useful? React with 👍 / 👎. |
||
| } | ||
| StatementKind::WaitOrder { .. } => Err(unsupported("wait order statement")), | ||
| StatementKind::EventTrigger(_) => Err(unsupported("event trigger")), | ||
| StatementKind::ProceduralAssign(_) | StatementKind::ProceduralRelease(_) => { | ||
|
|
@@ -985,11 +988,11 @@ impl<'s, 't, 'a> BodyBuilder<'s, 't, 'a> { | |
| .filter(|token| !token.is_trivia()) | ||
| .find(|token| token.text != "disable") | ||
| .is_some_and(|token| token.text == "fork"); | ||
| Err(unsupported(if disables_fork { | ||
| "disable fork statement" | ||
| if disables_fork { | ||
| Ok(vec![Stmt::DisableFork]) | ||
| } else { | ||
| "disable statement" | ||
| })) | ||
| Err(unsupported("disable statement")) | ||
| } | ||
| } | ||
| StatementKind::Parallel { .. } => Err(unsupported("fork-join block")), | ||
| _ => Err(unsupported("procedural statement")), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a function containing
disable forkis called from awaitcondition, this branch silently discards the cancellation.Ff::wait_leveltemporarily takesself.kernelout while lowering the predicate, soself.kernel.is_none()does not necessarily mean execution is outside a timed process. For example, after spawning a delayed child,wait(cancel())with a function that executesdisable forkand returns 1 continues without cancelling that child, allowing its later writes to occur. Preserve the caller's process-control effects while lowering these predicates, rather than treating this temporary builder state as a no-op context.Useful? React with 👍 / 👎.