Skip to content

Conversation

@meheff
Copy link
Collaborator

@meheff meheff commented Nov 6, 2025

Previously the generate loop contained a StatementBlock which limited what could be put inside of loops to statements. However, other constructs can be put in loops like always blocks, etc. This change expands what may be placed in the body of a GenerateLoop.

Copy link
Collaborator

@mikex-oss mikex-oss left a comment

Choose a reason for hiding this comment

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

Overall looks fine to me, aside from my other comment.

Would like someone with more VAST experience to give it a look.

};

using GenerateLoopMember =
std::variant<LocalParam*, Statement*, AlwaysComb*, AlwaysFf*, AlwaysFlop*,
Copy link
Collaborator

@mikex-oss mikex-oss Nov 7, 2025

Choose a reason for hiding this comment

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

Isn't Statement too general? Shouldn't this be some subset of ModuleMember and explicitly include things like GenerateLoop and ContinuousAssignment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah you're right, it's too general or more precisely kinda wrong. I think actually having it hold ModuleMember is probably the right thing to do since the body of the generate loop is effectively at the module scope. The only potentially weird thing is ModuleSection, but that is not really part of the AST and is instead a transparent container which makes it easier to construct VAST as you can add stuff to different points in the module rather than having to build everything sequentially. And there is no reason why the loop body couldn't use ModuleSection for the same purpose. I'll start on that change.

Copy link
Contributor

@grebe grebe left a comment

Choose a reason for hiding this comment

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

Modulo @mikex-oss's comment, LGTM

Previously the generate loop contained a StatementBlock which limited what could be put inside of loops to statements. However, other constructs can be put in loops like always blocks, etc. This change expands what may be placed in the body of a GenerateLoop.
@meheff meheff force-pushed the meheff/2025-10-27-vast-api branch from 4c77ace to 8aa5d96 Compare November 8, 2025 02:16
@meheff
Copy link
Collaborator Author

meheff commented Nov 8, 2025

Updated so generate loop bodies hold module members.

@meheff
Copy link
Collaborator Author

meheff commented Nov 12, 2025

Anything else you need from me on this PR?

@copybara-service copybara-service bot merged commit e970236 into google:main Nov 12, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants