Repository navigation
feat(sv): simulate program blocks #1897
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 |
|---|---|---|
|
|
@@ -30,7 +30,7 @@ impl ModuleIndex { | |
| for handle in tree.root_scopes()? { | ||
| 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When an instantiated program has an interface port, such as Useful? React with 👍 / 👎. |
||
| || unit.port_style == celox_sv_syntax::PortStyle::Wildcard | ||
| { | ||
| continue; | ||
|
|
@@ -51,11 +51,11 @@ impl ModuleIndex { | |
| } | ||
| } | ||
| if let Some(declarations) = declarations { | ||
| use celox_sv_syntax::{PortKind, PortStyle, UnitKind}; | ||
| use celox_sv_syntax::{PortKind, PortStyle}; | ||
| let units = declarations | ||
| .all_units() | ||
| .filter(|unit| { | ||
| unit.kind == UnitKind::Module | ||
| unit.kind.is_module_like() | ||
| && !unit.external | ||
| && unit.port_style != PortStyle::Wildcard | ||
| }) | ||
|
|
||
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 program's static variable initializer calls a function containing
$exitand a runtime operation such as$display, the initializer falls back to a process kernel. This condition treats that kernel as a program thread even thoughlower_initial_processesdeliberately leaves initializer kernels'slots.programasNone. Executing the resultingProcessStatus::Exitthen reachesSimulationState::exit_program, which requires a program identity and returnsInternalError, preventing simulation initialization. Check that the kernel actually belongs to a program'sinitialprocedure; calls from declaration initializers should follow the ignored-call warning path instead.Useful? React with 👍 / 👎.