Skip to content

[HW][Sim] Add SimulationVariableTypeInterface to let hw.inout hold sim value types - #10997

Open
okekayode wants to merge 1 commit into
mainfrom
dev/okekayode/add-sim-variable-interface
Open

[HW][Sim] Add SimulationVariableTypeInterface to let hw.inout hold sim value types #10997
okekayode wants to merge 1 commit into
mainfrom
dev/okekayode/add-sim-variable-interface

Conversation

@okekayode

@okekayode okekayode commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

In this PR we add a marker interface, SimulationVariableTypeInterface, implemented on !sim.assoc_array, !sim.queue, and !sim.dstring. InOutType::verify now accepts either a normal HW value type or this interface, so sv.reg/hw.inout can hold these simulation-only types.

We chose this over widening isHWValueType directly, since it has too many call sites and would let types leak into module ports, hw.array, etc. This keeps the change scope concise ( ports and aggregates still reject these types).

@okekayode
okekayode requested a review from youngar August 15, 2026 01:35
@okekayode
okekayode requested a review from darthscsi as a code owner August 15, 2026 01:35
@okekayode okekayode changed the title [HW][Sim] Add SimulationVariableTypeInterface to let hw.inout hold sim value types [HW][Sim] Add SimulationVariableTypeInterface to let hw.inout hold sim value types Aug 15, 2026
@circt-bot

circt-bot Bot commented Aug 15, 2026

Copy link
Copy Markdown

Results of circt-tests run for f6cb7d4 compared to results for 6a42084: no change to test results.

@fabianschuiki fabianschuiki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@uenoku

uenoku commented Aug 21, 2026

Copy link
Copy Markdown
Member

I’m not sure hw::InOutType is the right abstraction to widen here. This makes types such as !hw.inout<!sim.queue<...>> globally valid, which in turn makes them appear valid for users such as sv.wire, even though queues/strings/associative arrays have variable semantics rather than net semantics. Could we instead model references to SV variables separately, or otherwise keep the existing hw.inout invariant?

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.

3 participants