8000 read_verilog/astsimplify: copy inout ports in and out of functions/tasks by georgerennie · Pull Request #5158 · YosysHQ/yosys · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

read_verilog/astsimplify: copy inout ports in and out of functions/tasks #5158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 4, 2025

Conversation

georgerennie
Copy link
Collaborator
@georgerennie georgerennie commented May 31, 2025

What are the reasons/motivation for this change?

Fixes #5157

Explain how this is achieved.

Previously, inout ports to tasks/functions were incorrectly handled as the code assumed ports were either input or output, so inout ports would only have the values copied in, not out when they are instantiated. This change makes it two separate branches that can both be true (and uses ->clone methods so that both input and output get their own copies of the AST nodes if needed).

If applicable, please suggest to reviewers how they can test the change.

I've added the testcases from the issue as well as some basic tests using each of the port types for functions/tasks. These all fail before this change.

This probably conflicts with #5135 but I don't imagine its hard to fixup either depending on which gets merged first

@georgerennie georgerennie requested a review from zachjs as a code owner May 31, 2025 00:23
@georgerennie georgerennie changed the title read_verilog: copy inout ports in and out of functions/tasks read_verilog/astsimplify: copy inout ports in and out of functions/tasks May 31, 2025
Copy link
Member
@KrystalDelusion KrystalDelusion left a comment

Choose a reason for hiding this comment

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

Appears to work as expected. I also did a local build with ASAN just to double check (since CI isn't yet doing that) and no issues there.

@georgerennie georgerennie merged commit 0fcf5c0 into YosysHQ:main Jun 4, 2025
25 checks passed
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.

read_verilog: inout parameters not copied out of tasks
2 participants
0