diff --git a/conformance/sv-tests/expected.tsv b/conformance/sv-tests/expected.tsv
index 404b148ae0e..3a8ec649374 100644
--- a/conformance/sv-tests/expected.tsv
+++ b/conformance/sv-tests/expected.tsv
@@ -1583,24 +1583,24 @@ chapter-9/9.2.3--final.sv 2state pass
chapter-9/9.2.3--final.sv 4state pass
chapter-9/9.3.1--sequential_block.sv 2state pass
chapter-9/9.3.1--sequential_block.sv 4state pass
-chapter-9/9.3.2--parallel_block_join.sv 2state fail
-chapter-9/9.3.2--parallel_block_join.sv 4state fail
-chapter-9/9.3.2--parallel_block_join_any.sv 2state fail
-chapter-9/9.3.2--parallel_block_join_any.sv 4state fail
-chapter-9/9.3.2--parallel_block_join_none.sv 2state fail
-chapter-9/9.3.2--parallel_block_join_none.sv 4state fail
-chapter-9/9.3.3--block_start_finish.sv 2state fail
-chapter-9/9.3.3--block_start_finish.sv 4state fail
+chapter-9/9.3.2--parallel_block_join.sv 2state pass
+chapter-9/9.3.2--parallel_block_join.sv 4state pass
+chapter-9/9.3.2--parallel_block_join_any.sv 2state pass
+chapter-9/9.3.2--parallel_block_join_any.sv 4state pass
+chapter-9/9.3.2--parallel_block_join_none.sv 2state pass
+chapter-9/9.3.2--parallel_block_join_none.sv 4state pass
+chapter-9/9.3.3--block_start_finish.sv 2state pass
+chapter-9/9.3.3--block_start_finish.sv 4state pass
chapter-9/9.3.3--event.sv 2state fail
chapter-9/9.3.3--event.sv 4state fail
chapter-9/9.3.3--fork_return.sv 2state pass
chapter-9/9.3.3--fork_return.sv 4state pass
-chapter-9/9.3.4--block_names_par.sv 2state fail
-chapter-9/9.3.4--block_names_par.sv 4state fail
+chapter-9/9.3.4--block_names_par.sv 2state pass
+chapter-9/9.3.4--block_names_par.sv 4state pass
chapter-9/9.3.4--block_names_seq.sv 2state pass
chapter-9/9.3.4--block_names_seq.sv 4state pass
-chapter-9/9.3.5--statement_labels_par.sv 2state fail
-chapter-9/9.3.5--statement_labels_par.sv 4state fail
+chapter-9/9.3.5--statement_labels_par.sv 2state pass
+chapter-9/9.3.5--statement_labels_par.sv 4state pass
chapter-9/9.3.5--statement_labels_seq.sv 2state pass
chapter-9/9.3.5--statement_labels_seq.sv 4state pass
chapter-9/9.4.1--delay_control-sim.sv 2state pass
@@ -1645,14 +1645,14 @@ chapter-9/9.4.5--event_nonblocking_assignment_repeat_int_neg.sv 2state fail
chapter-9/9.4.5--event_nonblocking_assignment_repeat_int_neg.sv 4state fail
chapter-9/9.4.5--event_nonblocking_assignment_repeat_neg.sv 2state fail
chapter-9/9.4.5--event_nonblocking_assignment_repeat_neg.sv 4state fail
-chapter-9/9.6.1--wait_fork.sv 2state fail
-chapter-9/9.6.1--wait_fork.sv 4state fail
+chapter-9/9.6.1--wait_fork.sv 2state pass
+chapter-9/9.6.1--wait_fork.sv 4state pass
chapter-9/9.6.2--disable.sv 2state fail
chapter-9/9.6.2--disable.sv 4state fail
chapter-9/9.6.2--disable_other.sv 2state fail
chapter-9/9.6.2--disable_other.sv 4state fail
-chapter-9/9.6.3--disable_fork.sv 2state fail
-chapter-9/9.6.3--disable_fork.sv 4state fail
+chapter-9/9.6.3--disable_fork.sv 2state pass
+chapter-9/9.6.3--disable_fork.sv 4state pass
chapter-9/9.7--process_cls_await.sv 2state fail
chapter-9/9.7--process_cls_await.sv 4state fail
chapter-9/9.7--process_cls_kill.sv 2state fail
diff --git a/crates/celox-design/src/lib.rs b/crates/celox-design/src/lib.rs
index 7cb6fdda1da..faeb44eabf3 100644
--- a/crates/celox-design/src/lib.rs
+++ b/crates/celox-design/src/lib.rs
@@ -412,6 +412,14 @@ pub struct RuntimeErrorInfo {
pub signals: Vec,
}
+/// When a parent resumes after creating concurrent children (IEEE 1800-2023 9.3.2).
+#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
+pub enum ForkJoin {
+ All,
+ Any,
+ None,
+}
+
/// How a process kernel returned control to the runtime, as stored in its
/// [`ProcessSlots::status`] slot.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
@@ -452,6 +460,14 @@ pub enum ProcessStatus {
/// A program kernel called `$exit` (IEEE 1800-2023 24.7): it and every
/// other kernel of its program instance ([`ProcessSlots::program`]) end.
Exit,
+ /// Create child activations. The delay slot encodes their entry points and join mode.
+ Fork,
+ /// Allocate a fresh automatic local cell before its declaration initializer.
+ Local,
+ /// Wait for all live immediate child activations.
+ WaitFork,
+ /// Terminate all descendants of the calling activation.
+ DisableFork,
}
impl ProcessStatus {
@@ -470,6 +486,10 @@ impl ProcessStatus {
Self::Stop => 9,
Self::HostRequest => 10,
Self::Exit => 11,
+ Self::Fork => 12,
+ Self::Local => 13,
+ Self::WaitFork => 14,
+ Self::DisableFork => 15,
}
}
@@ -486,6 +506,10 @@ impl ProcessStatus {
9 => Some(Self::Stop),
10 => Some(Self::HostRequest),
11 => Some(Self::Exit),
+ 12 => Some(Self::Fork),
+ 13 => Some(Self::Local),
+ 14 => Some(Self::WaitFork),
+ 15 => Some(Self::DisableFork),
_ => None,
}
}
@@ -627,6 +651,29 @@ pub enum ProcessKind {
Final,
}
+/// Storage switched when several activations execute the same kernel.
+#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
+pub struct ProcessFrame {
+ /// Compiler temporaries and control slots private to each activation.
+ pub private: Vec,
+ /// Automatic locals shared with children until the declaration is re-entered.
+ pub locals: Vec,
+ pub random: A,
+ pub seed: u32,
+ pub starts_with_event_wait: bool,
+}
+impl ProcessFrame {
+ pub fn map(self, mut map: impl FnMut(A) -> B) -> ProcessFrame {
+ ProcessFrame {
+ private: self.private.into_iter().map(&mut map).collect(),
+ locals: self.locals.into_iter().map(&mut map).collect(),
+ random: map(self.random),
+ seed: self.seed,
+ starts_with_event_wait: self.starts_with_event_wait,
+ }
+ }
+}
+
/// State through which one process kernel exchanges control with the runtime.
///
/// A process kernel is a resumable function. On entry it reads `resume` to
@@ -1034,6 +1081,7 @@ pub struct RuntimeSchema {
pub processes: Vec>,
/// Source procedures of the process kernels, in kernel order.
pub process_origins: Vec,
+ pub process_frames: Vec