Skip to content

Fix declassign regs #136

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Jiahui17
Copy link

@Jiahui17 Jiahui17 commented Mar 18, 2025

Problem:

In Verilog, the statement

reg my_reg = 0;

is the same as

reg my_reg;
initial my_reg = 0;

whereas in the current HEAD, the statement above
is translated to

reg my_reg; assign my_reg = 0;

Solution

This commit fixes this bug by converting the assignment ast node to a blocking assignment wrapped in an initial block.

in verilog, the statement

```
reg my_reg = 0;
```

is the same as

```
reg my_reg;
initial my_reg = 0;
```

whereas in the current HEAD, the statement above
is translated to
```
reg my_reg; assign my_reg = 0;
```

This commit fixes this bug
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.

1 participant