Skip to content
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

Generated SystemVerilog uses bit slicing on expressions, illegal in SystemVerilog #163

Closed
mkorbel1 opened this issue Sep 27, 2022 · 0 comments · Fixed by #164
Closed

Generated SystemVerilog uses bit slicing on expressions, illegal in SystemVerilog #163

mkorbel1 opened this issue Sep 27, 2022 · 0 comments · Fixed by #164
Assignees
Labels
bug Something isn't working

Comments

@mkorbel1
Copy link
Contributor

mkorbel1 commented Sep 27, 2022

Describe the bug

In SystemVerilog, it is not legal to use bit slicing on an expression. For example, this is invalid:

assign expression_bit_select = ({a_b_joined,a_shrunk,a_range,a_rsliced,a_plus_b})[3:0];

ROHD currently generates code like this, which is illegal.

To Reproduce

Perform a slice on an inlineable expression and then generate SystemVerilog of it.

Expected behavior

Valid SystemVerilog is generated. One solution is an intermediate signal for the expression which is then sliced.

Actual behavior

Illegal SystemVerilog is generated.

Additional details

Found as part of debug on #158

@mkorbel1 mkorbel1 added the bug Something isn't working label Sep 27, 2022
@mkorbel1 mkorbel1 self-assigned this Sep 27, 2022
mkorbel1 added a commit to mkorbel1/rohd that referenced this issue Sep 27, 2022
mkorbel1 added a commit that referenced this issue Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant