Skip to content

Verilog: create $root module instance#1816

Draft
kroening wants to merge 1 commit intomainfrom
kroening/root-module-instance
Draft

Verilog: create $root module instance#1816
kroening wants to merge 1 commit intomainfrom
kroening/root-module-instance

Conversation

@kroening
Copy link
Copy Markdown
Collaborator

Create a $root module instance that contains an instance of the top-level module, per IEEE 1800-2017.

Changes

  • $root module creation: After typechecking the top-level module, a synthetic $root module is created with a verilog_instt that instantiates the top-level module. verilog_synthesis expands this, copying all symbols into $root's namespace.

  • main_symbol points to $root: The transition system's main_symbol now points to Verilog::$root. The $root module's type is copied from the top-level module (including ports). Its module field is set to the instance identifier for expression resolution (-p, --reset, etc.).

  • Display: Pretty names and the expression printer strip the $root prefix since it is implicit in SystemVerilog. Internal identifiers retain $root for correct lookups.

  • EBMC core fixes: instrument_past, liveness_to_safety, and live_signal now use main_symbol->name (not main_symbol->module) when registering new symbols, since these need to appear in the symbol_module_map under $root.

  • Regression tests: Updated 7 test descriptors to reflect $root in hierarchy display, internal identifiers, and VCD/SMV netlist output.

@kroening kroening force-pushed the kroening/root-module-instance branch 2 times, most recently from 6669f27 to e7fcf46 Compare April 21, 2026 03:47
Create a $root module instance that contains an instance of the
top-level module, per IEEE 1800-2017. The $root module is synthesized
via verilog_synthesis, which expands the top-level module into $root's
namespace. The main_symbol now points to $root.

The $root module's type is copied from the top-level module (including
ports), and its module field is set to the instance identifier for
expression resolution (used by -p, --reset, etc.).

Pretty names and expression output strip the $root prefix since it is
implicit in SystemVerilog.
@kroening kroening force-pushed the kroening/root-module-instance branch from e7fcf46 to ee8b061 Compare April 27, 2026 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant