Introduce mixin declaration to interface - #2996
Merged
Merged
Conversation
taichi-ishitani
marked this pull request as draft
July 13, 2026 07:14
taichi-ishitani
force-pushed
the
mixin_interface
branch
2 times, most recently
from
July 13, 2026 08:02
f423303 to
3bdd303
Compare
taichi-ishitani
marked this pull request as ready for review
July 13, 2026 08:06
taichi-ishitani
force-pushed
the
mixin_interface
branch
6 times, most recently
from
July 14, 2026 01:58
bf23d71 to
9ac90b8
Compare
taichi-ishitani
force-pushed
the
mixin_interface
branch
2 times, most recently
from
July 14, 2026 04:20
3f5942e to
e49fcf5
Compare
taichi-ishitani
marked this pull request as draft
July 14, 2026 05:14
taichi-ishitani
force-pushed
the
mixin_interface
branch
from
July 14, 2026 06:59
e49fcf5 to
e09018c
Compare
taichi-ishitani
marked this pull request as ready for review
July 14, 2026 07:05
taichi-ishitani
force-pushed
the
mixin_interface
branch
2 times, most recently
from
July 14, 2026 21:08
1b24caa to
fcb32ae
Compare
taichi-ishitani
marked this pull request as draft
July 15, 2026 01:10
taichi-ishitani
force-pushed
the
mixin_interface
branch
from
July 15, 2026 02:11
fcb32ae to
562f993
Compare
taichi-ishitani
marked this pull request as ready for review
July 15, 2026 02:12
taichi-ishitani
marked this pull request as draft
July 15, 2026 02:19
taichi-ishitani
force-pushed
the
mixin_interface
branch
3 times, most recently
from
July 15, 2026 06:40
8941e44 to
59c24e4
Compare
taichi-ishitani
marked this pull request as ready for review
July 15, 2026 06:51
taichi-ishitani
force-pushed
the
mixin_interface
branch
from
July 15, 2026 08:58
59c24e4 to
5c7756b
Compare
Collaborator
|
The whole changes look good. |
dalance
reviewed
Jul 15, 2026
| use msb::check_msb; | ||
| use serde::{Deserialize, Serialize}; | ||
| use std::cell::RefCell; | ||
| use std::collections::HashSet; |
Collaborator
There was a problem hiding this comment.
Could you use crate::HashSet instead of std?
Contributor
Author
There was a problem hiding this comment.
I changed it to crate::HashSet.
taichi-ishitani
force-pushed
the
mixin_interface
branch
from
July 16, 2026 01:12
5c7756b to
cbd92d1
Compare
Contributor
Author
I added snapshot tests for |
taichi-ishitani
force-pushed
the
mixin_interface
branch
3 times, most recently
from
July 16, 2026 03:00
fea81be to
8136af8
Compare
taichi-ishitani
force-pushed
the
mixin_interface
branch
from
July 16, 2026 03:01
8136af8 to
75500ce
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.
Close #1212
Adds interface mixin via a new
mixindeclaration. Inside an interface,mixin <interface>;mixes in the members (variables, functions, and modports) of another interface; the mixed-in members are expanded into the interface as if they were declared directly.Syntax
mixinis an interface declaration item:Generic arguments can be passed to a mixed-in interface:
Restrictions on a mixed-in interface
A mixed-in interface must satisfy all of the following; otherwise an
InvalidMixinerror is reported:protointerface.Generated SystemVerilog
The mixed-in members are expanded inline into the interface. Given:
Busis emitted with the mixed-in members expanded (names simplified for readability):Notes:
importis emitted in package-qualified form (e.g.DataPkg__W::Data) instead of merging theimportstatements. This avoids conflicts when mixed-in interfaces import same-named symbols from different packages.