Add support for hierarchical module instantiation syntax#12
Open
robtaylor wants to merge 1 commit into
Open
Conversation
robtaylor
force-pushed
the
allow-analog-in-conditionals
branch
2 times, most recently
from
December 18, 2025 14:32
be1ef89 to
cdb6796
Compare
robtaylor
force-pushed
the
module-instantiation-support
branch
from
December 18, 2025 14:33
ca84621 to
6bdf113
Compare
robtaylor
force-pushed
the
allow-analog-in-conditionals
branch
6 times, most recently
from
December 18, 2025 18:23
882ca3a to
449993c
Compare
robtaylor
force-pushed
the
module-instantiation-support
branch
2 times, most recently
from
December 18, 2025 18:41
c9f9ee3 to
3828184
Compare
robtaylor
force-pushed
the
allow-analog-in-conditionals
branch
from
December 23, 2025 00:26
449993c to
1f90eea
Compare
robtaylor
force-pushed
the
module-instantiation-support
branch
from
December 23, 2025 00:28
3828184 to
0188873
Compare
robtaylor
force-pushed
the
allow-analog-in-conditionals
branch
2 times, most recently
from
December 24, 2025 01:33
ac1a82d to
e3617c8
Compare
robtaylor
force-pushed
the
allow-analog-in-conditionals
branch
from
January 9, 2026 01:57
83ce287 to
eedcee9
Compare
robtaylor
force-pushed
the
module-instantiation-support
branch
from
January 9, 2026 02:11
0188873 to
ab10655
Compare
robtaylor
force-pushed
the
allow-analog-in-conditionals
branch
from
January 9, 2026 02:30
eedcee9 to
f8505dd
Compare
This adds parsing and HIR support for Verilog-A module instantiation syntax: module_name #(.param(value)) instance_name (port1, port2); This syntax is used in some foundry PDK models (e.g., GF130 ESD models) to instantiate primitive modules like resistors and capacitors with parameter overrides. Changes: - Add ModuleInst grammar to veriloga.ungram with ParamAssignments and PortConnections - Implement parser grammar with lookahead to distinguish module instantiation from net declarations - Add ModuleInstItem HIR type to store instance name, module type, parameter assignments, and port connections - Add HIR lowering for module instances - Module instances are recorded but don't participate in name resolution (they will be processed during elaboration/flattening) Note: This is parsing support only. The actual instantiation/flattening of modules is not implemented - the instances are simply stored in the HIR for potential future use. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
robtaylor
force-pushed
the
module-instantiation-support
branch
from
January 9, 2026 02:35
ab10655 to
e48013c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds parsing and HIR support for Verilog-A hierarchical module instantiation syntax:
This syntax is used in some foundry PDK models (e.g., GlobalFoundries GF130 ESD models) to instantiate primitive modules like resistors and capacitors with parameter overrides.
Example from GF130 ESD model:
Changes
ModuleInstgrammar toveriloga.ungramwithParamAssignmentsandPortConnectionsModuleInstItemHIR type to store instance name, module type, parameter assignments, and port connectionsLimitations
This is parsing support only. The actual instantiation/flattening of modules is not implemented - the instances are simply stored in the HIR for potential future use. This allows models using module instantiation to compile (the instances are ignored during code generation).
Test plan
item_treeanddef_mappass🤖 Generated with Claude Code