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 includes index access on 1-bit signals #204

Closed
mkorbel1 opened this issue Nov 22, 2022 · 1 comment · Fixed by #220
Closed

Generated SystemVerilog includes index access on 1-bit signals #204

mkorbel1 opened this issue Nov 22, 2022 · 1 comment · Fixed by #220
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@mkorbel1
Copy link
Contributor

Describe the bug

If a signal is defined as 1 bit in SystemVerilog:

logic x;

Then you should not access the 0'th bit of it like this:

x[0]

However, ROHD can generate this.

To Reproduce

Access the 0'th bit of a Logic and generate SystemVerilog for it.

Expected behavior

When a signal is 1 bit, treat a 0-index into it as a nop and generate accesses as just the raw signal. It's probably even better to just short-circuit this and return the signal itself immediately to save the extra work of a nop module.

Actual behavior

Generated verilog has x[0]-like behavior for 1-bit signals

Additional: Dart SDK info

No response

Additional: pubspec.yaml

No response

Additional: Context

This bug likely applies to both slice/BusSubset via constant indexing and IndexGate.

@mkorbel1 mkorbel1 added bug Something isn't working good first issue Good for newcomers labels Nov 22, 2022
@akshay-wankhede
Copy link
Contributor

I can work on this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants