Repository navigation
feat(sv): simulate program blocks - #1897
mergify[bot] merged 1 commit into
Conversation
|
This pull request is part of a Mergify stack:
|
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 354a8713be
ℹ️ 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".
| let scoped = tree.scoped(handle)?; | ||
| let unit = scoped.root_unit()?; | ||
| if unit.kind != celox_sv_syntax::UnitKind::Module | ||
| if !unit.kind.is_module_like() |
There was a problem hiding this comment.
Include programs in interface-port planning
When an instantiated program has an interface port, such as program Probe(Bus b), it is now indexed as a module-like unit, but interface planning still excludes it: Design::collect_selected in ast/interfaces.rs collects only UnitKind::Module, and plan_interfaces_with_member_paths likewise scans interface-port contracts only for modules. Consequently, no port expansion is created for the program, and its interface port reaches ordinary data-type lowering and is rejected instead of connecting to the design's interface. Include programs in those planning paths as well so the newly supported program ports work with interfaces.
Useful? React with 👍 / 👎.
| if self.m.program && self.kernel.is_some() { | ||
| self.with_kernel(ProcessKernelBuilder::exit); | ||
| return Ok(false); |
There was a problem hiding this comment.
Exclude declaration initializer kernels from program exit
When a program's static variable initializer calls a function containing $exit and a runtime operation such as $display, the initializer falls back to a process kernel. This condition treats that kernel as a program thread even though lower_initial_processes deliberately leaves initializer kernels' slots.program as None. Executing the resulting ProcessStatus::Exit then reaches SimulationState::exit_program, which requires a program identity and returns InternalError, preventing simulation initialization. Check that the kernel actually belongs to a program's initial procedure; calls from declaration initializers should follow the ignored-call warning path instead.
Useful? React with 👍 / 👎.
354a871 to
b6cf3ff
Compare
Revision history
|
|
Queued — the merge queue status continues in this comment ↓. |
The analyzer accepts program declarations and their instances (IEEE 1800-2023 24.3). It rejects always procedures, module instances and nested units inside a program, and reports a program nested in a module as unsupported. A program's initial procedures are not folded into initial state: they lower to kernels that name the program instance, so they run in the reactive region set, and $exit in a program ends its initial procedures (24.7). Continuous assignments of a program are evaluated with the design. Nested and anonymous programs, the implicit program top, and final and clocking blocks in programs are not supported yet. The shared suite's program cases are checked against xezim 0.11.3. Icarus 13.0 and Verilator 5.052 run program procedures in the active region set and do not end the simulation when the programs end; their exclusions record the pre-exclusion results. Change-Id: I3e6817bd4b94f04465a90ecb9ef4155ee3e582da
b6cf3ff to
9bb235a
Compare
dee80f0 to
883befe
Compare
Merge Queue Status
This pull request spent 1 hour 12 minutes 6 seconds in the queue, including 24 minutes 14 seconds running CI. Required conditions to merge
|
The analyzer accepts program declarations and their instances (IEEE
1800-2023 24.3). It rejects always procedures, module instances and
nested units inside a program, and reports a program nested in a module
as unsupported. A program's initial procedures are not folded into
initial state: they lower to kernels that name the program instance, so
they run in the reactive region set, and $exit in a program ends its
initial procedures (24.7).
Continuous assignments of a program are evaluated with the design.
Nested and anonymous programs, the implicit program top, and final and
clocking blocks in programs are not supported yet.
The shared suite's program cases are checked against xezim 0.11.3. Icarus
13.0 and Verilator 5.052 run program procedures in the active region set
and do not end the simulation when the programs end; their exclusions
record the pre-exclusion results.
Depends-On: #1896
Closes #1862.
Validation (rebased on c430061)
program.vtest. Rust tests cover a program continued after$stopand saved to a state file, and design processes that a program wakes reading pre-NBA values.CELOX_SCHEDULER=differentialpasses 4594.sv_testsexample (sv-tests c4229f3b) matches theexpected.tsvthis PR updates:chapter-24/24.3--program.svgoes from fail to pass in both modes.#0and Re-NBA.$finishwhen every program has ended (24.3): xezim doesn't do it.sv_program_reactive_region,sv_program_completion,sv_icarus_program_exit,sv_verilator_program_exitandsv_verilator_program_items, with the pre-exclusion results inverification/sv/limitations/programs-*.jsonand the retained reports inverification/sv/{icarus,verilator}/program.json. With the exclusions: Icarus 7 ignored, 2 rejected, 1 passed; Verilator 9 ignored, 1 passed.